diff --git a/en/go/resources/beta/index.md b/en/go/resources/beta/index.md index bfe7fff5..767a759f 100644 --- a/en/go/resources/beta/index.md +++ b/en/go/resources/beta/index.md @@ -1,9646 +1,8536 @@ # Beta -# ChatKit +# Responses -## Domain Types +## Create a model response -### ChatKit Workflow +`client.Beta.Responses.New(ctx, params) (*BetaResponse, error)` -- `type ChatKitWorkflow struct{…}` +**post** `/responses?beta=true` - Workflow metadata and state returned for the session. +Creates a model response. Provide [text](https://platform.openai.com/docs/guides/text) or +[image](https://platform.openai.com/docs/guides/images) inputs to generate [text](https://platform.openai.com/docs/guides/text) +or [JSON](https://platform.openai.com/docs/guides/structured-outputs) outputs. Have the model call +your own [custom code](https://platform.openai.com/docs/guides/function-calling) or use built-in +[tools](https://platform.openai.com/docs/guides/tools) like [web search](https://platform.openai.com/docs/guides/tools-web-search) +or [file search](https://platform.openai.com/docs/guides/tools-file-search) to use your own data +as input for the model's response. - - `ID string` +### Parameters - Identifier of the workflow backing the session. +- `params BetaResponseNewParams` - - `StateVariables map[string, ChatKitWorkflowStateVariableUnion]` + - `Background param.Field[bool]` - State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided. + Body param: Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). - - `string` + - `ContextManagement param.Field[[]BetaResponseNewParamsContextManagement]` - - `bool` + Body param: Context management configuration for this request. - - `float64` + - `Type string` - - `Tracing ChatKitWorkflowTracing` + The context management entry type. Currently only 'compaction' is supported. - Tracing settings applied to the workflow. + - `CompactThreshold int64` - - `Enabled bool` + Token threshold at which compaction should be triggered for this entry. - Indicates whether tracing is enabled. + - `Conversation param.Field[BetaResponseNewParamsConversationUnion]` - - `Version string` + Body param: The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. + Input items and output items from this response are automatically added to this conversation after this response completes. - Specific workflow version used for the session. Defaults to null when using the latest deployment. + - `string` -# Sessions + - `type BetaResponseConversationParamResp struct{…}` -## Cancel chat session + The conversation that this response belongs to. -`client.Beta.ChatKit.Sessions.Cancel(ctx, sessionID) (*ChatSession, error)` + - `ID string` -**post** `/chatkit/sessions/{session_id}/cancel` + The unique ID of the conversation. -Cancel chat session + - `Include param.Field[[]BetaResponseIncludable]` -### Parameters + Body param: Specify additional output data to include in the model response. Currently supported values are: -- `sessionID string` + - `web_search_call.action.sources`: Include the sources of the web search tool call. + - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. + - `computer_call_output.output.image_url`: Include image urls from the computer call output. + - `file_search_call.results`: Include the search results of the file search tool call. + - `message.input_image.image_url`: Include image urls from the input message. + - `message.output_text.logprobs`: Include logprobs with assistant messages. + - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). -### Returns + - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` -- `type ChatSession struct{…}` + - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` - Represents a ChatKit session and its resolved configuration. + - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` - - `ID string` + - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` - Identifier for the ChatKit session. + - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` - - `ChatKitConfiguration ChatSessionChatKitConfiguration` + - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` - Resolved ChatKit feature configuration for the session. + - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` - - `AutomaticThreadTitling ChatSessionAutomaticThreadTitling` + - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` - Automatic thread titling preferences. + - `Input param.Field[BetaResponseNewParamsInputUnion]` - - `Enabled bool` + Body param: Text, image, or file inputs to the model, used to generate a response. - Whether automatic thread titling is enabled. + Learn more: - - `FileUpload ChatSessionFileUpload` + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Image inputs](https://platform.openai.com/docs/guides/images) + - [File inputs](https://platform.openai.com/docs/guides/pdf-files) + - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) + - [Function calling](https://platform.openai.com/docs/guides/function-calling) - Upload settings for the session. + - `string` - - `Enabled bool` + - `type BetaResponseInput []BetaResponseInputItemUnion` - Indicates if uploads are enabled for the session. + A list of one or many input items to the model, containing + different content types. - - `MaxFileSize int64` + - `type BetaEasyInputMessage struct{…}` - Maximum upload size in megabytes. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `MaxFiles int64` + - `Content BetaEasyInputMessageContentUnion` - Maximum number of uploads allowed during the session. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - - `History ChatSessionHistory` + - `string` - History retention configuration. + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - `Enabled bool` + A list of one or many input items to the model, containing different content + types. - Indicates if chat history is persisted for the session. + - `type BetaResponseInputText struct{…}` - - `RecentThreads int64` + A text input to the model. - Number of prior threads surfaced in history views. Defaults to null when all history is retained. + - `Text string` - - `ClientSecret string` + The text input to the model. - Ephemeral client secret that authenticates session requests. + - `Type InputText` - - `ExpiresAt int64` + The type of the input item. Always `input_text`. - Unix timestamp (in seconds) for when the session expires. + - `const InputTextInputText InputText = "input_text"` - - `MaxRequestsPer1Minute int64` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - Convenience copy of the per-minute request limit. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Object ChatKitSession` + - `Mode Explicit` - Type discriminator that is always `chatkit.session`. + The breakpoint mode. Always `explicit`. - - `const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"` + - `const ExplicitExplicit Explicit = "explicit"` - - `RateLimits ChatSessionRateLimits` + - `type BetaResponseInputImage struct{…}` - Resolved rate limit values. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `MaxRequestsPer1Minute int64` + - `Detail BetaResponseInputImageDetail` - Maximum allowed requests per one-minute window. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `Status ChatSessionStatus` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - Current lifecycle state of the session. + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `const ChatSessionStatusActive ChatSessionStatus = "active"` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `const ChatSessionStatusExpired ChatSessionStatus = "expired"` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"` + - `Type InputImage` - - `User string` + The type of the input item. Always `input_image`. - User identifier associated with the session. + - `const InputImageInputImage InputImage = "input_image"` - - `Workflow ChatKitWorkflow` + - `FileID string` - Workflow metadata for the session. + The ID of the file to be sent to the model. - - `ID string` + - `ImageURL string` - Identifier of the workflow backing the session. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `StateVariables map[string, ChatKitWorkflowStateVariableUnion]` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `string` + - `Mode Explicit` - - `bool` + The breakpoint mode. Always `explicit`. - - `float64` + - `const ExplicitExplicit Explicit = "explicit"` - - `Tracing ChatKitWorkflowTracing` + - `type BetaResponseInputFile struct{…}` - Tracing settings applied to the workflow. + A file input to the model. - - `Enabled bool` + - `Type InputFile` - Indicates whether tracing is enabled. + The type of the input item. Always `input_file`. - - `Version string` + - `const InputFileInputFile InputFile = "input_file"` - Specific workflow version used for the session. Defaults to null when using the latest deployment. + - `Detail BetaResponseInputFileDetail` -### Example + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. -```go -package main + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` -import ( - "context" - "fmt" + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - chatSession, err := client.Beta.ChatKit.Sessions.Cancel(context.TODO(), "cksess_123") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", chatSession.ID) -} -``` + - `FileData string` -#### Response + The content of the file to be sent to the model. -```json -{ - "id": "id", - "chatkit_configuration": { - "automatic_thread_titling": { - "enabled": true - }, - "file_upload": { - "enabled": true, - "max_file_size": 0, - "max_files": 0 - }, - "history": { - "enabled": true, - "recent_threads": 0 - } - }, - "client_secret": "client_secret", - "expires_at": 0, - "max_requests_per_1_minute": 0, - "object": "chatkit.session", - "rate_limits": { - "max_requests_per_1_minute": 0 - }, - "status": "active", - "user": "user", - "workflow": { - "id": "id", - "state_variables": { - "foo": "string" - }, - "tracing": { - "enabled": true - }, - "version": "version" - } -} -``` + - `FileID string` -### Example + The ID of the file to be sent to the model. -```go -package main + - `FileURL string` -import ( - "context" - "fmt" + The URL of the file to be sent to the model. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `Filename string` -func main() { - client := openai.NewClient() - chatSession, err := client.Beta.ChatKit.Sessions.Cancel(context.TODO(), "cksess_123") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", chatSession.ID) -} -``` + The name of the file to be sent to the model. -#### Response + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` -```json -{ - "id": "cksess_123", - "object": "chatkit.session", - "workflow": { - "id": "workflow_alpha", - "version": "1" - }, - "scope": { - "customer_id": "cust_456" - }, - "max_requests_per_1_minute": 30, - "ttl_seconds": 900, - "status": "cancelled", - "cancelled_at": 1712345678 -} -``` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. -## Create ChatKit session + - `Mode Explicit` -`client.Beta.ChatKit.Sessions.New(ctx, body) (*ChatSession, error)` + The breakpoint mode. Always `explicit`. -**post** `/chatkit/sessions` + - `const ExplicitExplicit Explicit = "explicit"` -Create ChatKit session + - `Role BetaEasyInputMessageRole` -### Parameters + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. -- `body BetaChatKitSessionNewParams` + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - - `User param.Field[string]` + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - A free-form string that identifies your end user; ensures this Session can access other objects that have the same `user` scope. + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - - `Workflow param.Field[ChatSessionWorkflowParamResp]` + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - Workflow that powers the session. + - `Phase BetaEasyInputMessagePhase` - - `ChatKitConfiguration param.Field[ChatSessionChatKitConfigurationParamResp]` + 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. - Optional overrides for ChatKit runtime configuration features + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - - `ExpiresAfter param.Field[ChatSessionExpiresAfterParamResp]` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - Optional override for session expiration timing in seconds from creation. Defaults to 10 minutes. + - `Type BetaEasyInputMessageType` - - `RateLimits param.Field[ChatSessionRateLimitsParamResp]` + The type of the message input. Always `message`. - Optional override for per-minute request limits. When omitted, defaults to 10. + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` -### Returns + - `type BetaResponseInputItemMessage struct{…}` -- `type ChatSession struct{…}` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - Represents a ChatKit session and its resolved configuration. + - `Content BetaResponseInputMessageContentList` - - `ID string` + A list of one or many input items to the model, containing different content + types. - Identifier for the ChatKit session. + - `Role string` - - `ChatKitConfiguration ChatSessionChatKitConfiguration` + The role of the message input. One of `user`, `system`, or `developer`. - Resolved ChatKit feature configuration for the session. + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` - - `AutomaticThreadTitling ChatSessionAutomaticThreadTitling` + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` - Automatic thread titling preferences. + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` - - `Enabled bool` + - `Agent BetaResponseInputItemMessageAgent` - Whether automatic thread titling is enabled. + The agent that produced this item. - - `FileUpload ChatSessionFileUpload` + - `AgentName string` - Upload settings for the session. + The canonical name of the agent that produced this item. - - `Enabled bool` + - `Status string` - Indicates if uploads are enabled for the session. + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `MaxFileSize int64` + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - Maximum upload size in megabytes. + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - - `MaxFiles int64` + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - Maximum number of uploads allowed during the session. + - `Type string` - - `History ChatSessionHistory` + The type of the message input. Always set to `message`. - History retention configuration. + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - - `Enabled bool` + - `type BetaResponseOutputMessage struct{…}` - Indicates if chat history is persisted for the session. + An output message from the model. - - `RecentThreads int64` + - `ID string` - Number of prior threads surfaced in history views. Defaults to null when all history is retained. + The unique ID of the output message. - - `ClientSecret string` + - `Content []BetaResponseOutputMessageContentUnion` - Ephemeral client secret that authenticates session requests. + The content of the output message. - - `ExpiresAt int64` + - `type BetaResponseOutputText struct{…}` - Unix timestamp (in seconds) for when the session expires. + A text output from the model. - - `MaxRequestsPer1Minute int64` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - Convenience copy of the per-minute request limit. + The annotations of the text output. - - `Object ChatKitSession` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - Type discriminator that is always `chatkit.session`. + A citation to a file. - - `const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"` + - `FileID string` - - `RateLimits ChatSessionRateLimits` + The ID of the file. - Resolved rate limit values. + - `Filename string` - - `MaxRequestsPer1Minute int64` + The filename of the file cited. - Maximum allowed requests per one-minute window. + - `Index int64` - - `Status ChatSessionStatus` + The index of the file in the list of files. - Current lifecycle state of the session. + - `Type FileCitation` - - `const ChatSessionStatusActive ChatSessionStatus = "active"` + The type of the file citation. Always `file_citation`. - - `const ChatSessionStatusExpired ChatSessionStatus = "expired"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - - `User string` + A citation for a web resource used to generate a model response. - User identifier associated with the session. + - `EndIndex int64` - - `Workflow ChatKitWorkflow` + The index of the last character of the URL citation in the message. - Workflow metadata for the session. + - `StartIndex int64` - - `ID string` + The index of the first character of the URL citation in the message. - Identifier of the workflow backing the session. + - `Title string` - - `StateVariables map[string, ChatKitWorkflowStateVariableUnion]` + The title of the web resource. - State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided. + - `Type URLCitation` - - `string` + The type of the URL citation. Always `url_citation`. - - `bool` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `float64` + - `URL string` - - `Tracing ChatKitWorkflowTracing` + The URL of the web resource. - Tracing settings applied to the workflow. + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `Enabled bool` + A citation for a container file used to generate a model response. - Indicates whether tracing is enabled. + - `ContainerID string` - - `Version string` + The ID of the container file. - Specific workflow version used for the session. Defaults to null when using the latest deployment. + - `EndIndex int64` -### Example + The index of the last character of the container file citation in the message. -```go -package main + - `FileID string` -import ( - "context" - "fmt" + The ID of the file. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `Filename string` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - chatSession, err := client.Beta.ChatKit.Sessions.New(context.TODO(), openai.BetaChatKitSessionNewParams{ - User: "x", - Workflow: openai.ChatSessionWorkflowParam{ - ID: "id", - }, - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", chatSession.ID) -} -``` + The filename of the container file cited. -#### Response + - `StartIndex int64` -```json -{ - "id": "id", - "chatkit_configuration": { - "automatic_thread_titling": { - "enabled": true - }, - "file_upload": { - "enabled": true, - "max_file_size": 0, - "max_files": 0 - }, - "history": { - "enabled": true, - "recent_threads": 0 - } - }, - "client_secret": "client_secret", - "expires_at": 0, - "max_requests_per_1_minute": 0, - "object": "chatkit.session", - "rate_limits": { - "max_requests_per_1_minute": 0 - }, - "status": "active", - "user": "user", - "workflow": { - "id": "id", - "state_variables": { - "foo": "string" - }, - "tracing": { - "enabled": true - }, - "version": "version" - } -} -``` + The index of the first character of the container file citation in the message. -### Example + - `Type ContainerFileCitation` -```go -package main + The type of the container file citation. Always `container_file_citation`. -import ( - "context" - "fmt" + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` -func main() { - client := openai.NewClient() - chatSession, err := client.Beta.ChatKit.Sessions.New(context.TODO(), openai.BetaChatKitSessionNewParams{ - User: "user", - Workflow: openai.ChatSessionWorkflowParam{ - ID: "id", - }, - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", chatSession.ID) -} -``` + A path to a file. -#### Response + - `FileID string` -```json -{ - "client_secret": "chatkit_token_123", - "expires_at": 1735689600, - "workflow": { - "id": "workflow_alpha", - "version": "2024-10-01" - }, - "scope": { - "project": "alpha", - "environment": "staging" - }, - "max_requests_per_1_minute": 60, - "max_requests_per_session": 500, - "status": "active" -} -``` + The ID of the file. -# Threads + - `Index int64` -## List ChatKit thread items + The index of the file in the list of files. -`client.Beta.ChatKit.Threads.ListItems(ctx, threadID, query) (*ConversationCursorPage[ChatKitThreadItemListDataUnion], error)` + - `Type FilePath` -**get** `/chatkit/threads/{thread_id}/items` + The type of the file path. Always `file_path`. -List ChatKit thread items + - `const FilePathFilePath FilePath = "file_path"` -### Parameters + - `Text string` -- `threadID string` + The text output from the model. -- `query BetaChatKitThreadListItemsParams` + - `Type OutputText` - - `After param.Field[string]` + The type of the output text. Always `output_text`. - List items created after this thread item ID. Defaults to null for the first page. + - `const OutputTextOutputText OutputText = "output_text"` - - `Before param.Field[string]` + - `Logprobs []BetaResponseOutputTextLogprob` - List items created before this thread item ID. Defaults to null for the newest results. + - `Token string` - - `Limit param.Field[int64]` + - `Bytes []int64` - Maximum number of thread items to return. Defaults to 20. + - `Logprob float64` - - `Order param.Field[BetaChatKitThreadListItemsParamsOrder]` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - Sort order for results by creation time. Defaults to `desc`. + - `Token string` - - `const BetaChatKitThreadListItemsParamsOrderAsc BetaChatKitThreadListItemsParamsOrder = "asc"` + - `Bytes []int64` - - `const BetaChatKitThreadListItemsParamsOrderDesc BetaChatKitThreadListItemsParamsOrder = "desc"` + - `Logprob float64` -### Returns + - `type BetaResponseOutputRefusal struct{…}` -- `type ChatKitThreadItemListDataUnion interface{…}` + A refusal from the model. - User-authored messages within a thread. + - `Refusal string` - - `type ChatKitThreadUserMessageItem struct{…}` + The refusal explanation from the model. - User-authored messages within a thread. + - `Type Refusal` - - `ID string` + The type of the refusal. Always `refusal`. - Identifier of the thread item. + - `const RefusalRefusal Refusal = "refusal"` - - `Attachments []ChatKitAttachment` + - `Role Assistant` - Attachments associated with the user message. Defaults to an empty list. + The role of the output message. Always `assistant`. - - `ID string` + - `const AssistantAssistant Assistant = "assistant"` - Identifier for the attachment. + - `Status BetaResponseOutputMessageStatus` - - `MimeType string` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - MIME type of the attachment. + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `Name string` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - Original display name for the attachment. + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `PreviewURL string` + - `Type Message` - Preview URL for rendering the attachment inline. + The type of the output message. Always `message`. - - `Type ChatKitAttachmentType` + - `const MessageMessage Message = "message"` - Attachment discriminator. + - `Agent BetaResponseOutputMessageAgent` - - `const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image"` + The agent that produced this item. - - `const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"` + - `AgentName string` - - `Content []ChatKitThreadUserMessageItemContentUnion` + The canonical name of the agent that produced this item. - Ordered content elements supplied by the user. + - `Phase BetaResponseOutputMessagePhase` - - `type ChatKitThreadUserMessageItemContentInputText struct{…}` + 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. - Text block that a user contributed to the thread. + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `Text string` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - Plain-text content supplied by the user. + - `type BetaResponseFileSearchToolCall struct{…}` - - `Type InputText` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - Type discriminator that is always `input_text`. + - `ID string` - - `const InputTextInputText InputText = "input_text"` + The unique ID of the file search tool call. - - `type ChatKitThreadUserMessageItemContentQuotedText struct{…}` + - `Queries []string` - Quoted snippet that the user referenced in their message. + The queries used to search for files. - - `Text string` + - `Status BetaResponseFileSearchToolCallStatus` - Quoted text content. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `Type QuotedText` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - Type discriminator that is always `quoted_text`. + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `const QuotedTextQuotedText QuotedText = "quoted_text"` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - - `CreatedAt int64` + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - Unix timestamp (in seconds) for when the item was created. + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - - `InferenceOptions ChatKitThreadUserMessageItemInferenceOptions` + - `Type FileSearchCall` - Inference overrides applied to the message. Defaults to null when unset. + The type of the file search tool call. Always `file_search_call`. - - `Model string` + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - Model name that generated the response. Defaults to null when using the session default. + - `Agent BetaResponseFileSearchToolCallAgent` - - `ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoice` + The agent that produced this item. - Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - Identifier of the requested tool. + - `Results []BetaResponseFileSearchToolCallResult` - - `Object ChatKitThreadItem` + The results of the file search tool call. - Type discriminator that is always `chatkit.thread_item`. + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + 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. - - `ThreadID string` + - `string` - Identifier of the parent thread. + - `float64` - - `Type ChatKitUserMessage` + - `bool` - - `const ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"` + - `FileID string` - - `type ChatKitThreadAssistantMessageItem struct{…}` + The unique ID of the file. - Assistant-authored message within a thread. + - `Filename string` - - `ID string` + The name of the file. - Identifier of the thread item. + - `Score float64` - - `Content []ChatKitResponseOutputText` + The relevance score of the file - a value between 0 and 1. - Ordered assistant response segments. + - `Text string` - - `Annotations []ChatKitResponseOutputTextAnnotationUnion` + The text that was retrieved from the file. - Ordered list of annotations attached to the response text. + - `type BetaResponseComputerToolCall struct{…}` - - `type ChatKitResponseOutputTextAnnotationFile struct{…}` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - Annotation that references an uploaded file. + - `ID string` - - `Source ChatKitResponseOutputTextAnnotationFileSource` + The unique ID of the computer call. - File attachment referenced by the annotation. + - `CallID string` - - `Filename string` + An identifier used when responding to the tool call with output. - Filename referenced by the annotation. + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `Type File` + The pending safety checks for the computer call. - Type discriminator that is always `file`. + - `ID string` - - `const FileFile File = "file"` + The ID of the pending safety check. - - `Type File` + - `Code string` - Type discriminator that is always `file` for this annotation. + The type of the pending safety check. - - `const FileFile File = "file"` + - `Message string` - - `type ChatKitResponseOutputTextAnnotationURL struct{…}` + Details about the pending safety check. - Annotation that references a URL. + - `Status BetaResponseComputerToolCallStatus` - - `Source ChatKitResponseOutputTextAnnotationURLSource` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - URL referenced by the annotation. + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `Type URL` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - Type discriminator that is always `url`. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `const URLURL URL = "url"` + - `Type BetaResponseComputerToolCallType` - - `URL string` + The type of the computer call. Always `computer_call`. - URL referenced by the annotation. + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `Type URL` + - `Action BetaComputerActionUnion` - Type discriminator that is always `url` for this annotation. + A click action. - - `const URLURL URL = "url"` + - `type BetaComputerActionClick struct{…}` - - `Text string` + A click action. - Assistant generated text. + - `Button string` - - `Type OutputText` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - Type discriminator that is always `output_text`. + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `const OutputTextOutputText OutputText = "output_text"` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - `CreatedAt int64` + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - Unix timestamp (in seconds) for when the item was created. + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `Object ChatKitThreadItem` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - Type discriminator that is always `chatkit.thread_item`. + - `Type Click` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + Specifies the event type. For a click action, this property is always `click`. - - `ThreadID string` + - `const ClickClick Click = "click"` - Identifier of the parent thread. + - `X int64` - - `Type ChatKitAssistantMessage` + The x-coordinate where the click occurred. - Type discriminator that is always `chatkit.assistant_message`. + - `Y int64` - - `const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"` + The y-coordinate where the click occurred. - - `type ChatKitWidgetItem struct{…}` + - `Keys []string` - Thread item that renders a widget payload. + The keys being held while clicking. - - `ID string` + - `type BetaComputerActionDoubleClick struct{…}` - Identifier of the thread item. + A double click action. - - `CreatedAt int64` + - `Keys []string` - Unix timestamp (in seconds) for when the item was created. + The keys being held while double-clicking. - - `Object ChatKitThreadItem` + - `Type DoubleClick` - Type discriminator that is always `chatkit.thread_item`. + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `ThreadID string` + - `X int64` - Identifier of the parent thread. + The x-coordinate where the double click occurred. - - `Type ChatKitWidget` + - `Y int64` - Type discriminator that is always `chatkit.widget`. + The y-coordinate where the double click occurred. - - `const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"` + - `type BetaComputerActionDrag struct{…}` - - `Widget string` + A drag action. - Serialized widget payload rendered in the UI. + - `Path []BetaComputerActionDragPath` - - `type ChatKitThreadItemListDataChatKitClientToolCall struct{…}` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - Record of a client side tool invocation initiated by the assistant. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `ID string` + - `X int64` - Identifier of the thread item. + The x-coordinate. - - `Arguments string` + - `Y int64` - JSON-encoded arguments that were sent to the tool. + The y-coordinate. - - `CallID string` + - `Type Drag` - Identifier for the client tool call. + Specifies the event type. For a drag action, this property is always set to `drag`. - - `CreatedAt int64` + - `const DragDrag Drag = "drag"` - Unix timestamp (in seconds) for when the item was created. + - `Keys []string` - - `Name string` + The keys being held while dragging the mouse. - Tool name that was invoked. + - `type BetaComputerActionKeypress struct{…}` - - `Object ChatKitThreadItem` + A collection of keypresses the model would like to perform. - Type discriminator that is always `chatkit.thread_item`. + - `Keys []string` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `Output string` + - `Type Keypress` - JSON-encoded output captured from the tool. Defaults to null while execution is in progress. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `Status string` + - `const KeypressKeypress Keypress = "keypress"` - Execution status for the tool call. + - `type BetaComputerActionMove struct{…}` - - `const ChatKitThreadItemListDataChatKitClientToolCallStatusInProgress ChatKitThreadItemListDataChatKitClientToolCallStatus = "in_progress"` + A mouse move action. - - `const ChatKitThreadItemListDataChatKitClientToolCallStatusCompleted ChatKitThreadItemListDataChatKitClientToolCallStatus = "completed"` + - `Type Move` - - `ThreadID string` + Specifies the event type. For a move action, this property is always set to `move`. - Identifier of the parent thread. + - `const MoveMove Move = "move"` - - `Type ChatKitClientToolCall` + - `X int64` - Type discriminator that is always `chatkit.client_tool_call`. + The x-coordinate to move to. - - `const ChatKitClientToolCallChatKitClientToolCall ChatKitClientToolCall = "chatkit.client_tool_call"` + - `Y int64` - - `type ChatKitThreadItemListDataChatKitTask struct{…}` + The y-coordinate to move to. - Task emitted by the workflow to show progress and status updates. + - `Keys []string` - - `ID string` + The keys being held while moving the mouse. - Identifier of the thread item. + - `type BetaComputerActionScreenshot struct{…}` - - `CreatedAt int64` + A screenshot action. - Unix timestamp (in seconds) for when the item was created. + - `Type Screenshot` - - `Heading string` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - Optional heading for the task. Defaults to null when not provided. + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `Object ChatKitThreadItem` + - `type BetaComputerActionScroll struct{…}` - Type discriminator that is always `chatkit.thread_item`. + A scroll action. - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + - `ScrollX int64` - - `Summary string` + The horizontal scroll distance. - Optional summary that describes the task. Defaults to null when omitted. + - `ScrollY int64` - - `TaskType string` + The vertical scroll distance. - Subtype for the task. + - `Type Scroll` - - `const ChatKitThreadItemListDataChatKitTaskTaskTypeCustom ChatKitThreadItemListDataChatKitTaskTaskType = "custom"` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `const ChatKitThreadItemListDataChatKitTaskTaskTypeThought ChatKitThreadItemListDataChatKitTaskTaskType = "thought"` + - `const ScrollScroll Scroll = "scroll"` - - `ThreadID string` + - `X int64` - Identifier of the parent thread. + The x-coordinate where the scroll occurred. - - `Type ChatKitTask` + - `Y int64` - Type discriminator that is always `chatkit.task`. + The y-coordinate where the scroll occurred. - - `const ChatKitTaskChatKitTask ChatKitTask = "chatkit.task"` + - `Keys []string` - - `type ChatKitThreadItemListDataChatKitTaskGroup struct{…}` + The keys being held while scrolling. - Collection of workflow tasks grouped together in the thread. + - `type BetaComputerActionType struct{…}` - - `ID string` + An action to type in text. - Identifier of the thread item. + - `Text string` - - `CreatedAt int64` + The text to type. - Unix timestamp (in seconds) for when the item was created. + - `Type Type` - - `Object ChatKitThreadItem` + Specifies the event type. For a type action, this property is always set to `type`. - Type discriminator that is always `chatkit.thread_item`. + - `const TypeType Type = "type"` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + - `type BetaComputerActionWait struct{…}` - - `Tasks []ChatKitThreadItemListDataChatKitTaskGroupTask` + A wait action. - Tasks included in the group. + - `Type Wait` - - `Heading string` + Specifies the event type. For a wait action, this property is always set to `wait`. - Optional heading for the grouped task. Defaults to null when not provided. + - `const WaitWait Wait = "wait"` - - `Summary string` + - `Actions BetaComputerActionList` - Optional summary that describes the grouped task. Defaults to null when omitted. + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `Type string` + - `type BetaComputerActionClick struct{…}` - Subtype for the grouped task. + A click action. - - `const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeCustom ChatKitThreadItemListDataChatKitTaskGroupTaskType = "custom"` + - `type BetaComputerActionDoubleClick struct{…}` - - `const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeThought ChatKitThreadItemListDataChatKitTaskGroupTaskType = "thought"` + A double click action. - - `ThreadID string` + - `type BetaComputerActionDrag struct{…}` - Identifier of the parent thread. + A drag action. - - `Type ChatKitTaskGroup` + - `type BetaComputerActionKeypress struct{…}` - Type discriminator that is always `chatkit.task_group`. + A collection of keypresses the model would like to perform. - - `const ChatKitTaskGroupChatKitTaskGroup ChatKitTaskGroup = "chatkit.task_group"` + - `type BetaComputerActionMove struct{…}` -### Example + A mouse move action. -```go -package main + - `type BetaComputerActionScreenshot struct{…}` -import ( - "context" - "fmt" + A screenshot action. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `type BetaComputerActionScroll struct{…}` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - page, err := client.Beta.ChatKit.Threads.ListItems( - context.TODO(), - "cthr_123", - openai.BetaChatKitThreadListItemsParams{ + A scroll action. - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", page) -} -``` - -#### Response - -```json -{ - "data": [ - { - "id": "id", - "attachments": [ - { - "id": "id", - "mime_type": "mime_type", - "name": "name", - "preview_url": "https://example.com", - "type": "image" - } - ], - "content": [ - { - "text": "text", - "type": "input_text" - } - ], - "created_at": 0, - "inference_options": { - "model": "model", - "tool_choice": { - "id": "id" - } - }, - "object": "chatkit.thread_item", - "thread_id": "thread_id", - "type": "chatkit.user_message" - } - ], - "first_id": "first_id", - "has_more": true, - "last_id": "last_id", - "object": "list" -} -``` + - `type BetaComputerActionType struct{…}` -### Example + An action to type in text. -```go -package main + - `type BetaComputerActionWait struct{…}` -import ( - "context" - "fmt" + A wait action. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `Agent BetaResponseComputerToolCallAgent` -func main() { - client := openai.NewClient() - page, err := client.Beta.ChatKit.Threads.ListItems( - context.TODO(), - "cthr_123", - openai.BetaChatKitThreadListItemsParams{ + The agent that produced this item. - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", page) -} -``` + - `AgentName string` -#### Response + The canonical name of the agent that produced this item. -```json -{ - "data": [ - { - "id": "cthi_user_001", - "object": "chatkit.thread_item", - "type": "user_message", - "content": [ - { - "type": "input_text", - "text": "I need help debugging an onboarding issue." - } - ], - "attachments": [] - }, - { - "id": "cthi_assistant_002", - "object": "chatkit.thread_item", - "type": "assistant_message", - "content": [ - { - "type": "output_text", - "text": "Let's start by confirming the workflow version you deployed." - } - ] - } - ], - "has_more": false, - "object": "list" -} -``` + - `type BetaResponseInputItemComputerCallOutput struct{…}` -## Retrieve ChatKit thread + The output of a computer tool call. -`client.Beta.ChatKit.Threads.Get(ctx, threadID) (*ChatKitThread, error)` + - `CallID string` -**get** `/chatkit/threads/{thread_id}` + The ID of the computer tool call that produced the output. -Retrieve ChatKit thread + - `Output BetaResponseComputerToolCallOutputScreenshot` -### Parameters + A computer screenshot image used with the computer use tool. -- `threadID string` + - `Type ComputerScreenshot` -### Returns + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. -- `type ChatKitThread struct{…}` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - Represents a ChatKit thread and its current status. + - `FileID string` - - `ID string` + The identifier of an uploaded file that contains the screenshot. - Identifier of the thread. + - `ImageURL string` - - `CreatedAt int64` + The URL of the screenshot image. - Unix timestamp (in seconds) for when the thread was created. + - `Type ComputerCallOutput` - - `Object ChatKitThread` + The type of the computer tool call output. Always `computer_call_output`. - Type discriminator that is always `chatkit.thread`. + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"` + - `ID string` - - `Status ChatKitThreadStatusUnion` + The ID of the computer tool call output. - Current status for the thread. Defaults to `active` for newly created threads. + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - - `type ChatKitThreadStatusActive struct{…}` + The safety checks reported by the API that have been acknowledged by the developer. - Indicates that a thread is active. + - `ID string` - - `Type Active` + The ID of the pending safety check. - Status discriminator that is always `active`. + - `Code string` - - `const ActiveActive Active = "active"` + The type of the pending safety check. - - `type ChatKitThreadStatusLocked struct{…}` + - `Message string` - Indicates that a thread is locked and cannot accept new input. + Details about the pending safety check. - - `Reason string` + - `Agent BetaResponseInputItemComputerCallOutputAgent` - Reason that the thread was locked. Defaults to null when no reason is recorded. + The agent that produced this item. - - `Type Locked` + - `AgentName string` - Status discriminator that is always `locked`. + The canonical name of the agent that produced this item. - - `const LockedLocked Locked = "locked"` + - `Status string` - - `type ChatKitThreadStatusClosed struct{…}` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - Indicates that a thread has been closed. + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `Reason string` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - Reason that the thread was closed. Defaults to null when no reason is recorded. + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - - `Type Closed` + - `type BetaResponseFunctionWebSearch struct{…}` - Status discriminator that is always `closed`. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `const ClosedClosed Closed = "closed"` + - `ID string` - - `Title string` + The unique ID of the web search tool call. - Optional human-readable title for the thread. Defaults to null when no title has been generated. + - `Action BetaResponseFunctionWebSearchActionUnion` - - `User string` + 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). - Free-form string that identifies your end user who owns the thread. + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` -### Example + Action type "search" - Performs a web search query. -```go -package main + - `Type Search` -import ( - "context" - "fmt" + The action type. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `const SearchSearch Search = "search"` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - chatkitThread, err := client.Beta.ChatKit.Threads.Get(context.TODO(), "cthr_123") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", chatkitThread.ID) -} -``` + - `Queries []string` -#### Response + The search queries. -```json -{ - "id": "cthr_def456", - "created_at": 1712345600, - "object": "chatkit.thread", - "status": { - "type": "active" - }, - "title": "Demo feedback", - "user": "user_456" -} -``` + - `Query string` -### Example + The search query. -```go -package main + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` -import ( - "context" - "fmt" + The sources used in the search. - "github.com/openai/openai-go" -) + - `Type URL` -func main() { - client := openai.NewClient() - chatkitThread, err := client.Beta.ChatKit.Threads.Get(context.TODO(), "cthr_123") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", chatkitThread.ID) -} -``` + The type of source. Always `url`. -#### Response + - `const URLURL URL = "url"` -```json -{ - "id": "cthr_abc123", - "object": "chatkit.thread", - "title": "Customer escalation", - "items": { - "data": [ - { - "id": "cthi_user_001", - "object": "chatkit.thread_item", - "type": "user_message", - "content": [ - { - "type": "input_text", - "text": "I need help debugging an onboarding issue." - } - ], - "attachments": [] - }, - { - "id": "cthi_assistant_002", - "object": "chatkit.thread_item", - "type": "assistant_message", - "content": [ - { - "type": "output_text", - "text": "Let's start by confirming the workflow version you deployed." - } - ] - } - ], - "has_more": false - } -} -``` + - `URL string` -## Delete ChatKit thread + The URL of the source. -`client.Beta.ChatKit.Threads.Delete(ctx, threadID) (*BetaChatKitThreadDeleteResponse, error)` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` -**delete** `/chatkit/threads/{thread_id}` + Action type "open_page" - Opens a specific URL from search results. -Delete ChatKit thread + - `Type OpenPage` -### Parameters + The action type. -- `threadID string` + - `const OpenPageOpenPage OpenPage = "open_page"` -### Returns + - `URL string` -- `type BetaChatKitThreadDeleteResponse struct{…}` + The URL opened by the model. - Confirmation payload returned after deleting a thread. + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - - `ID string` + Action type "find_in_page": Searches for a pattern within a loaded page. - Identifier of the deleted thread. + - `Pattern string` - - `Deleted bool` + The pattern or text to search for within the page. - Indicates that the thread has been deleted. + - `Type FindInPage` - - `Object ChatKitThreadDeleted` + The action type. - Type discriminator that is always `chatkit.thread.deleted`. + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `const ChatKitThreadDeletedChatKitThreadDeleted ChatKitThreadDeleted = "chatkit.thread.deleted"` + - `URL string` -### Example + The URL of the page searched for the pattern. -```go -package main + - `Status BetaResponseFunctionWebSearchStatus` -import ( - "context" - "fmt" + The status of the web search tool call. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - thread, err := client.Beta.ChatKit.Threads.Delete(context.TODO(), "cthr_123") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", thread.ID) -} -``` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` -#### Response + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` -```json -{ - "id": "id", - "deleted": true, - "object": "chatkit.thread.deleted" -} -``` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` -### Example + - `Type WebSearchCall` -```go -package main + The type of the web search tool call. Always `web_search_call`. -import ( - "context" - "fmt" + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - "github.com/openai/openai-go" -) + - `Agent BetaResponseFunctionWebSearchAgent` -func main() { - client := openai.NewClient() - thread, err := client.Beta.ChatKit.Threads.Delete(context.TODO(), "cthr_123") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", thread.ID) -} -``` + The agent that produced this item. -## List ChatKit threads + - `AgentName string` -`client.Beta.ChatKit.Threads.List(ctx, query) (*ConversationCursorPage[ChatKitThread], error)` + The canonical name of the agent that produced this item. -**get** `/chatkit/threads` + - `type BetaResponseFunctionToolCall struct{…}` -List ChatKit threads + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. -### Parameters + - `Arguments string` -- `query BetaChatKitThreadListParams` + A JSON string of the arguments to pass to the function. - - `After param.Field[string]` + - `CallID string` - List items created after this thread item ID. Defaults to null for the first page. + The unique ID of the function tool call generated by the model. - - `Before param.Field[string]` + - `Name string` - List items created before this thread item ID. Defaults to null for the newest results. + The name of the function to run. - - `Limit param.Field[int64]` + - `Type FunctionCall` - Maximum number of thread items to return. Defaults to 20. + The type of the function tool call. Always `function_call`. - - `Order param.Field[BetaChatKitThreadListParamsOrder]` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - Sort order for results by creation time. Defaults to `desc`. + - `ID string` - - `const BetaChatKitThreadListParamsOrderAsc BetaChatKitThreadListParamsOrder = "asc"` + The unique ID of the function tool call. - - `const BetaChatKitThreadListParamsOrderDesc BetaChatKitThreadListParamsOrder = "desc"` + - `Agent BetaResponseFunctionToolCallAgent` - - `User param.Field[string]` + The agent that produced this item. - Filter threads that belong to this user identifier. Defaults to null to return all users. + - `AgentName string` -### Returns + The canonical name of the agent that produced this item. -- `type ChatKitThread struct{…}` + - `Caller BetaResponseFunctionToolCallCallerUnion` - Represents a ChatKit thread and its current status. + The execution context that produced this tool call. - - `ID string` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - Identifier of the thread. + - `Type Direct` - - `CreatedAt int64` + - `const DirectDirect Direct = "direct"` - Unix timestamp (in seconds) for when the thread was created. + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - `Object ChatKitThread` + - `CallerID string` - Type discriminator that is always `chatkit.thread`. + The call ID of the program item that produced this tool call. - - `const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"` + - `Type Program` - - `Status ChatKitThreadStatusUnion` + - `const ProgramProgram Program = "program"` - Current status for the thread. Defaults to `active` for newly created threads. + - `Namespace string` - - `type ChatKitThreadStatusActive struct{…}` + The namespace of the function to run. - Indicates that a thread is active. + - `Status BetaResponseFunctionToolCallStatus` - - `Type Active` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Status discriminator that is always `active`. + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `const ActiveActive Active = "active"` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `type ChatKitThreadStatusLocked struct{…}` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - Indicates that a thread is locked and cannot accept new input. + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `Reason string` + The output of a function tool call. - Reason that the thread was locked. Defaults to null when no reason is recorded. + - `CallID string` - - `Type Locked` + The unique ID of the function tool call generated by the model. - Status discriminator that is always `locked`. + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - - `const LockedLocked Locked = "locked"` + Text, image, or file output of the function tool call. - - `type ChatKitThreadStatusClosed struct{…}` + - `string` - Indicates that a thread has been closed. + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `Reason string` + An array of content outputs (text, image, file) for the function tool call. - Reason that the thread was closed. Defaults to null when no reason is recorded. + - `type BetaResponseInputTextContent struct{…}` - - `Type Closed` + A text input to the model. - Status discriminator that is always `closed`. + - `Text string` - - `const ClosedClosed Closed = "closed"` + The text input to the model. - - `Title string` + - `Type InputText` - Optional human-readable title for the thread. Defaults to null when no title has been generated. + The type of the input item. Always `input_text`. - - `User string` + - `const InputTextInputText InputText = "input_text"` - Free-form string that identifies your end user who owns the thread. + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` -### Example + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. -```go -package main + - `Mode Explicit` -import ( - "context" - "fmt" + The breakpoint mode. Always `explicit`. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `const ExplicitExplicit Explicit = "explicit"` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - page, err := client.Beta.ChatKit.Threads.List(context.TODO(), openai.BetaChatKitThreadListParams{ + - `type BetaResponseInputImageContent struct{…}` - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", page) -} -``` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) -#### Response + - `Type InputImage` -```json -{ - "data": [ - { - "id": "cthr_def456", - "created_at": 1712345600, - "object": "chatkit.thread", - "status": { - "type": "active" - }, - "title": "Demo feedback", - "user": "user_456" - } - ], - "first_id": "first_id", - "has_more": true, - "last_id": "last_id", - "object": "list" -} -``` + The type of the input item. Always `input_image`. -### Example + - `const InputImageInputImage InputImage = "input_image"` -```go -package main + - `Detail BetaResponseInputImageContentDetail` -import ( - "context" - "fmt" + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - "github.com/openai/openai-go" -) + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` -func main() { - client := openai.NewClient() - page, err := client.Beta.ChatKit.Threads.List(context.TODO(), openai.BetaChatKitThreadListParams{ + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", page) -} -``` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` -#### Response + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` -```json -{ - "data": [ - { - "id": "cthr_abc123", - "object": "chatkit.thread", - "title": "Customer escalation" - }, - { - "id": "cthr_def456", - "object": "chatkit.thread", - "title": "Demo feedback" - } - ], - "has_more": false, - "object": "list" -} -``` + - `FileID string` -## Domain Types + The ID of the file to be sent to the model. -### Chat Session + - `ImageURL string` -- `type ChatSession struct{…}` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - Represents a ChatKit session and its resolved configuration. + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `ID string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Identifier for the ChatKit session. + - `Mode Explicit` - - `ChatKitConfiguration ChatSessionChatKitConfiguration` + The breakpoint mode. Always `explicit`. - Resolved ChatKit feature configuration for the session. + - `const ExplicitExplicit Explicit = "explicit"` - - `AutomaticThreadTitling ChatSessionAutomaticThreadTitling` + - `type BetaResponseInputFileContent struct{…}` - Automatic thread titling preferences. + A file input to the model. - - `Enabled bool` + - `Type InputFile` - Whether automatic thread titling is enabled. + The type of the input item. Always `input_file`. - - `FileUpload ChatSessionFileUpload` + - `const InputFileInputFile InputFile = "input_file"` - Upload settings for the session. + - `Detail BetaResponseInputFileContentDetail` - - `Enabled bool` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - Indicates if uploads are enabled for the session. + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `MaxFileSize int64` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - Maximum upload size in megabytes. + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `MaxFiles int64` + - `FileData string` - Maximum number of uploads allowed during the session. + The base64-encoded data of the file to be sent to the model. - - `History ChatSessionHistory` + - `FileID string` - History retention configuration. + The ID of the file to be sent to the model. - - `Enabled bool` + - `FileURL string` - Indicates if chat history is persisted for the session. + The URL of the file to be sent to the model. - - `RecentThreads int64` + - `Filename string` - Number of prior threads surfaced in history views. Defaults to null when all history is retained. + The name of the file to be sent to the model. - - `ClientSecret string` + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - Ephemeral client secret that authenticates session requests. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `ExpiresAt int64` + - `Mode Explicit` - Unix timestamp (in seconds) for when the session expires. + The breakpoint mode. Always `explicit`. - - `MaxRequestsPer1Minute int64` + - `const ExplicitExplicit Explicit = "explicit"` - Convenience copy of the per-minute request limit. + - `Type FunctionCallOutput` - - `Object ChatKitSession` + The type of the function tool call output. Always `function_call_output`. - Type discriminator that is always `chatkit.session`. + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"` + - `ID string` - - `RateLimits ChatSessionRateLimits` + The unique ID of the function tool call output. Populated when this item is returned via API. - Resolved rate limit values. + - `Agent BetaResponseInputItemFunctionCallOutputAgent` - - `MaxRequestsPer1Minute int64` + The agent that produced this item. - Maximum allowed requests per one-minute window. + - `AgentName string` - - `Status ChatSessionStatus` + The canonical name of the agent that produced this item. - Current lifecycle state of the session. + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - - `const ChatSessionStatusActive ChatSessionStatus = "active"` + The execution context that produced this tool call. - - `const ChatSessionStatusExpired ChatSessionStatus = "expired"` + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - - `const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"` + - `Type Direct` - - `User string` + The caller type. Always `direct`. - User identifier associated with the session. + - `const DirectDirect Direct = "direct"` - - `Workflow ChatKitWorkflow` + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - Workflow metadata for the session. + - `CallerID string` - - `ID string` + The call ID of the program item that produced this tool call. - Identifier of the workflow backing the session. + - `Type Program` - - `StateVariables map[string, ChatKitWorkflowStateVariableUnion]` + The caller type. Always `program`. - State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided. + - `const ProgramProgram Program = "program"` - - `string` + - `Status string` - - `bool` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `float64` + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - - `Tracing ChatKitWorkflowTracing` + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - Tracing settings applied to the workflow. + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - - `Enabled bool` + - `type BetaResponseInputItemAgentMessage struct{…}` - Indicates whether tracing is enabled. + A message routed between agents. - - `Version string` + - `Author string` - Specific workflow version used for the session. Defaults to null when using the latest deployment. + The sending agent identity. -### Chat Session Automatic Thread Titling + - `Content []BetaResponseInputItemAgentMessageContentUnion` -- `type ChatSessionAutomaticThreadTitling struct{…}` + Plaintext, image, or encrypted content sent between agents. - Automatic thread title preferences for the session. + - `type BetaResponseInputTextContent struct{…}` - - `Enabled bool` + A text input to the model. - Whether automatic thread titling is enabled. + - `type BetaResponseInputImageContent struct{…}` -### Chat Session ChatKit Configuration + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) -- `type ChatSessionChatKitConfiguration struct{…}` + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - ChatKit configuration for the session. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `AutomaticThreadTitling ChatSessionAutomaticThreadTitling` + - `EncryptedContent string` - Automatic thread titling preferences. + Opaque encrypted content. - - `Enabled bool` + - `Type EncryptedContent` - Whether automatic thread titling is enabled. + The type of the input item. Always `encrypted_content`. - - `FileUpload ChatSessionFileUpload` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - Upload settings for the session. + - `Recipient string` - - `Enabled bool` + The destination agent identity. - Indicates if uploads are enabled for the session. + - `Type AgentMessage` - - `MaxFileSize int64` + The item type. Always `agent_message`. - Maximum upload size in megabytes. + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `MaxFiles int64` + - `ID string` - Maximum number of uploads allowed during the session. + The unique ID of this agent message item. - - `History ChatSessionHistory` + - `Agent BetaResponseInputItemAgentMessageAgent` - History retention configuration. + The agent that produced this item. - - `Enabled bool` + - `AgentName string` - Indicates if chat history is persisted for the session. + The canonical name of the agent that produced this item. - - `RecentThreads int64` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - Number of prior threads surfaced in history views. Defaults to null when all history is retained. + - `Action string` -### Chat Session ChatKit Configuration Param + The multi-agent action that was executed. -- `type ChatSessionChatKitConfigurationParamResp struct{…}` + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - Optional per-session configuration settings for ChatKit behavior. + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `AutomaticThreadTitling ChatSessionChatKitConfigurationParamAutomaticThreadTitlingResp` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - Configuration for automatic thread titling. When omitted, automatic thread titling is enabled by default. + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `Enabled bool` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - Enable automatic thread title generation. Defaults to true. + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `FileUpload ChatSessionChatKitConfigurationParamFileUploadResp` + - `Arguments string` - Configuration for upload enablement and limits. When omitted, uploads are disabled by default (max_files 10, max_file_size 512 MB). + The action arguments as a JSON string. - - `Enabled bool` + - `CallID string` - Enable uploads for this session. Defaults to false. + The unique ID linking this call to its output. - - `MaxFileSize int64` + - `Type MultiAgentCall` - Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is the maximum allowable size. + The item type. Always `multi_agent_call`. - - `MaxFiles int64` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - Maximum number of files that can be uploaded to the session. Defaults to 10. + - `ID string` - - `History ChatSessionChatKitConfigurationParamHistoryResp` + The unique ID of this multi-agent call. - Configuration for chat history retention. When omitted, history is enabled by default with no limit on recent_threads (null). + - `Agent BetaResponseInputItemMultiAgentCallAgent` - - `Enabled bool` + The agent that produced this item. - Enables chat users to access previous ChatKit threads. Defaults to true. + - `AgentName string` - - `RecentThreads int64` + The canonical name of the agent that produced this item. - Number of recent ChatKit threads users have access to. Defaults to unlimited when unset. + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` -### Chat Session Expires After Param + - `Action string` -- `type ChatSessionExpiresAfterParamResp struct{…}` + The multi-agent action that produced this result. - Controls when the session expires relative to an anchor timestamp. + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - - `Anchor CreatedAt` + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - Base timestamp used to calculate expiration. Currently fixed to `created_at`. + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - - `const CreatedAtCreatedAt CreatedAt = "created_at"` + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - - `Seconds int64` + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - Number of seconds after the anchor when the session expires. + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` -### Chat Session File Upload + - `CallID string` -- `type ChatSessionFileUpload struct{…}` + The unique ID of the multi-agent call. - Upload permissions and limits applied to the session. + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `Enabled bool` + Text output returned by the multi-agent action. - Indicates if uploads are enabled for the session. + - `Text string` - - `MaxFileSize int64` + The text content. - Maximum upload size in megabytes. + - `Type OutputText` - - `MaxFiles int64` + The content type. Always `output_text`. - Maximum number of uploads allowed during the session. + - `const OutputTextOutputText OutputText = "output_text"` -### Chat Session History + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` -- `type ChatSessionHistory struct{…}` + Citations associated with the text content. - History retention preferences returned for the session. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `Enabled bool` + - `FileID string` - Indicates if chat history is persisted for the session. + The ID of the file. - - `RecentThreads int64` + - `Filename string` - Number of prior threads surfaced in history views. Defaults to null when all history is retained. + The filename of the file cited. -### Chat Session Rate Limits + - `Index int64` -- `type ChatSessionRateLimits struct{…}` + The index of the file in the list of files. - Active per-minute request limit for the session. + - `Type FileCitation` - - `MaxRequestsPer1Minute int64` + The citation type. Always `file_citation`. - Maximum allowed requests per one-minute window. + - `const FileCitationFileCitation FileCitation = "file_citation"` -### Chat Session Rate Limits Param + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` -- `type ChatSessionRateLimitsParamResp struct{…}` + - `EndIndex int64` - Controls request rate limits for the session. + The index of the last character of the citation in the message. - - `MaxRequestsPer1Minute int64` + - `StartIndex int64` - Maximum number of requests allowed per minute for the session. Defaults to 10. + The index of the first character of the citation in the message. -### Chat Session Status + - `Title string` -- `type ChatSessionStatus string` + The title of the cited resource. - - `const ChatSessionStatusActive ChatSessionStatus = "active"` + - `Type URLCitation` - - `const ChatSessionStatusExpired ChatSessionStatus = "expired"` + The citation type. Always `url_citation`. - - `const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"` + - `const URLCitationURLCitation URLCitation = "url_citation"` -### Chat Session Workflow Param + - `URL string` -- `type ChatSessionWorkflowParamResp struct{…}` + The URL of the cited resource. - Workflow reference and overrides applied to the chat session. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `ID string` + - `ContainerID string` - Identifier for the workflow invoked by the session. + The ID of the container. - - `StateVariables map[string, ChatSessionWorkflowParamStateVariableUnionResp]` + - `EndIndex int64` - State variables forwarded to the workflow. Keys may be up to 64 characters, values must be primitive types, and the map defaults to an empty object. + The index of the last character of the citation in the message. - - `string` + - `FileID string` - - `bool` + The ID of the container file. - - `float64` + - `Filename string` - - `Tracing ChatSessionWorkflowParamTracingResp` + The filename of the container file cited. - Optional tracing overrides for the workflow invocation. When omitted, tracing is enabled by default. + - `StartIndex int64` - - `Enabled bool` + The index of the first character of the citation in the message. - Whether tracing is enabled during the session. Defaults to true. + - `Type ContainerFileCitation` - - `Version string` + The citation type. Always `container_file_citation`. - Specific workflow version to run. Defaults to the latest deployed version. + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` -### ChatKit Attachment + - `Type MultiAgentCallOutput` -- `type ChatKitAttachment struct{…}` + The item type. Always `multi_agent_call_output`. - Attachment metadata included on thread items. + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - `ID string` - Identifier for the attachment. + The unique ID of this multi-agent call output. - - `MimeType string` + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` - MIME type of the attachment. + The agent that produced this item. - - `Name string` + - `AgentName string` - Original display name for the attachment. + The canonical name of the agent that produced this item. - - `PreviewURL string` + - `type BetaResponseInputItemToolSearchCall struct{…}` - Preview URL for rendering the attachment inline. + - `Arguments any` - - `Type ChatKitAttachmentType` + The arguments supplied to the tool search call. - Attachment discriminator. + - `Type ToolSearchCall` - - `const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image"` + The item type. Always `tool_search_call`. - - `const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` -### ChatKit Response Output Text + - `ID string` -- `type ChatKitResponseOutputText struct{…}` + The unique ID of this tool search call. - Assistant response text accompanied by optional annotations. + - `Agent BetaResponseInputItemToolSearchCallAgent` - - `Annotations []ChatKitResponseOutputTextAnnotationUnion` + The agent that produced this item. - Ordered list of annotations attached to the response text. + - `AgentName string` - - `type ChatKitResponseOutputTextAnnotationFile struct{…}` + The canonical name of the agent that produced this item. - Annotation that references an uploaded file. + - `CallID string` - - `Source ChatKitResponseOutputTextAnnotationFileSource` + The unique ID of the tool search call generated by the model. - File attachment referenced by the annotation. + - `Execution string` - - `Filename string` + Whether tool search was executed by the server or by the client. - Filename referenced by the annotation. + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - - `Type File` + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - Type discriminator that is always `file`. + - `Status string` - - `const FileFile File = "file"` + The status of the tool search call. - - `Type File` + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - Type discriminator that is always `file` for this annotation. + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - - `const FileFile File = "file"` + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - - `type ChatKitResponseOutputTextAnnotationURL struct{…}` + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - Annotation that references a URL. + - `Tools []BetaToolUnion` - - `Source ChatKitResponseOutputTextAnnotationURLSource` + The loaded tool definitions returned by the tool search output. - URL referenced by the annotation. + - `type BetaFunctionTool struct{…}` - - `Type URL` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - Type discriminator that is always `url`. + - `Name string` - - `const URLURL URL = "url"` + The name of the function to call. - - `URL string` + - `Parameters map[string, any]` - URL referenced by the annotation. + A JSON schema object describing the parameters of the function. - - `Type URL` + - `Strict bool` - Type discriminator that is always `url` for this annotation. + Whether strict parameter validation is enforced for this function tool. - - `const URLURL URL = "url"` + - `Type Function` - - `Text string` + The type of the function tool. Always `function`. - Assistant generated text. + - `const FunctionFunction Function = "function"` - - `Type OutputText` + - `AllowedCallers []string` - Type discriminator that is always `output_text`. + The tool invocation context(s). - - `const OutputTextOutputText OutputText = "output_text"` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` -### ChatKit Thread + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` -- `type ChatKitThread struct{…}` + - `DeferLoading bool` - Represents a ChatKit thread and its current status. + Whether this function is deferred and loaded via tool search. - - `ID string` + - `Description string` - Identifier of the thread. + A description of the function. Used by the model to determine whether or not to call the function. - - `CreatedAt int64` + - `OutputSchema map[string, any]` - Unix timestamp (in seconds) for when the thread was created. + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `Object ChatKitThread` + - `type BetaFileSearchTool struct{…}` - Type discriminator that is always `chatkit.thread`. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"` + - `Type FileSearch` - - `Status ChatKitThreadStatusUnion` + The type of the file search tool. Always `file_search`. - Current status for the thread. Defaults to `active` for newly created threads. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type ChatKitThreadStatusActive struct{…}` + - `VectorStoreIDs []string` - Indicates that a thread is active. + The IDs of the vector stores to search. - - `Type Active` + - `Filters BetaFileSearchToolFiltersUnion` - Status discriminator that is always `active`. + A filter to apply. - - `const ActiveActive Active = "active"` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `type ChatKitThreadStatusLocked struct{…}` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - Indicates that a thread is locked and cannot accept new input. + - `Key string` - - `Reason string` + The key to compare against the value. - Reason that the thread was locked. Defaults to null when no reason is recorded. + - `Type string` - - `Type Locked` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - Status discriminator that is always `locked`. + - `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 LockedLocked Locked = "locked"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `type ChatKitThreadStatusClosed struct{…}` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - Indicates that a thread has been closed. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `Reason string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - Reason that the thread was closed. Defaults to null when no reason is recorded. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Type Closed` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - Status discriminator that is always `closed`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `const ClosedClosed Closed = "closed"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `Title string` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - Optional human-readable title for the thread. Defaults to null when no title has been generated. + The value to compare against the attribute key; supports string, number, or boolean types. - - `User string` + - `string` - Free-form string that identifies your end user who owns the thread. + - `float64` -### ChatKit Thread Assistant Message Item + - `bool` -- `type ChatKitThreadAssistantMessageItem struct{…}` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - Assistant-authored message within a thread. + - `string` - - `ID string` + - `float64` - Identifier of the thread item. + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `Content []ChatKitResponseOutputText` + Combine multiple filters using `and` or `or`. - Ordered assistant response segments. + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `Annotations []ChatKitResponseOutputTextAnnotationUnion` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - Ordered list of annotations attached to the response text. + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `type ChatKitResponseOutputTextAnnotationFile struct{…}` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - Annotation that references an uploaded file. + - `Key string` - - `Source ChatKitResponseOutputTextAnnotationFileSource` + The key to compare against the value. - File attachment referenced by the annotation. + - `Type string` - - `Filename string` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - Filename referenced by the annotation. + - `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 - - `Type File` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - Type discriminator that is always `file`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `const FileFile File = "file"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `Type File` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - Type discriminator that is always `file` for this annotation. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `const FileFile File = "file"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `type ChatKitResponseOutputTextAnnotationURL struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - Annotation that references a URL. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `Source ChatKitResponseOutputTextAnnotationURLSource` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - URL referenced by the annotation. + The value to compare against the attribute key; supports string, number, or boolean types. - - `Type URL` + - `string` - Type discriminator that is always `url`. + - `float64` - - `const URLURL URL = "url"` + - `bool` - - `URL string` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - URL referenced by the annotation. + - `string` - - `Type URL` + - `float64` - Type discriminator that is always `url` for this annotation. + - `Type string` - - `const URLURL URL = "url"` + Type of operation: `and` or `or`. - - `Text string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - Assistant generated text. + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - `Type OutputText` + - `MaxNumResults int64` - Type discriminator that is always `output_text`. + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `const OutputTextOutputText OutputText = "output_text"` + - `RankingOptions BetaFileSearchToolRankingOptions` - - `CreatedAt int64` + Ranking options for search. - Unix timestamp (in seconds) for when the item was created. + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `Object ChatKitThreadItem` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - Type discriminator that is always `chatkit.thread_item`. + - `EmbeddingWeight float64` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + The weight of the embedding in the reciprocal ranking fusion. - - `ThreadID string` + - `TextWeight float64` - Identifier of the parent thread. + The weight of the text in the reciprocal ranking fusion. - - `Type ChatKitAssistantMessage` + - `Ranker string` - Type discriminator that is always `chatkit.assistant_message`. + The ranker to use for the file search. - - `const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"` + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` -### ChatKit Thread Item List + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` -- `type ChatKitThreadItemList struct{…}` + - `ScoreThreshold float64` - A paginated list of thread items rendered for the ChatKit API. + 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. - - `Data []ChatKitThreadItemListDataUnion` + - `type BetaComputerTool struct{…}` - A list of items + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type ChatKitThreadUserMessageItem struct{…}` + - `Type Computer` - User-authored messages within a thread. + The type of the computer tool. Always `computer`. - - `ID string` + - `const ComputerComputer Computer = "computer"` - Identifier of the thread item. + - `type BetaComputerUsePreviewTool struct{…}` - - `Attachments []ChatKitAttachment` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - Attachments associated with the user message. Defaults to an empty list. + - `DisplayHeight int64` - - `ID string` + The height of the computer display. - Identifier for the attachment. + - `DisplayWidth int64` - - `MimeType string` + The width of the computer display. - MIME type of the attachment. + - `Environment BetaComputerUsePreviewToolEnvironment` - - `Name string` + The type of computer environment to control. - Original display name for the attachment. + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - - `PreviewURL string` + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - Preview URL for rendering the attachment inline. + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `Type ChatKitAttachmentType` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - Attachment discriminator. + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image"` + - `Type ComputerUsePreview` - - `const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"` + The type of the computer use tool. Always `computer_use_preview`. - - `Content []ChatKitThreadUserMessageItemContentUnion` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - Ordered content elements supplied by the user. + - `type BetaWebSearchTool struct{…}` - - `type ChatKitThreadUserMessageItemContentInputText struct{…}` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Text block that a user contributed to the thread. + - `Type BetaWebSearchToolType` - - `Text string` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - Plain-text content supplied by the user. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `Type InputText` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - Type discriminator that is always `input_text`. + - `Filters BetaWebSearchToolFilters` - - `const InputTextInputText InputText = "input_text"` + Filters for the search. - - `type ChatKitThreadUserMessageItemContentQuotedText struct{…}` + - `AllowedDomains []string` - Quoted snippet that the user referenced in their message. + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `Text string` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - Quoted text content. + - `SearchContextSize BetaWebSearchToolSearchContextSize` - - `Type QuotedText` + 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. - Type discriminator that is always `quoted_text`. + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - - `const QuotedTextQuotedText QuotedText = "quoted_text"` + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `CreatedAt int64` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - Unix timestamp (in seconds) for when the item was created. + - `UserLocation BetaWebSearchToolUserLocation` - - `InferenceOptions ChatKitThreadUserMessageItemInferenceOptions` + The approximate location of the user. - Inference overrides applied to the message. Defaults to null when unset. + - `City string` - - `Model string` + Free text input for the city of the user, e.g. `San Francisco`. - Model name that generated the response. Defaults to null when using the session default. + - `Country string` - - `ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoice` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + - `Region string` - - `ID string` + Free text input for the region of the user, e.g. `California`. - Identifier of the requested tool. + - `Timezone string` - - `Object ChatKitThreadItem` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - Type discriminator that is always `chatkit.thread_item`. + - `Type string` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + The type of location approximation. Always `approximate`. - - `ThreadID string` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - Identifier of the parent thread. + - `type BetaToolMcp struct{…}` - - `Type ChatKitUserMessage` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"` + - `ServerLabel string` - - `type ChatKitThreadAssistantMessageItem struct{…}` + A label for this MCP server, used to identify it in tool calls. - Assistant-authored message within a thread. + - `Type Mcp` - - `ID string` + The type of the MCP tool. Always `mcp`. - Identifier of the thread item. + - `const McpMcp Mcp = "mcp"` - - `Content []ChatKitResponseOutputText` + - `AllowedCallers []string` - Ordered assistant response segments. + The tool invocation context(s). - - `Annotations []ChatKitResponseOutputTextAnnotationUnion` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - Ordered list of annotations attached to the response text. + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `type ChatKitResponseOutputTextAnnotationFile struct{…}` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - Annotation that references an uploaded file. + List of allowed tool names or a filter object. - - `Source ChatKitResponseOutputTextAnnotationFileSource` + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - File attachment referenced by the annotation. + A string array of allowed tool names - - `Filename string` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - Filename referenced by the annotation. + A filter object to specify which tools are allowed. - - `Type File` + - `ReadOnly bool` - Type discriminator that is always `file`. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const FileFile File = "file"` + - `ToolNames []string` - - `Type File` + List of allowed tool names. - Type discriminator that is always `file` for this annotation. + - `Authorization string` - - `const FileFile File = "file"` + 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. - - `type ChatKitResponseOutputTextAnnotationURL struct{…}` + - `ConnectorID string` - Annotation that references a URL. + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `Source ChatKitResponseOutputTextAnnotationURLSource` + Currently supported `connector_id` values are: - URL referenced by the annotation. + - 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` - - `Type URL` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - Type discriminator that is always `url`. + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `const URLURL URL = "url"` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `URL string` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - URL referenced by the annotation. + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - - `Type URL` + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - Type discriminator that is always `url` for this annotation. + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - - `const URLURL URL = "url"` + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `Text string` + - `DeferLoading bool` - Assistant generated text. + Whether this MCP tool is deferred and discovered via tool search. - - `Type OutputText` + - `Headers map[string, string]` - Type discriminator that is always `output_text`. + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `const OutputTextOutputText OutputText = "output_text"` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `CreatedAt int64` + Specify which of the MCP server's tools require approval. - Unix timestamp (in seconds) for when the item was created. + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `Object ChatKitThreadItem` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - Type discriminator that is always `chatkit.thread_item`. + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + A filter object to specify which tools are allowed. - - `ThreadID string` + - `ReadOnly bool` - Identifier of the parent thread. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Type ChatKitAssistantMessage` + - `ToolNames []string` - Type discriminator that is always `chatkit.assistant_message`. + List of allowed tool names. - - `const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - - `type ChatKitWidgetItem struct{…}` + A filter object to specify which tools are allowed. - Thread item that renders a widget payload. + - `ReadOnly bool` - - `ID string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - Identifier of the thread item. + - `ToolNames []string` - - `CreatedAt int64` + List of allowed tool names. - Unix timestamp (in seconds) for when the item was created. + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `Object ChatKitThreadItem` + 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. - Type discriminator that is always `chatkit.thread_item`. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - - `ThreadID string` + - `ServerDescription string` - Identifier of the parent thread. + Optional description of the MCP server, used to provide more context. - - `Type ChatKitWidget` + - `ServerURL string` - Type discriminator that is always `chatkit.widget`. + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"` + - `TunnelID string` - - `Widget 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. - Serialized widget payload rendered in the UI. + - `type BetaToolCodeInterpreter struct{…}` - - `type ChatKitThreadItemListDataChatKitClientToolCall struct{…}` + A tool that runs Python code to help generate a response to a prompt. - Record of a client side tool invocation initiated by the assistant. + - `Container BetaToolCodeInterpreterContainerUnion` - - `ID string` + 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. - Identifier of the thread item. + - `string` - - `Arguments string` + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - JSON-encoded arguments that were sent to the tool. + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `CallID string` + - `Type Auto` - Identifier for the client tool call. + Always `auto`. - - `CreatedAt int64` + - `const AutoAuto Auto = "auto"` - Unix timestamp (in seconds) for when the item was created. + - `FileIDs []string` - - `Name string` + An optional list of uploaded files to make available to your code. - Tool name that was invoked. + - `MemoryLimit string` - - `Object ChatKitThreadItem` + The memory limit for the code interpreter container. - Type discriminator that is always `chatkit.thread_item`. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `Output string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - JSON-encoded output captured from the tool. Defaults to null while execution is in progress. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `Status string` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - Execution status for the tool call. + Network access policy for the container. - - `const ChatKitThreadItemListDataChatKitClientToolCallStatusInProgress ChatKitThreadItemListDataChatKitClientToolCallStatus = "in_progress"` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `const ChatKitThreadItemListDataChatKitClientToolCallStatusCompleted ChatKitThreadItemListDataChatKitClientToolCallStatus = "completed"` + - `Type Disabled` - - `ThreadID string` + Disable outbound network access. Always `disabled`. - Identifier of the parent thread. + - `const DisabledDisabled Disabled = "disabled"` - - `Type ChatKitClientToolCall` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - Type discriminator that is always `chatkit.client_tool_call`. + - `AllowedDomains []string` - - `const ChatKitClientToolCallChatKitClientToolCall ChatKitClientToolCall = "chatkit.client_tool_call"` + A list of allowed domains when type is `allowlist`. - - `type ChatKitThreadItemListDataChatKitTask struct{…}` + - `Type Allowlist` - Task emitted by the workflow to show progress and status updates. + Allow outbound network access only to specified domains. Always `allowlist`. - - `ID string` + - `const AllowlistAllowlist Allowlist = "allowlist"` - Identifier of the thread item. + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `CreatedAt int64` + Optional domain-scoped secrets for allowlisted domains. - Unix timestamp (in seconds) for when the item was created. + - `Domain string` - - `Heading string` + The domain associated with the secret. - Optional heading for the task. Defaults to null when not provided. + - `Name string` - - `Object ChatKitThreadItem` + The name of the secret to inject for the domain. - Type discriminator that is always `chatkit.thread_item`. + - `Value string` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + The secret value to inject for the domain. - - `Summary string` + - `Type CodeInterpreter` - Optional summary that describes the task. Defaults to null when omitted. + The type of the code interpreter tool. Always `code_interpreter`. - - `TaskType string` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - Subtype for the task. + - `AllowedCallers []string` - - `const ChatKitThreadItemListDataChatKitTaskTaskTypeCustom ChatKitThreadItemListDataChatKitTaskTaskType = "custom"` + The tool invocation context(s). - - `const ChatKitThreadItemListDataChatKitTaskTaskTypeThought ChatKitThreadItemListDataChatKitTaskTaskType = "thought"` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - - `ThreadID string` + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - Identifier of the parent thread. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Type ChatKitTask` + - `Type ProgrammaticToolCalling` - Type discriminator that is always `chatkit.task`. + The type of the tool. Always `programmatic_tool_calling`. - - `const ChatKitTaskChatKitTask ChatKitTask = "chatkit.task"` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `type ChatKitThreadItemListDataChatKitTaskGroup struct{…}` + - `type BetaToolImageGeneration struct{…}` - Collection of workflow tasks grouped together in the thread. + A tool that generates images using the GPT image models. - - `ID string` + - `Type ImageGeneration` - Identifier of the thread item. + The type of the image generation tool. Always `image_generation`. - - `CreatedAt int64` + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - Unix timestamp (in seconds) for when the item was created. + - `Action string` - - `Object ChatKitThreadItem` + Whether to generate a new image or edit an existing image. Default: `auto`. - Type discriminator that is always `chatkit.thread_item`. + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `Tasks []ChatKitThreadItemListDataChatKitTaskGroupTask` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - Tasks included in the group. + - `Background string` - - `Heading 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. - Optional heading for the grouped task. Defaults to null when not provided. + `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. - - `Summary string` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - Optional summary that describes the grouped task. Defaults to null when omitted. + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `Type string` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - Subtype for the grouped task. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeCustom ChatKitThreadItemListDataChatKitTaskGroupTaskType = "custom"` + - `InputFidelity string` - - `const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeThought ChatKitThreadItemListDataChatKitTaskGroupTaskType = "thought"` + 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`. - - `ThreadID string` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - Identifier of the parent thread. + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - - `Type ChatKitTaskGroup` + - `InputImageMask BetaToolImageGenerationInputImageMask` - Type discriminator that is always `chatkit.task_group`. + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `const ChatKitTaskGroupChatKitTaskGroup ChatKitTaskGroup = "chatkit.task_group"` + - `FileID string` - - `FirstID string` + File ID for the mask image. - The ID of the first item in the list. + - `ImageURL string` - - `HasMore bool` + Base64-encoded mask image. - Whether there are more items available. + - `Model string` - - `LastID string` + The image generation model to use. Default: `gpt-image-1`. - The ID of the last item in the list. + - `string` - - `Object List` + - `string` - The type of object returned, must be `list`. + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - - `const ListList List = "list"` + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` -### ChatKit Thread User Message Item + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` -- `type ChatKitThreadUserMessageItem struct{…}` + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - User-authored messages within a thread. + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - - `ID string` + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - Identifier of the thread item. + - `Moderation string` - - `Attachments []ChatKitAttachment` + Moderation level for the generated image. Default: `auto`. - Attachments associated with the user message. Defaults to an empty list. + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `ID string` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - Identifier for the attachment. + - `OutputCompression int64` - - `MimeType string` + Compression level for the output image. Default: 100. - MIME type of the attachment. + - `OutputFormat string` - - `Name string` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - Original display name for the attachment. + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `PreviewURL string` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - Preview URL for rendering the attachment inline. + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - - `Type ChatKitAttachmentType` + - `PartialImages int64` - Attachment discriminator. + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image"` + - `Quality string` - - `const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `Content []ChatKitThreadUserMessageItemContentUnion` + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - Ordered content elements supplied by the user. + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - - `type ChatKitThreadUserMessageItemContentInputText struct{…}` + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - Text block that a user contributed to the thread. + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - - `Text string` + - `Size string` - Plain-text content supplied by the user. + 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`. - - `Type InputText` + - `string` - Type discriminator that is always `input_text`. + - `string` - - `const InputTextInputText InputText = "input_text"` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - - `type ChatKitThreadUserMessageItemContentQuotedText struct{…}` + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - Quoted snippet that the user referenced in their message. + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - - `Text string` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - Quoted text content. + - `type BetaToolLocalShell struct{…}` - - `Type QuotedText` + A tool that allows the model to execute shell commands in a local environment. - Type discriminator that is always `quoted_text`. + - `Type LocalShell` - - `const QuotedTextQuotedText QuotedText = "quoted_text"` + The type of the local shell tool. Always `local_shell`. - - `CreatedAt int64` + - `const LocalShellLocalShell LocalShell = "local_shell"` - Unix timestamp (in seconds) for when the item was created. + - `type BetaFunctionShellTool struct{…}` - - `InferenceOptions ChatKitThreadUserMessageItemInferenceOptions` + A tool that allows the model to execute shell commands. - Inference overrides applied to the message. Defaults to null when unset. + - `Type Shell` - - `Model string` + The type of the shell tool. Always `shell`. - Model name that generated the response. Defaults to null when using the session default. + - `const ShellShell Shell = "shell"` - - `ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoice` + - `AllowedCallers []string` - Preferred tool to invoke. Defaults to null when ChatKit should auto-select. + The tool invocation context(s). - - `ID string` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - Identifier of the requested tool. + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - `Object ChatKitThreadItem` + - `Environment BetaFunctionShellToolEnvironmentUnion` - Type discriminator that is always `chatkit.thread_item`. + - `type BetaContainerAuto struct{…}` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + - `Type ContainerAuto` - - `ThreadID string` + Automatically creates a container for this request - Identifier of the parent thread. + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `Type ChatKitUserMessage` + - `FileIDs []string` - - `const ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"` + An optional list of uploaded files to make available to your code. -### ChatKit Widget Item + - `MemoryLimit BetaContainerAutoMemoryLimit` -- `type ChatKitWidgetItem struct{…}` + The memory limit for the container. - Thread item that renders a widget payload. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `ID string` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - Identifier of the thread item. + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `CreatedAt int64` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - Unix timestamp (in seconds) for when the item was created. + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - `Object ChatKitThreadItem` + Network access policy for the container. - Type discriminator that is always `chatkit.thread_item`. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `ThreadID string` + - `Skills []BetaContainerAutoSkillUnion` - Identifier of the parent thread. + An optional list of skills referenced by id or inline data. - - `Type ChatKitWidget` + - `type BetaSkillReference struct{…}` - Type discriminator that is always `chatkit.widget`. + - `SkillID string` - - `const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"` + The ID of the referenced skill. - - `Widget string` + - `Type SkillReference` - Serialized widget payload rendered in the UI. + References a skill created with the /v1/skills endpoint. -# Assistants + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` -## List assistants + - `Version string` -`client.Beta.Assistants.List(ctx, query) (*CursorPage[Assistant], error)` + Optional skill version. Use a positive integer or 'latest'. Omit for default. -**get** `/assistants` + - `type BetaInlineSkill struct{…}` -List assistants + - `Description string` -### Parameters + The description of the skill. -- `query BetaAssistantListParams` + - `Name string` - - `After param.Field[string]` + The name of the skill. - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + - `Source BetaInlineSkillSource` - - `Before param.Field[string]` + Inline skill payload - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + - `Data string` - - `Limit param.Field[int64]` + Base64-encoded skill zip bundle. - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - `MediaType ApplicationZip` - - `Order param.Field[BetaAssistantListParamsOrder]` + The media type of the inline skill payload. Must be `application/zip`. - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `const BetaAssistantListParamsOrderAsc BetaAssistantListParamsOrder = "asc"` + - `Type Base64` - - `const BetaAssistantListParamsOrderDesc BetaAssistantListParamsOrder = "desc"` + The type of the inline skill source. Must be `base64`. -### Returns + - `const Base64Base64 Base64 = "base64"` -- `type Assistant struct{…}` + - `Type Inline` - Represents an `assistant` that can call the model and use tools. + Defines an inline skill for this request. - - `ID string` + - `const InlineInline Inline = "inline"` - The identifier, which can be referenced in API endpoints. + - `type BetaLocalEnvironment struct{…}` - - `CreatedAt int64` + - `Type Local` - The Unix timestamp (in seconds) for when the assistant was created. + Use a local computer environment. - - `Description string` + - `const LocalLocal Local = "local"` - The description of the assistant. The maximum length is 512 characters. + - `Skills []BetaLocalSkill` - - `Instructions string` + An optional list of skills. - The system instructions that the assistant uses. The maximum length is 256,000 characters. + - `Description string` - - `Metadata Metadata` + The description of the skill. - 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. + - `Name string` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The name of the skill. - - `Model string` + - `Path string` - ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + The path to the directory containing the skill. - - `Name string` + - `type BetaContainerReference struct{…}` - The name of the assistant. The maximum length is 256 characters. + - `ContainerID string` - - `Object Assistant` + The ID of the referenced container. - The object type, which is always `assistant`. + - `Type ContainerReference` - - `const AssistantAssistant Assistant = "assistant"` + References a container created with the /v1/containers endpoint - - `Tools []any` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + - `type BetaCustomTool struct{…}` - - `ResponseFormat AssistantResponseFormatOptionUnion` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `Name string` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The name of the custom tool, used to identify it in tool calls. - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `Type Custom` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + The type of the custom tool. Always `custom`. - - `type Auto string` + - `const CustomCustom Custom = "custom"` - `auto` is the default value + - `AllowedCallers []string` - - `const AutoAuto Auto = "auto"` + The tool invocation context(s). - - `type ResponseFormatText struct{…}` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - Default response format. Used to generate text responses. + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - - `Type Text` + - `DeferLoading bool` - The type of response format being defined. Always `text`. + Whether this tool should be deferred and discovered via tool search. - - `const TextText Text = "text"` + - `Description string` - - `type ResponseFormatJSONObject struct{…}` + Optional description of the custom tool, used to provide more context. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `Format BetaCustomToolFormatUnion` - - `Type JSONObject` + The input format for the custom tool. Default is unconstrained text. - The type of response format being defined. Always `json_object`. + - `type BetaCustomToolFormatText struct{…}` - - `const JSONObjectJSONObject JSONObject = "json_object"` + Unconstrained free-form text. - - `type ResponseFormatJSONSchema struct{…}` + - `Type Text` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + Unconstrained text format. Always `text`. - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `const TextText Text = "text"` - Structured Outputs configuration options, including a JSON Schema. + - `type BetaCustomToolFormatGrammar struct{…}` - - `Name string` + A grammar defined by the user. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `Definition string` - - `Description string` + The grammar definition. - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `Syntax string` - - `Schema map[string, any]` + The syntax of the grammar definition. One of `lark` or `regex`. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `Strict bool` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Type Grammar` - - `Type JSONSchema` + Grammar format. Always `grammar`. - The type of response format being defined. Always `json_schema`. + - `const GrammarGrammar Grammar = "grammar"` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `type BetaNamespaceTool struct{…}` - - `Temperature float64` + Groups function/custom tools under a shared namespace. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + - `Description string` - - `ToolResources AssistantToolResources` + A description of the namespace shown to the model. - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `Name string` - - `CodeInterpreter AssistantToolResourcesCodeInterpreter` + The namespace name used in tool calls (for example, `crm`). - - `FileIDs []string` + - `Tools []BetaNamespaceToolToolUnion` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. + The function/custom tools available inside this namespace. - - `FileSearch AssistantToolResourcesFileSearch` + - `type BetaNamespaceToolToolFunction struct{…}` - - `VectorStoreIDs []string` + - `Name string` - The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + - `Type Function` - - `TopP float64` + - `const FunctionFunction Function = "function"` - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + - `AllowedCallers []string` - We generally recommend altering this or temperature but not both. + The tool invocation context(s). -### Example + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` -```go -package main + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` -import ( - "context" - "fmt" + - `DeferLoading bool` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + Whether this function should be deferred and discovered via tool search. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - page, err := client.Beta.Assistants.List(context.TODO(), openai.BetaAssistantListParams{ + - `Description string` - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", page) -} -``` + - `OutputSchema map[string, any]` -#### Response + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. -```json -{ - "data": [ - { - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - {} - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 - } - ], - "first_id": "asst_abc123", - "has_more": false, - "last_id": "asst_abc456", - "object": "list" -} -``` + - `Parameters any` -## Create assistant + - `Strict bool` -`client.Beta.Assistants.New(ctx, body) (*Assistant, error)` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. -**post** `/assistants` + - `type BetaCustomTool struct{…}` -Create assistant + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) -### Parameters + - `Type Namespace` -- `body BetaAssistantNewParams` + The type of the tool. Always `namespace`. - - `Model param.Field[ChatModel]` + - `const NamespaceNamespace Namespace = "namespace"` - ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + - `type BetaToolSearchTool struct{…}` - - `string` + Hosted or BYOT tool search configuration for deferred tools. - - `type ChatModel string` + - `Type ToolSearch` - - `const ChatModelGPT5_6Sol ChatModel = "gpt-5.6-sol"` + The type of the tool. Always `tool_search`. - - `const ChatModelGPT5_6Terra ChatModel = "gpt-5.6-terra"` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `const ChatModelGPT5_6Luna ChatModel = "gpt-5.6-luna"` + - `Description string` - - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"` + Description shown to the model for a client-executed tool search tool. - - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"` + - `Execution BetaToolSearchToolExecution` - - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"` + Whether tool search is executed by the server or by the client. - - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"` + - `Parameters any` - - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"` + Parameter schema for a client-executed tool search tool. - - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"` + - `Type BetaWebSearchPreviewToolType` - - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"` + - `SearchContentTypes []string` - - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `const ChatModelGPT5 ChatModel = "gpt-5"` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"` + 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 ChatModelGPT5Nano ChatModel = "gpt-5-nano"` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"` + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"` + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"` + The user's location. - - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"` + - `Type Approximate` - - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"` + The type of location approximation. Always `approximate`. - - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"` + - `const ApproximateApproximate Approximate = "approximate"` - - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"` + - `City string` - - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"` + Free text input for the city of the user, e.g. `San Francisco`. - - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"` + - `Country string` - - `const ChatModelO4Mini ChatModel = "o4-mini"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"` + - `Region string` - - `const ChatModelO3 ChatModel = "o3"` + Free text input for the region of the user, e.g. `California`. - - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"` + - `Timezone string` - - `const ChatModelO3Mini ChatModel = "o3-mini"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"` + - `type BetaApplyPatchTool struct{…}` - - `const ChatModelO1 ChatModel = "o1"` + Allows the assistant to create, delete, or update files using unified diffs. - - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"` + - `Type ApplyPatch` - - `const ChatModelO1Preview ChatModel = "o1-preview"` + The type of the tool. Always `apply_patch`. - - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `const ChatModelO1Mini ChatModel = "o1-mini"` + - `AllowedCallers []string` - - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"` + The tool invocation context(s). - - `const ChatModelGPT4o ChatModel = "gpt-4o"` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"` + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"` + - `Type ToolSearchOutput` - - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"` + The item type. Always `tool_search_output`. - - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"` + - `ID string` - - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"` + The unique ID of this tool search output. - - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"` + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"` + The agent that produced this item. - - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `AgentName string` - - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"` + The canonical name of the agent that produced this item. - - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"` + - `CallID string` - - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"` + The unique ID of the tool search call generated by the model. - - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"` + Whether tool search was executed by the server or by the client. - - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"` + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"` + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"` + - `Status BetaResponseToolSearchOutputItemParamStatus` - - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"` + The status of the tool search output. - - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"` + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"` + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"` + - `Role Developer` - - `const ChatModelGPT4 ChatModel = "gpt-4"` + The role that provided the additional tools. Only `developer` is supported. - - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"` + - `const DeveloperDeveloper Developer = "developer"` - - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"` + - `Tools []BetaToolUnion` - - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"` + A list of additional tools made available at this item. - - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"` + - `type BetaFunctionTool struct{…}` - - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"` + - `type BetaFileSearchTool struct{…}` - - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"` + - `type BetaComputerTool struct{…}` - - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"` + - `type BetaWebSearchTool struct{…}` - - `Description param.Field[string]` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The description of the assistant. The maximum length is 512 characters. + - `type BetaToolMcp struct{…}` - - `Instructions param.Field[string]` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The system instructions that the assistant uses. The maximum length is 256,000 characters. + - `type BetaToolCodeInterpreter struct{…}` - - `Metadata param.Field[Metadata]` + A tool that runs Python code to help generate a response to a prompt. - 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. + - `type BetaToolProgrammaticToolCalling struct{…}` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `type BetaToolImageGeneration struct{…}` - - `Name param.Field[string]` + A tool that generates images using the GPT image models. - The name of the assistant. The maximum length is 256 characters. + - `type BetaToolLocalShell struct{…}` - - `ReasoningEffort param.Field[ReasoningEffort]` + A tool that allows the model to execute shell commands in a local environment. - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `type BetaFunctionShellTool struct{…}` - - `ResponseFormat param.Field[AssistantResponseFormatOptionUnion]` + A tool that allows the model to execute shell commands. - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `type BetaCustomTool struct{…}` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `type BetaNamespaceTool struct{…}` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + Groups function/custom tools under a shared namespace. - - `Temperature param.Field[float64]` + - `type BetaToolSearchTool struct{…}` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + Hosted or BYOT tool search configuration for deferred tools. - - `ToolResources param.Field[BetaAssistantNewParamsToolResources]` + - `type BetaWebSearchPreviewTool struct{…}` - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `CodeInterpreter BetaAssistantNewParamsToolResourcesCodeInterpreter` + - `type BetaApplyPatchTool struct{…}` - - `FileIDs []string` + Allows the assistant to create, delete, or update files using unified diffs. - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + - `Type AdditionalTools` - - `FileSearch BetaAssistantNewParamsToolResourcesFileSearch` + The item type. Always `additional_tools`. - - `VectorStoreIDs []string` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + - `ID string` - - `VectorStores []BetaAssistantNewParamsToolResourcesFileSearchVectorStore` + The unique ID of this additional tools item. - A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this assistant. There can be a maximum of 1 vector store attached to the assistant. + - `Agent BetaResponseInputItemAdditionalToolsAgent` - - `ChunkingStrategy BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion` + The agent that produced this item. - The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + - `AgentName string` - - `type BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyAuto struct{…}` + The canonical name of the agent that produced this item. - The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. + - `type BetaResponseReasoningItem struct{…}` - - `Type Auto` + 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](https://platform.openai.com/docs/guides/conversation-state). - Always `auto`. + - `ID string` - - `const AutoAuto Auto = "auto"` + The unique identifier of the reasoning content. - - `type BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyStatic struct{…}` + - `Summary []BetaResponseReasoningItemSummary` - - `Static BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic` + Reasoning summary content. - - `ChunkOverlapTokens int64` + - `Text string` - The number of tokens that overlap between chunks. The default value is `400`. + A summary of the reasoning output from the model so far. - Note that the overlap must not exceed half of `max_chunk_size_tokens`. + - `Type SummaryText` - - `MaxChunkSizeTokens int64` + The type of the object. Always `summary_text`. - The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `Type Static` + - `Type Reasoning` - Always `static`. + The type of the object. Always `reasoning`. - - `const StaticStatic Static = "static"` + - `const ReasoningReasoning Reasoning = "reasoning"` - - `FileIDs []string` + - `Agent BetaResponseReasoningItemAgent` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. + The agent that produced this item. - - `Metadata Metadata` + - `AgentName string` - 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. + The canonical name of the agent that produced this item. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Content []BetaResponseReasoningItemContent` - - `Tools param.Field[[]any]` + Reasoning text content. - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + - `Text string` - - `TopP param.Field[float64]` + The reasoning text from the model. - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + - `Type ReasoningText` - We generally recommend altering this or temperature but not both. + The type of the reasoning text. Always `reasoning_text`. -### Returns + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` -- `type Assistant struct{…}` + - `EncryptedContent string` - Represents an `assistant` that can call the model and use tools. + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `ID string` + - `Status BetaResponseReasoningItemStatus` - The identifier, which can be referenced in API endpoints. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `CreatedAt int64` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - The Unix timestamp (in seconds) for when the assistant was created. + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `Description string` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - The description of the assistant. The maximum length is 512 characters. + - `type BetaResponseCompactionItemParamResp struct{…}` - - `Instructions string` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - The system instructions that the assistant uses. The maximum length is 256,000 characters. + - `EncryptedContent string` - - `Metadata Metadata` + The encrypted content of the compaction summary. - 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. + - `Type Compaction` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The type of the item. Always `compaction`. - - `Model string` + - `const CompactionCompaction Compaction = "compaction"` - ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + - `ID string` - - `Name string` + The ID of the compaction item. - The name of the assistant. The maximum length is 256 characters. + - `Agent BetaResponseCompactionItemParamAgentResp` - - `Object Assistant` + The agent that produced this item. - The object type, which is always `assistant`. + - `AgentName string` - - `const AssistantAssistant Assistant = "assistant"` + The canonical name of the agent that produced this item. - - `Tools []any` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + An image generation request made by the model. - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `ID string` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The unique ID of the image generation call. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Result string` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + The generated image encoded in base64. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `Status string` - - `type Auto string` + The status of the image generation call. - `auto` is the default value + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - - `const AutoAuto Auto = "auto"` + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - `type ResponseFormatText struct{…}` + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - Default response format. Used to generate text responses. + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - - `Type Text` + - `Type ImageGenerationCall` - The type of response format being defined. Always `text`. + The type of the image generation call. Always `image_generation_call`. - - `const TextText Text = "text"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `type ResponseFormatJSONObject struct{…}` + - `Agent BetaResponseInputItemImageGenerationCallAgent` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + The agent that produced this item. - - `Type JSONObject` + - `AgentName string` - The type of response format being defined. Always `json_object`. + The canonical name of the agent that produced this item. - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `type ResponseFormatJSONSchema struct{…}` + A tool call to run code. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `ID string` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + The unique ID of the code interpreter tool call. - Structured Outputs configuration options, including a JSON Schema. + - `Code string` - - `Name string` + The code to run, or null if not available. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `ContainerID string` - - `Description string` + The ID of the container used to run the code. - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `Schema map[string, any]` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `Strict bool` + The logs output from the code interpreter. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Logs string` - - `Type JSONSchema` + The logs output from the code interpreter. - The type of response format being defined. Always `json_schema`. + - `Type Logs` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The type of the output. Always `logs`. - - `Temperature float64` + - `const LogsLogs Logs = "logs"` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `ToolResources AssistantToolResources` + The image output from the code interpreter. - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `Type Image` - - `CodeInterpreter AssistantToolResourcesCodeInterpreter` + The type of the output. Always `image`. - - `FileIDs []string` + - `const ImageImage Image = "image"` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. + - `URL string` - - `FileSearch AssistantToolResourcesFileSearch` + The URL of the image output from the code interpreter. - - `VectorStoreIDs []string` + - `Status BetaResponseCodeInterpreterToolCallStatus` - The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `TopP float64` + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - We generally recommend altering this or temperature but not both. + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` -### Example + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` -```go -package main + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` -import ( - "context" - "fmt" + - `Type CodeInterpreterCall` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" - "github.com/openai/openai-go/shared" -) + The type of the code interpreter tool call. Always `code_interpreter_call`. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - assistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{ - Model: shared.ChatModelGPT4o, - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", assistant.ID) -} -``` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` -#### Response + - `Agent BetaResponseCodeInterpreterToolCallAgent` -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - {} - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` + The agent that produced this item. -## Retrieve assistant + - `AgentName string` -`client.Beta.Assistants.Get(ctx, assistantID) (*Assistant, error)` + The canonical name of the agent that produced this item. -**get** `/assistants/{assistant_id}` + - `type BetaResponseInputItemLocalShellCall struct{…}` -Retrieve assistant + A tool call to run a command on the local shell. -### Parameters + - `ID string` -- `assistantID string` + The unique ID of the local shell call. -### Returns + - `Action BetaResponseInputItemLocalShellCallAction` -- `type Assistant struct{…}` + Execute a shell command on the server. - Represents an `assistant` that can call the model and use tools. + - `Command []string` - - `ID string` + The command to run. - The identifier, which can be referenced in API endpoints. + - `Env map[string, string]` - - `CreatedAt int64` + Environment variables to set for the command. - The Unix timestamp (in seconds) for when the assistant was created. + - `Type Exec` - - `Description string` + The type of the local shell action. Always `exec`. - The description of the assistant. The maximum length is 512 characters. + - `const ExecExec Exec = "exec"` - - `Instructions string` + - `TimeoutMs int64` - The system instructions that the assistant uses. The maximum length is 256,000 characters. + Optional timeout in milliseconds for the command. - - `Metadata Metadata` + - `User string` - 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. + Optional user to run the command as. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `WorkingDirectory string` - - `Model string` + Optional working directory to run the command in. - ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + - `CallID string` - - `Name string` + The unique ID of the local shell tool call generated by the model. - The name of the assistant. The maximum length is 256 characters. + - `Status string` - - `Object Assistant` + The status of the local shell call. - The object type, which is always `assistant`. + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - - `const AssistantAssistant Assistant = "assistant"` + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `Tools []any` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + - `Type LocalShellCall` - - `ResponseFormat AssistantResponseFormatOptionUnion` + The type of the local shell call. Always `local_shell_call`. - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Agent BetaResponseInputItemLocalShellCallAgent` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + The agent that produced this item. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `AgentName string` - - `type Auto string` + The canonical name of the agent that produced this item. - `auto` is the default value + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `const AutoAuto Auto = "auto"` + The output of a local shell tool call. - - `type ResponseFormatText struct{…}` + - `ID string` - Default response format. Used to generate text responses. + The unique ID of the local shell tool call generated by the model. - - `Type Text` + - `Output string` - The type of response format being defined. Always `text`. + A JSON string of the output of the local shell tool call. - - `const TextText Text = "text"` + - `Type LocalShellCallOutput` - - `type ResponseFormatJSONObject struct{…}` + The type of the local shell tool call output. Always `local_shell_call_output`. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `Type JSONObject` + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - The type of response format being defined. Always `json_object`. + The agent that produced this item. - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `AgentName string` - - `type ResponseFormatJSONSchema struct{…}` + The canonical name of the agent that produced this item. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `Status string` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - Structured Outputs configuration options, including a JSON Schema. + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - - `Name string` + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - - `Description string` + - `type BetaResponseInputItemShellCall struct{…}` - A description of what the response format is for, used by the model to - determine how to respond in the format. + A tool representing a request to execute one or more shell commands. - - `Schema map[string, any]` + - `Action BetaResponseInputItemShellCallAction` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + The shell commands and limits that describe how to run the tool call. - - `Strict bool` + - `Commands []string` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + Ordered shell commands for the execution environment to run. - - `Type JSONSchema` + - `MaxOutputLength int64` - The type of response format being defined. Always `json_schema`. + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `TimeoutMs int64` - - `Temperature float64` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + - `CallID string` - - `ToolResources AssistantToolResources` + The unique ID of the shell tool call generated by the model. - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `Type ShellCall` - - `CodeInterpreter AssistantToolResourcesCodeInterpreter` + The type of the item. Always `shell_call`. - - `FileIDs []string` + - `const ShellCallShellCall ShellCall = "shell_call"` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. + - `ID string` - - `FileSearch AssistantToolResourcesFileSearch` + The unique ID of the shell tool call. Populated when this item is returned via API. - - `VectorStoreIDs []string` + - `Agent BetaResponseInputItemShellCallAgent` - The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + The agent that produced this item. - - `TopP float64` + - `AgentName string` - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + The canonical name of the agent that produced this item. - We generally recommend altering this or temperature but not both. + - `Caller BetaResponseInputItemShellCallCallerUnion` -### Example + The execution context that produced this tool call. -```go -package main + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` -import ( - "context" - "fmt" + - `Type Direct` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + The caller type. Always `direct`. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - assistant, err := client.Beta.Assistants.Get(context.TODO(), "assistant_id") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", assistant.ID) -} -``` + - `const DirectDirect Direct = "direct"` -#### Response + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - {} - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` + - `CallerID string` -## Modify assistant + The call ID of the program item that produced this tool call. -`client.Beta.Assistants.Update(ctx, assistantID, body) (*Assistant, error)` + - `Type Program` -**post** `/assistants/{assistant_id}` + The caller type. Always `program`. -Modify assistant + - `const ProgramProgram Program = "program"` -### Parameters + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` -- `assistantID string` + The environment to execute the shell commands in. -- `body BetaAssistantUpdateParams` + - `type BetaLocalEnvironment struct{…}` - - `Description param.Field[string]` + - `type BetaContainerReference struct{…}` - The description of the assistant. The maximum length is 512 characters. + - `Status string` - - `Instructions param.Field[string]` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - The system instructions that the assistant uses. The maximum length is 256,000 characters. + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - - `Metadata param.Field[Metadata]` + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - 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. + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `Model param.Field[BetaAssistantUpdateParamsModel]` + The streamed output items emitted by a shell tool call. - ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + - `CallID string` - - `string` + The unique ID of the shell tool call generated by the model. - - `type BetaAssistantUpdateParamsModel string` + - `Output []BetaResponseFunctionShellCallOutputContent` - ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `const BetaAssistantUpdateParamsModelGPT5 BetaAssistantUpdateParamsModel = "gpt-5"` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - `const BetaAssistantUpdateParamsModelGPT5Mini BetaAssistantUpdateParamsModel = "gpt-5-mini"` + The exit or timeout outcome associated with this shell call. - - `const BetaAssistantUpdateParamsModelGPT5Nano BetaAssistantUpdateParamsModel = "gpt-5-nano"` + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - - `const BetaAssistantUpdateParamsModelGPT5_2025_08_07 BetaAssistantUpdateParamsModel = "gpt-5-2025-08-07"` + Indicates that the shell call exceeded its configured time limit. - - `const BetaAssistantUpdateParamsModelGPT5Mini2025_08_07 BetaAssistantUpdateParamsModel = "gpt-5-mini-2025-08-07"` + - `Type Timeout` - - `const BetaAssistantUpdateParamsModelGPT5Nano2025_08_07 BetaAssistantUpdateParamsModel = "gpt-5-nano-2025-08-07"` + The outcome type. Always `timeout`. - - `const BetaAssistantUpdateParamsModelGPT4_1 BetaAssistantUpdateParamsModel = "gpt-4.1"` + - `const TimeoutTimeout Timeout = "timeout"` - - `const BetaAssistantUpdateParamsModelGPT4_1Mini BetaAssistantUpdateParamsModel = "gpt-4.1-mini"` + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - `const BetaAssistantUpdateParamsModelGPT4_1Nano BetaAssistantUpdateParamsModel = "gpt-4.1-nano"` + Indicates that the shell commands finished and returned an exit code. - - `const BetaAssistantUpdateParamsModelGPT4_1_2025_04_14 BetaAssistantUpdateParamsModel = "gpt-4.1-2025-04-14"` + - `ExitCode int64` - - `const BetaAssistantUpdateParamsModelGPT4_1Mini2025_04_14 BetaAssistantUpdateParamsModel = "gpt-4.1-mini-2025-04-14"` + The exit code returned by the shell process. - - `const BetaAssistantUpdateParamsModelGPT4_1Nano2025_04_14 BetaAssistantUpdateParamsModel = "gpt-4.1-nano-2025-04-14"` + - `Type Exit` - - `const BetaAssistantUpdateParamsModelO3Mini BetaAssistantUpdateParamsModel = "o3-mini"` + The outcome type. Always `exit`. - - `const BetaAssistantUpdateParamsModelO3Mini2025_01_31 BetaAssistantUpdateParamsModel = "o3-mini-2025-01-31"` + - `const ExitExit Exit = "exit"` - - `const BetaAssistantUpdateParamsModelO1 BetaAssistantUpdateParamsModel = "o1"` + - `Stderr string` - - `const BetaAssistantUpdateParamsModelO1_2024_12_17 BetaAssistantUpdateParamsModel = "o1-2024-12-17"` + Captured stderr output for the shell call. - - `const BetaAssistantUpdateParamsModelGPT4o BetaAssistantUpdateParamsModel = "gpt-4o"` + - `Stdout string` - - `const BetaAssistantUpdateParamsModelGPT4o2024_11_20 BetaAssistantUpdateParamsModel = "gpt-4o-2024-11-20"` + Captured stdout output for the shell call. - - `const BetaAssistantUpdateParamsModelGPT4o2024_08_06 BetaAssistantUpdateParamsModel = "gpt-4o-2024-08-06"` + - `Type ShellCallOutput` - - `const BetaAssistantUpdateParamsModelGPT4o2024_05_13 BetaAssistantUpdateParamsModel = "gpt-4o-2024-05-13"` + The type of the item. Always `shell_call_output`. - - `const BetaAssistantUpdateParamsModelGPT4oMini BetaAssistantUpdateParamsModel = "gpt-4o-mini"` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `const BetaAssistantUpdateParamsModelGPT4oMini2024_07_18 BetaAssistantUpdateParamsModel = "gpt-4o-mini-2024-07-18"` + - `ID string` - - `const BetaAssistantUpdateParamsModelGPT4_5Preview BetaAssistantUpdateParamsModel = "gpt-4.5-preview"` + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `const BetaAssistantUpdateParamsModelGPT4_5Preview2025_02_27 BetaAssistantUpdateParamsModel = "gpt-4.5-preview-2025-02-27"` + - `Agent BetaResponseInputItemShellCallOutputAgent` - - `const BetaAssistantUpdateParamsModelGPT4Turbo BetaAssistantUpdateParamsModel = "gpt-4-turbo"` + The agent that produced this item. - - `const BetaAssistantUpdateParamsModelGPT4Turbo2024_04_09 BetaAssistantUpdateParamsModel = "gpt-4-turbo-2024-04-09"` + - `AgentName string` - - `const BetaAssistantUpdateParamsModelGPT4_0125Preview BetaAssistantUpdateParamsModel = "gpt-4-0125-preview"` + The canonical name of the agent that produced this item. - - `const BetaAssistantUpdateParamsModelGPT4TurboPreview BetaAssistantUpdateParamsModel = "gpt-4-turbo-preview"` + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - - `const BetaAssistantUpdateParamsModelGPT4_1106Preview BetaAssistantUpdateParamsModel = "gpt-4-1106-preview"` + The execution context that produced this tool call. - - `const BetaAssistantUpdateParamsModelGPT4VisionPreview BetaAssistantUpdateParamsModel = "gpt-4-vision-preview"` + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - `const BetaAssistantUpdateParamsModelGPT4 BetaAssistantUpdateParamsModel = "gpt-4"` + - `Type Direct` - - `const BetaAssistantUpdateParamsModelGPT4_0314 BetaAssistantUpdateParamsModel = "gpt-4-0314"` + The caller type. Always `direct`. - - `const BetaAssistantUpdateParamsModelGPT4_0613 BetaAssistantUpdateParamsModel = "gpt-4-0613"` + - `const DirectDirect Direct = "direct"` - - `const BetaAssistantUpdateParamsModelGPT4_32k BetaAssistantUpdateParamsModel = "gpt-4-32k"` + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - `const BetaAssistantUpdateParamsModelGPT4_32k0314 BetaAssistantUpdateParamsModel = "gpt-4-32k-0314"` + - `CallerID string` - - `const BetaAssistantUpdateParamsModelGPT4_32k0613 BetaAssistantUpdateParamsModel = "gpt-4-32k-0613"` + The call ID of the program item that produced this tool call. - - `const BetaAssistantUpdateParamsModelGPT3_5Turbo BetaAssistantUpdateParamsModel = "gpt-3.5-turbo"` + - `Type Program` - - `const BetaAssistantUpdateParamsModelGPT3_5Turbo16k BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-16k"` + The caller type. Always `program`. - - `const BetaAssistantUpdateParamsModelGPT3_5Turbo0613 BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-0613"` + - `const ProgramProgram Program = "program"` - - `const BetaAssistantUpdateParamsModelGPT3_5Turbo1106 BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-1106"` + - `MaxOutputLength int64` - - `const BetaAssistantUpdateParamsModelGPT3_5Turbo0125 BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-0125"` + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `const BetaAssistantUpdateParamsModelGPT3_5Turbo16k0613 BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-16k-0613"` + - `Status string` - - `Name param.Field[string]` + The status of the shell call output. - The name of the assistant. The maximum length is 256 characters. + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - - `ReasoningEffort param.Field[ReasoningEffort]` + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - - `ResponseFormat param.Field[AssistantResponseFormatOptionUnion]` + - `type BetaResponseInputItemApplyPatchCall struct{…}` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + A tool call representing a request to create, delete, or update files using diff patches. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `CallID string` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + The unique ID of the apply patch tool call generated by the model. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - - `Temperature param.Field[float64]` + The specific create, delete, or update instruction for the apply_patch tool call. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - - `ToolResources param.Field[BetaAssistantUpdateParamsToolResources]` + Instruction for creating a new file via the apply_patch tool. - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `Diff string` - - `CodeInterpreter BetaAssistantUpdateParamsToolResourcesCodeInterpreter` + Unified diff content to apply when creating the file. - - `FileIDs []string` + - `Path string` - Overrides the list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + Path of the file to create relative to the workspace root. - - `FileSearch BetaAssistantUpdateParamsToolResourcesFileSearch` + - `Type CreateFile` - - `VectorStoreIDs []string` + The operation type. Always `create_file`. - Overrides the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `Tools param.Field[[]any]` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + Instruction for deleting an existing file via the apply_patch tool. - - `TopP param.Field[float64]` + - `Path string` - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + Path of the file to delete relative to the workspace root. - We generally recommend altering this or temperature but not both. + - `Type DeleteFile` -### Returns + The operation type. Always `delete_file`. -- `type Assistant struct{…}` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - Represents an `assistant` that can call the model and use tools. + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - - `ID string` + Instruction for updating an existing file via the apply_patch tool. - The identifier, which can be referenced in API endpoints. + - `Diff string` - - `CreatedAt int64` + Unified diff content to apply to the existing file. - The Unix timestamp (in seconds) for when the assistant was created. + - `Path string` - - `Description string` + Path of the file to update relative to the workspace root. - The description of the assistant. The maximum length is 512 characters. + - `Type UpdateFile` - - `Instructions string` + The operation type. Always `update_file`. - The system instructions that the assistant uses. The maximum length is 256,000 characters. + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Metadata Metadata` + - `Status string` - 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. + The status of the apply patch tool call. One of `in_progress` or `completed`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `Model string` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + - `Type ApplyPatchCall` - - `Name string` + The type of the item. Always `apply_patch_call`. - The name of the assistant. The maximum length is 256 characters. + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `Object Assistant` + - `ID string` - The object type, which is always `assistant`. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const AssistantAssistant Assistant = "assistant"` + - `Agent BetaResponseInputItemApplyPatchCallAgent` - - `Tools []any` + The agent that produced this item. - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + - `AgentName string` - - `ResponseFormat AssistantResponseFormatOptionUnion` + The canonical name of the agent that produced this item. - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The execution context that produced this tool call. - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `Type Direct` - - `type Auto string` + The caller type. Always `direct`. - `auto` is the default value + - `const DirectDirect Direct = "direct"` - - `const AutoAuto Auto = "auto"` + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - - `type ResponseFormatText struct{…}` + - `CallerID string` - Default response format. Used to generate text responses. + The call ID of the program item that produced this tool call. - - `Type Text` + - `Type Program` - The type of response format being defined. Always `text`. + The caller type. Always `program`. - - `const TextText Text = "text"` + - `const ProgramProgram Program = "program"` - - `type ResponseFormatJSONObject struct{…}` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + The streamed output emitted by an apply patch tool call. - - `Type JSONObject` + - `CallID string` - The type of response format being defined. Always `json_object`. + The unique ID of the apply patch tool call generated by the model. - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `Status string` - - `type ResponseFormatJSONSchema struct{…}` + The status of the apply patch tool call output. One of `completed` or `failed`. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - Structured Outputs configuration options, including a JSON Schema. + - `Type ApplyPatchCallOutput` - - `Name string` + The type of the item. Always `apply_patch_call_output`. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `Description string` + - `ID string` - A description of what the response format is for, used by the model to - determine how to respond in the format. + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `Schema map[string, any]` + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + The agent that produced this item. - - `Strict bool` + - `AgentName string` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + The canonical name of the agent that produced this item. - - `Type JSONSchema` + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - The type of response format being defined. Always `json_schema`. + The execution context that produced this tool call. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - - `Temperature float64` + - `Type Direct` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + The caller type. Always `direct`. - - `ToolResources AssistantToolResources` + - `const DirectDirect Direct = "direct"` - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - - `CodeInterpreter AssistantToolResourcesCodeInterpreter` - - - `FileIDs []string` - - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. + - `CallerID string` - - `FileSearch AssistantToolResourcesFileSearch` + The call ID of the program item that produced this tool call. - - `VectorStoreIDs []string` + - `Type Program` - The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + The caller type. Always `program`. - - `TopP float64` + - `const ProgramProgram Program = "program"` - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + - `Output string` - We generally recommend altering this or temperature but not both. + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). -### Example + - `type BetaResponseInputItemMcpListTools struct{…}` -```go -package main + A list of tools available on an MCP server. -import ( - "context" - "fmt" + - `ID string` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + The unique ID of the list. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - assistant, err := client.Beta.Assistants.Update( - context.TODO(), - "assistant_id", - openai.BetaAssistantUpdateParams{ + - `ServerLabel string` - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", assistant.ID) -} -``` + The label of the MCP server. -#### Response + - `Tools []BetaResponseInputItemMcpListToolsTool` -```json -{ - "id": "id", - "created_at": 0, - "description": "description", - "instructions": "instructions", - "metadata": { - "foo": "string" - }, - "model": "model", - "name": "name", - "object": "assistant", - "tools": [ - {} - ], - "response_format": "auto", - "temperature": 1, - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - }, - "top_p": 1 -} -``` + The tools available on the server. -## Delete assistant + - `InputSchema any` -`client.Beta.Assistants.Delete(ctx, assistantID) (*AssistantDeleted, error)` + The JSON schema describing the tool's input. -**delete** `/assistants/{assistant_id}` + - `Name string` -Delete assistant + The name of the tool. -### Parameters + - `Annotations any` -- `assistantID string` + Additional annotations about the tool. -### Returns + - `Description string` -- `type AssistantDeleted struct{…}` + The description of the tool. - - `ID string` + - `Type McpListTools` - - `Deleted bool` + The type of the item. Always `mcp_list_tools`. - - `Object AssistantDeleted` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `const AssistantDeletedAssistantDeleted AssistantDeleted = "assistant.deleted"` + - `Agent BetaResponseInputItemMcpListToolsAgent` -### Example + The agent that produced this item. -```go -package main + - `AgentName string` -import ( - "context" - "fmt" + The canonical name of the agent that produced this item. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `Error string` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - assistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), "assistant_id") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", assistantDeleted.ID) -} -``` + Error message if the server could not list tools. -#### Response + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` -```json -{ - "id": "id", - "deleted": true, - "object": "assistant.deleted" -} -``` + A request for human approval of a tool invocation. -## Domain Types + - `ID string` -### Assistant + The unique ID of the approval request. -- `type Assistant struct{…}` + - `Arguments string` - Represents an `assistant` that can call the model and use tools. + A JSON string of arguments for the tool. - - `ID string` + - `Name string` - The identifier, which can be referenced in API endpoints. + The name of the tool to run. - - `CreatedAt int64` + - `ServerLabel string` - The Unix timestamp (in seconds) for when the assistant was created. + The label of the MCP server making the request. - - `Description string` + - `Type McpApprovalRequest` - The description of the assistant. The maximum length is 512 characters. + The type of the item. Always `mcp_approval_request`. - - `Instructions string` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - The system instructions that the assistant uses. The maximum length is 256,000 characters. + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - - `Metadata Metadata` + The agent that produced this item. - 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. + - `AgentName string` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The canonical name of the agent that produced this item. - - `Model string` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + A response to an MCP approval request. - - `Name string` + - `ApprovalRequestID string` - The name of the assistant. The maximum length is 256 characters. + The ID of the approval request being answered. - - `Object Assistant` + - `Approve bool` - The object type, which is always `assistant`. + Whether the request was approved. - - `const AssistantAssistant Assistant = "assistant"` + - `Type McpApprovalResponse` - - `Tools []any` + The type of the item. Always `mcp_approval_response`. - A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `ID string` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The unique ID of the approval response - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + The agent that produced this item. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `AgentName string` - - `type Auto string` + The canonical name of the agent that produced this item. - `auto` is the default value + - `Reason string` - - `const AutoAuto Auto = "auto"` + Optional reason for the decision. - - `type ResponseFormatText struct{…}` + - `type BetaResponseInputItemMcpCall struct{…}` - Default response format. Used to generate text responses. + An invocation of a tool on an MCP server. - - `Type Text` + - `ID string` - The type of response format being defined. Always `text`. + The unique ID of the tool call. - - `const TextText Text = "text"` + - `Arguments string` - - `type ResponseFormatJSONObject struct{…}` + A JSON string of the arguments passed to the tool. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `Name string` - - `Type JSONObject` + The name of the tool that was run. - The type of response format being defined. Always `json_object`. + - `ServerLabel string` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The label of the MCP server running the tool. - - `type ResponseFormatJSONSchema struct{…}` + - `Type McpCall` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + The type of the item. Always `mcp_call`. - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `const McpCallMcpCall McpCall = "mcp_call"` - Structured Outputs configuration options, including a JSON Schema. + - `Agent BetaResponseInputItemMcpCallAgent` - - `Name string` + The agent that produced this item. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `AgentName string` - - `Description string` + The canonical name of the agent that produced this item. - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `ApprovalRequestID string` - - `Schema map[string, any]` + 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. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `Error string` - - `Strict bool` + The error from the tool call, if any. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Output string` - - `Type JSONSchema` + The output from the tool call. - The type of response format being defined. Always `json_schema`. + - `Status string` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `Temperature float64` + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - `ToolResources AssistantToolResources` + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - `CodeInterpreter AssistantToolResourcesCodeInterpreter` + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `FileIDs []string` + - `type BetaResponseCustomToolCallOutput struct{…}` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. + The output of a custom tool call from your code, being sent back to the model. - - `FileSearch AssistantToolResourcesFileSearch` + - `CallID string` - - `VectorStoreIDs []string` + The call ID, used to map this custom tool call output to a custom tool call. - The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + - `Output BetaResponseCustomToolCallOutputOutputUnion` - - `TopP float64` + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + - `string` - We generally recommend altering this or temperature but not both. + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` -### Assistant Deleted + Text, image, or file output of the custom tool call. -- `type AssistantDeleted struct{…}` + - `type BetaResponseInputText struct{…}` - - `ID string` + A text input to the model. - - `Deleted bool` + - `type BetaResponseInputImage struct{…}` - - `Object AssistantDeleted` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const AssistantDeletedAssistantDeleted AssistantDeleted = "assistant.deleted"` + - `type BetaResponseInputFile struct{…}` -### Assistant Stream Event + A file input to the model. -- `type AssistantStreamEventUnion interface{…}` + - `Type CustomToolCallOutput` - Represents an event emitted when streaming a Run. + The type of the custom tool call output. Always `custom_tool_call_output`. - Each event in a server-sent events stream has an `event` and `data` property: + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - ``` - event: thread.created - data: {"id": "thread_123", "object": "thread", ...} - ``` + - `ID string` - We emit events whenever a new object is created, transitions to a new state, or is being - streamed in parts (deltas). For example, we emit `thread.run.created` when a new run - is created, `thread.run.completed` when a run completes, and so on. When an Assistant chooses - to create a message during a run, we emit a `thread.message.created event`, a - `thread.message.in_progress` event, many `thread.message.delta` events, and finally a - `thread.message.completed` event. + The unique ID of the custom tool call output in the OpenAI platform. - We may add additional events over time, so we recommend handling unknown events gracefully - in your code. See the [Assistants API quickstart](https://platform.openai.com/docs/assistants/overview) to learn how to - integrate the Assistants API with streaming. + - `Agent BetaResponseCustomToolCallOutputAgent` - - `type AssistantStreamEventThreadCreated struct{…}` + The agent that produced this item. - Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object) is created. + - `AgentName string` - - `Data Thread` + The canonical name of the agent that produced this item. - Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - `ID string` + The execution context that produced this tool call. - The identifier, which can be referenced in API endpoints. + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - - `CreatedAt int64` + - `Type Direct` - The Unix timestamp (in seconds) for when the thread was created. + The caller type. Always `direct`. - - `Metadata Metadata` + - `const DirectDirect Direct = "direct"` - 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. + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `CallerID string` - - `Object Thread` + The call ID of the program item that produced this tool call. - The object type, which is always `thread`. + - `Type Program` - - `const ThreadThread Thread = "thread"` + The caller type. Always `program`. - - `ToolResources ThreadToolResources` + - `const ProgramProgram Program = "program"` - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `type BetaResponseCustomToolCall struct{…}` - - `CodeInterpreter ThreadToolResourcesCodeInterpreter` + A call to a custom tool created by the model. - - `FileIDs []string` + - `CallID string` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + An identifier used to map this custom tool call to a tool call output. - - `FileSearch ThreadToolResourcesFileSearch` + - `Input string` - - `VectorStoreIDs []string` + The input for the custom tool call generated by the model. - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + - `Name string` - - `Event ThreadCreated` + The name of the custom tool being called. - - `const ThreadCreatedThreadCreated ThreadCreated = "thread.created"` + - `Type CustomToolCall` - - `Enabled bool` + The type of the custom tool call. Always `custom_tool_call`. - Whether to enable input audio transcription. + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `type AssistantStreamEventThreadRunCreated struct{…}` + - `ID string` - Occurs when a new [run](https://platform.openai.com/docs/api-reference/runs/object) is created. + The unique ID of the custom tool call in the OpenAI platform. - - `Data Run` + - `Agent BetaResponseCustomToolCallAgent` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + The agent that produced this item. - - `ID string` + - `AgentName string` - The identifier, which can be referenced in API endpoints. + The canonical name of the agent that produced this item. - - `AssistantID string` + - `Caller BetaResponseCustomToolCallCallerUnion` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + The execution context that produced this tool call. - - `CancelledAt int64` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - The Unix timestamp (in seconds) for when the run was cancelled. + - `Type Direct` - - `CompletedAt int64` + - `const DirectDirect Direct = "direct"` - The Unix timestamp (in seconds) for when the run was completed. + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `CreatedAt int64` + - `CallerID string` - The Unix timestamp (in seconds) for when the run was created. + The call ID of the program item that produced this tool call. - - `ExpiresAt int64` + - `Type Program` - The Unix timestamp (in seconds) for when the run will expire. + - `const ProgramProgram Program = "program"` - - `FailedAt int64` + - `Namespace string` - The Unix timestamp (in seconds) for when the run failed. + The namespace of the custom tool being called. - - `IncompleteDetails RunIncompleteDetails` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + Compacts the current context. Must be the final input item. - - `Reason string` + - `Type CompactionTrigger` - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + The type of the item. Always `compaction_trigger`. - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - - `Instructions string` + The agent that produced this item. - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `AgentName string` - - `LastError RunLastError` + The canonical name of the agent that produced this item. - The last error associated with this run. Will be `null` if there are no errors. + - `type BetaResponseInputItemItemReference struct{…}` - - `Code string` + An internal identifier for an item to reference. - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + - `ID string` - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + The ID of the item to reference. - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + - `Agent BetaResponseInputItemItemReferenceAgent` - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + The agent that produced this item. - - `Message string` + - `AgentName string` - A human-readable description of the error. + The canonical name of the agent that produced this item. - - `MaxCompletionTokens int64` + - `Type string` - The maximum number of completion tokens specified to have been used over the course of the run. + The type of item to reference. Always `item_reference`. - - `MaxPromptTokens int64` + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - The maximum number of prompt tokens specified to have been used over the course of the run. + - `type BetaResponseInputItemProgram struct{…}` - - `Metadata Metadata` + - `ID string` - 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. + The unique ID of this program item. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `CallID string` - - `Model string` + The stable call ID of the program item. - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `Code string` - - `Object ThreadRun` + The JavaScript source executed by programmatic tool calling. - The object type, which is always `thread.run`. + - `Fingerprint string` - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + Opaque program replay fingerprint that must be round-tripped. - - `ParallelToolCalls bool` + - `Type Program` - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + The item type. Always `program`. - - `RequiredAction RunRequiredAction` + - `const ProgramProgram Program = "program"` - Details on the action required to continue the run. Will be `null` if no action is required. + - `Agent BetaResponseInputItemProgramAgent` - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + The agent that produced this item. - Details on the tool outputs needed for this run to continue. + - `AgentName string` - - `ToolCalls []RequiredActionFunctionToolCall` + The canonical name of the agent that produced this item. - A list of the relevant tool calls. + - `type BetaResponseInputItemProgramOutput struct{…}` - `ID string` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + The unique ID of this program output item. - - `Function RequiredActionFunctionToolCallFunction` + - `CallID string` - The function definition. + The call ID of the program item. - - `Arguments string` + - `Result string` - The arguments that the model expects you to pass to the function. + The result produced by the program item. - - `Name string` + - `Status string` - The name of the function. + The terminal status of the program output. - - `Type Function` + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - The type of tool call the output is required for. For now, this is always `function`. + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - - `const FunctionFunction Function = "function"` + - `Type ProgramOutput` - - `Type SubmitToolOutputs` + The item type. Always `program_output`. - For now, this is always `submit_tool_outputs`. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + - `Agent BetaResponseInputItemProgramOutputAgent` - - `ResponseFormat AssistantResponseFormatOptionUnion` + The agent that produced this item. - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `AgentName string` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The canonical name of the agent that produced this item. - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `Instructions param.Field[string]` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + Body param: A system (or developer) message inserted into the model's context. - - `type Auto string` + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. - `auto` is the default value + - `MaxOutputTokens param.Field[int64]` - - `const AutoAuto Auto = "auto"` + Body param: An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - - `type ResponseFormatText struct{…}` + - `MaxToolCalls param.Field[int64]` - Default response format. Used to generate text responses. + Body param: The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `Type Text` + - `Metadata param.Field[map[string, string]]` - The type of response format being defined. Always `text`. + Body param: 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. - - `const TextText Text = "text"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `type ResponseFormatJSONObject struct{…}` + - `Model param.Field[BetaResponseNewParamsModel]` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + Body param: Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - - `Type JSONObject` + - `BetaResponseNewParamsModel` - The type of response format being defined. Always `json_object`. + - `const BetaResponseNewParamsModelGPT5_6Sol BetaResponseNewParamsModel = "gpt-5.6-sol"` - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `const BetaResponseNewParamsModelGPT5_6Terra BetaResponseNewParamsModel = "gpt-5.6-terra"` - - `type ResponseFormatJSONSchema struct{…}` + - `const BetaResponseNewParamsModelGPT5_6Luna BetaResponseNewParamsModel = "gpt-5.6-luna"` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseNewParamsModelGPT5_4 BetaResponseNewParamsModel = "gpt-5.4"` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `const BetaResponseNewParamsModelGPT5_4Mini BetaResponseNewParamsModel = "gpt-5.4-mini"` - Structured Outputs configuration options, including a JSON Schema. + - `const BetaResponseNewParamsModelGPT5_4Nano BetaResponseNewParamsModel = "gpt-5.4-nano"` - - `Name string` + - `const BetaResponseNewParamsModelGPT5_4Mini2026_03_17 BetaResponseNewParamsModel = "gpt-5.4-mini-2026-03-17"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseNewParamsModelGPT5_4Nano2026_03_17 BetaResponseNewParamsModel = "gpt-5.4-nano-2026-03-17"` - - `Description string` + - `const BetaResponseNewParamsModelGPT5_3ChatLatest BetaResponseNewParamsModel = "gpt-5.3-chat-latest"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `const BetaResponseNewParamsModelGPT5_2 BetaResponseNewParamsModel = "gpt-5.2"` - - `Schema map[string, any]` + - `const BetaResponseNewParamsModelGPT5_2_2025_12_11 BetaResponseNewParamsModel = "gpt-5.2-2025-12-11"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const BetaResponseNewParamsModelGPT5_2ChatLatest BetaResponseNewParamsModel = "gpt-5.2-chat-latest"` - - `Strict bool` + - `const BetaResponseNewParamsModelGPT5_2Pro BetaResponseNewParamsModel = "gpt-5.2-pro"` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseNewParamsModelGPT5_2Pro2025_12_11 BetaResponseNewParamsModel = "gpt-5.2-pro-2025-12-11"` - - `Type JSONSchema` + - `const BetaResponseNewParamsModelGPT5_1 BetaResponseNewParamsModel = "gpt-5.1"` - The type of response format being defined. Always `json_schema`. + - `const BetaResponseNewParamsModelGPT5_1_2025_11_13 BetaResponseNewParamsModel = "gpt-5.1-2025-11-13"` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `const BetaResponseNewParamsModelGPT5_1Codex BetaResponseNewParamsModel = "gpt-5.1-codex"` - - `StartedAt int64` + - `const BetaResponseNewParamsModelGPT5_1Mini BetaResponseNewParamsModel = "gpt-5.1-mini"` - The Unix timestamp (in seconds) for when the run was started. + - `const BetaResponseNewParamsModelGPT5_1ChatLatest BetaResponseNewParamsModel = "gpt-5.1-chat-latest"` - - `Status any` + - `const BetaResponseNewParamsModelGPT5 BetaResponseNewParamsModel = "gpt-5"` - - `ThreadID string` + - `const BetaResponseNewParamsModelGPT5Mini BetaResponseNewParamsModel = "gpt-5-mini"` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + - `const BetaResponseNewParamsModelGPT5Nano BetaResponseNewParamsModel = "gpt-5-nano"` - - `ToolChoice AssistantToolChoiceOptionUnion` + - `const BetaResponseNewParamsModelGPT5_2025_08_07 BetaResponseNewParamsModel = "gpt-5-2025-08-07"` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `const BetaResponseNewParamsModelGPT5Mini2025_08_07 BetaResponseNewParamsModel = "gpt-5-mini-2025-08-07"` - - `type AssistantToolChoiceOptionAuto string` + - `const BetaResponseNewParamsModelGPT5Nano2025_08_07 BetaResponseNewParamsModel = "gpt-5-nano-2025-08-07"` - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + - `const BetaResponseNewParamsModelGPT5ChatLatest BetaResponseNewParamsModel = "gpt-5-chat-latest"` - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + - `const BetaResponseNewParamsModelGPT4_1 BetaResponseNewParamsModel = "gpt-4.1"` - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + - `const BetaResponseNewParamsModelGPT4_1Mini BetaResponseNewParamsModel = "gpt-4.1-mini"` - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + - `const BetaResponseNewParamsModelGPT4_1Nano BetaResponseNewParamsModel = "gpt-4.1-nano"` - - `type AssistantToolChoice struct{…}` + - `const BetaResponseNewParamsModelGPT4_1_2025_04_14 BetaResponseNewParamsModel = "gpt-4.1-2025-04-14"` - Specifies a tool the model should use. Use to force the model to call a specific tool. + - `const BetaResponseNewParamsModelGPT4_1Mini2025_04_14 BetaResponseNewParamsModel = "gpt-4.1-mini-2025-04-14"` - - `Type AssistantToolChoiceType` + - `const BetaResponseNewParamsModelGPT4_1Nano2025_04_14 BetaResponseNewParamsModel = "gpt-4.1-nano-2025-04-14"` - The type of the tool. If type is `function`, the function name must be set + - `const BetaResponseNewParamsModelO4Mini BetaResponseNewParamsModel = "o4-mini"` - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `const BetaResponseNewParamsModelO4Mini2025_04_16 BetaResponseNewParamsModel = "o4-mini-2025-04-16"` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + - `const BetaResponseNewParamsModelO3 BetaResponseNewParamsModel = "o3"` - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `const BetaResponseNewParamsModelO3_2025_04_16 BetaResponseNewParamsModel = "o3-2025-04-16"` - - `Function AssistantToolChoiceFunction` + - `const BetaResponseNewParamsModelO3Mini BetaResponseNewParamsModel = "o3-mini"` - - `Name string` + - `const BetaResponseNewParamsModelO3Mini2025_01_31 BetaResponseNewParamsModel = "o3-mini-2025-01-31"` - The name of the function to call. + - `const BetaResponseNewParamsModelO1 BetaResponseNewParamsModel = "o1"` - - `Tools []any` + - `const BetaResponseNewParamsModelO1_2024_12_17 BetaResponseNewParamsModel = "o1-2024-12-17"` - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const BetaResponseNewParamsModelO1Preview BetaResponseNewParamsModel = "o1-preview"` - - `TruncationStrategy RunTruncationStrategy` + - `const BetaResponseNewParamsModelO1Preview2024_09_12 BetaResponseNewParamsModel = "o1-preview-2024-09-12"` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + - `const BetaResponseNewParamsModelO1Mini BetaResponseNewParamsModel = "o1-mini"` - - `Type string` + - `const BetaResponseNewParamsModelO1Mini2024_09_12 BetaResponseNewParamsModel = "o1-mini-2024-09-12"` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + - `const BetaResponseNewParamsModelGPT4o BetaResponseNewParamsModel = "gpt-4o"` - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + - `const BetaResponseNewParamsModelGPT4o2024_11_20 BetaResponseNewParamsModel = "gpt-4o-2024-11-20"` - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + - `const BetaResponseNewParamsModelGPT4o2024_08_06 BetaResponseNewParamsModel = "gpt-4o-2024-08-06"` - - `LastMessages int64` + - `const BetaResponseNewParamsModelGPT4o2024_05_13 BetaResponseNewParamsModel = "gpt-4o-2024-05-13"` - The number of most recent messages from the thread when constructing the context for the run. + - `const BetaResponseNewParamsModelGPT4oAudioPreview BetaResponseNewParamsModel = "gpt-4o-audio-preview"` - - `Usage RunUsage` + - `const BetaResponseNewParamsModelGPT4oAudioPreview2024_10_01 BetaResponseNewParamsModel = "gpt-4o-audio-preview-2024-10-01"` - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + - `const BetaResponseNewParamsModelGPT4oAudioPreview2024_12_17 BetaResponseNewParamsModel = "gpt-4o-audio-preview-2024-12-17"` - - `CompletionTokens int64` + - `const BetaResponseNewParamsModelGPT4oAudioPreview2025_06_03 BetaResponseNewParamsModel = "gpt-4o-audio-preview-2025-06-03"` - Number of completion tokens used over the course of the run. + - `const BetaResponseNewParamsModelGPT4oMiniAudioPreview BetaResponseNewParamsModel = "gpt-4o-mini-audio-preview"` - - `PromptTokens int64` + - `const BetaResponseNewParamsModelGPT4oMiniAudioPreview2024_12_17 BetaResponseNewParamsModel = "gpt-4o-mini-audio-preview-2024-12-17"` - Number of prompt tokens used over the course of the run. + - `const BetaResponseNewParamsModelGPT4oSearchPreview BetaResponseNewParamsModel = "gpt-4o-search-preview"` - - `TotalTokens int64` + - `const BetaResponseNewParamsModelGPT4oMiniSearchPreview BetaResponseNewParamsModel = "gpt-4o-mini-search-preview"` - Total number of tokens used (prompt + completion). + - `const BetaResponseNewParamsModelGPT4oSearchPreview2025_03_11 BetaResponseNewParamsModel = "gpt-4o-search-preview-2025-03-11"` - - `Temperature float64` + - `const BetaResponseNewParamsModelGPT4oMiniSearchPreview2025_03_11 BetaResponseNewParamsModel = "gpt-4o-mini-search-preview-2025-03-11"` - The sampling temperature used for this run. If not set, defaults to 1. + - `const BetaResponseNewParamsModelChatgpt4oLatest BetaResponseNewParamsModel = "chatgpt-4o-latest"` - - `TopP float64` + - `const BetaResponseNewParamsModelCodexMiniLatest BetaResponseNewParamsModel = "codex-mini-latest"` - The nucleus sampling value used for this run. If not set, defaults to 1. + - `const BetaResponseNewParamsModelGPT4oMini BetaResponseNewParamsModel = "gpt-4o-mini"` - - `Event ThreadRunCreated` + - `const BetaResponseNewParamsModelGPT4oMini2024_07_18 BetaResponseNewParamsModel = "gpt-4o-mini-2024-07-18"` - - `const ThreadRunCreatedThreadRunCreated ThreadRunCreated = "thread.run.created"` + - `const BetaResponseNewParamsModelGPT4Turbo BetaResponseNewParamsModel = "gpt-4-turbo"` - - `type AssistantStreamEventThreadRunQueued struct{…}` + - `const BetaResponseNewParamsModelGPT4Turbo2024_04_09 BetaResponseNewParamsModel = "gpt-4-turbo-2024-04-09"` - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `queued` status. + - `const BetaResponseNewParamsModelGPT4_0125Preview BetaResponseNewParamsModel = "gpt-4-0125-preview"` - - `Data Run` + - `const BetaResponseNewParamsModelGPT4TurboPreview BetaResponseNewParamsModel = "gpt-4-turbo-preview"` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaResponseNewParamsModelGPT4_1106Preview BetaResponseNewParamsModel = "gpt-4-1106-preview"` - - `Event ThreadRunQueued` + - `const BetaResponseNewParamsModelGPT4VisionPreview BetaResponseNewParamsModel = "gpt-4-vision-preview"` - - `const ThreadRunQueuedThreadRunQueued ThreadRunQueued = "thread.run.queued"` + - `const BetaResponseNewParamsModelGPT4 BetaResponseNewParamsModel = "gpt-4"` - - `type AssistantStreamEventThreadRunInProgress struct{…}` + - `const BetaResponseNewParamsModelGPT4_0314 BetaResponseNewParamsModel = "gpt-4-0314"` - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to an `in_progress` status. + - `const BetaResponseNewParamsModelGPT4_0613 BetaResponseNewParamsModel = "gpt-4-0613"` - - `Data Run` + - `const BetaResponseNewParamsModelGPT4_32k BetaResponseNewParamsModel = "gpt-4-32k"` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaResponseNewParamsModelGPT4_32k0314 BetaResponseNewParamsModel = "gpt-4-32k-0314"` - - `Event ThreadRunInProgress` + - `const BetaResponseNewParamsModelGPT4_32k0613 BetaResponseNewParamsModel = "gpt-4-32k-0613"` - - `const ThreadRunInProgressThreadRunInProgress ThreadRunInProgress = "thread.run.in_progress"` + - `const BetaResponseNewParamsModelGPT3_5Turbo BetaResponseNewParamsModel = "gpt-3.5-turbo"` - - `type AssistantStreamEventThreadRunRequiresAction struct{…}` + - `const BetaResponseNewParamsModelGPT3_5Turbo16k BetaResponseNewParamsModel = "gpt-3.5-turbo-16k"` - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `requires_action` status. + - `const BetaResponseNewParamsModelGPT3_5Turbo0301 BetaResponseNewParamsModel = "gpt-3.5-turbo-0301"` - - `Data Run` + - `const BetaResponseNewParamsModelGPT3_5Turbo0613 BetaResponseNewParamsModel = "gpt-3.5-turbo-0613"` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaResponseNewParamsModelGPT3_5Turbo1106 BetaResponseNewParamsModel = "gpt-3.5-turbo-1106"` - - `Event ThreadRunRequiresAction` + - `const BetaResponseNewParamsModelGPT3_5Turbo0125 BetaResponseNewParamsModel = "gpt-3.5-turbo-0125"` - - `const ThreadRunRequiresActionThreadRunRequiresAction ThreadRunRequiresAction = "thread.run.requires_action"` + - `const BetaResponseNewParamsModelGPT3_5Turbo16k0613 BetaResponseNewParamsModel = "gpt-3.5-turbo-16k-0613"` - - `type AssistantStreamEventThreadRunCompleted struct{…}` + - `const BetaResponseNewParamsModelO1Pro BetaResponseNewParamsModel = "o1-pro"` - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is completed. + - `const BetaResponseNewParamsModelO1Pro2025_03_19 BetaResponseNewParamsModel = "o1-pro-2025-03-19"` - - `Data Run` + - `const BetaResponseNewParamsModelO3Pro BetaResponseNewParamsModel = "o3-pro"` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaResponseNewParamsModelO3Pro2025_06_10 BetaResponseNewParamsModel = "o3-pro-2025-06-10"` - - `Event ThreadRunCompleted` + - `const BetaResponseNewParamsModelO3DeepResearch BetaResponseNewParamsModel = "o3-deep-research"` - - `const ThreadRunCompletedThreadRunCompleted ThreadRunCompleted = "thread.run.completed"` + - `const BetaResponseNewParamsModelO3DeepResearch2025_06_26 BetaResponseNewParamsModel = "o3-deep-research-2025-06-26"` - - `type AssistantStreamEventThreadRunIncomplete struct{…}` + - `const BetaResponseNewParamsModelO4MiniDeepResearch BetaResponseNewParamsModel = "o4-mini-deep-research"` - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) ends with status `incomplete`. + - `const BetaResponseNewParamsModelO4MiniDeepResearch2025_06_26 BetaResponseNewParamsModel = "o4-mini-deep-research-2025-06-26"` - - `Data Run` + - `const BetaResponseNewParamsModelComputerUsePreview BetaResponseNewParamsModel = "computer-use-preview"` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaResponseNewParamsModelComputerUsePreview2025_03_11 BetaResponseNewParamsModel = "computer-use-preview-2025-03-11"` - - `Event ThreadRunIncomplete` + - `const BetaResponseNewParamsModelGPT5Codex BetaResponseNewParamsModel = "gpt-5-codex"` - - `const ThreadRunIncompleteThreadRunIncomplete ThreadRunIncomplete = "thread.run.incomplete"` + - `const BetaResponseNewParamsModelGPT5Pro BetaResponseNewParamsModel = "gpt-5-pro"` - - `type AssistantStreamEventThreadRunFailed struct{…}` + - `const BetaResponseNewParamsModelGPT5Pro2025_10_06 BetaResponseNewParamsModel = "gpt-5-pro-2025-10-06"` - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) fails. + - `const BetaResponseNewParamsModelGPT5_1CodexMax BetaResponseNewParamsModel = "gpt-5.1-codex-max"` - - `Data Run` + - `string` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `Moderation param.Field[BetaResponseNewParamsModeration]` - - `Event ThreadRunFailed` + Body param: Configuration for running moderation on the input and output of this response. - - `const ThreadRunFailedThreadRunFailed ThreadRunFailed = "thread.run.failed"` + - `Model string` - - `type AssistantStreamEventThreadRunCancelling struct{…}` + The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'. - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `cancelling` status. + - `Policy BetaResponseNewParamsModerationPolicy` - - `Data Run` + The policy to apply to moderated response input and output. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `Input BetaResponseNewParamsModerationPolicyInput` - - `Event ThreadRunCancelling` + The moderation policy for the response input. - - `const ThreadRunCancellingThreadRunCancelling ThreadRunCancelling = "thread.run.cancelling"` + - `Mode string` - - `type AssistantStreamEventThreadRunCancelled struct{…}` + - `const BetaResponseNewParamsModerationPolicyInputModeScore BetaResponseNewParamsModerationPolicyInputMode = "score"` - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is cancelled. + - `const BetaResponseNewParamsModerationPolicyInputModeBlock BetaResponseNewParamsModerationPolicyInputMode = "block"` - - `Data Run` + - `Output BetaResponseNewParamsModerationPolicyOutput` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + The moderation policy for the response output. - - `Event ThreadRunCancelled` + - `Mode string` - - `const ThreadRunCancelledThreadRunCancelled ThreadRunCancelled = "thread.run.cancelled"` + - `const BetaResponseNewParamsModerationPolicyOutputModeScore BetaResponseNewParamsModerationPolicyOutputMode = "score"` - - `type AssistantStreamEventThreadRunExpired struct{…}` + - `const BetaResponseNewParamsModerationPolicyOutputModeBlock BetaResponseNewParamsModerationPolicyOutputMode = "block"` - Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) expires. + - `MultiAgent param.Field[BetaResponseNewParamsMultiAgent]` - - `Data Run` + Body param: Configuration for server-hosted multi-agent execution. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `Enabled bool` - - `Event ThreadRunExpired` + Whether to enable server-hosted multi-agent execution for this response. - - `const ThreadRunExpiredThreadRunExpired ThreadRunExpired = "thread.run.expired"` + - `MaxConcurrentSubagents int64` - - `type AssistantStreamEventThreadRunStepCreated struct{…}` + `max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent. + The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run. - Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is created. + - `ParallelToolCalls param.Field[bool]` - - `Data RunStep` + Body param: Whether to allow the model to run tool calls in parallel. - Represents a step in execution of a run. + - `PreviousResponseID param.Field[string]` - - `ID string` + Body param: The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - The identifier of the run step, which can be referenced in API endpoints. + - `Prompt param.Field[BetaResponsePrompt]` - - `AssistantID string` + Body param: Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. + - `PromptCacheKey param.Field[string]` - - `CancelledAt int64` + Body param: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - The Unix timestamp (in seconds) for when the run step was cancelled. + - `PromptCacheOptions param.Field[BetaResponseNewParamsPromptCacheOptions]` - - `CompletedAt int64` + Body param: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details. - The Unix timestamp (in seconds) for when the run step completed. + - `Mode string` - - `CreatedAt int64` + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. - The Unix timestamp (in seconds) for when the run step was created. + - `const BetaResponseNewParamsPromptCacheOptionsModeImplicit BetaResponseNewParamsPromptCacheOptionsMode = "implicit"` - - `ExpiredAt int64` + - `const BetaResponseNewParamsPromptCacheOptionsModeExplicit BetaResponseNewParamsPromptCacheOptionsMode = "explicit"` - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + - `Ttl string` - - `FailedAt int64` + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. - The Unix timestamp (in seconds) for when the run step failed. + - `const BetaResponseNewParamsPromptCacheOptionsTtl30m BetaResponseNewParamsPromptCacheOptionsTtl = "30m"` - - `LastError RunStepLastError` + - `PromptCacheRetention param.Field[BetaResponseNewParamsPromptCacheRetention]` - The last error associated with this run step. Will be `null` if there are no errors. + Body param: Deprecated. Use `prompt_cache_options.ttl` instead. - - `Code string` + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - One of `server_error` or `rate_limit_exceeded`. + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` + - `const BetaResponseNewParamsPromptCacheRetentionInMemory BetaResponseNewParamsPromptCacheRetention = "in_memory"` - - `Message string` + - `const BetaResponseNewParamsPromptCacheRetention24h BetaResponseNewParamsPromptCacheRetention = "24h"` - A human-readable description of the error. + - `Reasoning param.Field[BetaResponseNewParamsReasoning]` - - `Metadata Metadata` + Body param: **gpt-5 and o-series models only** - 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. + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Context string` - - `Object ThreadRunStep` + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - The object type, which is always `thread.run.step`. + - `const BetaResponseNewParamsReasoningContextAuto BetaResponseNewParamsReasoningContext = "auto"` - - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` + - `const BetaResponseNewParamsReasoningContextCurrentTurn BetaResponseNewParamsReasoningContext = "current_turn"` - - `RunID string` + - `const BetaResponseNewParamsReasoningContextAllTurns BetaResponseNewParamsReasoningContext = "all_turns"` - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. + - `Effort string` - - `Status RunStepStatus` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + - `const BetaResponseNewParamsReasoningEffortNone BetaResponseNewParamsReasoningEffort = "none"` - - `const RunStepStatusInProgress RunStepStatus = "in_progress"` + - `const BetaResponseNewParamsReasoningEffortMinimal BetaResponseNewParamsReasoningEffort = "minimal"` - - `const RunStepStatusCancelled RunStepStatus = "cancelled"` + - `const BetaResponseNewParamsReasoningEffortLow BetaResponseNewParamsReasoningEffort = "low"` - - `const RunStepStatusFailed RunStepStatus = "failed"` + - `const BetaResponseNewParamsReasoningEffortMedium BetaResponseNewParamsReasoningEffort = "medium"` - - `const RunStepStatusCompleted RunStepStatus = "completed"` + - `const BetaResponseNewParamsReasoningEffortHigh BetaResponseNewParamsReasoningEffort = "high"` - - `const RunStepStatusExpired RunStepStatus = "expired"` + - `const BetaResponseNewParamsReasoningEffortXhigh BetaResponseNewParamsReasoningEffort = "xhigh"` - - `StepDetails RunStepStepDetailsUnion` + - `const BetaResponseNewParamsReasoningEffortMax BetaResponseNewParamsReasoningEffort = "max"` - The details of the run step. + - `GenerateSummary string` - - `type MessageCreationStepDetails struct{…}` + **Deprecated:** use `summary` instead. - Details of the message creation by the run step. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `MessageCreation MessageCreationStepDetailsMessageCreation` + - `const BetaResponseNewParamsReasoningGenerateSummaryAuto BetaResponseNewParamsReasoningGenerateSummary = "auto"` - - `MessageID string` + - `const BetaResponseNewParamsReasoningGenerateSummaryConcise BetaResponseNewParamsReasoningGenerateSummary = "concise"` - The ID of the message that was created by this run step. + - `const BetaResponseNewParamsReasoningGenerateSummaryDetailed BetaResponseNewParamsReasoningGenerateSummary = "detailed"` - - `Type MessageCreation` + - `Mode string` - Always `message_creation`. + Controls the reasoning execution mode for the request. - - `const MessageCreationMessageCreation MessageCreation = "message_creation"` + When returned on a response, this is the effective execution mode. - - `type ToolCallsStepDetails struct{…}` + - `string` - Details of the tool call. + - `string` - - `ToolCalls []any` + - `const BetaResponseNewParamsReasoningModeStandard BetaResponseNewParamsReasoningMode = "standard"` - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + - `const BetaResponseNewParamsReasoningModePro BetaResponseNewParamsReasoningMode = "pro"` - - `Type ToolCalls` + - `Summary string` - Always `tool_calls`. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `const ToolCallsToolCalls ToolCalls = "tool_calls"` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - - `ThreadID string` + - `const BetaResponseNewParamsReasoningSummaryAuto BetaResponseNewParamsReasoningSummary = "auto"` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + - `const BetaResponseNewParamsReasoningSummaryConcise BetaResponseNewParamsReasoningSummary = "concise"` - - `Type RunStepType` + - `const BetaResponseNewParamsReasoningSummaryDetailed BetaResponseNewParamsReasoningSummary = "detailed"` - The type of run step, which can be either `message_creation` or `tool_calls`. + - `SafetyIdentifier param.Field[string]` - - `const RunStepTypeMessageCreation RunStepType = "message_creation"` + Body param: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `const RunStepTypeToolCalls RunStepType = "tool_calls"` + - `ServiceTier param.Field[BetaResponseNewParamsServiceTier]` - - `Usage RunStepUsage` + Body param: Specifies the processing type used for serving the request. - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - - `CompletionTokens int64` + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - Number of completion tokens used over the course of the run step. + - `const BetaResponseNewParamsServiceTierAuto BetaResponseNewParamsServiceTier = "auto"` - - `PromptTokens int64` + - `const BetaResponseNewParamsServiceTierDefault BetaResponseNewParamsServiceTier = "default"` - Number of prompt tokens used over the course of the run step. + - `const BetaResponseNewParamsServiceTierFlex BetaResponseNewParamsServiceTier = "flex"` - - `TotalTokens int64` + - `const BetaResponseNewParamsServiceTierScale BetaResponseNewParamsServiceTier = "scale"` - Total number of tokens used (prompt + completion). + - `const BetaResponseNewParamsServiceTierPriority BetaResponseNewParamsServiceTier = "priority"` - - `Event ThreadRunStepCreated` + - `Store param.Field[bool]` - - `const ThreadRunStepCreatedThreadRunStepCreated ThreadRunStepCreated = "thread.run.step.created"` + Body param: Whether to store the generated model response for later retrieval via + API. - - `type AssistantStreamEventThreadRunStepInProgress struct{…}` + - `` - Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) moves to an `in_progress` state. + - `StreamOptions param.Field[BetaResponseNewParamsStreamOptions]` - - `Data RunStep` + Body param: Options for streaming responses. Only set this when you set `stream: true`. - Represents a step in execution of a run. + - `IncludeObfuscation bool` - - `Event ThreadRunStepInProgress` + When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events to + normalize payload sizes as a mitigation to certain side-channel attacks. + These obfuscation fields are included by default, but add a small amount + of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between + your application and the OpenAI API. - - `const ThreadRunStepInProgressThreadRunStepInProgress ThreadRunStepInProgress = "thread.run.step.in_progress"` + - `Temperature param.Field[float64]` - - `type AssistantStreamEventThreadRunStepDelta struct{…}` + Body param: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - Occurs when parts of a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) are being streamed. + - `Text param.Field[BetaResponseTextConfig]` - - `Data RunStepDeltaEvent` + Body param: Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - Represents a run step delta i.e. any changed fields on a run step during streaming. + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - - `ID string` + - `ToolChoice param.Field[BetaResponseNewParamsToolChoiceUnion]` - The identifier of the run step, which can be referenced in API endpoints. + Body param: How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - - `Delta any` + - `type BetaToolChoiceOptions string` - - `Object ThreadRunStepDelta` + Controls which (if any) tool is called by the model. - The object type, which is always `thread.run.step.delta`. + `none` means the model will not call any tool and instead generates a message. - - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` + `auto` means the model can pick between generating a message or calling one or + more tools. - - `Event ThreadRunStepDelta` + `required` means the model must call one or more tools. - - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - - `type AssistantStreamEventThreadRunStepCompleted struct{…}` + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is completed. + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - - `Data RunStep` + - `type BetaToolChoiceAllowed struct{…}` - Represents a step in execution of a run. + Constrains the tools available to the model to a pre-defined set. - - `Event ThreadRunStepCompleted` + - `Mode BetaToolChoiceAllowedMode` - - `const ThreadRunStepCompletedThreadRunStepCompleted ThreadRunStepCompleted = "thread.run.step.completed"` + Constrains the tools available to the model to a pre-defined set. - - `type AssistantStreamEventThreadRunStepFailed struct{…}` + `auto` allows the model to pick from among the allowed tools and generate a + message. - Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) fails. + `required` requires the model to call one or more of the allowed tools. - - `Data RunStep` + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - Represents a step in execution of a run. + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - - `Event ThreadRunStepFailed` + - `Tools []map[string, any]` - - `const ThreadRunStepFailedThreadRunStepFailed ThreadRunStepFailed = "thread.run.step.failed"` + A list of tool definitions that the model should be allowed to call. - - `type AssistantStreamEventThreadRunStepCancelled struct{…}` + For the Responses API, the list of tool definitions might look like: - Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is cancelled. + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - - `Data RunStep` + - `Type AllowedTools` - Represents a step in execution of a run. + Allowed tool configuration type. Always `allowed_tools`. - - `Event ThreadRunStepCancelled` + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `const ThreadRunStepCancelledThreadRunStepCancelled ThreadRunStepCancelled = "thread.run.step.cancelled"` + - `type BetaToolChoiceTypes struct{…}` - - `type AssistantStreamEventThreadRunStepExpired struct{…}` + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) expires. + - `Type BetaToolChoiceTypesType` - - `Data RunStep` + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - Represents a step in execution of a run. + Allowed values are: - - `Event ThreadRunStepExpired` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - - `const ThreadRunStepExpiredThreadRunStepExpired ThreadRunStepExpired = "thread.run.step.expired"` + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - `type AssistantStreamEventThreadMessageCreated struct{…}` + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) is created. + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `Data Message` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - - `ID string` + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - The identifier, which can be referenced in API endpoints. + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - - `AssistantID string` + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + - `type BetaToolChoiceFunction struct{…}` - - `Attachments []MessageAttachment` + Use this option to force the model to call a specific function. - A list of files attached to the message, and the tools they were added to. + - `Name string` - - `FileID string` + The name of the function to call. - The ID of the file to attach to the message. + - `Type Function` - - `Tools []MessageAttachmentToolUnion` + For function calling, the type is always `function`. - The tools to add this file to. + - `const FunctionFunction Function = "function"` - - `type CodeInterpreterTool struct{…}` + - `type BetaToolChoiceMcp struct{…}` - - `Type CodeInterpreter` + Use this option to force the model to call a specific tool on a remote MCP server. - The type of tool being defined: `code_interpreter` + - `ServerLabel string` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + The label of the MCP server to use. - - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` + - `Type Mcp` - - `Type FileSearch` + For MCP tools, the type is always `mcp`. - The type of tool being defined: `file_search` + - `const McpMcp Mcp = "mcp"` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `Name string` - - `CompletedAt int64` + The name of the tool to call on the server. - The Unix timestamp (in seconds) for when the message was completed. + - `type BetaToolChoiceCustom struct{…}` - - `Content []any` + Use this option to force the model to call a specific custom tool. - The content of the message in array of text and/or images. + - `Name string` - - `CreatedAt int64` + The name of the custom tool to call. - The Unix timestamp (in seconds) for when the message was created. + - `Type Custom` - - `IncompleteAt int64` + For custom tool calling, the type is always `custom`. - The Unix timestamp (in seconds) for when the message was marked as incomplete. + - `const CustomCustom Custom = "custom"` - - `IncompleteDetails MessageIncompleteDetails` + - `BetaResponseNewParamsToolChoiceBetaSpecificProgrammaticToolCallingParam` - On an incomplete message, details about why the message is incomplete. + - `Type ProgrammaticToolCalling` - - `Reason string` + The tool to call. Always `programmatic_tool_calling`. - The reason the message is incomplete. + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` + - `type BetaToolChoiceApplyPatch struct{…}` - - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` + Forces the model to call the apply_patch tool when executing a tool call. - - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` + - `Type ApplyPatch` - - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` + The tool to call. Always `apply_patch`. - - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `Metadata Metadata` + - `type BetaToolChoiceShell struct{…}` - 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. + Forces the model to call the shell tool when a tool call is required. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Type Shell` - - `Object ThreadMessage` + The tool to call. Always `shell`. - The object type, which is always `thread.message`. + - `const ShellShell Shell = "shell"` - - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` + - `Tools param.Field[[]BetaToolUnion]` - - `Role MessageRole` + Body param: An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. - The entity that produced the message. One of `user` or `assistant`. + We support the following categories of tools: - - `const MessageRoleUser MessageRole = "user"` + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. - - `const MessageRoleAssistant MessageRole = "assistant"` + - `type BetaFunctionTool struct{…}` - - `RunID string` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + - `type BetaFileSearchTool struct{…}` - - `Status MessageStatus` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + - `type BetaComputerTool struct{…}` - - `const MessageStatusInProgress MessageStatus = "in_progress"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const MessageStatusIncomplete MessageStatus = "incomplete"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const MessageStatusCompleted MessageStatus = "completed"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `ThreadID string` + - `type BetaWebSearchTool struct{…}` - The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Event ThreadMessageCreated` + - `type BetaToolMcp struct{…}` - - `const ThreadMessageCreatedThreadMessageCreated ThreadMessageCreated = "thread.message.created"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `type AssistantStreamEventThreadMessageInProgress struct{…}` + - `type BetaToolCodeInterpreter struct{…}` - Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) moves to an `in_progress` state. + A tool that runs Python code to help generate a response to a prompt. - - `Data Message` + - `type BetaToolProgrammaticToolCalling struct{…}` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + - `type BetaToolImageGeneration struct{…}` - - `Event ThreadMessageInProgress` + A tool that generates images using the GPT image models. - - `const ThreadMessageInProgressThreadMessageInProgress ThreadMessageInProgress = "thread.message.in_progress"` + - `type BetaToolLocalShell struct{…}` - - `type AssistantStreamEventThreadMessageDelta struct{…}` + A tool that allows the model to execute shell commands in a local environment. - Occurs when parts of a [Message](https://platform.openai.com/docs/api-reference/messages/object) are being streamed. + - `type BetaFunctionShellTool struct{…}` - - `Data MessageDeltaEvent` + A tool that allows the model to execute shell commands. - Represents a message delta i.e. any changed fields on a message during streaming. + - `type BetaCustomTool struct{…}` - - `ID string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The identifier of the message, which can be referenced in API endpoints. + - `type BetaNamespaceTool struct{…}` - - `Delta MessageDelta` + Groups function/custom tools under a shared namespace. - The delta containing the fields that have changed on the Message. + - `type BetaToolSearchTool struct{…}` - - `Content []any` + Hosted or BYOT tool search configuration for deferred tools. - The content of the message in array of text and/or images. + - `type BetaWebSearchPreviewTool struct{…}` - - `Role MessageDeltaRole` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The entity that produced the message. One of `user` or `assistant`. + - `type BetaApplyPatchTool struct{…}` - - `const MessageDeltaRoleUser MessageDeltaRole = "user"` + Allows the assistant to create, delete, or update files using unified diffs. - - `const MessageDeltaRoleAssistant MessageDeltaRole = "assistant"` + - `TopLogprobs param.Field[int64]` - - `Object ThreadMessageDelta` + Body param: An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - The object type, which is always `thread.message.delta`. + - `TopP param.Field[float64]` - - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` + Body param: An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - - `Event ThreadMessageDelta` + We generally recommend altering this or `temperature` but not both. - - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` + - `Truncation param.Field[BetaResponseNewParamsTruncation]` - - `type AssistantStreamEventThreadMessageCompleted struct{…}` + Body param: The truncation strategy to use for the model response. - Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) is completed. + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `Data Message` + - `const BetaResponseNewParamsTruncationAuto BetaResponseNewParamsTruncation = "auto"` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaResponseNewParamsTruncationDisabled BetaResponseNewParamsTruncation = "disabled"` - - `Event ThreadMessageCompleted` + - `User param.Field[string]` - - `const ThreadMessageCompletedThreadMessageCompleted ThreadMessageCompleted = "thread.message.completed"` + Body param: This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `type AssistantStreamEventThreadMessageIncomplete struct{…}` + - `Betas param.Field[[]string]` - Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) ends before it is completed. + Header param: Optional beta features to enable for this request. - - `Data Message` + - `const BetaResponseNewParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseNewParamsOpenAIBeta = "responses_multi_agent=v1"` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). +### Returns - - `Event ThreadMessageIncomplete` +- `type BetaResponse struct{…}` - - `const ThreadMessageIncompleteThreadMessageIncomplete ThreadMessageIncomplete = "thread.message.incomplete"` + - `ID string` - - `type AssistantStreamEventErrorEvent struct{…}` + Unique identifier for this Response. - Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. + - `CreatedAt float64` - - `Data ErrorObject` + Unix timestamp (in seconds) of when this Response was created. - - `Code string` + - `Error BetaResponseError` - - `Message string` + An error object returned when the model fails to generate a Response. - - `Param string` + - `Code BetaResponseErrorCode` - - `Type string` + The error code for the response. - - `Event Error` + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` - - `const ErrorError Error = "error"` + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` -### Assistant Tool + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` -- `type AssistantTool interface{…}` + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` -### Code Interpreter Tool + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` -- `type CodeInterpreterTool struct{…}` + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` - - `Type CodeInterpreter` + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` - The type of tool being defined: `code_interpreter` + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` -### File Search Tool + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` -- `type FileSearchTool struct{…}` + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` - - `Type FileSearch` + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` - The type of tool being defined: `file_search` + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` - - `FileSearch FileSearchToolFileSearch` + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` - Overrides for the file search tool. + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` - - `MaxNumResults int64` + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` - The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` - Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` - - `RankingOptions FileSearchToolFileSearchRankingOptions` + - `Message string` - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. + A human-readable description of the error. - See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + - `IncompleteDetails BetaResponseIncompleteDetails` - - `ScoreThreshold float64` + Details about why the response is incomplete. - The score threshold for the file search. All values must be a floating point number between 0 and 1. + - `Reason string` - - `Ranker string` + The reason why the response is incomplete. - The ranker to use for the file search. If not specified will use the `auto` ranker. + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` - - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` - - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` + - `Instructions BetaResponseInstructionsUnion` -### Function Tool + A system (or developer) message inserted into the model's context. -- `type FunctionTool struct{…}` + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. - - `Function FunctionDefinition` + - `string` - - `Name string` + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` - The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + A list of one or many input items to the model, containing + different content types. - - `Description string` + - `type BetaEasyInputMessage struct{…}` - A description of what the function does, used by the model to choose when and how to call the function. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `Parameters FunctionParameters` + - `Content BetaEasyInputMessageContentUnion` - The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - Omitting `parameters` defines a function with an empty parameter list. + - `string` - - `Strict bool` + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). + A list of one or many input items to the model, containing different content + types. - - `Type Function` + - `type BetaResponseInputText struct{…}` - The type of tool being defined: `function` + A text input to the model. - - `const FunctionFunction Function = "function"` + - `Text string` -### Message Stream Event + The text input to the model. -- `type MessageStreamEventUnion interface{…}` + - `Type InputText` - Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) is created. + The type of the input item. Always `input_text`. - - `MessageStreamEventThreadMessageCreated` + - `const InputTextInputText InputText = "input_text"` - - `Data Message` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `ID string` + - `Mode Explicit` - The identifier, which can be referenced in API endpoints. + The breakpoint mode. Always `explicit`. - - `AssistantID string` + - `const ExplicitExplicit Explicit = "explicit"` - If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + - `type BetaResponseInputImage struct{…}` - - `Attachments []MessageAttachment` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - A list of files attached to the message, and the tools they were added to. + - `Detail BetaResponseInputImageDetail` - - `FileID string` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The ID of the file to attach to the message. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `Tools []MessageAttachmentToolUnion` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - The tools to add this file to. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `type CodeInterpreterTool struct{…}` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `Type CodeInterpreter` + - `Type InputImage` - The type of tool being defined: `code_interpreter` + The type of the input item. Always `input_image`. - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `const InputImageInputImage InputImage = "input_image"` - - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` + - `FileID string` - - `Type FileSearch` + The ID of the file to be sent to the model. - The type of tool being defined: `file_search` + - `ImageURL string` - - `const FileSearchFileSearch FileSearch = "file_search"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `CompletedAt int64` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - The Unix timestamp (in seconds) for when the message was completed. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Content []any` + - `Mode Explicit` - The content of the message in array of text and/or images. + The breakpoint mode. Always `explicit`. - - `CreatedAt int64` + - `const ExplicitExplicit Explicit = "explicit"` - The Unix timestamp (in seconds) for when the message was created. + - `type BetaResponseInputFile struct{…}` - - `IncompleteAt int64` + A file input to the model. - The Unix timestamp (in seconds) for when the message was marked as incomplete. + - `Type InputFile` - - `IncompleteDetails MessageIncompleteDetails` + The type of the input item. Always `input_file`. - On an incomplete message, details about why the message is incomplete. + - `const InputFileInputFile InputFile = "input_file"` - - `Reason string` + - `Detail BetaResponseInputFileDetail` - The reason the message is incomplete. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` + - `FileData string` - - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` + The content of the file to be sent to the model. - - `Metadata Metadata` + - `FileID string` - 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. + The ID of the file to be sent to the model. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `FileURL string` - - `Object ThreadMessage` + The URL of the file to be sent to the model. - The object type, which is always `thread.message`. + - `Filename string` - - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` + The name of the file to be sent to the model. - - `Role MessageRole` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - The entity that produced the message. One of `user` or `assistant`. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const MessageRoleUser MessageRole = "user"` + - `Mode Explicit` - - `const MessageRoleAssistant MessageRole = "assistant"` + The breakpoint mode. Always `explicit`. - - `RunID string` + - `const ExplicitExplicit Explicit = "explicit"` - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + - `Role BetaEasyInputMessageRole` - - `Status MessageStatus` + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - - `const MessageStatusInProgress MessageStatus = "in_progress"` + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - - `const MessageStatusIncomplete MessageStatus = "incomplete"` + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - - `const MessageStatusCompleted MessageStatus = "completed"` + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - - `ThreadID string` + - `Phase BetaEasyInputMessagePhase` - The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + 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. - - `Event ThreadMessageCreated` + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - - `const ThreadMessageCreatedThreadMessageCreated ThreadMessageCreated = "thread.message.created"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - - `MessageStreamEventThreadMessageInProgress` + - `Type BetaEasyInputMessageType` - - `Data Message` + The type of the message input. Always `message`. - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - - `Event ThreadMessageInProgress` + - `type BetaResponseInputItemMessage struct{…}` - - `const ThreadMessageInProgressThreadMessageInProgress ThreadMessageInProgress = "thread.message.in_progress"` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - - `MessageStreamEventThreadMessageDelta` + - `Content BetaResponseInputMessageContentList` - - `Data MessageDeltaEvent` + A list of one or many input items to the model, containing different content + types. - Represents a message delta i.e. any changed fields on a message during streaming. + - `Role string` - - `ID string` + The role of the message input. One of `user`, `system`, or `developer`. - The identifier of the message, which can be referenced in API endpoints. + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` - - `Delta MessageDelta` + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` - The delta containing the fields that have changed on the Message. + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` - - `Content []any` + - `Agent BetaResponseInputItemMessageAgent` - The content of the message in array of text and/or images. + The agent that produced this item. - - `Role MessageDeltaRole` + - `AgentName string` - The entity that produced the message. One of `user` or `assistant`. + The canonical name of the agent that produced this item. - - `const MessageDeltaRoleUser MessageDeltaRole = "user"` + - `Status string` - - `const MessageDeltaRoleAssistant MessageDeltaRole = "assistant"` + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Object ThreadMessageDelta` + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - The object type, which is always `thread.message.delta`. + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - - `Event ThreadMessageDelta` + - `Type string` - - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` + The type of the message input. Always set to `message`. - - `MessageStreamEventThreadMessageCompleted` + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - - `Data Message` + - `type BetaResponseOutputMessage struct{…}` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + An output message from the model. - - `Event ThreadMessageCompleted` + - `ID string` - - `const ThreadMessageCompletedThreadMessageCompleted ThreadMessageCompleted = "thread.message.completed"` + The unique ID of the output message. - - `MessageStreamEventThreadMessageIncomplete` + - `Content []BetaResponseOutputMessageContentUnion` - - `Data Message` + The content of the output message. - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + - `type BetaResponseOutputText struct{…}` - - `Event ThreadMessageIncomplete` + A text output from the model. - - `const ThreadMessageIncompleteThreadMessageIncomplete ThreadMessageIncomplete = "thread.message.incomplete"` + - `Annotations []BetaResponseOutputTextAnnotationUnion` -### Run Step Stream Event + The annotations of the text output. -- `type RunStepStreamEventUnion interface{…}` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is created. + A citation to a file. - - `RunStepStreamEventThreadRunStepCreated` + - `FileID string` - - `Data RunStep` + The ID of the file. - Represents a step in execution of a run. + - `Filename string` - - `ID string` + The filename of the file cited. - The identifier of the run step, which can be referenced in API endpoints. + - `Index int64` - - `AssistantID string` + The index of the file in the list of files. - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. + - `Type FileCitation` - - `CancelledAt int64` + The type of the file citation. Always `file_citation`. - The Unix timestamp (in seconds) for when the run step was cancelled. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `CompletedAt int64` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - The Unix timestamp (in seconds) for when the run step completed. + A citation for a web resource used to generate a model response. - - `CreatedAt int64` + - `EndIndex int64` - The Unix timestamp (in seconds) for when the run step was created. + The index of the last character of the URL citation in the message. - - `ExpiredAt int64` + - `StartIndex int64` - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + The index of the first character of the URL citation in the message. - - `FailedAt int64` + - `Title string` - The Unix timestamp (in seconds) for when the run step failed. + The title of the web resource. - - `LastError RunStepLastError` + - `Type URLCitation` - The last error associated with this run step. Will be `null` if there are no errors. + The type of the URL citation. Always `url_citation`. - - `Code string` + - `const URLCitationURLCitation URLCitation = "url_citation"` - One of `server_error` or `rate_limit_exceeded`. + - `URL string` - - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` + The URL of the web resource. - - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `Message string` + A citation for a container file used to generate a model response. - A human-readable description of the error. + - `ContainerID string` - - `Metadata Metadata` + The ID of the container file. - 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. + - `EndIndex int64` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The index of the last character of the container file citation in the message. - - `Object ThreadRunStep` + - `FileID string` - The object type, which is always `thread.run.step`. + The ID of the file. - - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` + - `Filename string` - - `RunID string` + The filename of the container file cited. - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. + - `StartIndex int64` - - `Status RunStepStatus` + The index of the first character of the container file citation in the message. - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + - `Type ContainerFileCitation` - - `const RunStepStatusInProgress RunStepStatus = "in_progress"` + The type of the container file citation. Always `container_file_citation`. - - `const RunStepStatusCancelled RunStepStatus = "cancelled"` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `const RunStepStatusFailed RunStepStatus = "failed"` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - - `const RunStepStatusCompleted RunStepStatus = "completed"` + A path to a file. - - `const RunStepStatusExpired RunStepStatus = "expired"` + - `FileID string` - - `StepDetails RunStepStepDetailsUnion` + The ID of the file. - The details of the run step. + - `Index int64` - - `type MessageCreationStepDetails struct{…}` + The index of the file in the list of files. - Details of the message creation by the run step. + - `Type FilePath` - - `MessageCreation MessageCreationStepDetailsMessageCreation` + The type of the file path. Always `file_path`. - - `MessageID string` + - `const FilePathFilePath FilePath = "file_path"` - The ID of the message that was created by this run step. + - `Text string` - - `Type MessageCreation` + The text output from the model. - Always `message_creation`. + - `Type OutputText` - - `const MessageCreationMessageCreation MessageCreation = "message_creation"` + The type of the output text. Always `output_text`. - - `type ToolCallsStepDetails struct{…}` + - `const OutputTextOutputText OutputText = "output_text"` - Details of the tool call. + - `Logprobs []BetaResponseOutputTextLogprob` - - `ToolCalls []any` + - `Token string` - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + - `Bytes []int64` - - `Type ToolCalls` + - `Logprob float64` - Always `tool_calls`. + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - - `const ToolCallsToolCalls ToolCalls = "tool_calls"` + - `Token string` - - `ThreadID string` + - `Bytes []int64` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + - `Logprob float64` - - `Type RunStepType` + - `type BetaResponseOutputRefusal struct{…}` - The type of run step, which can be either `message_creation` or `tool_calls`. + A refusal from the model. - - `const RunStepTypeMessageCreation RunStepType = "message_creation"` + - `Refusal string` - - `const RunStepTypeToolCalls RunStepType = "tool_calls"` + The refusal explanation from the model. - - `Usage RunStepUsage` + - `Type Refusal` - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. + The type of the refusal. Always `refusal`. - - `CompletionTokens int64` + - `const RefusalRefusal Refusal = "refusal"` - Number of completion tokens used over the course of the run step. + - `Role Assistant` - - `PromptTokens int64` + The role of the output message. Always `assistant`. - Number of prompt tokens used over the course of the run step. + - `const AssistantAssistant Assistant = "assistant"` - - `TotalTokens int64` + - `Status BetaResponseOutputMessageStatus` - Total number of tokens used (prompt + completion). + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `Event ThreadRunStepCreated` + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `const ThreadRunStepCreatedThreadRunStepCreated ThreadRunStepCreated = "thread.run.step.created"` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - - `RunStepStreamEventThreadRunStepInProgress` + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `Data RunStep` + - `Type Message` - Represents a step in execution of a run. + The type of the output message. Always `message`. - - `Event ThreadRunStepInProgress` + - `const MessageMessage Message = "message"` - - `const ThreadRunStepInProgressThreadRunStepInProgress ThreadRunStepInProgress = "thread.run.step.in_progress"` + - `Agent BetaResponseOutputMessageAgent` - - `RunStepStreamEventThreadRunStepDelta` + The agent that produced this item. - - `Data RunStepDeltaEvent` + - `AgentName string` - Represents a run step delta i.e. any changed fields on a run step during streaming. + The canonical name of the agent that produced this item. - - `ID string` + - `Phase BetaResponseOutputMessagePhase` - The identifier of the run step, which can be referenced in API endpoints. + 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. - - `Delta any` + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `Object ThreadRunStepDelta` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - The object type, which is always `thread.run.step.delta`. + - `type BetaResponseFileSearchToolCall struct{…}` - - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `Event ThreadRunStepDelta` + - `ID string` - - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` + The unique ID of the file search tool call. - - `RunStepStreamEventThreadRunStepCompleted` + - `Queries []string` - - `Data RunStep` + The queries used to search for files. - Represents a step in execution of a run. + - `Status BetaResponseFileSearchToolCallStatus` - - `Event ThreadRunStepCompleted` + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `const ThreadRunStepCompletedThreadRunStepCompleted ThreadRunStepCompleted = "thread.run.step.completed"` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - - `RunStepStreamEventThreadRunStepFailed` + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `Data RunStep` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - Represents a step in execution of a run. + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `Event ThreadRunStepFailed` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - - `const ThreadRunStepFailedThreadRunStepFailed ThreadRunStepFailed = "thread.run.step.failed"` + - `Type FileSearchCall` - - `RunStepStreamEventThreadRunStepCancelled` + The type of the file search tool call. Always `file_search_call`. - - `Data RunStep` + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - Represents a step in execution of a run. + - `Agent BetaResponseFileSearchToolCallAgent` - - `Event ThreadRunStepCancelled` + The agent that produced this item. - - `const ThreadRunStepCancelledThreadRunStepCancelled ThreadRunStepCancelled = "thread.run.step.cancelled"` + - `AgentName string` - - `RunStepStreamEventThreadRunStepExpired` + The canonical name of the agent that produced this item. - - `Data RunStep` + - `Results []BetaResponseFileSearchToolCallResult` - Represents a step in execution of a run. + The results of the file search tool call. - - `Event ThreadRunStepExpired` + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - - `const ThreadRunStepExpiredThreadRunStepExpired ThreadRunStepExpired = "thread.run.step.expired"` + 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. -### Run Stream Event + - `string` -- `type RunStreamEventUnion interface{…}` + - `float64` - Occurs when a new [run](https://platform.openai.com/docs/api-reference/runs/object) is created. + - `bool` - - `RunStreamEventThreadRunCreated` + - `FileID string` - - `Data Run` + The unique ID of the file. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `Filename string` - - `ID string` + The name of the file. - The identifier, which can be referenced in API endpoints. + - `Score float64` - - `AssistantID string` + The relevance score of the file - a value between 0 and 1. - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + - `Text string` - - `CancelledAt int64` + The text that was retrieved from the file. - The Unix timestamp (in seconds) for when the run was cancelled. + - `type BetaResponseComputerToolCall struct{…}` - - `CompletedAt int64` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - The Unix timestamp (in seconds) for when the run was completed. + - `ID string` - - `CreatedAt int64` + The unique ID of the computer call. - The Unix timestamp (in seconds) for when the run was created. + - `CallID string` - - `ExpiresAt int64` + An identifier used when responding to the tool call with output. - The Unix timestamp (in seconds) for when the run will expire. + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `FailedAt int64` + The pending safety checks for the computer call. - The Unix timestamp (in seconds) for when the run failed. + - `ID string` - - `IncompleteDetails RunIncompleteDetails` + The ID of the pending safety check. - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + - `Code string` - - `Reason string` + The type of the pending safety check. - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + - `Message string` - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + Details about the pending safety check. - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + - `Status BetaResponseComputerToolCallStatus` - - `Instructions string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `LastError RunLastError` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - The last error associated with this run. Will be `null` if there are no errors. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `Code string` + - `Type BetaResponseComputerToolCallType` - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + The type of the computer call. Always `computer_call`. - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + - `Action BetaComputerActionUnion` - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + A click action. - - `Message string` + - `type BetaComputerActionClick struct{…}` - A human-readable description of the error. + A click action. - - `MaxCompletionTokens int64` + - `Button string` - The maximum number of completion tokens specified to have been used over the course of the run. + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `MaxPromptTokens int64` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - The maximum number of prompt tokens specified to have been used over the course of the run. + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - `Metadata Metadata` + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - 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. + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `Model string` + - `Type Click` - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + Specifies the event type. For a click action, this property is always `click`. - - `Object ThreadRun` + - `const ClickClick Click = "click"` - The object type, which is always `thread.run`. + - `X int64` - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + The x-coordinate where the click occurred. - - `ParallelToolCalls bool` + - `Y int64` - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + The y-coordinate where the click occurred. - - `RequiredAction RunRequiredAction` + - `Keys []string` - Details on the action required to continue the run. Will be `null` if no action is required. + The keys being held while clicking. - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `type BetaComputerActionDoubleClick struct{…}` - Details on the tool outputs needed for this run to continue. + A double click action. - - `ToolCalls []RequiredActionFunctionToolCall` + - `Keys []string` - A list of the relevant tool calls. + The keys being held while double-clicking. - - `ID string` + - `Type DoubleClick` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `Function RequiredActionFunctionToolCallFunction` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - The function definition. + - `X int64` - - `Arguments string` + The x-coordinate where the double click occurred. - The arguments that the model expects you to pass to the function. + - `Y int64` - - `Name string` + The y-coordinate where the double click occurred. - The name of the function. + - `type BetaComputerActionDrag struct{…}` - - `Type Function` + A drag action. - The type of tool call the output is required for. For now, this is always `function`. + - `Path []BetaComputerActionDragPath` - - `const FunctionFunction Function = "function"` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `Type SubmitToolOutputs` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - For now, this is always `submit_tool_outputs`. + - `X int64` - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + The x-coordinate. - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `Y int64` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The y-coordinate. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Type Drag` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + Specifies the event type. For a drag action, this property is always set to `drag`. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `const DragDrag Drag = "drag"` - - `type Auto string` + - `Keys []string` - `auto` is the default value + The keys being held while dragging the mouse. - - `const AutoAuto Auto = "auto"` + - `type BetaComputerActionKeypress struct{…}` - - `type ResponseFormatText struct{…}` + A collection of keypresses the model would like to perform. - Default response format. Used to generate text responses. + - `Keys []string` - - `Type Text` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - The type of response format being defined. Always `text`. + - `Type Keypress` - - `const TextText Text = "text"` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `type ResponseFormatJSONObject struct{…}` + - `const KeypressKeypress Keypress = "keypress"` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `type BetaComputerActionMove struct{…}` - - `Type JSONObject` + A mouse move action. - The type of response format being defined. Always `json_object`. + - `Type Move` - - `const JSONObjectJSONObject JSONObject = "json_object"` + Specifies the event type. For a move action, this property is always set to `move`. - - `type ResponseFormatJSONSchema struct{…}` + - `const MoveMove Move = "move"` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `X int64` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + The x-coordinate to move to. - Structured Outputs configuration options, including a JSON Schema. + - `Y int64` - - `Name string` + The y-coordinate to move to. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `Keys []string` - - `Description string` + The keys being held while moving the mouse. - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `type BetaComputerActionScreenshot struct{…}` - - `Schema map[string, any]` + A screenshot action. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `Type Screenshot` - - `Strict bool` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `Type JSONSchema` + - `type BetaComputerActionScroll struct{…}` - The type of response format being defined. Always `json_schema`. + A scroll action. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `ScrollX int64` - - `StartedAt int64` + The horizontal scroll distance. - The Unix timestamp (in seconds) for when the run was started. + - `ScrollY int64` - - `Status any` + The vertical scroll distance. - - `ThreadID string` + - `Type Scroll` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `ToolChoice AssistantToolChoiceOptionUnion` + - `const ScrollScroll Scroll = "scroll"` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `X int64` - - `type AssistantToolChoiceOptionAuto string` + The x-coordinate where the scroll occurred. - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + - `Y int64` - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + The y-coordinate where the scroll occurred. - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + - `Keys []string` - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + The keys being held while scrolling. - - `type AssistantToolChoice struct{…}` + - `type BetaComputerActionType struct{…}` - Specifies a tool the model should use. Use to force the model to call a specific tool. + An action to type in text. - - `Type AssistantToolChoiceType` + - `Text string` - The type of the tool. If type is `function`, the function name must be set + The text to type. - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `Type Type` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + Specifies the event type. For a type action, this property is always set to `type`. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `const TypeType Type = "type"` - - `Function AssistantToolChoiceFunction` + - `type BetaComputerActionWait struct{…}` - - `Name string` + A wait action. - The name of the function to call. + - `Type Wait` - - `Tools []any` + Specifies the event type. For a wait action, this property is always set to `wait`. - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const WaitWait Wait = "wait"` - - `TruncationStrategy RunTruncationStrategy` + - `Actions BetaComputerActionList` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `Type string` + - `type BetaComputerActionClick struct{…}` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + A click action. - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + - `type BetaComputerActionDoubleClick struct{…}` - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + A double click action. - - `LastMessages int64` + - `type BetaComputerActionDrag struct{…}` - The number of most recent messages from the thread when constructing the context for the run. + A drag action. - - `Usage RunUsage` + - `type BetaComputerActionKeypress struct{…}` - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + A collection of keypresses the model would like to perform. - - `CompletionTokens int64` + - `type BetaComputerActionMove struct{…}` - Number of completion tokens used over the course of the run. + A mouse move action. - - `PromptTokens int64` + - `type BetaComputerActionScreenshot struct{…}` - Number of prompt tokens used over the course of the run. + A screenshot action. - - `TotalTokens int64` + - `type BetaComputerActionScroll struct{…}` - Total number of tokens used (prompt + completion). + A scroll action. - - `Temperature float64` + - `type BetaComputerActionType struct{…}` - The sampling temperature used for this run. If not set, defaults to 1. + An action to type in text. - - `TopP float64` + - `type BetaComputerActionWait struct{…}` - The nucleus sampling value used for this run. If not set, defaults to 1. + A wait action. - - `Event ThreadRunCreated` + - `Agent BetaResponseComputerToolCallAgent` - - `const ThreadRunCreatedThreadRunCreated ThreadRunCreated = "thread.run.created"` + The agent that produced this item. - - `RunStreamEventThreadRunQueued` + - `AgentName string` - - `Data Run` + The canonical name of the agent that produced this item. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `type BetaResponseInputItemComputerCallOutput struct{…}` - - `Event ThreadRunQueued` + The output of a computer tool call. - - `const ThreadRunQueuedThreadRunQueued ThreadRunQueued = "thread.run.queued"` + - `CallID string` - - `RunStreamEventThreadRunInProgress` + The ID of the computer tool call that produced the output. - - `Data Run` + - `Output BetaResponseComputerToolCallOutputScreenshot` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + A computer screenshot image used with the computer use tool. - - `Event ThreadRunInProgress` + - `Type ComputerScreenshot` - - `const ThreadRunInProgressThreadRunInProgress ThreadRunInProgress = "thread.run.in_progress"` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `RunStreamEventThreadRunRequiresAction` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `Data Run` + - `FileID string` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + The identifier of an uploaded file that contains the screenshot. - - `Event ThreadRunRequiresAction` + - `ImageURL string` - - `const ThreadRunRequiresActionThreadRunRequiresAction ThreadRunRequiresAction = "thread.run.requires_action"` + The URL of the screenshot image. - - `RunStreamEventThreadRunCompleted` + - `Type ComputerCallOutput` - - `Data Run` + The type of the computer tool call output. Always `computer_call_output`. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `Event ThreadRunCompleted` + - `ID string` - - `const ThreadRunCompletedThreadRunCompleted ThreadRunCompleted = "thread.run.completed"` + The ID of the computer tool call output. - - `RunStreamEventThreadRunIncomplete` + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - - `Data Run` + The safety checks reported by the API that have been acknowledged by the developer. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `ID string` - - `Event ThreadRunIncomplete` + The ID of the pending safety check. - - `const ThreadRunIncompleteThreadRunIncomplete ThreadRunIncomplete = "thread.run.incomplete"` + - `Code string` - - `RunStreamEventThreadRunFailed` + The type of the pending safety check. - - `Data Run` + - `Message string` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + Details about the pending safety check. - - `Event ThreadRunFailed` + - `Agent BetaResponseInputItemComputerCallOutputAgent` - - `const ThreadRunFailedThreadRunFailed ThreadRunFailed = "thread.run.failed"` + The agent that produced this item. - - `RunStreamEventThreadRunCancelling` + - `AgentName string` - - `Data Run` + The canonical name of the agent that produced this item. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `Status string` - - `Event ThreadRunCancelling` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - - `const ThreadRunCancellingThreadRunCancelling ThreadRunCancelling = "thread.run.cancelling"` + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `RunStreamEventThreadRunCancelled` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - - `Data Run` + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `type BetaResponseFunctionWebSearch struct{…}` - - `Event ThreadRunCancelled` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `const ThreadRunCancelledThreadRunCancelled ThreadRunCancelled = "thread.run.cancelled"` + - `ID string` - - `RunStreamEventThreadRunExpired` + The unique ID of the web search tool call. - - `Data Run` + - `Action BetaResponseFunctionWebSearchActionUnion` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + 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). - - `Event ThreadRunExpired` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - - `const ThreadRunExpiredThreadRunExpired ThreadRunExpired = "thread.run.expired"` + Action type "search" - Performs a web search query. -### Thread Stream Event + - `Type Search` -- `type ThreadStreamEvent struct{…}` + The action type. - Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object) is created. + - `const SearchSearch Search = "search"` - - `Data Thread` + - `Queries []string` - Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). + The search queries. - - `ID string` + - `Query string` - The identifier, which can be referenced in API endpoints. + The search query. - - `CreatedAt int64` + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - The Unix timestamp (in seconds) for when the thread was created. + The sources used in the search. - - `Metadata Metadata` + - `Type URL` - 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. + The type of source. Always `url`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const URLURL URL = "url"` - - `Object Thread` + - `URL string` - The object type, which is always `thread`. + The URL of the source. - - `const ThreadThread Thread = "thread"` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `ToolResources ThreadToolResources` + Action type "open_page" - Opens a specific URL from search results. - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `Type OpenPage` - - `CodeInterpreter ThreadToolResourcesCodeInterpreter` + The action type. - - `FileIDs []string` + - `const OpenPageOpenPage OpenPage = "open_page"` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + - `URL string` - - `FileSearch ThreadToolResourcesFileSearch` + The URL opened by the model. - - `VectorStoreIDs []string` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + Action type "find_in_page": Searches for a pattern within a loaded page. - - `Event ThreadCreated` + - `Pattern string` - - `const ThreadCreatedThreadCreated ThreadCreated = "thread.created"` + The pattern or text to search for within the page. - - `Enabled bool` + - `Type FindInPage` - Whether to enable input audio transcription. + The action type. -# Threads + - `const FindInPageFindInPage FindInPage = "find_in_page"` -## Create thread + - `URL string` -`client.Beta.Threads.New(ctx, body) (*Thread, error)` + The URL of the page searched for the pattern. -**post** `/threads` + - `Status BetaResponseFunctionWebSearchStatus` -Create thread + The status of the web search tool call. -### Parameters + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` -- `body BetaThreadNewParams` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - `Messages param.Field[[]BetaThreadNewParamsMessage]` + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `Content BetaThreadNewParamsMessageContentUnion` + - `Type WebSearchCall` - The text contents of the message. + The type of the web search tool call. Always `web_search_call`. - - `string` + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `type BetaThreadNewParamsMessageContentArrayOfContentParts []MessageContentPartParamUnionResp` + - `Agent BetaResponseFunctionWebSearchAgent` - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](https://platform.openai.com/docs/models). + The agent that produced this item. - - `type ImageFileContentBlockParam struct{…}` + - `AgentName string` - References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + The canonical name of the agent that produced this item. - - `ImageFile ImageFile` + - `type BetaResponseFunctionToolCall struct{…}` - - `FileID string` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + - `Arguments string` - - `Detail ImageFileDetail` + A JSON string of the arguments to pass to the function. - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + - `CallID string` - - `const ImageFileDetailAuto ImageFileDetail = "auto"` + The unique ID of the function tool call generated by the model. - - `const ImageFileDetailLow ImageFileDetail = "low"` + - `Name string` - - `const ImageFileDetailHigh ImageFileDetail = "high"` + The name of the function to run. - - `Type ImageFile` + - `Type FunctionCall` - Always `image_file`. + The type of the function tool call. Always `function_call`. - - `const ImageFileImageFile ImageFile = "image_file"` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `type ImageURLContentBlockParam struct{…}` + - `ID string` - References an image URL in the content of a message. + The unique ID of the function tool call. - - `ImageURL ImageURL` + - `Agent BetaResponseFunctionToolCallAgent` - - `URL string` + The agent that produced this item. - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + - `AgentName string` - - `Detail ImageURLDetail` + The canonical name of the agent that produced this item. - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` + - `Caller BetaResponseFunctionToolCallCallerUnion` - - `const ImageURLDetailAuto ImageURLDetail = "auto"` + The execution context that produced this tool call. - - `const ImageURLDetailLow ImageURLDetail = "low"` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `const ImageURLDetailHigh ImageURLDetail = "high"` + - `Type Direct` - - `Type ImageURL` + - `const DirectDirect Direct = "direct"` - The type of the content part. + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - `const ImageURLImageURL ImageURL = "image_url"` + - `CallerID string` - - `type TextContentBlockParam struct{…}` + The call ID of the program item that produced this tool call. - The text content that is part of a message. + - `Type Program` - - `Text string` + - `const ProgramProgram Program = "program"` - Text content to be sent to the model + - `Namespace string` - - `Type Text` + The namespace of the function to run. - Always `text`. + - `Status BetaResponseFunctionToolCallStatus` - - `const TextText Text = "text"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Role string` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - The role of the entity that is creating the message. Allowed values include: + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `const BetaThreadNewParamsMessageRoleUser BetaThreadNewParamsMessageRole = "user"` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `const BetaThreadNewParamsMessageRoleAssistant BetaThreadNewParamsMessageRole = "assistant"` + The output of a function tool call. - - `Attachments []BetaThreadNewParamsMessageAttachment` + - `CallID string` - A list of files attached to the message, and the tools they should be added to. + The unique ID of the function tool call generated by the model. - - `FileID string` + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - The ID of the file to attach to the message. + Text, image, or file output of the function tool call. - - `Tools []BetaThreadNewParamsMessageAttachmentToolUnion` + - `string` - The tools to add this file to. + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `type CodeInterpreterTool struct{…}` + An array of content outputs (text, image, file) for the function tool call. - - `Type CodeInterpreter` + - `type BetaResponseInputTextContent struct{…}` - The type of tool being defined: `code_interpreter` + A text input to the model. - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `Text string` - - `type BetaThreadNewParamsMessageAttachmentToolFileSearch struct{…}` + The text input to the model. - - `Type FileSearch` + - `Type InputText` - The type of tool being defined: `file_search` + The type of the input item. Always `input_text`. - - `const FileSearchFileSearch FileSearch = "file_search"` + - `const InputTextInputText InputText = "input_text"` - - `Metadata Metadata` + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - 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. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Mode Explicit` - - `Metadata param.Field[Metadata]` + The breakpoint mode. Always `explicit`. - 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. + - `const ExplicitExplicit Explicit = "explicit"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `type BetaResponseInputImageContent struct{…}` - - `ToolResources param.Field[BetaThreadNewParamsToolResources]` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `Type InputImage` - - `CodeInterpreter BetaThreadNewParamsToolResourcesCodeInterpreter` + The type of the input item. Always `input_image`. - - `FileIDs []string` + - `const InputImageInputImage InputImage = "input_image"` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + - `Detail BetaResponseInputImageContentDetail` - - `FileSearch BetaThreadNewParamsToolResourcesFileSearch` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `VectorStoreIDs []string` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - - `VectorStores []BetaThreadNewParamsToolResourcesFileSearchVectorStore` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this thread. There can be a maximum of 1 vector store attached to the thread. + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - - `ChunkingStrategy BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion` + - `FileID string` - The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + The ID of the file to be sent to the model. - - `type BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyAuto struct{…}` + - `ImageURL string` - The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `Type Auto` + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - Always `auto`. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const AutoAuto Auto = "auto"` + - `Mode Explicit` - - `type BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyStatic struct{…}` + The breakpoint mode. Always `explicit`. - - `Static BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic` + - `const ExplicitExplicit Explicit = "explicit"` - - `ChunkOverlapTokens int64` + - `type BetaResponseInputFileContent struct{…}` - The number of tokens that overlap between chunks. The default value is `400`. + A file input to the model. - Note that the overlap must not exceed half of `max_chunk_size_tokens`. + - `Type InputFile` - - `MaxChunkSizeTokens int64` + The type of the input item. Always `input_file`. - The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. + - `const InputFileInputFile InputFile = "input_file"` - - `Type Static` + - `Detail BetaResponseInputFileContentDetail` - Always `static`. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const StaticStatic Static = "static"` + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `FileIDs []string` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `Metadata Metadata` + - `FileData string` - 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. + The base64-encoded data of the file to be sent to the model. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `FileID string` -### Returns + The ID of the file to be sent to the model. -- `type Thread struct{…}` + - `FileURL string` - Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). + The URL of the file to be sent to the model. - - `ID string` + - `Filename string` - The identifier, which can be referenced in API endpoints. + The name of the file to be sent to the model. - - `CreatedAt int64` + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - The Unix timestamp (in seconds) for when the thread was created. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Metadata Metadata` + - `Mode Explicit` - 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. + The breakpoint mode. Always `explicit`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const ExplicitExplicit Explicit = "explicit"` - - `Object Thread` + - `Type FunctionCallOutput` - The object type, which is always `thread`. + The type of the function tool call output. Always `function_call_output`. - - `const ThreadThread Thread = "thread"` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `ToolResources ThreadToolResources` + - `ID string` - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + The unique ID of the function tool call output. Populated when this item is returned via API. - - `CodeInterpreter ThreadToolResourcesCodeInterpreter` + - `Agent BetaResponseInputItemFunctionCallOutputAgent` - - `FileIDs []string` + The agent that produced this item. - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + - `AgentName string` - - `FileSearch ThreadToolResourcesFileSearch` + The canonical name of the agent that produced this item. - - `VectorStoreIDs []string` + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + The execution context that produced this tool call. -### Example + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` -```go -package main + - `Type Direct` -import ( - "context" - "fmt" + The caller type. Always `direct`. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `const DirectDirect Direct = "direct"` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - thread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{ + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", thread.ID) -} -``` + - `CallerID string` -#### Response + The call ID of the program item that produced this tool call. -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` + - `Type Program` -## Create thread and run + The caller type. Always `program`. -`client.Beta.Threads.NewAndRun(ctx, body) (*Run, error)` + - `const ProgramProgram Program = "program"` -**post** `/threads/runs` + - `Status string` -Create thread and run + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. -### Parameters + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` -- `body BetaThreadNewAndRunParams` + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - - `AssistantID param.Field[string]` + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + - `type BetaResponseInputItemAgentMessage struct{…}` - - `Instructions param.Field[string]` + A message routed between agents. - Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. + - `Author string` - - `MaxCompletionTokens param.Field[int64]` + The sending agent identity. - The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + - `Content []BetaResponseInputItemAgentMessageContentUnion` - - `MaxPromptTokens param.Field[int64]` + Plaintext, image, or encrypted content sent between agents. - The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + - `type BetaResponseInputTextContent struct{…}` - - `Metadata param.Field[Metadata]` + A text input to the model. - 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. + - `type BetaResponseInputImageContent struct{…}` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `Model param.Field[ChatModel]` + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `string` + - `EncryptedContent string` - - `type ChatModel string` + Opaque encrypted content. - - `const ChatModelGPT5_6Sol ChatModel = "gpt-5.6-sol"` + - `Type EncryptedContent` - - `const ChatModelGPT5_6Terra ChatModel = "gpt-5.6-terra"` + The type of the input item. Always `encrypted_content`. - - `const ChatModelGPT5_6Luna ChatModel = "gpt-5.6-luna"` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"` + - `Recipient string` - - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"` + The destination agent identity. - - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"` + - `Type AgentMessage` - - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"` + The item type. Always `agent_message`. - - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"` + - `ID string` - - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"` + The unique ID of this agent message item. - - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"` + - `Agent BetaResponseInputItemAgentMessageAgent` - - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"` + The agent that produced this item. - - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"` + - `AgentName string` - - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"` + The canonical name of the agent that produced this item. - - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"` + - `Action string` - - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"` + The multi-agent action that was executed. - - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"` + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"` + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `const ChatModelGPT5 ChatModel = "gpt-5"` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"` + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `const ChatModelGPT5Nano ChatModel = "gpt-5-nano"` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"` + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"` + - `Arguments string` - - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"` + The action arguments as a JSON string. - - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"` + - `CallID string` - - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"` + The unique ID linking this call to its output. - - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"` + - `Type MultiAgentCall` - - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"` + The item type. Always `multi_agent_call`. - - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"` + - `ID string` - - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"` + The unique ID of this multi-agent call. - - `const ChatModelO4Mini ChatModel = "o4-mini"` + - `Agent BetaResponseInputItemMultiAgentCallAgent` - - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"` + The agent that produced this item. - - `const ChatModelO3 ChatModel = "o3"` + - `AgentName string` - - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"` + The canonical name of the agent that produced this item. - - `const ChatModelO3Mini ChatModel = "o3-mini"` + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"` + - `Action string` - - `const ChatModelO1 ChatModel = "o1"` + The multi-agent action that produced this result. - - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"` + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const ChatModelO1Preview ChatModel = "o1-preview"` + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"` + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - - `const ChatModelO1Mini ChatModel = "o1-mini"` + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"` + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - - `const ChatModelGPT4o ChatModel = "gpt-4o"` + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"` + - `CallID string` - - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"` + The unique ID of the multi-agent call. - - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"` + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"` + Text output returned by the multi-agent action. - - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"` + - `Text string` - - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"` + The text content. - - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"` + - `Type OutputText` - - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"` + The content type. Always `output_text`. - - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `const OutputTextOutputText OutputText = "output_text"` - - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"` + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"` + Citations associated with the text content. - - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `FileID string` - - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"` + The ID of the file. - - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"` + - `Filename string` - - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"` + The filename of the file cited. - - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"` + - `Index int64` - - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"` + The index of the file in the list of files. - - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"` + - `Type FileCitation` - - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"` + The citation type. Always `file_citation`. - - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"` + - `EndIndex int64` - - `const ChatModelGPT4 ChatModel = "gpt-4"` + The index of the last character of the citation in the message. - - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"` + - `StartIndex int64` - - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"` + The index of the first character of the citation in the message. - - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"` + - `Title string` - - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"` + The title of the cited resource. - - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"` + - `Type URLCitation` - - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"` + The citation type. Always `url_citation`. - - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"` + - `URL string` - - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"` + The URL of the cited resource. - - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"` + - `ContainerID string` - - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"` + The ID of the container. - - `ParallelToolCalls param.Field[bool]` + - `EndIndex int64` - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + The index of the last character of the citation in the message. - - `ResponseFormat param.Field[AssistantResponseFormatOptionUnion]` + - `FileID string` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The ID of the container file. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Filename string` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + The filename of the container file cited. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `StartIndex int64` - - `` + The index of the first character of the citation in the message. - - `Temperature param.Field[float64]` + - `Type ContainerFileCitation` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + The citation type. Always `container_file_citation`. - - `Thread param.Field[BetaThreadNewAndRunParamsThread]` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - Options to create a new thread. If no thread is provided when running a - request, an empty thread will be created. + - `Type MultiAgentCallOutput` - - `Messages []BetaThreadNewAndRunParamsThreadMessage` + The item type. Always `multi_agent_call_output`. - A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `Content BetaThreadNewAndRunParamsThreadMessageContentUnion` + - `ID string` - The text contents of the message. + The unique ID of this multi-agent call output. - - `string` + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` - - `[]MessageContentPartParamUnion` + The agent that produced this item. - - `type ImageFileContentBlockParam struct{…}` + - `AgentName string` - References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + The canonical name of the agent that produced this item. - - `ImageFile ImageFile` + - `type BetaResponseInputItemToolSearchCall struct{…}` - - `FileID string` + - `Arguments any` - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + The arguments supplied to the tool search call. - - `Detail ImageFileDetail` + - `Type ToolSearchCall` - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + The item type. Always `tool_search_call`. - - `const ImageFileDetailAuto ImageFileDetail = "auto"` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `const ImageFileDetailLow ImageFileDetail = "low"` + - `ID string` - - `const ImageFileDetailHigh ImageFileDetail = "high"` + The unique ID of this tool search call. - - `Type ImageFile` + - `Agent BetaResponseInputItemToolSearchCallAgent` - Always `image_file`. + The agent that produced this item. - - `const ImageFileImageFile ImageFile = "image_file"` + - `AgentName string` - - `type ImageURLContentBlockParam struct{…}` + The canonical name of the agent that produced this item. - References an image URL in the content of a message. + - `CallID string` - - `ImageURL ImageURL` + The unique ID of the tool search call generated by the model. - - `URL string` + - `Execution string` - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + Whether tool search was executed by the server or by the client. - - `Detail ImageURLDetail` + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - - `const ImageURLDetailAuto ImageURLDetail = "auto"` + - `Status string` - - `const ImageURLDetailLow ImageURLDetail = "low"` + The status of the tool search call. - - `const ImageURLDetailHigh ImageURLDetail = "high"` + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - - `Type ImageURL` + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - The type of the content part. + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - - `const ImageURLImageURL ImageURL = "image_url"` + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - - `type TextContentBlockParam struct{…}` + - `Tools []BetaToolUnion` - The text content that is part of a message. + The loaded tool definitions returned by the tool search output. - - `Text string` + - `type BetaFunctionTool struct{…}` - Text content to be sent to the model + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Type Text` + - `Name string` - Always `text`. + The name of the function to call. - - `const TextText Text = "text"` + - `Parameters map[string, any]` - - `Role string` + A JSON schema object describing the parameters of the function. - The role of the entity that is creating the message. Allowed values include: + - `Strict bool` - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. + Whether strict parameter validation is enforced for this function tool. - - `const BetaThreadNewAndRunParamsThreadMessageRoleUser BetaThreadNewAndRunParamsThreadMessageRole = "user"` + - `Type Function` - - `const BetaThreadNewAndRunParamsThreadMessageRoleAssistant BetaThreadNewAndRunParamsThreadMessageRole = "assistant"` + The type of the function tool. Always `function`. - - `Attachments []BetaThreadNewAndRunParamsThreadMessageAttachment` + - `const FunctionFunction Function = "function"` - A list of files attached to the message, and the tools they should be added to. + - `AllowedCallers []string` - - `FileID string` + The tool invocation context(s). - The ID of the file to attach to the message. + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `Tools []BetaThreadNewAndRunParamsThreadMessageAttachmentToolUnion` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - The tools to add this file to. + - `DeferLoading bool` - - `type CodeInterpreterTool struct{…}` + Whether this function is deferred and loaded via tool search. - - `Type CodeInterpreter` + - `Description string` - The type of tool being defined: `code_interpreter` + A description of the function. Used by the model to determine whether or not to call the function. - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `OutputSchema map[string, any]` - - `BetaThreadNewAndRunParamsThreadMessageAttachmentToolFileSearch` + A JSON schema object describing the JSON value encoded in string outputs for this function. + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - `Type FileSearch` - The type of tool being defined: `file_search` + The type of the file search tool. Always `file_search`. - `const FileSearchFileSearch FileSearch = "file_search"` - - `Metadata Metadata` + - `VectorStoreIDs []string` - 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. + The IDs of the vector stores to search. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Filters BetaFileSearchToolFiltersUnion` - - `Metadata Metadata` + A filter to apply. - 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. + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `ToolResources BetaThreadNewAndRunParamsThreadToolResources` + - `Key string` - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + The key to compare against the value. - - `CodeInterpreter BetaThreadNewAndRunParamsThreadToolResourcesCodeInterpreter` + - `Type string` - - `FileIDs []string` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + - `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 - - `FileSearch BetaThreadNewAndRunParamsThreadToolResourcesFileSearch` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `VectorStoreIDs []string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `VectorStores []BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStore` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this thread. There can be a maximum of 1 vector store attached to the thread. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `ChunkingStrategy BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyUnion` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `Type Auto` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - Always `auto`. + The value to compare against the attribute key; supports string, number, or boolean types. - - `const AutoAuto Auto = "auto"` + - `string` - - `BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic` + - `float64` - - `Static BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic` + - `bool` - - `ChunkOverlapTokens int64` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - The number of tokens that overlap between chunks. The default value is `400`. + - `string` - Note that the overlap must not exceed half of `max_chunk_size_tokens`. + - `float64` - - `MaxChunkSizeTokens int64` + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. + Combine multiple filters using `and` or `or`. - - `Type Static` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - Always `static`. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `const StaticStatic Static = "static"` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `FileIDs []string` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. + - `Key string` - - `Metadata Metadata` + The key to compare against the value. - 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. + - `Type string` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `ToolChoice param.Field[AssistantToolChoiceOptionUnion]` + - `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 - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `ToolResources param.Field[BetaThreadNewAndRunParamsToolResources]` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `CodeInterpreter BetaThreadNewAndRunParamsToolResourcesCodeInterpreter` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `FileIDs []string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `FileSearch BetaThreadNewAndRunParamsToolResourcesFileSearch` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - `VectorStoreIDs []string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - `Tools param.Field[[]any]` + The value to compare against the attribute key; supports string, number, or boolean types. - Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + - `string` - - `TopP param.Field[float64]` + - `float64` - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + - `bool` - We generally recommend altering this or temperature but not both. + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `TruncationStrategy param.Field[BetaThreadNewAndRunParamsTruncationStrategy]` + - `string` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + - `float64` - `Type string` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + Type of operation: `and` or `or`. - - `const BetaThreadNewAndRunParamsTruncationStrategyTypeAuto BetaThreadNewAndRunParamsTruncationStrategyType = "auto"` + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `const BetaThreadNewAndRunParamsTruncationStrategyTypeLastMessages BetaThreadNewAndRunParamsTruncationStrategyType = "last_messages"` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - `LastMessages int64` + - `MaxNumResults int64` - The number of most recent messages from the thread when constructing the context for the run. + The maximum number of results to return. This number should be between 1 and 50 inclusive. -### Returns + - `RankingOptions BetaFileSearchToolRankingOptions` -- `type Run struct{…}` + Ranking options for search. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `ID string` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - The identifier, which can be referenced in API endpoints. + - `EmbeddingWeight float64` - - `AssistantID string` + The weight of the embedding in the reciprocal ranking fusion. - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + - `TextWeight float64` - - `CancelledAt int64` + The weight of the text in the reciprocal ranking fusion. - The Unix timestamp (in seconds) for when the run was cancelled. + - `Ranker string` - - `CompletedAt int64` + The ranker to use for the file search. - The Unix timestamp (in seconds) for when the run was completed. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `CreatedAt int64` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - The Unix timestamp (in seconds) for when the run was created. + - `ScoreThreshold float64` - - `ExpiresAt int64` + 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. - The Unix timestamp (in seconds) for when the run will expire. + - `type BetaComputerTool struct{…}` - - `FailedAt int64` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The Unix timestamp (in seconds) for when the run failed. + - `Type Computer` - - `IncompleteDetails RunIncompleteDetails` + The type of the computer tool. Always `computer`. - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + - `const ComputerComputer Computer = "computer"` - - `Reason string` + - `type BetaComputerUsePreviewTool struct{…}` - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + - `DisplayHeight int64` - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + The height of the computer display. - - `Instructions string` + - `DisplayWidth int64` - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + The width of the computer display. - - `LastError RunLastError` + - `Environment BetaComputerUsePreviewToolEnvironment` - The last error associated with this run. Will be `null` if there are no errors. + The type of computer environment to control. - - `Code string` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `Message string` + - `Type ComputerUsePreview` - A human-readable description of the error. + The type of the computer use tool. Always `computer_use_preview`. - - `MaxCompletionTokens int64` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - The maximum number of completion tokens specified to have been used over the course of the run. + - `type BetaWebSearchTool struct{…}` - - `MaxPromptTokens int64` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The maximum number of prompt tokens specified to have been used over the course of the run. + - `Type BetaWebSearchToolType` - - `Metadata Metadata` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - 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. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - - `Model string` + - `Filters BetaWebSearchToolFilters` - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + Filters for the search. - - `Object ThreadRun` + - `AllowedDomains []string` - The object type, which is always `thread.run`. + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `ParallelToolCalls bool` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + 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. - - `RequiredAction RunRequiredAction` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - Details on the action required to continue the run. Will be `null` if no action is required. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - Details on the tool outputs needed for this run to continue. + - `UserLocation BetaWebSearchToolUserLocation` - - `ToolCalls []RequiredActionFunctionToolCall` + The approximate location of the user. - A list of the relevant tool calls. + - `City string` - - `ID string` + Free text input for the city of the user, e.g. `San Francisco`. - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + - `Country string` - - `Function RequiredActionFunctionToolCallFunction` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The function definition. + - `Region string` - - `Arguments string` + Free text input for the region of the user, e.g. `California`. - The arguments that the model expects you to pass to the function. + - `Timezone string` - - `Name string` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The name of the function. + - `Type string` - - `Type Function` + The type of location approximation. Always `approximate`. - The type of tool call the output is required for. For now, this is always `function`. + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `const FunctionFunction Function = "function"` + - `type BetaToolMcp struct{…}` - - `Type SubmitToolOutputs` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - For now, this is always `submit_tool_outputs`. + - `ServerLabel string` - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + A label for this MCP server, used to identify it in tool calls. - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `Type Mcp` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The type of the MCP tool. Always `mcp`. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const McpMcp Mcp = "mcp"` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `AllowedCallers []string` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + The tool invocation context(s). - - `type Auto string` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - `auto` is the default value + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `const AutoAuto Auto = "auto"` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `type ResponseFormatText struct{…}` + List of allowed tool names or a filter object. - Default response format. Used to generate text responses. + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `Type Text` + A string array of allowed tool names - The type of response format being defined. Always `text`. + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `const TextText Text = "text"` + A filter object to specify which tools are allowed. - - `type ResponseFormatJSONObject struct{…}` + - `ReadOnly bool` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Type JSONObject` + - `ToolNames []string` - The type of response format being defined. Always `json_object`. + List of allowed tool names. - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `Authorization string` - - `type ResponseFormatJSONSchema struct{…}` + 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. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `ConnectorID string` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - Structured Outputs configuration options, including a JSON Schema. + Currently supported `connector_id` values are: - - `Name string` + - 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` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `Description string` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `Schema map[string, any]` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - - `Strict bool` + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - - `Type JSONSchema` + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - The type of response format being defined. Always `json_schema`. + - `DeferLoading bool` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + Whether this MCP tool is deferred and discovered via tool search. - - `StartedAt int64` + - `Headers map[string, string]` - The Unix timestamp (in seconds) for when the run was started. + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `Status any` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `ThreadID string` + Specify which of the MCP server's tools require approval. - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `ToolChoice AssistantToolChoiceOptionUnion` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `type AssistantToolChoiceOptionAuto string` + A filter object to specify which tools are allowed. - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + - `ReadOnly bool` - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + - `ToolNames []string` - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + List of allowed tool names. - - `type AssistantToolChoice struct{…}` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - Specifies a tool the model should use. Use to force the model to call a specific tool. + A filter object to specify which tools are allowed. - - `Type AssistantToolChoiceType` + - `ReadOnly bool` - The type of the tool. If type is `function`, the function name must be set + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `ToolNames []string` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + List of allowed tool names. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `Function AssistantToolChoiceFunction` + 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. - - `Name string` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - The name of the function to call. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - - `Tools []any` + - `ServerDescription string` - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + Optional description of the MCP server, used to provide more context. - - `TruncationStrategy RunTruncationStrategy` + - `ServerURL string` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `Type string` + - `TunnelID string` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + 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. - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + - `type BetaToolCodeInterpreter struct{…}` - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + A tool that runs Python code to help generate a response to a prompt. - - `LastMessages int64` + - `Container BetaToolCodeInterpreterContainerUnion` - The number of most recent messages from the thread when constructing the context for the run. + 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. - - `Usage RunUsage` + - `string` - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `CompletionTokens int64` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - Number of completion tokens used over the course of the run. + - `Type Auto` - - `PromptTokens int64` + Always `auto`. - Number of prompt tokens used over the course of the run. + - `const AutoAuto Auto = "auto"` - - `TotalTokens int64` + - `FileIDs []string` - Total number of tokens used (prompt + completion). + An optional list of uploaded files to make available to your code. - - `Temperature float64` + - `MemoryLimit string` - The sampling temperature used for this run. If not set, defaults to 1. + The memory limit for the code interpreter container. - - `TopP float64` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - The nucleus sampling value used for this run. If not set, defaults to 1. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` -### Example + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` -```go -package main + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` -import ( - "context" - "fmt" + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + Network access policy for the container. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{ - AssistantID: "assistant_id", - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", run.ID) -} -``` + - `type BetaContainerNetworkPolicyDisabled struct{…}` -#### Response + - `Type Disabled` -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": {}, - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - {} - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` + Disable outbound network access. Always `disabled`. -## Retrieve thread + - `const DisabledDisabled Disabled = "disabled"` -`client.Beta.Threads.Get(ctx, threadID) (*Thread, error)` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` -**get** `/threads/{thread_id}` + - `AllowedDomains []string` -Retrieve thread + A list of allowed domains when type is `allowlist`. -### Parameters + - `Type Allowlist` -- `threadID string` + Allow outbound network access only to specified domains. Always `allowlist`. -### Returns + - `const AllowlistAllowlist Allowlist = "allowlist"` -- `type Thread struct{…}` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). + Optional domain-scoped secrets for allowlisted domains. - - `ID string` + - `Domain string` - The identifier, which can be referenced in API endpoints. + The domain associated with the secret. - - `CreatedAt int64` + - `Name string` - The Unix timestamp (in seconds) for when the thread was created. + The name of the secret to inject for the domain. - - `Metadata Metadata` + - `Value string` - 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. + The secret value to inject for the domain. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Type CodeInterpreter` - - `Object Thread` + The type of the code interpreter tool. Always `code_interpreter`. - The object type, which is always `thread`. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `const ThreadThread Thread = "thread"` + - `AllowedCallers []string` - - `ToolResources ThreadToolResources` + The tool invocation context(s). - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - - `CodeInterpreter ThreadToolResourcesCodeInterpreter` + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `FileIDs []string` + - `type BetaToolProgrammaticToolCalling struct{…}` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + - `Type ProgrammaticToolCalling` - - `FileSearch ThreadToolResourcesFileSearch` + The type of the tool. Always `programmatic_tool_calling`. - - `VectorStoreIDs []string` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + - `type BetaToolImageGeneration struct{…}` -### Example + A tool that generates images using the GPT image models. -```go -package main + - `Type ImageGeneration` -import ( - "context" - "fmt" + The type of the image generation tool. Always `image_generation`. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - thread, err := client.Beta.Threads.Get(context.TODO(), "thread_id") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", thread.ID) -} -``` + - `Action string` -#### Response + Whether to generate a new image or edit an existing image. Default: `auto`. -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` -## Modify thread + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` -`client.Beta.Threads.Update(ctx, threadID, body) (*Thread, error)` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` -**post** `/threads/{thread_id}` + - `Background string` -Modify thread + 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. -### Parameters + `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. -- `threadID string` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. -- `body BetaThreadUpdateParams` + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `Metadata param.Field[Metadata]` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - 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. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `InputFidelity string` - - `ToolResources param.Field[BetaThreadUpdateParamsToolResources]` + 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`. - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - - `CodeInterpreter BetaThreadUpdateParamsToolResourcesCodeInterpreter` + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - - `FileIDs []string` + - `InputImageMask BetaToolImageGenerationInputImageMask` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `FileSearch BetaThreadUpdateParamsToolResourcesFileSearch` + - `FileID string` - - `VectorStoreIDs []string` + File ID for the mask image. - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + - `ImageURL string` -### Returns + Base64-encoded mask image. -- `type Thread struct{…}` + - `Model string` - Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). + The image generation model to use. Default: `gpt-image-1`. - - `ID string` + - `string` - The identifier, which can be referenced in API endpoints. + - `string` - - `CreatedAt int64` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - The Unix timestamp (in seconds) for when the thread was created. + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `Metadata Metadata` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - 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. + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - - `Object Thread` + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - The object type, which is always `thread`. + - `Moderation string` - - `const ThreadThread Thread = "thread"` + Moderation level for the generated image. Default: `auto`. - - `ToolResources ThreadToolResources` + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - - `CodeInterpreter ThreadToolResourcesCodeInterpreter` + - `OutputCompression int64` - - `FileIDs []string` + Compression level for the output image. Default: 100. - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + - `OutputFormat string` - - `FileSearch ThreadToolResourcesFileSearch` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `VectorStoreIDs []string` + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` -### Example + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` -```go -package main + - `PartialImages int64` -import ( - "context" - "fmt" + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `Quality string` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - thread, err := client.Beta.Threads.Update( - context.TODO(), - "thread_id", - openai.BetaThreadUpdateParams{ + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", thread.ID) -} -``` + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` -#### Response + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` -```json -{ - "id": "id", - "created_at": 0, - "metadata": { - "foo": "string" - }, - "object": "thread", - "tool_resources": { - "code_interpreter": { - "file_ids": [ - "string" - ] - }, - "file_search": { - "vector_store_ids": [ - "string" - ] - } - } -} -``` + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` -## Delete thread + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` -`client.Beta.Threads.Delete(ctx, threadID) (*ThreadDeleted, error)` + - `Size string` -**delete** `/threads/{thread_id}` + 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`. -Delete thread + - `string` -### Parameters + - `string` -- `threadID string` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` -### Returns + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` -- `type ThreadDeleted struct{…}` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - - `ID string` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - - `Deleted bool` + - `type BetaToolLocalShell struct{…}` - - `Object ThreadDeleted` + A tool that allows the model to execute shell commands in a local environment. - - `const ThreadDeletedThreadDeleted ThreadDeleted = "thread.deleted"` + - `Type LocalShell` -### Example + The type of the local shell tool. Always `local_shell`. -```go -package main + - `const LocalShellLocalShell LocalShell = "local_shell"` -import ( - "context" - "fmt" + - `type BetaFunctionShellTool struct{…}` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + A tool that allows the model to execute shell commands. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - threadDeleted, err := client.Beta.Threads.Delete(context.TODO(), "thread_id") - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", threadDeleted.ID) -} -``` + - `Type Shell` -#### Response + The type of the shell tool. Always `shell`. -```json -{ - "id": "id", - "deleted": true, - "object": "thread.deleted" -} -``` + - `const ShellShell Shell = "shell"` -## Domain Types + - `AllowedCallers []string` -### Assistant Response Format Option + The tool invocation context(s). -- `type AssistantResponseFormatOptionUnion interface{…}` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Environment BetaFunctionShellToolEnvironmentUnion` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `type BetaContainerAuto struct{…}` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `Type ContainerAuto` - - `type Auto string` + Automatically creates a container for this request - `auto` is the default value + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `const AutoAuto Auto = "auto"` + - `FileIDs []string` - - `type ResponseFormatText struct{…}` + An optional list of uploaded files to make available to your code. - Default response format. Used to generate text responses. + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `Type Text` + The memory limit for the container. - The type of response format being defined. Always `text`. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `const TextText Text = "text"` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `type ResponseFormatJSONObject struct{…}` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `Type JSONObject` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - The type of response format being defined. Always `json_object`. + Network access policy for the container. - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `type ResponseFormatJSONSchema struct{…}` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `Skills []BetaContainerAutoSkillUnion` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + An optional list of skills referenced by id or inline data. - Structured Outputs configuration options, including a JSON Schema. + - `type BetaSkillReference struct{…}` - - `Name string` + - `SkillID string` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + The ID of the referenced skill. - - `Description string` + - `Type SkillReference` - A description of what the response format is for, used by the model to - determine how to respond in the format. + References a skill created with the /v1/skills endpoint. - - `Schema map[string, any]` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `Version string` - - `Strict bool` + Optional skill version. Use a positive integer or 'latest'. Omit for default. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `type BetaInlineSkill struct{…}` - - `Type JSONSchema` + - `Description string` - The type of response format being defined. Always `json_schema`. + The description of the skill. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `Name string` -### Assistant Tool Choice + The name of the skill. -- `type AssistantToolChoice struct{…}` + - `Source BetaInlineSkillSource` - Specifies a tool the model should use. Use to force the model to call a specific tool. + Inline skill payload - - `Type AssistantToolChoiceType` + - `Data string` - The type of the tool. If type is `function`, the function name must be set + Base64-encoded skill zip bundle. - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `MediaType ApplicationZip` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + The media type of the inline skill payload. Must be `application/zip`. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `Function AssistantToolChoiceFunction` + - `Type Base64` - - `Name string` + The type of the inline skill source. Must be `base64`. - The name of the function to call. + - `const Base64Base64 Base64 = "base64"` -### Assistant Tool Choice Function + - `Type Inline` -- `type AssistantToolChoiceFunction struct{…}` + Defines an inline skill for this request. - - `Name string` + - `const InlineInline Inline = "inline"` - The name of the function to call. + - `type BetaLocalEnvironment struct{…}` -### Assistant Tool Choice Option + - `Type Local` -- `type AssistantToolChoiceOptionUnion interface{…}` + Use a local computer environment. - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `const LocalLocal Local = "local"` - - `type AssistantToolChoiceOptionAuto string` + - `Skills []BetaLocalSkill` - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + An optional list of skills. - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + - `Description string` - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + The description of the skill. - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + - `Name string` - - `type AssistantToolChoice struct{…}` + The name of the skill. - Specifies a tool the model should use. Use to force the model to call a specific tool. + - `Path string` - - `Type AssistantToolChoiceType` + The path to the directory containing the skill. - The type of the tool. If type is `function`, the function name must be set + - `type BetaContainerReference struct{…}` - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `ContainerID string` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + The ID of the referenced container. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `Type ContainerReference` - - `Function AssistantToolChoiceFunction` + References a container created with the /v1/containers endpoint - - `Name string` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - The name of the function to call. + - `type BetaCustomTool struct{…}` -### Thread + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) -- `type Thread struct{…}` + - `Name string` - Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). + The name of the custom tool, used to identify it in tool calls. - - `ID string` + - `Type Custom` - The identifier, which can be referenced in API endpoints. + The type of the custom tool. Always `custom`. - - `CreatedAt int64` + - `const CustomCustom Custom = "custom"` - The Unix timestamp (in seconds) for when the thread was created. + - `AllowedCallers []string` - - `Metadata Metadata` + The tool invocation context(s). - 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. + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - - `Object Thread` + - `DeferLoading bool` - The object type, which is always `thread`. + Whether this tool should be deferred and discovered via tool search. - - `const ThreadThread Thread = "thread"` + - `Description string` - - `ToolResources ThreadToolResources` + Optional description of the custom tool, used to provide more context. - A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + - `Format BetaCustomToolFormatUnion` - - `CodeInterpreter ThreadToolResourcesCodeInterpreter` + The input format for the custom tool. Default is unconstrained text. - - `FileIDs []string` + - `type BetaCustomToolFormatText struct{…}` - A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + Unconstrained free-form text. - - `FileSearch ThreadToolResourcesFileSearch` + - `Type Text` - - `VectorStoreIDs []string` + Unconstrained text format. Always `text`. - The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + - `const TextText Text = "text"` -### Thread Deleted + - `type BetaCustomToolFormatGrammar struct{…}` -- `type ThreadDeleted struct{…}` + A grammar defined by the user. - - `ID string` + - `Definition string` - - `Deleted bool` + The grammar definition. - - `Object ThreadDeleted` + - `Syntax string` - - `const ThreadDeletedThreadDeleted ThreadDeleted = "thread.deleted"` + The syntax of the grammar definition. One of `lark` or `regex`. -# Runs + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` -## List runs + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` -`client.Beta.Threads.Runs.List(ctx, threadID, query) (*CursorPage[Run], error)` + - `Type Grammar` -**get** `/threads/{thread_id}/runs` + Grammar format. Always `grammar`. -List runs + - `const GrammarGrammar Grammar = "grammar"` -### Parameters + - `type BetaNamespaceTool struct{…}` -- `threadID string` + Groups function/custom tools under a shared namespace. -- `query BetaThreadRunListParams` + - `Description string` - - `After param.Field[string]` + A description of the namespace shown to the model. - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + - `Name string` - - `Before param.Field[string]` + The namespace name used in tool calls (for example, `crm`). - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + - `Tools []BetaNamespaceToolToolUnion` - - `Limit param.Field[int64]` + The function/custom tools available inside this namespace. - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - `type BetaNamespaceToolToolFunction struct{…}` - - `Order param.Field[BetaThreadRunListParamsOrder]` + - `Name string` - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - `Type Function` - - `const BetaThreadRunListParamsOrderAsc BetaThreadRunListParamsOrder = "asc"` + - `const FunctionFunction Function = "function"` - - `const BetaThreadRunListParamsOrderDesc BetaThreadRunListParamsOrder = "desc"` + - `AllowedCallers []string` -### Returns + The tool invocation context(s). -- `type Run struct{…}` + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `ID string` + - `DeferLoading bool` - The identifier, which can be referenced in API endpoints. + Whether this function should be deferred and discovered via tool search. - - `AssistantID string` + - `Description string` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + - `OutputSchema map[string, any]` - - `CancelledAt int64` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - The Unix timestamp (in seconds) for when the run was cancelled. + - `Parameters any` - - `CompletedAt int64` + - `Strict bool` - The Unix timestamp (in seconds) for when the run was completed. + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `CreatedAt int64` + - `type BetaCustomTool struct{…}` - The Unix timestamp (in seconds) for when the run was created. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `ExpiresAt int64` + - `Type Namespace` - The Unix timestamp (in seconds) for when the run will expire. + The type of the tool. Always `namespace`. - - `FailedAt int64` + - `const NamespaceNamespace Namespace = "namespace"` - The Unix timestamp (in seconds) for when the run failed. + - `type BetaToolSearchTool struct{…}` - - `IncompleteDetails RunIncompleteDetails` + Hosted or BYOT tool search configuration for deferred tools. - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + - `Type ToolSearch` - - `Reason string` + The type of the tool. Always `tool_search`. - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + - `Description string` - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + Description shown to the model for a client-executed tool search tool. - - `Instructions string` + - `Execution BetaToolSearchToolExecution` - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + Whether tool search is executed by the server or by the client. - - `LastError RunLastError` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - The last error associated with this run. Will be `null` if there are no errors. + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `Code string` + - `Parameters any` - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + Parameter schema for a client-executed tool search tool. - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + - `Type BetaWebSearchPreviewToolType` - - `Message string` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - A human-readable description of the error. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `MaxCompletionTokens int64` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - The maximum number of completion tokens specified to have been used over the course of the run. + - `SearchContentTypes []string` - - `MaxPromptTokens int64` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - The maximum number of prompt tokens specified to have been used over the course of the run. + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `Metadata Metadata` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - 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. + 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. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - - `Model string` + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - `Object ThreadRun` + - `UserLocation BetaWebSearchPreviewToolUserLocation` - The object type, which is always `thread.run`. + The user's location. - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + - `Type Approximate` - - `ParallelToolCalls bool` + The type of location approximation. Always `approximate`. - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + - `const ApproximateApproximate Approximate = "approximate"` - - `RequiredAction RunRequiredAction` + - `City string` - Details on the action required to continue the run. Will be `null` if no action is required. + Free text input for the city of the user, e.g. `San Francisco`. - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `Country string` - Details on the tool outputs needed for this run to continue. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `ToolCalls []RequiredActionFunctionToolCall` + - `Region string` - A list of the relevant tool calls. + Free text input for the region of the user, e.g. `California`. - - `ID string` + - `Timezone string` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `Function RequiredActionFunctionToolCallFunction` + - `type BetaApplyPatchTool struct{…}` - The function definition. + Allows the assistant to create, delete, or update files using unified diffs. - - `Arguments string` + - `Type ApplyPatch` - The arguments that the model expects you to pass to the function. + The type of the tool. Always `apply_patch`. - - `Name string` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - The name of the function. + - `AllowedCallers []string` - - `Type Function` + The tool invocation context(s). - The type of tool call the output is required for. For now, this is always `function`. + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - - `const FunctionFunction Function = "function"` + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `Type SubmitToolOutputs` + - `Type ToolSearchOutput` - For now, this is always `submit_tool_outputs`. + The item type. Always `tool_search_output`. - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `ID string` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The unique ID of this tool search output. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + The agent that produced this item. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `AgentName string` - - `type Auto string` + The canonical name of the agent that produced this item. - `auto` is the default value + - `CallID string` - - `const AutoAuto Auto = "auto"` + The unique ID of the tool search call generated by the model. - - `type ResponseFormatText struct{…}` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - Default response format. Used to generate text responses. + Whether tool search was executed by the server or by the client. - - `Type Text` + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - The type of response format being defined. Always `text`. + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - `const TextText Text = "text"` + - `Status BetaResponseToolSearchOutputItemParamStatus` - - `type ResponseFormatJSONObject struct{…}` + The status of the tool search output. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - - `Type JSONObject` + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - The type of response format being defined. Always `json_object`. + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `type ResponseFormatJSONSchema struct{…}` + - `Role Developer` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + The role that provided the additional tools. Only `developer` is supported. - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `const DeveloperDeveloper Developer = "developer"` - Structured Outputs configuration options, including a JSON Schema. + - `Tools []BetaToolUnion` - - `Name string` + A list of additional tools made available at this item. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `type BetaFunctionTool struct{…}` - - `Description string` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `type BetaFileSearchTool struct{…}` - - `Schema map[string, any]` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `type BetaComputerTool struct{…}` - - `Strict bool` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `type BetaComputerUsePreviewTool struct{…}` - - `Type JSONSchema` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The type of response format being defined. Always `json_schema`. + - `type BetaWebSearchTool struct{…}` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `StartedAt int64` + - `type BetaToolMcp struct{…}` - The Unix timestamp (in seconds) for when the run was started. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Status any` + - `type BetaToolCodeInterpreter struct{…}` - - `ThreadID string` + A tool that runs Python code to help generate a response to a prompt. - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `ToolChoice AssistantToolChoiceOptionUnion` + - `type BetaToolImageGeneration struct{…}` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + A tool that generates images using the GPT image models. - - `type AssistantToolChoiceOptionAuto string` + - `type BetaToolLocalShell struct{…}` - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + A tool that allows the model to execute shell commands in a local environment. - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + - `type BetaFunctionShellTool struct{…}` - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + A tool that allows the model to execute shell commands. - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + - `type BetaCustomTool struct{…}` - - `type AssistantToolChoice struct{…}` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - Specifies a tool the model should use. Use to force the model to call a specific tool. + - `type BetaNamespaceTool struct{…}` - - `Type AssistantToolChoiceType` + Groups function/custom tools under a shared namespace. - The type of the tool. If type is `function`, the function name must be set + - `type BetaToolSearchTool struct{…}` - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + Hosted or BYOT tool search configuration for deferred tools. - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Function AssistantToolChoiceFunction` + - `type BetaApplyPatchTool struct{…}` - - `Name string` + Allows the assistant to create, delete, or update files using unified diffs. - The name of the function to call. + - `Type AdditionalTools` - - `Tools []any` + The item type. Always `additional_tools`. - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `TruncationStrategy RunTruncationStrategy` + - `ID string` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + The unique ID of this additional tools item. - - `Type string` + - `Agent BetaResponseInputItemAdditionalToolsAgent` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + The agent that produced this item. - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + - `AgentName string` - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + The canonical name of the agent that produced this item. - - `LastMessages int64` + - `type BetaResponseReasoningItem struct{…}` - The number of most recent messages from the thread when constructing the context for the run. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `Usage RunUsage` + - `ID string` - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + The unique identifier of the reasoning content. - - `CompletionTokens int64` + - `Summary []BetaResponseReasoningItemSummary` - Number of completion tokens used over the course of the run. + Reasoning summary content. - - `PromptTokens int64` + - `Text string` - Number of prompt tokens used over the course of the run. + A summary of the reasoning output from the model so far. - - `TotalTokens int64` + - `Type SummaryText` - Total number of tokens used (prompt + completion). + The type of the object. Always `summary_text`. - - `Temperature float64` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - The sampling temperature used for this run. If not set, defaults to 1. + - `Type Reasoning` - - `TopP float64` + The type of the object. Always `reasoning`. - The nucleus sampling value used for this run. If not set, defaults to 1. + - `const ReasoningReasoning Reasoning = "reasoning"` -### Example + - `Agent BetaResponseReasoningItemAgent` -```go -package main + The agent that produced this item. -import ( - "context" - "fmt" + - `AgentName string` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + The canonical name of the agent that produced this item. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - page, err := client.Beta.Threads.Runs.List( - context.TODO(), - "thread_id", - openai.BetaThreadRunListParams{ + - `Content []BetaResponseReasoningItemContent` - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", page) -} -``` + Reasoning text content. -#### Response + - `Text string` -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": {}, - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - {} - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 - } - ], - "first_id": "run_abc123", - "has_more": false, - "last_id": "run_abc456", - "object": "list" -} -``` + The reasoning text from the model. -## Create run + - `Type ReasoningText` -`client.Beta.Threads.Runs.New(ctx, threadID, params) (*Run, error)` + The type of the reasoning text. Always `reasoning_text`. -**post** `/threads/{thread_id}/runs` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` -Create run + - `EncryptedContent string` -### Parameters + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. -- `threadID string` + - `Status BetaResponseReasoningItemStatus` -- `params BetaThreadRunNewParams` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `AssistantID param.Field[string]` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - Body param: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `Include param.Field[[]RunStepInclude]` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - Query param: A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + - `type BetaResponseCompactionItemParamResp struct{…}` - See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `const RunStepIncludeStepDetailsToolCallsFileSearchResultsContent RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` + - `EncryptedContent string` - - `AdditionalInstructions param.Field[string]` + The encrypted content of the compaction summary. - Body param: Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. + - `Type Compaction` - - `AdditionalMessages param.Field[[]BetaThreadRunNewParamsAdditionalMessage]` + The type of the item. Always `compaction`. - Body param: Adds additional messages to the thread before creating the run. + - `const CompactionCompaction Compaction = "compaction"` - - `Content BetaThreadRunNewParamsAdditionalMessageContentUnion` + - `ID string` - The text contents of the message. + The ID of the compaction item. - - `string` + - `Agent BetaResponseCompactionItemParamAgentResp` - - `[]MessageContentPartParamUnion` + The agent that produced this item. - - `type ImageFileContentBlockParam struct{…}` + - `AgentName string` - References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + The canonical name of the agent that produced this item. - - `ImageFile ImageFile` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - - `FileID string` + An image generation request made by the model. - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + - `ID string` - - `Detail ImageFileDetail` + The unique ID of the image generation call. - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + - `Result string` - - `const ImageFileDetailAuto ImageFileDetail = "auto"` + The generated image encoded in base64. - - `const ImageFileDetailLow ImageFileDetail = "low"` + - `Status string` - - `const ImageFileDetailHigh ImageFileDetail = "high"` + The status of the image generation call. - - `Type ImageFile` + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - Always `image_file`. + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - `const ImageFileImageFile ImageFile = "image_file"` + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - - `type ImageURLContentBlockParam struct{…}` + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - References an image URL in the content of a message. + - `Type ImageGenerationCall` - - `ImageURL ImageURL` + The type of the image generation call. Always `image_generation_call`. - - `URL string` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + - `Agent BetaResponseInputItemImageGenerationCallAgent` - - `Detail ImageURLDetail` + The agent that produced this item. - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` + - `AgentName string` - - `const ImageURLDetailAuto ImageURLDetail = "auto"` + The canonical name of the agent that produced this item. - - `const ImageURLDetailLow ImageURLDetail = "low"` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const ImageURLDetailHigh ImageURLDetail = "high"` + A tool call to run code. - - `Type ImageURL` + - `ID string` - The type of the content part. + The unique ID of the code interpreter tool call. - - `const ImageURLImageURL ImageURL = "image_url"` + - `Code string` - - `type TextContentBlockParam struct{…}` + The code to run, or null if not available. - The text content that is part of a message. + - `ContainerID string` - - `Text string` + The ID of the container used to run the code. - Text content to be sent to the model + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `Type Text` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - Always `text`. + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `const TextText Text = "text"` + The logs output from the code interpreter. - - `Role string` + - `Logs string` - The role of the entity that is creating the message. Allowed values include: + The logs output from the code interpreter. - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. + - `Type Logs` - - `const BetaThreadRunNewParamsAdditionalMessageRoleUser BetaThreadRunNewParamsAdditionalMessageRole = "user"` + The type of the output. Always `logs`. - - `const BetaThreadRunNewParamsAdditionalMessageRoleAssistant BetaThreadRunNewParamsAdditionalMessageRole = "assistant"` + - `const LogsLogs Logs = "logs"` - - `Attachments []BetaThreadRunNewParamsAdditionalMessageAttachment` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - A list of files attached to the message, and the tools they should be added to. + The image output from the code interpreter. - - `FileID string` + - `Type Image` - The ID of the file to attach to the message. + The type of the output. Always `image`. - - `Tools []BetaThreadRunNewParamsAdditionalMessageAttachmentToolUnion` + - `const ImageImage Image = "image"` - The tools to add this file to. + - `URL string` - - `type CodeInterpreterTool struct{…}` + The URL of the image output from the code interpreter. - - `Type CodeInterpreter` + - `Status BetaResponseCodeInterpreterToolCallStatus` - The type of tool being defined: `code_interpreter` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `BetaThreadRunNewParamsAdditionalMessageAttachmentToolFileSearch` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - `Type FileSearch` + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - The type of tool being defined: `file_search` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `Metadata Metadata` + - `Type CodeInterpreterCall` - 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. + The type of the code interpreter tool call. Always `code_interpreter_call`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - `Instructions param.Field[string]` + - `Agent BetaResponseCodeInterpreterToolCallAgent` - Body param: Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. + The agent that produced this item. - - `MaxCompletionTokens param.Field[int64]` + - `AgentName string` - Body param: The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + The canonical name of the agent that produced this item. - - `MaxPromptTokens param.Field[int64]` + - `type BetaResponseInputItemLocalShellCall struct{…}` - Body param: The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + A tool call to run a command on the local shell. - - `Metadata param.Field[Metadata]` + - `ID string` - Body param: 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. + The unique ID of the local shell call. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Action BetaResponseInputItemLocalShellCallAction` - - `Model param.Field[ChatModel]` + Execute a shell command on the server. - Body param: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + - `Command []string` - - `string` + The command to run. - - `type ChatModel string` + - `Env map[string, string]` - - `const ChatModelGPT5_6Sol ChatModel = "gpt-5.6-sol"` + Environment variables to set for the command. - - `const ChatModelGPT5_6Terra ChatModel = "gpt-5.6-terra"` + - `Type Exec` - - `const ChatModelGPT5_6Luna ChatModel = "gpt-5.6-luna"` + The type of the local shell action. Always `exec`. - - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"` + - `const ExecExec Exec = "exec"` - - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"` + - `TimeoutMs int64` - - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"` + Optional timeout in milliseconds for the command. - - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"` + - `User string` - - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"` + Optional user to run the command as. - - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"` + - `WorkingDirectory string` - - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"` + Optional working directory to run the command in. - - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"` + - `CallID string` - - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"` + The unique ID of the local shell tool call generated by the model. - - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"` + - `Status string` - - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"` + The status of the local shell call. - - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"` + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"` + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"` + - `Type LocalShellCall` - - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"` + The type of the local shell call. Always `local_shell_call`. - - `const ChatModelGPT5 ChatModel = "gpt-5"` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"` + - `Agent BetaResponseInputItemLocalShellCallAgent` - - `const ChatModelGPT5Nano ChatModel = "gpt-5-nano"` + The agent that produced this item. - - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"` + - `AgentName string` - - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"` + The canonical name of the agent that produced this item. - - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"` + The output of a local shell tool call. - - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"` + - `ID string` - - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"` + The unique ID of the local shell tool call generated by the model. - - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"` + - `Output string` - - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"` + A JSON string of the output of the local shell tool call. - - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"` + - `Type LocalShellCallOutput` - - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"` + The type of the local shell tool call output. Always `local_shell_call_output`. - - `const ChatModelO4Mini ChatModel = "o4-mini"` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"` + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - - `const ChatModelO3 ChatModel = "o3"` + The agent that produced this item. - - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"` + - `AgentName string` - - `const ChatModelO3Mini ChatModel = "o3-mini"` + The canonical name of the agent that produced this item. - - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"` + - `Status string` - - `const ChatModelO1 ChatModel = "o1"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"` + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - - `const ChatModelO1Preview ChatModel = "o1-preview"` + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"` + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - - `const ChatModelO1Mini ChatModel = "o1-mini"` + - `type BetaResponseInputItemShellCall struct{…}` - - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"` + A tool representing a request to execute one or more shell commands. - - `const ChatModelGPT4o ChatModel = "gpt-4o"` + - `Action BetaResponseInputItemShellCallAction` - - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"` + The shell commands and limits that describe how to run the tool call. - - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"` + - `Commands []string` - - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"` + Ordered shell commands for the execution environment to run. - - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"` + - `MaxOutputLength int64` - - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"` + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"` + - `TimeoutMs int64` - - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"` + - `CallID string` - - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"` + The unique ID of the shell tool call generated by the model. - - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"` + - `Type ShellCall` - - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"` + The type of the item. Always `shell_call`. - - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"` + - `const ShellCallShellCall ShellCall = "shell_call"` - - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `ID string` - - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"` + The unique ID of the shell tool call. Populated when this item is returned via API. - - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"` + - `Agent BetaResponseInputItemShellCallAgent` - - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"` + The agent that produced this item. - - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"` + - `AgentName string` - - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"` + The canonical name of the agent that produced this item. - - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"` + - `Caller BetaResponseInputItemShellCallCallerUnion` - - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"` + The execution context that produced this tool call. - - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"` + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"` + - `Type Direct` - - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"` + The caller type. Always `direct`. - - `const ChatModelGPT4 ChatModel = "gpt-4"` + - `const DirectDirect Direct = "direct"` - - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"` + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"` + - `CallerID string` - - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"` + The call ID of the program item that produced this tool call. - - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"` + - `Type Program` - - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"` + The caller type. Always `program`. - - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"` + - `const ProgramProgram Program = "program"` - - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"` + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"` + The environment to execute the shell commands in. - - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"` + - `type BetaLocalEnvironment struct{…}` - - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"` + - `type BetaContainerReference struct{…}` - - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"` + - `Status string` - - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `ParallelToolCalls param.Field[bool]` + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - Body param: Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - - `ReasoningEffort param.Field[ReasoningEffort]` + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - Body param: Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `ResponseFormat param.Field[AssistantResponseFormatOptionUnion]` + The streamed output items emitted by a shell tool call. - Body param: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `CallID string` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The unique ID of the shell tool call generated by the model. - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `Output []BetaResponseFunctionShellCallOutputContent` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - `Temperature param.Field[float64]` + The exit or timeout outcome associated with this shell call. - Body param: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - - `ToolChoice param.Field[AssistantToolChoiceOptionUnion]` + Indicates that the shell call exceeded its configured time limit. - Body param: Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `Type Timeout` - - `Tools param.Field[[]any]` + The outcome type. Always `timeout`. - Body param: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + - `const TimeoutTimeout Timeout = "timeout"` - - `TopP param.Field[float64]` + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - Body param: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + Indicates that the shell commands finished and returned an exit code. - We generally recommend altering this or temperature but not both. + - `ExitCode int64` - - `TruncationStrategy param.Field[BetaThreadRunNewParamsTruncationStrategy]` + The exit code returned by the shell process. - Body param: Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + - `Type Exit` - - `Type string` + The outcome type. Always `exit`. - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + - `const ExitExit Exit = "exit"` - - `const BetaThreadRunNewParamsTruncationStrategyTypeAuto BetaThreadRunNewParamsTruncationStrategyType = "auto"` + - `Stderr string` - - `const BetaThreadRunNewParamsTruncationStrategyTypeLastMessages BetaThreadRunNewParamsTruncationStrategyType = "last_messages"` + Captured stderr output for the shell call. - - `LastMessages int64` + - `Stdout string` - The number of most recent messages from the thread when constructing the context for the run. + Captured stdout output for the shell call. -### Returns + - `Type ShellCallOutput` -- `type Run struct{…}` + The type of the item. Always `shell_call_output`. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - `ID string` - The identifier, which can be referenced in API endpoints. + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `AssistantID string` + - `Agent BetaResponseInputItemShellCallOutputAgent` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + The agent that produced this item. - - `CancelledAt int64` + - `AgentName string` - The Unix timestamp (in seconds) for when the run was cancelled. + The canonical name of the agent that produced this item. - - `CompletedAt int64` + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - The Unix timestamp (in seconds) for when the run was completed. + The execution context that produced this tool call. - - `CreatedAt int64` + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - The Unix timestamp (in seconds) for when the run was created. + - `Type Direct` - - `ExpiresAt int64` + The caller type. Always `direct`. - The Unix timestamp (in seconds) for when the run will expire. + - `const DirectDirect Direct = "direct"` - - `FailedAt int64` + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - The Unix timestamp (in seconds) for when the run failed. + - `CallerID string` - - `IncompleteDetails RunIncompleteDetails` + The call ID of the program item that produced this tool call. - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + - `Type Program` - - `Reason string` + The caller type. Always `program`. - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + - `const ProgramProgram Program = "program"` - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + - `MaxOutputLength int64` - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `Instructions string` + - `Status string` - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + The status of the shell call output. - - `LastError RunLastError` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - The last error associated with this run. Will be `null` if there are no errors. + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - - `Code string` + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + - `type BetaResponseInputItemApplyPatchCall struct{…}` - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + A tool call representing a request to create, delete, or update files using diff patches. - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + - `CallID string` - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + The unique ID of the apply patch tool call generated by the model. - - `Message string` + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - A human-readable description of the error. + The specific create, delete, or update instruction for the apply_patch tool call. - - `MaxCompletionTokens int64` + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - The maximum number of completion tokens specified to have been used over the course of the run. + Instruction for creating a new file via the apply_patch tool. - - `MaxPromptTokens int64` + - `Diff string` - The maximum number of prompt tokens specified to have been used over the course of the run. + Unified diff content to apply when creating the file. - - `Metadata Metadata` + - `Path string` - 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. + Path of the file to create relative to the workspace root. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Type CreateFile` - - `Model string` + The operation type. Always `create_file`. - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `Object ThreadRun` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - The object type, which is always `thread.run`. + Instruction for deleting an existing file via the apply_patch tool. - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + - `Path string` - - `ParallelToolCalls bool` + Path of the file to delete relative to the workspace root. - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + - `Type DeleteFile` - - `RequiredAction RunRequiredAction` + The operation type. Always `delete_file`. - Details on the action required to continue the run. Will be `null` if no action is required. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - Details on the tool outputs needed for this run to continue. + Instruction for updating an existing file via the apply_patch tool. - - `ToolCalls []RequiredActionFunctionToolCall` + - `Diff string` - A list of the relevant tool calls. + Unified diff content to apply to the existing file. - - `ID string` + - `Path string` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + Path of the file to update relative to the workspace root. - - `Function RequiredActionFunctionToolCallFunction` + - `Type UpdateFile` - The function definition. + The operation type. Always `update_file`. - - `Arguments string` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - The arguments that the model expects you to pass to the function. + - `Status string` - - `Name string` + The status of the apply patch tool call. One of `in_progress` or `completed`. - The name of the function. + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `Type Function` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - The type of tool call the output is required for. For now, this is always `function`. + - `Type ApplyPatchCall` - - `const FunctionFunction Function = "function"` + The type of the item. Always `apply_patch_call`. - - `Type SubmitToolOutputs` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - For now, this is always `submit_tool_outputs`. + - `ID string` - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `Agent BetaResponseInputItemApplyPatchCallAgent` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The agent that produced this item. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `AgentName string` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + The canonical name of the agent that produced this item. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - - `type Auto string` + The execution context that produced this tool call. - `auto` is the default value + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - - `const AutoAuto Auto = "auto"` + - `Type Direct` - - `type ResponseFormatText struct{…}` + The caller type. Always `direct`. - Default response format. Used to generate text responses. + - `const DirectDirect Direct = "direct"` - - `Type Text` + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - The type of response format being defined. Always `text`. + - `CallerID string` - - `const TextText Text = "text"` + The call ID of the program item that produced this tool call. - - `type ResponseFormatJSONObject struct{…}` + - `Type Program` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + The caller type. Always `program`. - - `Type JSONObject` + - `const ProgramProgram Program = "program"` - The type of response format being defined. Always `json_object`. + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The streamed output emitted by an apply patch tool call. - - `type ResponseFormatJSONSchema struct{…}` + - `CallID string` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + The unique ID of the apply patch tool call generated by the model. - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `Status string` - Structured Outputs configuration options, including a JSON Schema. + The status of the apply patch tool call output. One of `completed` or `failed`. - - `Name string` + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - - `Description string` + - `Type ApplyPatchCallOutput` - A description of what the response format is for, used by the model to - determine how to respond in the format. + The type of the item. Always `apply_patch_call_output`. - - `Schema map[string, any]` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `ID string` - - `Strict bool` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - - `Type JSONSchema` + The agent that produced this item. - The type of response format being defined. Always `json_schema`. + - `AgentName string` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The canonical name of the agent that produced this item. - - `StartedAt int64` + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - The Unix timestamp (in seconds) for when the run was started. + The execution context that produced this tool call. - - `Status any` + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - - `ThreadID string` + - `Type Direct` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + The caller type. Always `direct`. - - `ToolChoice AssistantToolChoiceOptionUnion` + - `const DirectDirect Direct = "direct"` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - - `type AssistantToolChoiceOptionAuto string` + - `CallerID string` - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + The call ID of the program item that produced this tool call. - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + - `Type Program` - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + The caller type. Always `program`. - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + - `const ProgramProgram Program = "program"` - - `type AssistantToolChoice struct{…}` + - `Output string` - Specifies a tool the model should use. Use to force the model to call a specific tool. + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - `Type AssistantToolChoiceType` + - `type BetaResponseInputItemMcpListTools struct{…}` - The type of the tool. If type is `function`, the function name must be set + A list of tools available on an MCP server. - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `ID string` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + The unique ID of the list. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `ServerLabel string` - - `Function AssistantToolChoiceFunction` + The label of the MCP server. + + - `Tools []BetaResponseInputItemMcpListToolsTool` + + The tools available on the server. + + - `InputSchema any` + + The JSON schema describing the tool's input. - `Name string` - The name of the function to call. + The name of the tool. - - `Tools []any` + - `Annotations any` - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + Additional annotations about the tool. - - `TruncationStrategy RunTruncationStrategy` + - `Description string` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + The description of the tool. - - `Type string` + - `Type McpListTools` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + The type of the item. Always `mcp_list_tools`. - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + - `Agent BetaResponseInputItemMcpListToolsAgent` - - `LastMessages int64` + The agent that produced this item. - The number of most recent messages from the thread when constructing the context for the run. + - `AgentName string` - - `Usage RunUsage` + The canonical name of the agent that produced this item. - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + - `Error string` - - `CompletionTokens int64` + Error message if the server could not list tools. - Number of completion tokens used over the course of the run. + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - - `PromptTokens int64` + A request for human approval of a tool invocation. - Number of prompt tokens used over the course of the run. + - `ID string` - - `TotalTokens int64` + The unique ID of the approval request. - Total number of tokens used (prompt + completion). + - `Arguments string` - - `Temperature float64` + A JSON string of arguments for the tool. - The sampling temperature used for this run. If not set, defaults to 1. + - `Name string` - - `TopP float64` + The name of the tool to run. - The nucleus sampling value used for this run. If not set, defaults to 1. + - `ServerLabel string` -### Example + The label of the MCP server making the request. -```go -package main + - `Type McpApprovalRequest` -import ( - "context" - "fmt" + The type of the item. Always `mcp_approval_request`. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - run, err := client.Beta.Threads.Runs.New( - context.TODO(), - "thread_id", - openai.BetaThreadRunNewParams{ - AssistantID: "assistant_id", - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", run.ID) -} -``` + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` -#### Response + The agent that produced this item. -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": {}, - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - {} - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` + - `AgentName string` -## Retrieve run + The canonical name of the agent that produced this item. -`client.Beta.Threads.Runs.Get(ctx, threadID, runID) (*Run, error)` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` -**get** `/threads/{thread_id}/runs/{run_id}` + A response to an MCP approval request. -Retrieve run + - `ApprovalRequestID string` -### Parameters + The ID of the approval request being answered. -- `threadID string` + - `Approve bool` -- `runID string` + Whether the request was approved. -### Returns + - `Type McpApprovalResponse` -- `type Run struct{…}` + The type of the item. Always `mcp_approval_response`. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - `ID string` - The identifier, which can be referenced in API endpoints. + The unique ID of the approval response - - `AssistantID string` + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + The agent that produced this item. - - `CancelledAt int64` + - `AgentName string` - The Unix timestamp (in seconds) for when the run was cancelled. + The canonical name of the agent that produced this item. - - `CompletedAt int64` + - `Reason string` - The Unix timestamp (in seconds) for when the run was completed. + Optional reason for the decision. - - `CreatedAt int64` + - `type BetaResponseInputItemMcpCall struct{…}` - The Unix timestamp (in seconds) for when the run was created. + An invocation of a tool on an MCP server. - - `ExpiresAt int64` + - `ID string` - The Unix timestamp (in seconds) for when the run will expire. + The unique ID of the tool call. - - `FailedAt int64` + - `Arguments string` - The Unix timestamp (in seconds) for when the run failed. + A JSON string of the arguments passed to the tool. - - `IncompleteDetails RunIncompleteDetails` + - `Name string` - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + The name of the tool that was run. - - `Reason string` + - `ServerLabel string` - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + The label of the MCP server running the tool. - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + - `Type McpCall` - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + The type of the item. Always `mcp_call`. - - `Instructions string` + - `const McpCallMcpCall McpCall = "mcp_call"` - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `Agent BetaResponseInputItemMcpCallAgent` - - `LastError RunLastError` + The agent that produced this item. - The last error associated with this run. Will be `null` if there are no errors. + - `AgentName string` - - `Code string` + The canonical name of the agent that produced this item. - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + - `ApprovalRequestID string` - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + 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. - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + - `Error string` - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + The error from the tool call, if any. - - `Message string` + - `Output string` - A human-readable description of the error. + The output from the tool call. - - `MaxCompletionTokens int64` + - `Status string` - The maximum number of completion tokens specified to have been used over the course of the run. + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `MaxPromptTokens int64` + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - The maximum number of prompt tokens specified to have been used over the course of the run. + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - `Metadata Metadata` + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - 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. + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `Model string` + - `type BetaResponseCustomToolCallOutput struct{…}` - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + The output of a custom tool call from your code, being sent back to the model. - - `Object ThreadRun` + - `CallID string` - The object type, which is always `thread.run`. + The call ID, used to map this custom tool call output to a custom tool call. - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + - `Output BetaResponseCustomToolCallOutputOutputUnion` - - `ParallelToolCalls bool` + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + - `string` - - `RequiredAction RunRequiredAction` + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - Details on the action required to continue the run. Will be `null` if no action is required. + Text, image, or file output of the custom tool call. - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `type BetaResponseInputText struct{…}` - Details on the tool outputs needed for this run to continue. + A text input to the model. - - `ToolCalls []RequiredActionFunctionToolCall` + - `type BetaResponseInputImage struct{…}` - A list of the relevant tool calls. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `ID string` + - `type BetaResponseInputFile struct{…}` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + A file input to the model. - - `Function RequiredActionFunctionToolCallFunction` + - `Type CustomToolCallOutput` - The function definition. + The type of the custom tool call output. Always `custom_tool_call_output`. - - `Arguments string` + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - The arguments that the model expects you to pass to the function. + - `ID string` - - `Name string` + The unique ID of the custom tool call output in the OpenAI platform. - The name of the function. + - `Agent BetaResponseCustomToolCallOutputAgent` - - `Type Function` + The agent that produced this item. - The type of tool call the output is required for. For now, this is always `function`. + - `AgentName string` - - `const FunctionFunction Function = "function"` + The canonical name of the agent that produced this item. - - `Type SubmitToolOutputs` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - For now, this is always `submit_tool_outputs`. + The execution context that produced this tool call. - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `Type Direct` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The caller type. Always `direct`. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const DirectDirect Direct = "direct"` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `CallerID string` - - `type Auto string` + The call ID of the program item that produced this tool call. - `auto` is the default value + - `Type Program` - - `const AutoAuto Auto = "auto"` + The caller type. Always `program`. - - `type ResponseFormatText struct{…}` + - `const ProgramProgram Program = "program"` - Default response format. Used to generate text responses. + - `type BetaResponseCustomToolCall struct{…}` - - `Type Text` + A call to a custom tool created by the model. - The type of response format being defined. Always `text`. + - `CallID string` - - `const TextText Text = "text"` + An identifier used to map this custom tool call to a tool call output. - - `type ResponseFormatJSONObject struct{…}` + - `Input string` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + The input for the custom tool call generated by the model. - - `Type JSONObject` + - `Name string` - The type of response format being defined. Always `json_object`. + The name of the custom tool being called. - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `Type CustomToolCall` - - `type ResponseFormatJSONSchema struct{…}` + The type of the custom tool call. Always `custom_tool_call`. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `ID string` - Structured Outputs configuration options, including a JSON Schema. + The unique ID of the custom tool call in the OpenAI platform. - - `Name string` + - `Agent BetaResponseCustomToolCallAgent` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + The agent that produced this item. - - `Description string` + - `AgentName string` - A description of what the response format is for, used by the model to - determine how to respond in the format. + The canonical name of the agent that produced this item. - - `Schema map[string, any]` + - `Caller BetaResponseCustomToolCallCallerUnion` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + The execution context that produced this tool call. - - `Strict bool` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Type Direct` - - `Type JSONSchema` + - `const DirectDirect Direct = "direct"` - The type of response format being defined. Always `json_schema`. + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `CallerID string` - - `StartedAt int64` + The call ID of the program item that produced this tool call. - The Unix timestamp (in seconds) for when the run was started. + - `Type Program` - - `Status any` + - `const ProgramProgram Program = "program"` - - `ThreadID string` + - `Namespace string` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + The namespace of the custom tool being called. - - `ToolChoice AssistantToolChoiceOptionUnion` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + Compacts the current context. Must be the final input item. - - `type AssistantToolChoiceOptionAuto string` + - `Type CompactionTrigger` - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + The type of the item. Always `compaction_trigger`. - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + The agent that produced this item. - - `type AssistantToolChoice struct{…}` + - `AgentName string` - Specifies a tool the model should use. Use to force the model to call a specific tool. + The canonical name of the agent that produced this item. - - `Type AssistantToolChoiceType` + - `type BetaResponseInputItemItemReference struct{…}` - The type of the tool. If type is `function`, the function name must be set + An internal identifier for an item to reference. - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `ID string` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + The ID of the item to reference. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `Agent BetaResponseInputItemItemReferenceAgent` - - `Function AssistantToolChoiceFunction` + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the function to call. + The canonical name of the agent that produced this item. - - `Tools []any` + - `Type string` - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + The type of item to reference. Always `item_reference`. - - `TruncationStrategy RunTruncationStrategy` + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + - `type BetaResponseInputItemProgram struct{…}` - - `Type string` + - `ID string` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + The unique ID of this program item. - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + - `CallID string` - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + The stable call ID of the program item. - - `LastMessages int64` + - `Code string` - The number of most recent messages from the thread when constructing the context for the run. + The JavaScript source executed by programmatic tool calling. - - `Usage RunUsage` + - `Fingerprint string` - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + Opaque program replay fingerprint that must be round-tripped. - - `CompletionTokens int64` + - `Type Program` - Number of completion tokens used over the course of the run. + The item type. Always `program`. - - `PromptTokens int64` + - `const ProgramProgram Program = "program"` - Number of prompt tokens used over the course of the run. + - `Agent BetaResponseInputItemProgramAgent` - - `TotalTokens int64` + The agent that produced this item. - Total number of tokens used (prompt + completion). + - `AgentName string` - - `Temperature float64` + The canonical name of the agent that produced this item. - The sampling temperature used for this run. If not set, defaults to 1. + - `type BetaResponseInputItemProgramOutput struct{…}` - - `TopP float64` + - `ID string` - The nucleus sampling value used for this run. If not set, defaults to 1. + The unique ID of this program output item. -### Example + - `CallID string` -```go -package main + The call ID of the program item. -import ( - "context" - "fmt" + - `Result string` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + The result produced by the program item. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - run, err := client.Beta.Threads.Runs.Get( - context.TODO(), - "thread_id", - "run_id", - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", run.ID) -} -``` + - `Status string` -#### Response + The terminal status of the program output. -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": {}, - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - {} - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` -## Modify run + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` -`client.Beta.Threads.Runs.Update(ctx, threadID, runID, body) (*Run, error)` + - `Type ProgramOutput` -**post** `/threads/{thread_id}/runs/{run_id}` + The item type. Always `program_output`. -Modify run + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` -### Parameters + - `Agent BetaResponseInputItemProgramOutputAgent` -- `threadID string` + The agent that produced this item. -- `runID string` + - `AgentName string` -- `body BetaThreadRunUpdateParams` + The canonical name of the agent that produced this item. - - `Metadata param.Field[Metadata]` + - `Metadata map[string, string]` 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 @@ -9649,2831 +8539,2535 @@ Modify run Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. -### Returns + - `Model BetaResponseModel` -- `type Run struct{…}` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `type BetaResponseModel string` - - `ID string` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - The identifier, which can be referenced in API endpoints. + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - - `AssistantID string` + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - - `CancelledAt int64` + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - The Unix timestamp (in seconds) for when the run was cancelled. + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - - `CompletedAt int64` + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - The Unix timestamp (in seconds) for when the run was completed. + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - - `CreatedAt int64` + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - The Unix timestamp (in seconds) for when the run was created. + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - - `ExpiresAt int64` + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - The Unix timestamp (in seconds) for when the run will expire. + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - - `FailedAt int64` + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - The Unix timestamp (in seconds) for when the run failed. + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - - `IncompleteDetails RunIncompleteDetails` + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - - `Reason string` + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - - `Instructions string` + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - - `LastError RunLastError` + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - The last error associated with this run. Will be `null` if there are no errors. + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - - `Code string` + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - - `Message string` + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - A human-readable description of the error. + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - - `MaxCompletionTokens int64` + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - The maximum number of completion tokens specified to have been used over the course of the run. + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - - `MaxPromptTokens int64` + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - The maximum number of prompt tokens specified to have been used over the course of the run. + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - - `Metadata Metadata` + - `const BetaResponseModelO3 BetaResponseModel = "o3"` - 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. + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - - `Model string` + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const BetaResponseModelO1 BetaResponseModel = "o1"` - - `Object ThreadRun` + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - The object type, which is always `thread.run`. + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - - `ParallelToolCalls bool` + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - `RequiredAction RunRequiredAction` + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - Details on the action required to continue the run. Will be `null` if no action is required. + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - Details on the tool outputs needed for this run to continue. + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - - `ToolCalls []RequiredActionFunctionToolCall` + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - A list of the relevant tool calls. + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - - `ID string` + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - - `Function RequiredActionFunctionToolCallFunction` + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - The function definition. + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - `Arguments string` + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - The arguments that the model expects you to pass to the function. + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - - `Name string` + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - The name of the function. + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `Type Function` + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - The type of tool call the output is required for. For now, this is always `function`. + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - - `const FunctionFunction Function = "function"` + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` - - `Type SubmitToolOutputs` + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` - For now, this is always `submit_tool_outputs`. + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - - `type Auto string` + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - `auto` is the default value + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - - `const AutoAuto Auto = "auto"` + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - - `type ResponseFormatText struct{…}` + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - Default response format. Used to generate text responses. + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - - `Type Text` + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - The type of response format being defined. Always `text`. + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - - `const TextText Text = "text"` + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - - `type ResponseFormatJSONObject struct{…}` + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - - `Type JSONObject` + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - The type of response format being defined. Always `json_object`. + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - - `type ResponseFormatJSONSchema struct{…}` + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - Structured Outputs configuration options, including a JSON Schema. + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - - `Name string` + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - - `Description string` + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - - `Schema map[string, any]` + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - - `Strict bool` + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - - `Type JSONSchema` + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - The type of response format being defined. Always `json_schema`. + - `string` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `Object Response` - - `StartedAt int64` + The object type of this resource - always set to `response`. - The Unix timestamp (in seconds) for when the run was started. + - `const ResponseResponse Response = "response"` - - `Status any` + - `Output []BetaResponseOutputItemUnion` - - `ThreadID string` + An array of content items generated by the model. - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - - `ToolChoice AssistantToolChoiceOptionUnion` + - `type BetaResponseOutputMessage struct{…}` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + An output message from the model. - - `type AssistantToolChoiceOptionAuto string` + - `type BetaResponseFileSearchToolCall struct{…}` - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + - `type BetaResponseFunctionToolCall struct{…}` - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `type AssistantToolChoice struct{…}` + - `ID string` - Specifies a tool the model should use. Use to force the model to call a specific tool. + The unique ID of the function call tool output. - - `Type AssistantToolChoiceType` + - `CallID string` - The type of the tool. If type is `function`, the function name must be set + The unique ID of the function tool call generated by the model. - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + The output from the function call generated by your code. + Can be a string or an list of output content. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `string` - - `Function AssistantToolChoiceFunction` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - - `Name string` + Text, image, or file output of the function call. - The name of the function to call. + - `type BetaResponseInputText struct{…}` - - `Tools []any` + A text input to the model. - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `type BetaResponseInputImage struct{…}` - - `TruncationStrategy RunTruncationStrategy` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + - `type BetaResponseInputFile struct{…}` - - `Type string` + A file input to the model. - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + - `Status BetaResponseFunctionToolCallOutputItemStatus` - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `LastMessages int64` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - The number of most recent messages from the thread when constructing the context for the run. + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `Usage RunUsage` + - `Type FunctionCallOutput` - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + The type of the function tool call output. Always `function_call_output`. - - `CompletionTokens int64` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - Number of completion tokens used over the course of the run. + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - - `PromptTokens int64` + The agent that produced this item. - Number of prompt tokens used over the course of the run. + - `AgentName string` - - `TotalTokens int64` + The canonical name of the agent that produced this item. - Total number of tokens used (prompt + completion). + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - `Temperature float64` + The execution context that produced this tool call. - The sampling temperature used for this run. If not set, defaults to 1. + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - `TopP float64` + - `Type Direct` - The nucleus sampling value used for this run. If not set, defaults to 1. + The caller type. Always `direct`. -### Example + - `const DirectDirect Direct = "direct"` -```go -package main + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` -import ( - "context" - "fmt" + - `CallerID string` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + The call ID of the program item that produced this tool call. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - run, err := client.Beta.Threads.Runs.Update( - context.TODO(), - "thread_id", - "run_id", - openai.BetaThreadRunUpdateParams{ + - `Type Program` - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", run.ID) -} -``` + The caller type. Always `program`. -#### Response + - `const ProgramProgram Program = "program"` -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": {}, - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - {} - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` - -## Submit tool outputs to run + - `CreatedBy string` -`client.Beta.Threads.Runs.SubmitToolOutputs(ctx, threadID, runID, body) (*Run, error)` + The identifier of the actor that created the item. -**post** `/threads/{thread_id}/runs/{run_id}/submit_tool_outputs` + - `type BetaResponseOutputItemAgentMessage struct{…}` -Submit tool outputs to run + - `ID string` -### Parameters + The unique ID of the agent message. -- `threadID string` + - `Author string` -- `runID string` + The sending agent identity. -- `body BetaThreadRunSubmitToolOutputsParams` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - - `ToolOutputs param.Field[[]BetaThreadRunSubmitToolOutputsParamsToolOutput]` + Encrypted content sent between agents. - A list of tools for which the outputs are being submitted. + - `type BetaResponseInputText struct{…}` - - `Output string` + A text input to the model. - The output of the tool call to be submitted to continue the run. + - `type BetaResponseOutputText struct{…}` - - `ToolCallID string` + A text output from the model. - The ID of the tool call in the `required_action` object within the run object the output is being submitted for. + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - - `` + A text content. -### Returns + - `Text string` -- `type Run struct{…}` + - `Type Text` - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `const TextText Text = "text"` - - `ID string` + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - The identifier, which can be referenced in API endpoints. + A summary text from the model. - - `AssistantID string` + - `Text string` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + A summary of the reasoning output from the model so far. - - `CancelledAt int64` + - `Type SummaryText` - The Unix timestamp (in seconds) for when the run was cancelled. + The type of the object. Always `summary_text`. - - `CompletedAt int64` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - The Unix timestamp (in seconds) for when the run was completed. + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - - `CreatedAt int64` + Reasoning text from the model. - The Unix timestamp (in seconds) for when the run was created. + - `Text string` - - `ExpiresAt int64` + The reasoning text from the model. - The Unix timestamp (in seconds) for when the run will expire. + - `Type ReasoningText` - - `FailedAt int64` + The type of the reasoning text. Always `reasoning_text`. - The Unix timestamp (in seconds) for when the run failed. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `IncompleteDetails RunIncompleteDetails` + - `type BetaResponseOutputRefusal struct{…}` - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + A refusal from the model. - - `Reason string` + - `type BetaResponseInputImage struct{…}` - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + A screenshot of a computer. - - `Instructions string` + - `Detail string` - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `LastError RunLastError` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - The last error associated with this run. Will be `null` if there are no errors. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - - `Code string` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + - `FileID string` - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + The identifier of an uploaded file that contains the screenshot. - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + - `ImageURL string` - - `Message string` + The URL of the screenshot image. - A human-readable description of the error. + - `Type ComputerScreenshot` - - `MaxCompletionTokens int64` + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - The maximum number of completion tokens specified to have been used over the course of the run. + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `MaxPromptTokens int64` + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - The maximum number of prompt tokens specified to have been used over the course of the run. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Metadata Metadata` + - `Mode Explicit` - 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. + The breakpoint mode. Always `explicit`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const ExplicitExplicit Explicit = "explicit"` - - `Model string` + - `type BetaResponseInputFile struct{…}` - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + A file input to the model. - - `Object ThreadRun` + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - The object type, which is always `thread.run`. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + - `EncryptedContent string` - - `ParallelToolCalls bool` + Opaque encrypted content. - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + - `Type EncryptedContent` - - `RequiredAction RunRequiredAction` + The type of the input item. Always `encrypted_content`. - Details on the action required to continue the run. Will be `null` if no action is required. + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `Recipient string` - Details on the tool outputs needed for this run to continue. + The destination agent identity. - - `ToolCalls []RequiredActionFunctionToolCall` + - `Type AgentMessage` - A list of the relevant tool calls. + The type of the item. Always `agent_message`. - - `ID string` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + - `Agent BetaResponseOutputItemAgentMessageAgent` - - `Function RequiredActionFunctionToolCallFunction` + The agent that produced this item. - The function definition. + - `AgentName string` - - `Arguments string` + The canonical name of the agent that produced this item. - The arguments that the model expects you to pass to the function. + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - `Name string` + - `ID string` - The name of the function. + The unique ID of the multi-agent call item. - - `Type Function` + - `Action string` - The type of tool call the output is required for. For now, this is always `function`. + The multi-agent action to execute. - - `const FunctionFunction Function = "function"` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - - `Type SubmitToolOutputs` + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - For now, this is always `submit_tool_outputs`. + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Arguments string` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + The JSON string of arguments generated for the action. - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `CallID string` - - `type Auto string` + The unique ID linking this call to its output. - `auto` is the default value + - `Type MultiAgentCall` - - `const AutoAuto Auto = "auto"` + The type of the multi-agent call. Always `multi_agent_call`. - - `type ResponseFormatText struct{…}` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - Default response format. Used to generate text responses. + - `Agent BetaResponseOutputItemMultiAgentCallAgent` - - `Type Text` + The agent that produced this item. - The type of response format being defined. Always `text`. + - `AgentName string` - - `const TextText Text = "text"` + The canonical name of the agent that produced this item. - - `type ResponseFormatJSONObject struct{…}` + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `ID string` - - `Type JSONObject` + The unique ID of the multi-agent call output item. - The type of response format being defined. Always `json_object`. + - `Action string` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The multi-agent action that produced this result. - - `type ResponseFormatJSONSchema struct{…}` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - Structured Outputs configuration options, including a JSON Schema. + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - - `Name string` + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - - `Description string` + - `CallID string` - A description of what the response format is for, used by the model to - determine how to respond in the format. + The unique ID of the multi-agent call. - - `Schema map[string, any]` + - `Output []BetaResponseOutputText` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + Text output returned by the multi-agent action. - - `Strict bool` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + The annotations of the text output. - - `Type JSONSchema` + - `Text string` - The type of response format being defined. Always `json_schema`. + The text output from the model. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `Type OutputText` - - `StartedAt int64` + The type of the output text. Always `output_text`. - The Unix timestamp (in seconds) for when the run was started. + - `Logprobs []BetaResponseOutputTextLogprob` - - `Status any` + - `Type MultiAgentCallOutput` - - `ThreadID string` + The type of the multi-agent result. Always `multi_agent_call_output`. - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `ToolChoice AssistantToolChoiceOptionUnion` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + The agent that produced this item. - - `type AssistantToolChoiceOptionAuto string` + - `AgentName string` - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + The canonical name of the agent that produced this item. - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + - `type BetaResponseFunctionWebSearch struct{…}` - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + - `type BetaResponseComputerToolCall struct{…}` - - `type AssistantToolChoice struct{…}` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - Specifies a tool the model should use. Use to force the model to call a specific tool. + - `type BetaResponseComputerToolCallOutputItem struct{…}` - - `Type AssistantToolChoiceType` + - `ID string` - The type of the tool. If type is `function`, the function name must be set + The unique ID of the computer call tool output. - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `CallID string` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + The ID of the computer tool call that produced the output. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `Function AssistantToolChoiceFunction` + A computer screenshot image used with the computer use tool. - - `Name string` + - `Status BetaResponseComputerToolCallOutputItemStatus` - The name of the function to call. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `Tools []any` + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - - `TruncationStrategy RunTruncationStrategy` + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - `Type string` + - `Type ComputerCallOutput` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + The type of the computer tool call output. Always `computer_call_output`. - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `LastMessages int64` + The safety checks reported by the API that have been acknowledged by the + developer. - The number of most recent messages from the thread when constructing the context for the run. + - `ID string` - - `Usage RunUsage` + The ID of the pending safety check. - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + - `Code string` - - `CompletionTokens int64` + The type of the pending safety check. - Number of completion tokens used over the course of the run. + - `Message string` - - `PromptTokens int64` + Details about the pending safety check. - Number of prompt tokens used over the course of the run. + - `Agent BetaResponseComputerToolCallOutputItemAgent` - - `TotalTokens int64` + The agent that produced this item. - Total number of tokens used (prompt + completion). + - `AgentName string` - - `Temperature float64` + The canonical name of the agent that produced this item. - The sampling temperature used for this run. If not set, defaults to 1. + - `CreatedBy string` - - `TopP float64` + The identifier of the actor that created the item. - The nucleus sampling value used for this run. If not set, defaults to 1. + - `type BetaResponseReasoningItem struct{…}` -### Example + 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](https://platform.openai.com/docs/guides/conversation-state). -```go -package main + - `type BetaResponseOutputItemProgram struct{…}` -import ( - "context" - "fmt" + - `ID string` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + The unique ID of the program item. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - run, err := client.Beta.Threads.Runs.SubmitToolOutputs( - context.TODO(), - "thread_id", - "run_id", - openai.BetaThreadRunSubmitToolOutputsParams{ - ToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{ + - `CallID string` - }}, - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", run.ID) -} -``` + The stable call ID of the program item. -#### Response + - `Code string` -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": {}, - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - {} - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` + The JavaScript source executed by programmatic tool calling. -## Cancel a run + - `Fingerprint string` -`client.Beta.Threads.Runs.Cancel(ctx, threadID, runID) (*Run, error)` + Opaque program replay fingerprint that must be round-tripped. -**post** `/threads/{thread_id}/runs/{run_id}/cancel` + - `Type Program` -Cancel a run + The type of the item. Always `program`. -### Parameters + - `const ProgramProgram Program = "program"` -- `threadID string` + - `Agent BetaResponseOutputItemProgramAgent` -- `runID string` + The agent that produced this item. -### Returns + - `AgentName string` -- `type Run struct{…}` + The canonical name of the agent that produced this item. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `type BetaResponseOutputItemProgramOutput struct{…}` - `ID string` - The identifier, which can be referenced in API endpoints. + The unique ID of the program output item. - - `AssistantID string` + - `CallID string` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + The call ID of the program item. - - `CancelledAt int64` + - `Result string` - The Unix timestamp (in seconds) for when the run was cancelled. + The result produced by the program item. - - `CompletedAt int64` + - `Status string` - The Unix timestamp (in seconds) for when the run was completed. + The terminal status of the program output item. - - `CreatedAt int64` + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - The Unix timestamp (in seconds) for when the run was created. + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - `ExpiresAt int64` + - `Type ProgramOutput` - The Unix timestamp (in seconds) for when the run will expire. + The type of the item. Always `program_output`. - - `FailedAt int64` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - The Unix timestamp (in seconds) for when the run failed. + - `Agent BetaResponseOutputItemProgramOutputAgent` - - `IncompleteDetails RunIncompleteDetails` + The agent that produced this item. - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + - `AgentName string` - - `Reason string` + The canonical name of the agent that produced this item. - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + - `type BetaResponseToolSearchCall struct{…}` - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + - `ID string` - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + The unique ID of the tool search call item. - - `Instructions string` + - `Arguments any` - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + Arguments used for the tool search call. - - `LastError RunLastError` + - `CallID string` - The last error associated with this run. Will be `null` if there are no errors. + The unique ID of the tool search call generated by the model. - - `Code string` + - `Execution BetaResponseToolSearchCallExecution` - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + Whether tool search was executed by the server or by the client. - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + - `Status BetaResponseToolSearchCallStatus` - - `Message string` + The status of the tool search call item that was recorded. - A human-readable description of the error. + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - - `MaxCompletionTokens int64` + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - The maximum number of completion tokens specified to have been used over the course of the run. + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - - `MaxPromptTokens int64` + - `Type ToolSearchCall` - The maximum number of prompt tokens specified to have been used over the course of the run. + The type of the item. Always `tool_search_call`. - - `Metadata Metadata` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - 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. + - `Agent BetaResponseToolSearchCallAgent` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The agent that produced this item. - - `Model string` + - `AgentName string` - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + The canonical name of the agent that produced this item. - - `Object ThreadRun` + - `CreatedBy string` - The object type, which is always `thread.run`. + The identifier of the actor that created the item. - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + - `type BetaResponseToolSearchOutputItem struct{…}` - - `ParallelToolCalls bool` + - `ID string` - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + The unique ID of the tool search output item. - - `RequiredAction RunRequiredAction` + - `CallID string` - Details on the action required to continue the run. Will be `null` if no action is required. + The unique ID of the tool search call generated by the model. - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `Execution BetaResponseToolSearchOutputItemExecution` - Details on the tool outputs needed for this run to continue. + Whether tool search was executed by the server or by the client. - - `ToolCalls []RequiredActionFunctionToolCall` + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - A list of the relevant tool calls. + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - - `ID string` + - `Status BetaResponseToolSearchOutputItemStatus` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + The status of the tool search output item that was recorded. - - `Function RequiredActionFunctionToolCallFunction` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - The function definition. + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - `Arguments string` + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - The arguments that the model expects you to pass to the function. + - `Tools []BetaToolUnion` - - `Name string` + The loaded tool definitions returned by tool search. - The name of the function. + - `type BetaFunctionTool struct{…}` - - `Type Function` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The type of tool call the output is required for. For now, this is always `function`. + - `type BetaFileSearchTool struct{…}` - - `const FunctionFunction Function = "function"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Type SubmitToolOutputs` + - `type BetaComputerTool struct{…}` - For now, this is always `submit_tool_outputs`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + - `type BetaComputerUsePreviewTool struct{…}` - - `ResponseFormat AssistantResponseFormatOptionUnion` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + - `type BetaWebSearchTool struct{…}` - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `type BetaToolMcp struct{…}` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `type Auto string` + - `type BetaToolCodeInterpreter struct{…}` - `auto` is the default value + A tool that runs Python code to help generate a response to a prompt. - - `const AutoAuto Auto = "auto"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type ResponseFormatText struct{…}` + - `type BetaToolImageGeneration struct{…}` - Default response format. Used to generate text responses. + A tool that generates images using the GPT image models. - - `Type Text` + - `type BetaToolLocalShell struct{…}` - The type of response format being defined. Always `text`. + A tool that allows the model to execute shell commands in a local environment. - - `const TextText Text = "text"` + - `type BetaFunctionShellTool struct{…}` - - `type ResponseFormatJSONObject struct{…}` + A tool that allows the model to execute shell commands. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `type BetaCustomTool struct{…}` - - `Type JSONObject` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The type of response format being defined. Always `json_object`. + - `type BetaNamespaceTool struct{…}` - - `const JSONObjectJSONObject JSONObject = "json_object"` + Groups function/custom tools under a shared namespace. - - `type ResponseFormatJSONSchema struct{…}` + - `type BetaToolSearchTool struct{…}` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + Hosted or BYOT tool search configuration for deferred tools. - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `type BetaWebSearchPreviewTool struct{…}` - Structured Outputs configuration options, including a JSON Schema. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Name string` + - `type BetaApplyPatchTool struct{…}` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + Allows the assistant to create, delete, or update files using unified diffs. - - `Description string` + - `Type ToolSearchOutput` - A description of what the response format is for, used by the model to - determine how to respond in the format. + The type of the item. Always `tool_search_output`. - - `Schema map[string, any]` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `Agent BetaResponseToolSearchOutputItemAgent` - - `Strict bool` + The agent that produced this item. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `AgentName string` - - `Type JSONSchema` + The canonical name of the agent that produced this item. - The type of response format being defined. Always `json_schema`. + - `CreatedBy string` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The identifier of the actor that created the item. - - `StartedAt int64` + - `type BetaResponseOutputItemAdditionalTools struct{…}` - The Unix timestamp (in seconds) for when the run was started. + - `ID string` - - `Status any` + The unique ID of the additional tools item. - - `ThreadID string` + - `Role string` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + The role that provided the additional tools. - - `ToolChoice AssistantToolChoiceOptionUnion` + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - - `type AssistantToolChoiceOptionAuto string` + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - - `type AssistantToolChoice struct{…}` + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - Specifies a tool the model should use. Use to force the model to call a specific tool. + - `Tools []BetaToolUnion` - - `Type AssistantToolChoiceType` + The additional tool definitions made available at this item. - The type of the tool. If type is `function`, the function name must be set + - `type BetaFunctionTool struct{…}` - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + - `type BetaFileSearchTool struct{…}` - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Function AssistantToolChoiceFunction` + - `type BetaComputerTool struct{…}` - - `Name string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The name of the function to call. + - `type BetaComputerUsePreviewTool struct{…}` - - `Tools []any` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `type BetaWebSearchTool struct{…}` - - `TruncationStrategy RunTruncationStrategy` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + - `type BetaToolMcp struct{…}` - - `Type string` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + - `type BetaToolCodeInterpreter struct{…}` - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + A tool that runs Python code to help generate a response to a prompt. - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `LastMessages int64` + - `type BetaToolImageGeneration struct{…}` - The number of most recent messages from the thread when constructing the context for the run. + A tool that generates images using the GPT image models. - - `Usage RunUsage` + - `type BetaToolLocalShell struct{…}` - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + A tool that allows the model to execute shell commands in a local environment. - - `CompletionTokens int64` + - `type BetaFunctionShellTool struct{…}` - Number of completion tokens used over the course of the run. + A tool that allows the model to execute shell commands. - - `PromptTokens int64` + - `type BetaCustomTool struct{…}` - Number of prompt tokens used over the course of the run. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `TotalTokens int64` + - `type BetaNamespaceTool struct{…}` - Total number of tokens used (prompt + completion). + Groups function/custom tools under a shared namespace. - - `Temperature float64` + - `type BetaToolSearchTool struct{…}` - The sampling temperature used for this run. If not set, defaults to 1. + Hosted or BYOT tool search configuration for deferred tools. - - `TopP float64` + - `type BetaWebSearchPreviewTool struct{…}` - The nucleus sampling value used for this run. If not set, defaults to 1. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). -### Example + - `type BetaApplyPatchTool struct{…}` -```go -package main + Allows the assistant to create, delete, or update files using unified diffs. -import ( - "context" - "fmt" + - `Type AdditionalTools` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + The type of the item. Always `additional_tools`. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - run, err := client.Beta.Threads.Runs.Cancel( - context.TODO(), - "thread_id", - "run_id", - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", run.ID) -} -``` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` -#### Response + - `Agent BetaResponseOutputItemAdditionalToolsAgent` -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expires_at": 0, - "failed_at": 0, - "incomplete_details": { - "reason": "max_completion_tokens" - }, - "instructions": "instructions", - "last_error": { - "code": "server_error", - "message": "message" - }, - "max_completion_tokens": 256, - "max_prompt_tokens": 256, - "metadata": { - "foo": "string" - }, - "model": "model", - "object": "thread.run", - "parallel_tool_calls": true, - "required_action": { - "submit_tool_outputs": { - "tool_calls": [ - { - "id": "id", - "function": { - "arguments": "arguments", - "name": "name" - }, - "type": "function" - } - ] - }, - "type": "submit_tool_outputs" - }, - "response_format": "auto", - "started_at": 0, - "status": {}, - "thread_id": "thread_id", - "tool_choice": "none", - "tools": [ - {} - ], - "truncation_strategy": { - "type": "auto", - "last_messages": 1 - }, - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - }, - "temperature": 0, - "top_p": 0 -} -``` + The agent that produced this item. -## Domain Types + - `AgentName string` -### Required Action Function Tool Call + The canonical name of the agent that produced this item. -- `type RequiredActionFunctionToolCall struct{…}` + - `type BetaResponseCompactionItem struct{…}` - Tool call objects + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - `ID string` - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + The unique ID of the compaction item. - - `Function RequiredActionFunctionToolCallFunction` + - `EncryptedContent string` - The function definition. + The encrypted content that was produced by compaction. - - `Arguments string` + - `Type Compaction` - The arguments that the model expects you to pass to the function. + The type of the item. Always `compaction`. - - `Name string` + - `const CompactionCompaction Compaction = "compaction"` - The name of the function. + - `Agent BetaResponseCompactionItemAgent` - - `Type Function` + The agent that produced this item. - The type of tool call the output is required for. For now, this is always `function`. + - `AgentName string` - - `const FunctionFunction Function = "function"` + The canonical name of the agent that produced this item. -### Run + - `CreatedBy string` -- `type Run struct{…}` + The identifier of the actor that created the item. - Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + - `type BetaResponseOutputItemImageGenerationCall struct{…}` + + An image generation request made by the model. - `ID string` - The identifier, which can be referenced in API endpoints. + The unique ID of the image generation call. - - `AssistantID string` + - `Result string` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + The generated image encoded in base64. - - `CancelledAt int64` + - `Status string` - The Unix timestamp (in seconds) for when the run was cancelled. + The status of the image generation call. - - `CompletedAt int64` + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - The Unix timestamp (in seconds) for when the run was completed. + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - `CreatedAt int64` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - The Unix timestamp (in seconds) for when the run was created. + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - - `ExpiresAt int64` + - `Type ImageGenerationCall` - The Unix timestamp (in seconds) for when the run will expire. + The type of the image generation call. Always `image_generation_call`. - - `FailedAt int64` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - The Unix timestamp (in seconds) for when the run failed. + - `Agent BetaResponseOutputItemImageGenerationCallAgent` - - `IncompleteDetails RunIncompleteDetails` + The agent that produced this item. - Details on why the run is incomplete. Will be `null` if the run is not incomplete. + - `AgentName string` - - `Reason string` + The canonical name of the agent that produced this item. - The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` + A tool call to run code. - - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` + - `type BetaResponseOutputItemLocalShellCall struct{…}` - - `Instructions string` + A tool call to run a command on the local shell. - The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + - `ID string` - - `LastError RunLastError` + The unique ID of the local shell call. - The last error associated with this run. Will be `null` if there are no errors. + - `Action BetaResponseOutputItemLocalShellCallAction` - - `Code string` + Execute a shell command on the server. - One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + - `Command []string` - - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` + The command to run. - - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` + - `Env map[string, string]` - - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` + Environment variables to set for the command. - - `Message string` + - `Type Exec` - A human-readable description of the error. + The type of the local shell action. Always `exec`. - - `MaxCompletionTokens int64` + - `const ExecExec Exec = "exec"` - The maximum number of completion tokens specified to have been used over the course of the run. + - `TimeoutMs int64` - - `MaxPromptTokens int64` + Optional timeout in milliseconds for the command. - The maximum number of prompt tokens specified to have been used over the course of the run. + - `User string` - - `Metadata Metadata` + Optional user to run the command as. - 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. + - `WorkingDirectory string` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + Optional working directory to run the command in. - - `Model string` + - `CallID string` - The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + The unique ID of the local shell tool call generated by the model. - - `Object ThreadRun` + - `Status string` - The object type, which is always `thread.run`. + The status of the local shell call. - - `const ThreadRunThreadRun ThreadRun = "thread.run"` + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `ParallelToolCalls bool` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - - `RequiredAction RunRequiredAction` + - `Type LocalShellCall` - Details on the action required to continue the run. Will be `null` if no action is required. + The type of the local shell call. Always `local_shell_call`. - - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - Details on the tool outputs needed for this run to continue. + - `Agent BetaResponseOutputItemLocalShellCallAgent` - - `ToolCalls []RequiredActionFunctionToolCall` + The agent that produced this item. - A list of the relevant tool calls. + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - `Function RequiredActionFunctionToolCallFunction` + The output of a local shell tool call. - The function definition. + - `ID string` - - `Arguments string` + The unique ID of the local shell tool call generated by the model. - The arguments that the model expects you to pass to the function. + - `Output string` - - `Name string` + A JSON string of the output of the local shell tool call. - The name of the function. + - `Type LocalShellCallOutput` - - `Type Function` + The type of the local shell tool call output. Always `local_shell_call_output`. - The type of tool call the output is required for. For now, this is always `function`. + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `const FunctionFunction Function = "function"` + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` - - `Type SubmitToolOutputs` + The agent that produced this item. - For now, this is always `submit_tool_outputs`. + - `AgentName string` - - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` + The canonical name of the agent that produced this item. - - `ResponseFormat AssistantResponseFormatOptionUnion` + - `Status string` - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - - `type Auto string` + - `type BetaResponseFunctionShellToolCall struct{…}` - `auto` is the default value + A tool call that executes one or more shell commands in a managed environment. - - `const AutoAuto Auto = "auto"` + - `ID string` - - `type ResponseFormatText struct{…}` + The unique ID of the shell tool call. Populated when this item is returned via API. - Default response format. Used to generate text responses. + - `Action BetaResponseFunctionShellToolCallAction` - - `Type Text` + The shell commands and limits that describe how to run the tool call. - The type of response format being defined. Always `text`. + - `Commands []string` - - `const TextText Text = "text"` + - `MaxOutputLength int64` - - `type ResponseFormatJSONObject struct{…}` + Optional maximum number of characters to return from each command. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `TimeoutMs int64` - - `Type JSONObject` + Optional timeout in milliseconds for the commands. - The type of response format being defined. Always `json_object`. + - `CallID string` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The unique ID of the shell tool call generated by the model. - - `type ResponseFormatJSONSchema struct{…}` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + Represents the use of a local environment to perform shell actions. - - `JSONSchema ResponseFormatJSONSchemaJSONSchema` + - `type BetaResponseLocalEnvironment struct{…}` - Structured Outputs configuration options, including a JSON Schema. + Represents the use of a local environment to perform shell actions. - - `Name string` + - `Type Local` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + The environment type. Always `local`. - - `Description string` + - `const LocalLocal Local = "local"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `type BetaResponseContainerReference struct{…}` - - `Schema map[string, any]` + Represents a container created with /v1/containers. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `ContainerID string` - - `Strict bool` + - `Type ContainerReference` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + The environment type. Always `container_reference`. - - `Type JSONSchema` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - The type of response format being defined. Always `json_schema`. + - `Status BetaResponseFunctionShellToolCallStatus` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `StartedAt int64` + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - The Unix timestamp (in seconds) for when the run was started. + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - - `Status any` + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `ThreadID string` + - `Type ShellCall` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + The type of the item. Always `shell_call`. - - `ToolChoice AssistantToolChoiceOptionUnion` + - `const ShellCallShellCall ShellCall = "shell_call"` - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + - `Agent BetaResponseFunctionShellToolCallAgent` - - `type AssistantToolChoiceOptionAuto string` + The agent that produced this item. - `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. + - `AgentName string` - - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` + The canonical name of the agent that produced this item. - - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` + The execution context that produced this tool call. - - `type AssistantToolChoice struct{…}` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - Specifies a tool the model should use. Use to force the model to call a specific tool. + - `Type Direct` - - `Type AssistantToolChoiceType` + - `const DirectDirect Direct = "direct"` - The type of the tool. If type is `function`, the function name must be set + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` + - `CallerID string` - - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` + The call ID of the program item that produced this tool call. - - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` + - `Type Program` - - `Function AssistantToolChoiceFunction` + - `const ProgramProgram Program = "program"` - - `Name string` + - `CreatedBy string` - The name of the function to call. + The ID of the entity that created this tool call. - - `Tools []any` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + The output of a shell tool call that was emitted. - - `TruncationStrategy RunTruncationStrategy` + - `ID string` - Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + The unique ID of the shell call output. Populated when this item is returned via API. - - `Type string` + - `CallID string` - The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + The unique ID of the shell tool call generated by the model. - - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` + - `MaxOutputLength int64` - - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `LastMessages int64` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - The number of most recent messages from the thread when constructing the context for the run. + An array of shell call output contents - - `Usage RunUsage` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - - `CompletionTokens int64` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - Number of completion tokens used over the course of the run. + Indicates that the shell call exceeded its configured time limit. - - `PromptTokens int64` + - `Type Timeout` - Number of prompt tokens used over the course of the run. + The outcome type. Always `timeout`. - - `TotalTokens int64` + - `const TimeoutTimeout Timeout = "timeout"` - Total number of tokens used (prompt + completion). + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - - `Temperature float64` + Indicates that the shell commands finished and returned an exit code. - The sampling temperature used for this run. If not set, defaults to 1. + - `ExitCode int64` - - `TopP float64` + Exit code from the shell process. - The nucleus sampling value used for this run. If not set, defaults to 1. + - `Type Exit` -### Run Status + The outcome type. Always `exit`. -- `type RunStatus interface{…}` + - `const ExitExit Exit = "exit"` -# Steps + - `Stderr string` -## List run steps + The standard error output that was captured. -`client.Beta.Threads.Runs.Steps.List(ctx, threadID, runID, query) (*CursorPage[RunStep], error)` + - `Stdout string` -**get** `/threads/{thread_id}/runs/{run_id}/steps` + The standard output that was captured. -List run steps + - `CreatedBy string` -### Parameters + The identifier of the actor that created the item. -- `threadID string` + - `Status BetaResponseFunctionShellToolCallOutputStatus` -- `runID string` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. -- `query BetaThreadRunStepListParams` + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `After param.Field[string]` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - - `Before param.Field[string]` + - `Type ShellCallOutput` - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + The type of the shell call output. Always `shell_call_output`. - - `Include param.Field[[]RunStepInclude]` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + The agent that produced this item. - - `const RunStepIncludeStepDetailsToolCallsFileSearchResultsContent RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` + - `AgentName string` - - `Limit param.Field[int64]` + The canonical name of the agent that produced this item. - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - - `Order param.Field[BetaThreadRunStepListParamsOrder]` + The execution context that produced this tool call. - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `const BetaThreadRunStepListParamsOrderAsc BetaThreadRunStepListParamsOrder = "asc"` + - `Type Direct` - - `const BetaThreadRunStepListParamsOrderDesc BetaThreadRunStepListParamsOrder = "desc"` + - `const DirectDirect Direct = "direct"` -### Returns + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` -- `type RunStep struct{…}` + - `CallerID string` - Represents a step in execution of a run. + The call ID of the program item that produced this tool call. - - `ID string` + - `Type Program` - The identifier of the run step, which can be referenced in API endpoints. + - `const ProgramProgram Program = "program"` - - `AssistantID string` + - `CreatedBy string` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. + The identifier of the actor that created the item. - - `CancelledAt int64` + - `type BetaResponseApplyPatchToolCall struct{…}` - The Unix timestamp (in seconds) for when the run step was cancelled. + A tool call that applies file diffs by creating, deleting, or updating files. - - `CompletedAt int64` + - `ID string` - The Unix timestamp (in seconds) for when the run step completed. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `CreatedAt int64` + - `CallID string` - The Unix timestamp (in seconds) for when the run step was created. + The unique ID of the apply patch tool call generated by the model. - - `ExpiredAt int64` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `FailedAt int64` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - The Unix timestamp (in seconds) for when the run step failed. + Instruction describing how to create a file via the apply_patch tool. - - `LastError RunStepLastError` + - `Diff string` - The last error associated with this run step. Will be `null` if there are no errors. + Diff to apply. - - `Code string` + - `Path string` - One of `server_error` or `rate_limit_exceeded`. + Path of the file to create. - - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` + - `Type CreateFile` - - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` + Create a new file with the provided diff. - - `Message string` + - `const CreateFileCreateFile CreateFile = "create_file"` - A human-readable description of the error. + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - - `Metadata Metadata` + Instruction describing how to delete a file via the apply_patch tool. - 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. + - `Path string` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + Path of the file to delete. - - `Object ThreadRunStep` + - `Type DeleteFile` - The object type, which is always `thread.run.step`. + Delete the specified file. - - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `RunID string` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. + Instruction describing how to update a file via the apply_patch tool. - - `Status RunStepStatus` + - `Diff string` - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + Diff to apply. - - `const RunStepStatusInProgress RunStepStatus = "in_progress"` + - `Path string` - - `const RunStepStatusCancelled RunStepStatus = "cancelled"` + Path of the file to update. - - `const RunStepStatusFailed RunStepStatus = "failed"` + - `Type UpdateFile` - - `const RunStepStatusCompleted RunStepStatus = "completed"` + Update an existing file with the provided diff. - - `const RunStepStatusExpired RunStepStatus = "expired"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `StepDetails RunStepStepDetailsUnion` + - `Status BetaResponseApplyPatchToolCallStatus` - The details of the run step. + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `type MessageCreationStepDetails struct{…}` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - Details of the message creation by the run step. + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - `MessageCreation MessageCreationStepDetailsMessageCreation` + - `Type ApplyPatchCall` - - `MessageID string` + The type of the item. Always `apply_patch_call`. - The ID of the message that was created by this run step. + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `Type MessageCreation` + - `Agent BetaResponseApplyPatchToolCallAgent` - Always `message_creation`. + The agent that produced this item. - - `const MessageCreationMessageCreation MessageCreation = "message_creation"` + - `AgentName string` - - `type ToolCallsStepDetails struct{…}` + The canonical name of the agent that produced this item. - Details of the tool call. + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - `ToolCalls []any` + The execution context that produced this tool call. - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `Type ToolCalls` + - `Type Direct` - Always `tool_calls`. + - `const DirectDirect Direct = "direct"` - - `const ToolCallsToolCalls ToolCalls = "tool_calls"` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `ThreadID string` + - `CallerID string` - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + The call ID of the program item that produced this tool call. - - `Type RunStepType` + - `Type Program` - The type of run step, which can be either `message_creation` or `tool_calls`. + - `const ProgramProgram Program = "program"` - - `const RunStepTypeMessageCreation RunStepType = "message_creation"` + - `CreatedBy string` - - `const RunStepTypeToolCalls RunStepType = "tool_calls"` + The ID of the entity that created this tool call. - - `Usage RunStepUsage` + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. + The output emitted by an apply patch tool call. - - `CompletionTokens int64` + - `ID string` - Number of completion tokens used over the course of the run step. + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `PromptTokens int64` + - `CallID string` - Number of prompt tokens used over the course of the run step. + The unique ID of the apply patch tool call generated by the model. - - `TotalTokens int64` + - `Status BetaResponseApplyPatchToolCallOutputStatus` - Total number of tokens used (prompt + completion). + The status of the apply patch tool call output. One of `completed` or `failed`. -### Example + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` -```go -package main + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` -import ( - "context" - "fmt" + - `Type ApplyPatchCallOutput` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + The type of the item. Always `apply_patch_call_output`. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - page, err := client.Beta.Threads.Runs.Steps.List( - context.TODO(), - "thread_id", - "run_id", - openai.BetaThreadRunStepListParams{ + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", page) -} -``` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` -#### Response + The agent that produced this item. -```json -{ - "data": [ - { - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } - } - ], - "first_id": "step_abc123", - "has_more": false, - "last_id": "step_abc456", - "object": "list" -} -``` + - `AgentName string` -## Retrieve run step + The canonical name of the agent that produced this item. -`client.Beta.Threads.Runs.Steps.Get(ctx, threadID, runID, stepID, query) (*RunStep, error)` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` -**get** `/threads/{thread_id}/runs/{run_id}/steps/{step_id}` + The execution context that produced this tool call. -Retrieve run step + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` -### Parameters + - `Type Direct` -- `threadID string` + - `const DirectDirect Direct = "direct"` -- `runID string` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` -- `stepID string` + - `CallerID string` -- `query BetaThreadRunStepGetParams` + The call ID of the program item that produced this tool call. - - `Include param.Field[[]RunStepInclude]` + - `Type Program` - A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + - `const ProgramProgram Program = "program"` - See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + - `CreatedBy string` - - `const RunStepIncludeStepDetailsToolCallsFileSearchResultsContent RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` + The ID of the entity that created this tool call output. -### Returns + - `Output string` -- `type RunStep struct{…}` + Optional textual output returned by the apply patch tool. - Represents a step in execution of a run. + - `type BetaResponseOutputItemMcpCall struct{…}` + + An invocation of a tool on an MCP server. - `ID string` - The identifier of the run step, which can be referenced in API endpoints. + The unique ID of the tool call. - - `AssistantID string` + - `Arguments string` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. + A JSON string of the arguments passed to the tool. - - `CancelledAt int64` + - `Name string` - The Unix timestamp (in seconds) for when the run step was cancelled. + The name of the tool that was run. - - `CompletedAt int64` + - `ServerLabel string` - The Unix timestamp (in seconds) for when the run step completed. + The label of the MCP server running the tool. - - `CreatedAt int64` + - `Type McpCall` - The Unix timestamp (in seconds) for when the run step was created. + The type of the item. Always `mcp_call`. - - `ExpiredAt int64` + - `const McpCallMcpCall McpCall = "mcp_call"` - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + - `Agent BetaResponseOutputItemMcpCallAgent` - - `FailedAt int64` + The agent that produced this item. - The Unix timestamp (in seconds) for when the run step failed. + - `AgentName string` - - `LastError RunStepLastError` + The canonical name of the agent that produced this item. - The last error associated with this run step. Will be `null` if there are no errors. + - `ApprovalRequestID string` - - `Code 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. - One of `server_error` or `rate_limit_exceeded`. + - `Error string` - - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` + The error from the tool call, if any. - - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` + - `Output string` - - `Message string` + The output from the tool call. - A human-readable description of the error. + - `Status string` - - `Metadata Metadata` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - 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. + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - - `Object ThreadRunStep` + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - The object type, which is always `thread.run.step`. + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - `RunID string` + - `type BetaResponseOutputItemMcpListTools struct{…}` - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. + A list of tools available on an MCP server. - - `Status RunStepStatus` + - `ID string` - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + The unique ID of the list. - - `const RunStepStatusInProgress RunStepStatus = "in_progress"` + - `ServerLabel string` - - `const RunStepStatusCancelled RunStepStatus = "cancelled"` + The label of the MCP server. - - `const RunStepStatusFailed RunStepStatus = "failed"` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - - `const RunStepStatusCompleted RunStepStatus = "completed"` + The tools available on the server. - - `const RunStepStatusExpired RunStepStatus = "expired"` + - `InputSchema any` - - `StepDetails RunStepStepDetailsUnion` + The JSON schema describing the tool's input. - The details of the run step. + - `Name string` - - `type MessageCreationStepDetails struct{…}` + The name of the tool. - Details of the message creation by the run step. + - `Annotations any` - - `MessageCreation MessageCreationStepDetailsMessageCreation` + Additional annotations about the tool. - - `MessageID string` + - `Description string` - The ID of the message that was created by this run step. + The description of the tool. - - `Type MessageCreation` + - `Type McpListTools` - Always `message_creation`. + The type of the item. Always `mcp_list_tools`. - - `const MessageCreationMessageCreation MessageCreation = "message_creation"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `type ToolCallsStepDetails struct{…}` + - `Agent BetaResponseOutputItemMcpListToolsAgent` - Details of the tool call. + The agent that produced this item. - - `ToolCalls []any` + - `AgentName string` - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + The canonical name of the agent that produced this item. - - `Type ToolCalls` + - `Error string` - Always `tool_calls`. + Error message if the server could not list tools. - - `const ToolCallsToolCalls ToolCalls = "tool_calls"` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - `ThreadID string` + A request for human approval of a tool invocation. - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + - `ID string` - - `Type RunStepType` + The unique ID of the approval request. - The type of run step, which can be either `message_creation` or `tool_calls`. + - `Arguments string` - - `const RunStepTypeMessageCreation RunStepType = "message_creation"` + A JSON string of arguments for the tool. - - `const RunStepTypeToolCalls RunStepType = "tool_calls"` + - `Name string` - - `Usage RunStepUsage` + The name of the tool to run. - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. + - `ServerLabel string` - - `CompletionTokens int64` + The label of the MCP server making the request. - Number of completion tokens used over the course of the run step. + - `Type McpApprovalRequest` - - `PromptTokens int64` + The type of the item. Always `mcp_approval_request`. - Number of prompt tokens used over the course of the run step. + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `TotalTokens int64` + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` - Total number of tokens used (prompt + completion). + The agent that produced this item. -### Example + - `AgentName string` -```go -package main + The canonical name of the agent that produced this item. -import ( - "context" - "fmt" + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + A response to an MCP approval request. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - runStep, err := client.Beta.Threads.Runs.Steps.Get( - context.TODO(), - "thread_id", - "run_id", - "step_id", - openai.BetaThreadRunStepGetParams{ + - `ID string` - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", runStep.ID) -} -``` + The unique ID of the approval response -#### Response + - `ApprovalRequestID string` -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "cancelled_at": 0, - "completed_at": 0, - "created_at": 0, - "expired_at": 0, - "failed_at": 0, - "last_error": { - "code": "server_error", - "message": "message" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.run.step", - "run_id": "run_id", - "status": "in_progress", - "step_details": { - "message_creation": { - "message_id": "message_id" - }, - "type": "message_creation" - }, - "thread_id": "thread_id", - "type": "message_creation", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 0, - "total_tokens": 0 - } -} -``` + The ID of the approval request being answered. -## Domain Types + - `Approve bool` -### Code Interpreter Logs + Whether the request was approved. -- `type CodeInterpreterLogs struct{…}` + - `Type McpApprovalResponse` - Text output from the Code Interpreter tool call as part of a run step. + The type of the item. Always `mcp_approval_response`. - - `Index int64` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - The index of the output in the outputs array. + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - - `Type Logs` + The agent that produced this item. - Always `logs`. + - `AgentName string` - - `const LogsLogs Logs = "logs"` + The canonical name of the agent that produced this item. - - `Logs string` + - `Reason string` - The text output from the Code Interpreter tool call. + Optional reason for the decision. -### Code Interpreter Output Image + - `type BetaResponseCustomToolCall struct{…}` -- `type CodeInterpreterOutputImage struct{…}` + A call to a custom tool created by the model. - - `Index int64` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - The index of the output in the outputs array. + The output of a custom tool call from your code, being sent back to the model. - - `Type Image` + - `ID string` - Always `image`. + The unique ID of the custom tool call output item. - - `const ImageImage Image = "image"` + - `Status string` - - `Image CodeInterpreterOutputImageImage` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `FileID string` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` -### Code Interpreter Tool Call + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` -- `type CodeInterpreterToolCall struct{…}` + - `CreatedBy string` - Details of the Code Interpreter tool call the run step was involved in. + The identifier of the actor that created the item. - - `ID string` + - `ParallelToolCalls bool` - The ID of the tool call. + Whether to allow the model to run tool calls in parallel. - - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` + - `Temperature float64` - The Code Interpreter tool call definition. + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - - `Input string` + - `ToolChoice BetaResponseToolChoiceUnion` - The input to the Code Interpreter tool call. + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` + - `type BetaToolChoiceOptions string` - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. + Controls which (if any) tool is called by the model. - - `CodeInterpreterToolCallCodeInterpreterOutputLogs` + `none` means the model will not call any tool and instead generates a message. - - `Logs string` + `auto` means the model can pick between generating a message or calling one or + more tools. - The text output from the Code Interpreter tool call. + `required` means the model must call one or more tools. - - `Type Logs` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - Always `logs`. + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - - `const LogsLogs Logs = "logs"` + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - - `CodeInterpreterToolCallCodeInterpreterOutputImage` + - `type BetaToolChoiceAllowed struct{…}` - - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` + Constrains the tools available to the model to a pre-defined set. - - `FileID string` + - `Mode BetaToolChoiceAllowedMode` - The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. + Constrains the tools available to the model to a pre-defined set. - - `Type Image` + `auto` allows the model to pick from among the allowed tools and generate a + message. - Always `image`. + `required` requires the model to call one or more of the allowed tools. - - `const ImageImage Image = "image"` + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - - `Type CodeInterpreter` + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + - `Tools []map[string, any]` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + A list of tool definitions that the model should be allowed to call. -### Code Interpreter Tool Call Delta + For the Responses API, the list of tool definitions might look like: -- `type CodeInterpreterToolCallDelta struct{…}` + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - Details of the Code Interpreter tool call the run step was involved in. + - `Type AllowedTools` - - `Index int64` + Allowed tool configuration type. Always `allowed_tools`. - The index of the tool call in the tool calls array. + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `Type CodeInterpreter` + - `type BetaToolChoiceTypes struct{…}` - The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `Type BetaToolChoiceTypesType` - - `ID string` + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - The ID of the tool call. + Allowed values are: - - `CodeInterpreter CodeInterpreterToolCallDeltaCodeInterpreter` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - The Code Interpreter tool call definition. + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - `Input string` + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - The input to the Code Interpreter tool call. + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `Outputs []CodeInterpreterToolCallDeltaCodeInterpreterOutputUnion` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - - `type CodeInterpreterLogs struct{…}` + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - Text output from the Code Interpreter tool call as part of a run step. + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - - `Index int64` + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - The index of the output in the outputs array. + - `type BetaToolChoiceFunction struct{…}` - - `Type Logs` + Use this option to force the model to call a specific function. - Always `logs`. + - `Name string` - - `const LogsLogs Logs = "logs"` + The name of the function to call. - - `Logs string` + - `Type Function` - The text output from the Code Interpreter tool call. + For function calling, the type is always `function`. - - `type CodeInterpreterOutputImage struct{…}` + - `const FunctionFunction Function = "function"` - - `Index int64` + - `type BetaToolChoiceMcp struct{…}` - The index of the output in the outputs array. + Use this option to force the model to call a specific tool on a remote MCP server. - - `Type Image` + - `ServerLabel string` - Always `image`. + The label of the MCP server to use. - - `const ImageImage Image = "image"` + - `Type Mcp` - - `Image CodeInterpreterOutputImageImage` + For MCP tools, the type is always `mcp`. - - `FileID string` + - `const McpMcp Mcp = "mcp"` - The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. + - `Name string` -### File Search Tool Call + The name of the tool to call on the server. -- `type FileSearchToolCall struct{…}` + - `type BetaToolChoiceCustom struct{…}` - - `ID string` + Use this option to force the model to call a specific custom tool. - The ID of the tool call object. + - `Name string` - - `FileSearch FileSearchToolCallFileSearch` + The name of the custom tool to call. - For now, this is always going to be an empty object. + - `Type Custom` - - `RankingOptions FileSearchToolCallFileSearchRankingOptions` + For custom tool calling, the type is always `custom`. - The ranking options for the file search. + - `const CustomCustom Custom = "custom"` - - `Ranker string` + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - The ranker to use for the file search. If not specified will use the `auto` ranker. + - `Type ProgrammaticToolCalling` - - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` + The tool to call. Always `programmatic_tool_calling`. - - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `ScoreThreshold float64` + - `type BetaToolChoiceApplyPatch struct{…}` - The score threshold for the file search. All values must be a floating point number between 0 and 1. + Forces the model to call the apply_patch tool when executing a tool call. - - `Results []FileSearchToolCallFileSearchResult` + - `Type ApplyPatch` - The results of the file search. + The tool to call. Always `apply_patch`. - - `FileID string` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - The ID of the file that result was found in. + - `type BetaToolChoiceShell struct{…}` - - `FileName string` + Forces the model to call the shell tool when a tool call is required. - The name of the file that result was found in. + - `Type Shell` - - `Score float64` + The tool to call. Always `shell`. - The score of the result. All values must be a floating point number between 0 and 1. + - `const ShellShell Shell = "shell"` - - `Content []FileSearchToolCallFileSearchResultContent` + - `Tools []BetaToolUnion` - The content of the result that was found. The content is only included if requested via the include query parameter. + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. - - `Text string` + We support the following categories of tools: - The text content of the file. + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. - - `Type string` + - `type BetaFunctionTool struct{…}` - The type of the content. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` + - `type BetaFileSearchTool struct{…}` - - `Type FileSearch` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The type of tool call. This is always going to be `file_search` for this type of tool call. + - `type BetaComputerTool struct{…}` - - `const FileSearchFileSearch FileSearch = "file_search"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). -### File Search Tool Call Delta + - `type BetaComputerUsePreviewTool struct{…}` -- `type FileSearchToolCallDelta struct{…}` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `FileSearch any` + - `type BetaWebSearchTool struct{…}` - For now, this is always going to be an empty object. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Index int64` + - `type BetaToolMcp struct{…}` - The index of the tool call in the tool calls array. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Type FileSearch` + - `type BetaToolCodeInterpreter struct{…}` - The type of tool call. This is always going to be `file_search` for this type of tool call. + A tool that runs Python code to help generate a response to a prompt. - - `const FileSearchFileSearch FileSearch = "file_search"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `ID string` + - `type BetaToolImageGeneration struct{…}` - The ID of the tool call object. + A tool that generates images using the GPT image models. -### Function Tool Call + - `type BetaToolLocalShell struct{…}` -- `type FunctionToolCall struct{…}` + A tool that allows the model to execute shell commands in a local environment. - - `ID string` + - `type BetaFunctionShellTool struct{…}` - The ID of the tool call object. + A tool that allows the model to execute shell commands. - - `Function FunctionToolCallFunction` + - `type BetaCustomTool struct{…}` - The definition of the function that was called. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Arguments string` + - `type BetaNamespaceTool struct{…}` - The arguments passed to the function. + Groups function/custom tools under a shared namespace. - - `Name string` + - `type BetaToolSearchTool struct{…}` - The name of the function. + Hosted or BYOT tool search configuration for deferred tools. - - `Output string` + - `type BetaWebSearchPreviewTool struct{…}` - The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type Function` + - `type BetaApplyPatchTool struct{…}` - The type of tool call. This is always going to be `function` for this type of tool call. + Allows the assistant to create, delete, or update files using unified diffs. - - `const FunctionFunction Function = "function"` + - `TopP float64` -### Function Tool Call Delta + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. -- `type FunctionToolCallDelta struct{…}` + We generally recommend altering this or `temperature` but not both. - - `Index int64` + - `Background bool` - The index of the tool call in the tool calls array. + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). - - `Type Function` + - `CompletedAt float64` - The type of tool call. This is always going to be `function` for this type of tool call. + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - - `const FunctionFunction Function = "function"` + - `Conversation BetaResponseConversation` + + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - `ID string` - The ID of the tool call object. + The unique ID of the conversation that this response was associated with. - - `Function FunctionToolCallDeltaFunction` + - `MaxOutputTokens int64` - The definition of the function that was called. + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - - `Arguments string` + - `MaxToolCalls int64` - The arguments passed to the function. + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `Name string` + - `Moderation BetaResponseModeration` - The name of the function. + Moderation results for the response input and output, if moderated completions were requested. - - `Output string` + - `Input BetaResponseModerationInputUnion` - The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. + Moderation for the response input. -### Message Creation Step Details + - `type BetaResponseModerationInputModerationResult struct{…}` -- `type MessageCreationStepDetails struct{…}` + A moderation result produced for the response input or output. - Details of the message creation by the run step. + - `Categories map[string, bool]` - - `MessageCreation MessageCreationStepDetailsMessageCreation` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `MessageID string` + - `CategoryAppliedInputTypes map[string, []string]` - The ID of the message that was created by this run step. + Which modalities of input are reflected by the score for each category. - - `Type MessageCreation` + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` - Always `message_creation`. + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` - - `const MessageCreationMessageCreation MessageCreation = "message_creation"` + - `CategoryScores map[string, float64]` -### Run Step + A dictionary of moderation categories to scores. -- `type RunStep struct{…}` + - `Flagged bool` - Represents a step in execution of a run. + A boolean indicating whether the content was flagged by any category. - - `ID string` + - `Model string` - The identifier of the run step, which can be referenced in API endpoints. + The moderation model that produced this result. - - `AssistantID string` + - `Type ModerationResult` - The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. + The object type, which was always `moderation_result` for successful moderation results. - - `CancelledAt int64` + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - The Unix timestamp (in seconds) for when the run step was cancelled. + - `type BetaResponseModerationInputError struct{…}` - - `CompletedAt int64` + An error produced while attempting moderation for the response input or output. - The Unix timestamp (in seconds) for when the run step completed. + - `Code string` - - `CreatedAt int64` + The error code. - The Unix timestamp (in seconds) for when the run step was created. + - `Message string` - - `ExpiredAt int64` + The error message. - The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + - `Type Error` - - `FailedAt int64` + The object type, which was always `error` for moderation failures. - The Unix timestamp (in seconds) for when the run step failed. + - `const ErrorError Error = "error"` - - `LastError RunStepLastError` + - `Output BetaResponseModerationOutputUnion` - The last error associated with this run step. Will be `null` if there are no errors. + Moderation for the response output. - - `Code string` + - `type BetaResponseModerationOutputModerationResult struct{…}` - One of `server_error` or `rate_limit_exceeded`. + A moderation result produced for the response input or output. - - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` + - `Categories map[string, bool]` - - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `Message string` + - `CategoryAppliedInputTypes map[string, []string]` - A human-readable description of the error. + Which modalities of input are reflected by the score for each category. - - `Metadata Metadata` + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` - 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. + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `CategoryScores map[string, float64]` - - `Object ThreadRunStep` + A dictionary of moderation categories to scores. - The object type, which is always `thread.run.step`. + - `Flagged bool` - - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` + A boolean indicating whether the content was flagged by any category. - - `RunID string` + - `Model string` - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. + The moderation model that produced this result. - - `Status RunStepStatus` + - `Type ModerationResult` - The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + The object type, which was always `moderation_result` for successful moderation results. - - `const RunStepStatusInProgress RunStepStatus = "in_progress"` + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `const RunStepStatusCancelled RunStepStatus = "cancelled"` + - `type BetaResponseModerationOutputError struct{…}` - - `const RunStepStatusFailed RunStepStatus = "failed"` + An error produced while attempting moderation for the response input or output. - - `const RunStepStatusCompleted RunStepStatus = "completed"` + - `Code string` - - `const RunStepStatusExpired RunStepStatus = "expired"` + The error code. - - `StepDetails RunStepStepDetailsUnion` + - `Message string` - The details of the run step. + The error message. - - `type MessageCreationStepDetails struct{…}` + - `Type Error` - Details of the message creation by the run step. + The object type, which was always `error` for moderation failures. - - `MessageCreation MessageCreationStepDetailsMessageCreation` + - `const ErrorError Error = "error"` - - `MessageID string` + - `PreviousResponseID string` - The ID of the message that was created by this run step. + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - - `Type MessageCreation` + - `Prompt BetaResponsePrompt` - Always `message_creation`. + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - - `const MessageCreationMessageCreation MessageCreation = "message_creation"` + - `ID string` - - `type ToolCallsStepDetails struct{…}` + The unique identifier of the prompt template to use. - Details of the tool call. + - `Variables map[string, BetaResponsePromptVariableUnion]` - - `ToolCalls []any` + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + - `string` - - `Type ToolCalls` + - `type BetaResponseInputText struct{…}` - Always `tool_calls`. + A text input to the model. - - `const ToolCallsToolCalls ToolCalls = "tool_calls"` + - `type BetaResponseInputImage struct{…}` - - `ThreadID string` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + - `type BetaResponseInputFile struct{…}` - - `Type RunStepType` + A file input to the model. - The type of run step, which can be either `message_creation` or `tool_calls`. + - `Version string` - - `const RunStepTypeMessageCreation RunStepType = "message_creation"` + Optional version of the prompt template. - - `const RunStepTypeToolCalls RunStepType = "tool_calls"` + - `PromptCacheKey string` - - `Usage RunStepUsage` + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. + - `PromptCacheOptions BetaResponsePromptCacheOptions` - - `CompletionTokens int64` + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - Number of completion tokens used over the course of the run step. + - `Mode string` - - `PromptTokens int64` + Whether implicit prompt-cache breakpoints were enabled. - Number of prompt tokens used over the course of the run step. + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` - - `TotalTokens int64` + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` - Total number of tokens used (prompt + completion). + - `Ttl string` -### Run Step Delta + The minimum lifetime applied to each cache breakpoint. -- `type RunStepDelta interface{…}` + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` -### Run Step Delta Event + - `PromptCacheRetention BetaResponsePromptCacheRetention` -- `type RunStepDeltaEvent struct{…}` + Deprecated. Use `prompt_cache_options.ttl` instead. - Represents a run step delta i.e. any changed fields on a run step during streaming. + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - `ID string` + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - The identifier of the run step, which can be referenced in API endpoints. + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - `Delta any` + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` - - `Object ThreadRunStepDelta` + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` - The object type, which is always `thread.run.step.delta`. + - `Reasoning BetaResponseReasoning` - - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` + **gpt-5 and o-series models only** -### Run Step Delta Message Delta + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). -- `type RunStepDeltaMessageDelta struct{…}` + - `Context string` - Details of the message creation by the run step. + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - - `Type MessageCreation` + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` - Always `message_creation`. + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` - - `const MessageCreationMessageCreation MessageCreation = "message_creation"` + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` - - `MessageCreation RunStepDeltaMessageDeltaMessageCreation` + - `Effort string` - - `MessageID string` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - The ID of the message that was created by this run step. + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` -### Run Step Include + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` -- `type RunStepInclude string` + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` - - `const RunStepIncludeStepDetailsToolCallsFileSearchResultsContent RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` -### Tool Call + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` -- `type ToolCall interface{…}` + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` -### Tool Call Delta + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` -- `type ToolCallDelta interface{…}` + - `GenerateSummary string` -### Tool Call Delta Object + **Deprecated:** use `summary` instead. -- `type ToolCallDeltaObject struct{…}` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - Details of the tool call. + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` - - `Type ToolCalls` + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` - Always `tool_calls`. + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` - - `const ToolCallsToolCalls ToolCalls = "tool_calls"` + - `Mode string` - - `ToolCalls []any` + Controls the reasoning execution mode for the request. - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + When returned on a response, this is the effective execution mode. -### Tool Calls Step Details + - `string` -- `type ToolCallsStepDetails struct{…}` + - `string` - Details of the tool call. + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` - - `ToolCalls []any` + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` - An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + - `Summary string` - - `Type ToolCalls` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - Always `tool_calls`. + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - - `const ToolCallsToolCalls ToolCalls = "tool_calls"` + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` -# Messages + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` -## List messages + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` -`client.Beta.Threads.Messages.List(ctx, threadID, query) (*CursorPage[Message], error)` + - `SafetyIdentifier string` -**get** `/threads/{thread_id}/messages` + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). -List messages + - `ServiceTier BetaResponseServiceTier` -### Parameters + Specifies the processing type used for serving the request. -- `threadID string` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. -- `query BetaThreadMessageListParams` + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - `After param.Field[string]` + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` - A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` - - `Before param.Field[string]` + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` - A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` - - `Limit param.Field[int64]` + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - `Status BetaResponseStatus` - - `Order param.Field[BetaThreadMessageListParamsOrder]` + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` - - `const BetaThreadMessageListParamsOrderAsc BetaThreadMessageListParamsOrder = "asc"` + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` - - `const BetaThreadMessageListParamsOrderDesc BetaThreadMessageListParamsOrder = "desc"` + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` - - `RunID param.Field[string]` + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` - Filter messages by the run ID that generated them. + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` -### Returns + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` -- `type Message struct{…}` + - `Text BetaResponseTextConfig` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - - `ID string` + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - The identifier, which can be referenced in API endpoints. + - `Format BetaResponseFormatTextConfigUnion` - - `AssistantID string` + An object specifying the format that the model must output. - If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Attachments []MessageAttachment` + The default format is `{ "type": "text" }` with no additional options. - A list of files attached to the message, and the tools they were added to. + **Not recommended for gpt-4o and newer models:** - - `FileID string` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - The ID of the file to attach to the message. + - `type BetaResponseFormatTextConfigText struct{…}` - - `Tools []MessageAttachmentToolUnion` + Default response format. Used to generate text responses. - The tools to add this file to. + - `Type Text` - - `type CodeInterpreterTool struct{…}` + The type of response format being defined. Always `text`. - - `Type CodeInterpreter` + - `const TextText Text = "text"` - The type of tool being defined: `code_interpreter` + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` + - `Name string` - - `Type FileSearch` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The type of tool being defined: `file_search` + - `Schema map[string, any]` - - `const FileSearchFileSearch FileSearch = "file_search"` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `CompletedAt int64` + - `Type JSONSchema` - The Unix timestamp (in seconds) for when the message was completed. + The type of response format being defined. Always `json_schema`. - - `Content []any` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - The content of the message in array of text and/or images. + - `Description string` - - `CreatedAt int64` + A description of what the response format is for, used by the model to + determine how to respond in the format. - The Unix timestamp (in seconds) for when the message was created. + - `Strict bool` - - `IncompleteAt int64` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The Unix timestamp (in seconds) for when the message was marked as incomplete. + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - - `IncompleteDetails MessageIncompleteDetails` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - On an incomplete message, details about why the message is incomplete. + - `Type JSONObject` - - `Reason string` + The type of response format being defined. Always `json_object`. - The reason the message is incomplete. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` + - `Verbosity BetaResponseTextConfigVerbosity` - - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - - `Metadata Metadata` + - `TopLogprobs int64` - 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. + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Truncation BetaResponseTruncation` - - `Object ThreadMessage` + The truncation strategy to use for the model response. - The object type, which is always `thread.message`. + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` - - `Role MessageRole` + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` - The entity that produced the message. One of `user` or `assistant`. + - `Usage BetaResponseUsage` - - `const MessageRoleUser MessageRole = "user"` + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - - `const MessageRoleAssistant MessageRole = "assistant"` + - `InputTokens int64` - - `RunID string` + The number of input tokens. - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - - `Status MessageStatus` + A detailed breakdown of the input tokens. - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + - `CacheWriteTokens int64` - - `const MessageStatusInProgress MessageStatus = "in_progress"` + The number of input tokens that were written to the cache. - - `const MessageStatusIncomplete MessageStatus = "incomplete"` + - `CachedTokens int64` - - `const MessageStatusCompleted MessageStatus = "completed"` + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - - `ThreadID string` + - `OutputTokens int64` - The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + The number of output tokens. + + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + + A detailed breakdown of the output tokens. + + - `ReasoningTokens int64` + + The number of reasoning tokens. + + - `TotalTokens int64` + + The total number of tokens used. + + - `User string` + + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). ### Example @@ -12492,17 +11086,13 @@ func main() { client := openai.NewClient( option.WithAPIKey("My API Key"), ) - page, err := client.Beta.Threads.Messages.List( - context.TODO(), - "thread_id", - openai.BetaThreadMessageListParams{ + betaResponse, err := client.Beta.Responses.New(context.TODO(), openai.BetaResponseNewParams{ - }, - ) + }) if err != nil { panic(err.Error()) } - fmt.Printf("%+v\n", page) + fmt.Printf("%+v\n", betaResponse.ID) } ``` @@ -12510,1803 +11100,1739 @@ func main() { ```json { - "data": [ + "id": "id", + "created_at": 0, + "error": { + "code": "server_error", + "message": "message" + }, + "incomplete_details": { + "reason": "max_output_tokens" + }, + "instructions": "string", + "metadata": { + "foo": "string" + }, + "model": "gpt-5.1", + "object": "response", + "output": [ { "id": "id", - "assistant_id": "assistant_id", - "attachments": [ + "content": [ + { + "annotations": [ { "file_id": "file_id", - "tools": [ + "filename": "filename", + "index": 0, + "type": "file_citation" + } + ], + "text": "text", + "type": "output_text", + "logprobs": [ { - "type": "code_interpreter" + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0, + "top_logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0 + } + ] } ] } ], - "completed_at": 0, - "content": [ - {} - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" + "role": "assistant", + "status": "in_progress", + "type": "message", + "agent": { + "agent_name": "agent_name" }, - "metadata": { - "foo": "string" + "phase": "commentary" + } + ], + "parallel_tool_calls": true, + "temperature": 1, + "tool_choice": "none", + "tools": [ + { + "name": "name", + "parameters": { + "foo": "bar" }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" + "strict": true, + "type": "function", + "allowed_callers": [ + "direct" + ], + "defer_loading": true, + "description": "description", + "output_schema": { + "foo": "bar" + } } ], - "first_id": "msg_abc123", - "has_more": false, - "last_id": "msg_abc123", - "object": "list" + "top_p": 1, + "background": true, + "completed_at": 0, + "conversation": { + "id": "id" + }, + "max_output_tokens": 0, + "max_tool_calls": 0, + "moderation": { + "input": { + "categories": { + "foo": true + }, + "category_applied_input_types": { + "foo": [ + "text" + ] + }, + "category_scores": { + "foo": 0 + }, + "flagged": true, + "model": "model", + "type": "moderation_result" + }, + "output": { + "categories": { + "foo": true + }, + "category_applied_input_types": { + "foo": [ + "text" + ] + }, + "category_scores": { + "foo": 0 + }, + "flagged": true, + "model": "model", + "type": "moderation_result" + } + }, + "output_text": "output_text", + "previous_response_id": "previous_response_id", + "prompt": { + "id": "id", + "variables": { + "foo": "string" + }, + "version": "version" + }, + "prompt_cache_key": "prompt-cache-key-1234", + "prompt_cache_options": { + "mode": "implicit", + "ttl": "30m" + }, + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": "auto", + "effort": "none", + "generate_summary": "auto", + "mode": "standard", + "summary": "auto" + }, + "safety_identifier": "safety-identifier-1234", + "service_tier": "auto", + "status": "completed", + "text": { + "format": { + "type": "text" + }, + "verbosity": "low" + }, + "top_logprobs": 0, + "truncation": "auto", + "usage": { + "input_tokens": 0, + "input_tokens_details": { + "cache_write_tokens": 0, + "cached_tokens": 0 + }, + "output_tokens": 0, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 0 + }, + "user": "user-1234" } ``` -## Create message +## Get a model response -`client.Beta.Threads.Messages.New(ctx, threadID, body) (*Message, error)` +`client.Beta.Responses.Get(ctx, responseID, params) (*BetaResponse, error)` -**post** `/threads/{thread_id}/messages` +**get** `/responses/{response_id}?beta=true` -Create message +Retrieves a model response with the given ID. ### Parameters -- `threadID string` +- `responseID string` -- `body BetaThreadMessageNewParams` +- `params BetaResponseGetParams` - - `Content param.Field[BetaThreadMessageNewParamsContentUnion]` + - `Include param.Field[[]BetaResponseIncludable]` - The text contents of the message. + Query param: Additional fields to include in the response. See the `include` + parameter for Response creation above for more information. - - `string` + - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` - - `type BetaThreadMessageNewParamsContentArrayOfContentParts []MessageContentPartParamUnionResp` + - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` - An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](https://platform.openai.com/docs/models). + - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` - - `type ImageFileContentBlockParam struct{…}` + - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` - References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` - - `ImageFile ImageFile` + - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` - - `FileID string` + - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` - - `Detail ImageFileDetail` + - `IncludeObfuscation param.Field[bool]` - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + Query param: When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events + to normalize payload sizes as a mitigation to certain side-channel + attacks. These obfuscation fields are included by default, but add a + small amount of overhead to the data stream. You can set + `include_obfuscation` to false to optimize for bandwidth if you trust + the network links between your application and the OpenAI API. - - `const ImageFileDetailAuto ImageFileDetail = "auto"` + - `StartingAfter param.Field[int64]` - - `const ImageFileDetailLow ImageFileDetail = "low"` + Query param: The sequence number of the event after which to start streaming. - - `const ImageFileDetailHigh ImageFileDetail = "high"` + - `` - - `Type ImageFile` + - `Betas param.Field[[]string]` - Always `image_file`. + Header param: Optional beta features to enable for this request. - - `const ImageFileImageFile ImageFile = "image_file"` + - `const BetaResponseGetParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseGetParamsOpenAIBeta = "responses_multi_agent=v1"` - - `type ImageURLContentBlockParam struct{…}` +### Returns - References an image URL in the content of a message. +- `type BetaResponse struct{…}` - - `ImageURL ImageURL` + - `ID string` - - `URL string` + Unique identifier for this Response. - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + - `CreatedAt float64` - - `Detail ImageURLDetail` + Unix timestamp (in seconds) of when this Response was created. - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` + - `Error BetaResponseError` - - `const ImageURLDetailAuto ImageURLDetail = "auto"` + An error object returned when the model fails to generate a Response. - - `const ImageURLDetailLow ImageURLDetail = "low"` + - `Code BetaResponseErrorCode` - - `const ImageURLDetailHigh ImageURLDetail = "high"` + The error code for the response. - - `Type ImageURL` + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` - The type of the content part. + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` - - `const ImageURLImageURL ImageURL = "image_url"` + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` - - `type TextContentBlockParam struct{…}` + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` - The text content that is part of a message. + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` - - `Text string` + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` - Text content to be sent to the model + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` - - `Type Text` + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` - Always `text`. + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` - - `const TextText Text = "text"` + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` - - `Role param.Field[BetaThreadMessageNewParamsRole]` + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` - The role of the entity that is creating the message. Allowed values include: + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` - - `const BetaThreadMessageNewParamsRoleUser BetaThreadMessageNewParamsRole = "user"` + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` - - `const BetaThreadMessageNewParamsRoleAssistant BetaThreadMessageNewParamsRole = "assistant"` + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` - - `Attachments param.Field[[]BetaThreadMessageNewParamsAttachment]` + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` - A list of files attached to the message, and the tools they should be added to. + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` - - `FileID string` + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` - The ID of the file to attach to the message. + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` - - `Tools []BetaThreadMessageNewParamsAttachmentToolUnion` + - `Message string` - The tools to add this file to. + A human-readable description of the error. - - `type CodeInterpreterTool struct{…}` + - `IncompleteDetails BetaResponseIncompleteDetails` - - `Type CodeInterpreter` + Details about why the response is incomplete. - The type of tool being defined: `code_interpreter` + - `Reason string` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + The reason why the response is incomplete. - - `type BetaThreadMessageNewParamsAttachmentToolFileSearch struct{…}` + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` - - `Type FileSearch` + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` - The type of tool being defined: `file_search` + - `Instructions BetaResponseInstructionsUnion` - - `const FileSearchFileSearch FileSearch = "file_search"` + A system (or developer) message inserted into the model's context. - - `Metadata param.Field[Metadata]` + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. - 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. + - `string` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` -### Returns + A list of one or many input items to the model, containing + different content types. -- `type Message struct{…}` + - `type BetaEasyInputMessage struct{…}` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `ID string` + - `Content BetaEasyInputMessageContentUnion` - The identifier, which can be referenced in API endpoints. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - - `AssistantID string` + - `string` - If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - `Attachments []MessageAttachment` + A list of one or many input items to the model, containing different content + types. - A list of files attached to the message, and the tools they were added to. + - `type BetaResponseInputText struct{…}` - - `FileID string` + A text input to the model. - The ID of the file to attach to the message. + - `Text string` - - `Tools []MessageAttachmentToolUnion` + The text input to the model. - The tools to add this file to. + - `Type InputText` - - `type CodeInterpreterTool struct{…}` + The type of the input item. Always `input_text`. - - `Type CodeInterpreter` + - `const InputTextInputText InputText = "input_text"` - The type of tool being defined: `code_interpreter` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` + - `Mode Explicit` - - `Type FileSearch` + The breakpoint mode. Always `explicit`. - The type of tool being defined: `file_search` + - `const ExplicitExplicit Explicit = "explicit"` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `type BetaResponseInputImage struct{…}` - - `CompletedAt int64` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The Unix timestamp (in seconds) for when the message was completed. + - `Detail BetaResponseInputImageDetail` - - `Content []any` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The content of the message in array of text and/or images. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `CreatedAt int64` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - The Unix timestamp (in seconds) for when the message was created. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `IncompleteAt int64` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - The Unix timestamp (in seconds) for when the message was marked as incomplete. + - `Type InputImage` - - `IncompleteDetails MessageIncompleteDetails` + The type of the input item. Always `input_image`. - On an incomplete message, details about why the message is incomplete. + - `const InputImageInputImage InputImage = "input_image"` - - `Reason string` + - `FileID string` - The reason the message is incomplete. + The ID of the file to be sent to the model. - - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` + - `ImageURL string` - - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` + - `Mode Explicit` - - `Metadata Metadata` + The breakpoint mode. Always `explicit`. - 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. + - `const ExplicitExplicit Explicit = "explicit"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `type BetaResponseInputFile struct{…}` - - `Object ThreadMessage` + A file input to the model. - The object type, which is always `thread.message`. + - `Type InputFile` - - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` + The type of the input item. Always `input_file`. - - `Role MessageRole` + - `const InputFileInputFile InputFile = "input_file"` - The entity that produced the message. One of `user` or `assistant`. + - `Detail BetaResponseInputFileDetail` - - `const MessageRoleUser MessageRole = "user"` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const MessageRoleAssistant MessageRole = "assistant"` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `RunID string` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `Status MessageStatus` + - `FileData string` - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + The content of the file to be sent to the model. - - `const MessageStatusInProgress MessageStatus = "in_progress"` + - `FileID string` - - `const MessageStatusIncomplete MessageStatus = "incomplete"` + The ID of the file to be sent to the model. - - `const MessageStatusCompleted MessageStatus = "completed"` + - `FileURL string` - - `ThreadID string` + The URL of the file to be sent to the model. - The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + - `Filename string` -### Example + The name of the file to be sent to the model. -```go -package main + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` -import ( - "context" - "fmt" + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `Mode Explicit` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - message, err := client.Beta.Threads.Messages.New( - context.TODO(), - "thread_id", - openai.BetaThreadMessageNewParams{ - Content: openai.BetaThreadMessageNewParamsContentUnion{ - OfString: openai.String("string"), - }, - Role: openai.BetaThreadMessageNewParamsRoleUser, - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", message.ID) -} -``` + The breakpoint mode. Always `explicit`. -#### Response + - `const ExplicitExplicit Explicit = "explicit"` -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - {} - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` + - `Role BetaEasyInputMessageRole` -## Modify message + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. -`client.Beta.Threads.Messages.Update(ctx, threadID, messageID, body) (*Message, error)` + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` -**post** `/threads/{thread_id}/messages/{message_id}` + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` -Modify message + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` -### Parameters + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` -- `threadID string` + - `Phase BetaEasyInputMessagePhase` -- `messageID string` + 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. -- `body BetaThreadMessageUpdateParams` + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - - `Metadata param.Field[Metadata]` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - 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. + - `Type BetaEasyInputMessageType` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The type of the message input. Always `message`. -### Returns + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` -- `type Message struct{…}` + - `type BetaResponseInputItemMessage struct{…}` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - - `ID string` + - `Content BetaResponseInputMessageContentList` - The identifier, which can be referenced in API endpoints. + A list of one or many input items to the model, containing different content + types. - - `AssistantID string` + - `Role string` - If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + The role of the message input. One of `user`, `system`, or `developer`. - - `Attachments []MessageAttachment` + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` - A list of files attached to the message, and the tools they were added to. + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` - - `FileID string` + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` - The ID of the file to attach to the message. + - `Agent BetaResponseInputItemMessageAgent` - - `Tools []MessageAttachmentToolUnion` + The agent that produced this item. - The tools to add this file to. + - `AgentName string` - - `type CodeInterpreterTool struct{…}` + The canonical name of the agent that produced this item. - - `Type CodeInterpreter` + - `Status string` - The type of tool being defined: `code_interpreter` + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - - `Type FileSearch` + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - The type of tool being defined: `file_search` + - `Type string` - - `const FileSearchFileSearch FileSearch = "file_search"` + The type of the message input. Always set to `message`. - - `CompletedAt int64` + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - The Unix timestamp (in seconds) for when the message was completed. + - `type BetaResponseOutputMessage struct{…}` - - `Content []any` + An output message from the model. - The content of the message in array of text and/or images. + - `ID string` - - `CreatedAt int64` + The unique ID of the output message. - The Unix timestamp (in seconds) for when the message was created. + - `Content []BetaResponseOutputMessageContentUnion` - - `IncompleteAt int64` + The content of the output message. - The Unix timestamp (in seconds) for when the message was marked as incomplete. + - `type BetaResponseOutputText struct{…}` - - `IncompleteDetails MessageIncompleteDetails` + A text output from the model. - On an incomplete message, details about why the message is incomplete. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `Reason string` + The annotations of the text output. - The reason the message is incomplete. + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` + A citation to a file. - - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` + - `FileID string` - - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` + The ID of the file. - - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` + - `Filename string` - - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` + The filename of the file cited. - - `Metadata Metadata` + - `Index int64` - 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. + The index of the file in the list of files. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Type FileCitation` - - `Object ThreadMessage` + The type of the file citation. Always `file_citation`. - The object type, which is always `thread.message`. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - - `Role MessageRole` + A citation for a web resource used to generate a model response. - The entity that produced the message. One of `user` or `assistant`. + - `EndIndex int64` - - `const MessageRoleUser MessageRole = "user"` + The index of the last character of the URL citation in the message. - - `const MessageRoleAssistant MessageRole = "assistant"` + - `StartIndex int64` - - `RunID string` + The index of the first character of the URL citation in the message. - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + - `Title string` - - `Status MessageStatus` + The title of the web resource. - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + - `Type URLCitation` - - `const MessageStatusInProgress MessageStatus = "in_progress"` + The type of the URL citation. Always `url_citation`. - - `const MessageStatusIncomplete MessageStatus = "incomplete"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `const MessageStatusCompleted MessageStatus = "completed"` + - `URL string` - - `ThreadID string` + The URL of the web resource. - The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` -### Example + A citation for a container file used to generate a model response. -```go -package main + - `ContainerID string` -import ( - "context" - "fmt" + The ID of the container file. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `EndIndex int64` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - message, err := client.Beta.Threads.Messages.Update( - context.TODO(), - "thread_id", - "message_id", - openai.BetaThreadMessageUpdateParams{ + The index of the last character of the container file citation in the message. - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", message.ID) -} -``` + - `FileID string` -#### Response + The ID of the file. -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - {} - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` + - `Filename string` -## Retrieve message + The filename of the container file cited. -`client.Beta.Threads.Messages.Get(ctx, threadID, messageID) (*Message, error)` + - `StartIndex int64` -**get** `/threads/{thread_id}/messages/{message_id}` + The index of the first character of the container file citation in the message. -Retrieve message + - `Type ContainerFileCitation` -### Parameters + The type of the container file citation. Always `container_file_citation`. -- `threadID string` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` -- `messageID string` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` -### Returns + A path to a file. -- `type Message struct{…}` + - `FileID string` - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + The ID of the file. - - `ID string` + - `Index int64` - The identifier, which can be referenced in API endpoints. + The index of the file in the list of files. - - `AssistantID string` + - `Type FilePath` - If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + The type of the file path. Always `file_path`. - - `Attachments []MessageAttachment` + - `const FilePathFilePath FilePath = "file_path"` - A list of files attached to the message, and the tools they were added to. + - `Text string` - - `FileID string` + The text output from the model. - The ID of the file to attach to the message. + - `Type OutputText` - - `Tools []MessageAttachmentToolUnion` + The type of the output text. Always `output_text`. - The tools to add this file to. + - `const OutputTextOutputText OutputText = "output_text"` - - `type CodeInterpreterTool struct{…}` + - `Logprobs []BetaResponseOutputTextLogprob` - - `Type CodeInterpreter` + - `Token string` - The type of tool being defined: `code_interpreter` + - `Bytes []int64` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `Logprob float64` - - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - - `Type FileSearch` + - `Token string` - The type of tool being defined: `file_search` + - `Bytes []int64` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `Logprob float64` - - `CompletedAt int64` + - `type BetaResponseOutputRefusal struct{…}` - The Unix timestamp (in seconds) for when the message was completed. + A refusal from the model. - - `Content []any` + - `Refusal string` - The content of the message in array of text and/or images. + The refusal explanation from the model. - - `CreatedAt int64` + - `Type Refusal` - The Unix timestamp (in seconds) for when the message was created. + The type of the refusal. Always `refusal`. - - `IncompleteAt int64` + - `const RefusalRefusal Refusal = "refusal"` - The Unix timestamp (in seconds) for when the message was marked as incomplete. + - `Role Assistant` - - `IncompleteDetails MessageIncompleteDetails` + The role of the output message. Always `assistant`. - On an incomplete message, details about why the message is incomplete. + - `const AssistantAssistant Assistant = "assistant"` - - `Reason string` + - `Status BetaResponseOutputMessageStatus` - The reason the message is incomplete. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` + - `Type Message` - - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` + The type of the output message. Always `message`. - - `Metadata Metadata` + - `const MessageMessage Message = "message"` - 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. + - `Agent BetaResponseOutputMessageAgent` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The agent that produced this item. - - `Object ThreadMessage` + - `AgentName string` - The object type, which is always `thread.message`. + The canonical name of the agent that produced this item. - - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` + - `Phase BetaResponseOutputMessagePhase` - - `Role MessageRole` + 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. - The entity that produced the message. One of `user` or `assistant`. + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `const MessageRoleUser MessageRole = "user"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - - `const MessageRoleAssistant MessageRole = "assistant"` + - `type BetaResponseFileSearchToolCall struct{…}` - - `RunID string` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + - `ID string` - - `Status MessageStatus` + The unique ID of the file search tool call. - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + - `Queries []string` - - `const MessageStatusInProgress MessageStatus = "in_progress"` + The queries used to search for files. - - `const MessageStatusIncomplete MessageStatus = "incomplete"` + - `Status BetaResponseFileSearchToolCallStatus` - - `const MessageStatusCompleted MessageStatus = "completed"` + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `ThreadID string` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` -### Example + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` -```go -package main + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` -import ( - "context" - "fmt" + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `Type FileSearchCall` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - message, err := client.Beta.Threads.Messages.Get( - context.TODO(), - "thread_id", - "message_id", - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", message.ID) -} -``` + The type of the file search tool call. Always `file_search_call`. -#### Response + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` -```json -{ - "id": "id", - "assistant_id": "assistant_id", - "attachments": [ - { - "file_id": "file_id", - "tools": [ - { - "type": "code_interpreter" - } - ] - } - ], - "completed_at": 0, - "content": [ - {} - ], - "created_at": 0, - "incomplete_at": 0, - "incomplete_details": { - "reason": "content_filter" - }, - "metadata": { - "foo": "string" - }, - "object": "thread.message", - "role": "user", - "run_id": "run_id", - "status": "in_progress", - "thread_id": "thread_id" -} -``` + - `Agent BetaResponseFileSearchToolCallAgent` -## Delete message + The agent that produced this item. -`client.Beta.Threads.Messages.Delete(ctx, threadID, messageID) (*MessageDeleted, error)` + - `AgentName string` -**delete** `/threads/{thread_id}/messages/{message_id}` + The canonical name of the agent that produced this item. -Delete message + - `Results []BetaResponseFileSearchToolCallResult` -### Parameters + The results of the file search tool call. -- `threadID string` + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` -- `messageID string` + 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. -### Returns + - `string` -- `type MessageDeleted struct{…}` + - `float64` - - `ID string` + - `bool` - - `Deleted bool` + - `FileID string` - - `Object ThreadMessageDeleted` + The unique ID of the file. - - `const ThreadMessageDeletedThreadMessageDeleted ThreadMessageDeleted = "thread.message.deleted"` + - `Filename string` -### Example + The name of the file. -```go -package main + - `Score float64` -import ( - "context" - "fmt" + The relevance score of the file - a value between 0 and 1. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" -) + - `Text string` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - messageDeleted, err := client.Beta.Threads.Messages.Delete( - context.TODO(), - "thread_id", - "message_id", - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", messageDeleted.ID) -} -``` + The text that was retrieved from the file. -#### Response + - `type BetaResponseComputerToolCall struct{…}` -```json -{ - "id": "id", - "deleted": true, - "object": "thread.message.deleted" -} -``` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. -## Domain Types + - `ID string` -### Annotation + The unique ID of the computer call. -- `type Annotation interface{…}` + - `CallID string` -### Annotation Delta + An identifier used when responding to the tool call with output. -- `type AnnotationDelta interface{…}` + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` -### File Citation Annotation + The pending safety checks for the computer call. -- `type FileCitationAnnotation struct{…}` + - `ID string` - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. + The ID of the pending safety check. - - `EndIndex int64` + - `Code string` - - `FileCitation FileCitationAnnotationFileCitation` + The type of the pending safety check. - - `FileID string` + - `Message string` - The ID of the specific File the citation is from. + Details about the pending safety check. - - `StartIndex int64` + - `Status BetaResponseComputerToolCallStatus` - - `Text string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The text in the message content that needs to be replaced. + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `Type FileCitation` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - Always `file_citation`. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `Type BetaResponseComputerToolCallType` -### File Citation Delta Annotation + The type of the computer call. Always `computer_call`. -- `type FileCitationDeltaAnnotation struct{…}` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. + - `Action BetaComputerActionUnion` - - `Index int64` + A click action. - The index of the annotation in the text content part. + - `type BetaComputerActionClick struct{…}` - - `Type FileCitation` + A click action. - Always `file_citation`. + - `Button string` - - `const FileCitationFileCitation FileCitation = "file_citation"` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `EndIndex int64` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `FileCitation FileCitationDeltaAnnotationFileCitation` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - `FileID string` + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - The ID of the specific File the citation is from. + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `Quote string` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - The specific quote in the file. + - `Type Click` - - `StartIndex int64` + Specifies the event type. For a click action, this property is always `click`. - - `Text string` + - `const ClickClick Click = "click"` - The text in the message content that needs to be replaced. + - `X int64` -### File Path Annotation + The x-coordinate where the click occurred. -- `type FilePathAnnotation struct{…}` + - `Y int64` - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. + The y-coordinate where the click occurred. - - `EndIndex int64` + - `Keys []string` - - `FilePath FilePathAnnotationFilePath` + The keys being held while clicking. - - `FileID string` + - `type BetaComputerActionDoubleClick struct{…}` - The ID of the file that was generated. + A double click action. - - `StartIndex int64` + - `Keys []string` - - `Text string` + The keys being held while double-clicking. - The text in the message content that needs to be replaced. + - `Type DoubleClick` - - `Type FilePath` + Specifies the event type. For a double click action, this property is always set to `double_click`. - Always `file_path`. + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `const FilePathFilePath FilePath = "file_path"` + - `X int64` -### File Path Delta Annotation + The x-coordinate where the double click occurred. -- `type FilePathDeltaAnnotation struct{…}` + - `Y int64` - A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. + The y-coordinate where the double click occurred. - - `Index int64` + - `type BetaComputerActionDrag struct{…}` - The index of the annotation in the text content part. + A drag action. - - `Type FilePath` + - `Path []BetaComputerActionDragPath` - Always `file_path`. + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `const FilePathFilePath FilePath = "file_path"` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `EndIndex int64` + - `X int64` - - `FilePath FilePathDeltaAnnotationFilePath` + The x-coordinate. - - `FileID string` + - `Y int64` - The ID of the file that was generated. + The y-coordinate. - - `StartIndex int64` + - `Type Drag` - - `Text string` + Specifies the event type. For a drag action, this property is always set to `drag`. - The text in the message content that needs to be replaced. + - `const DragDrag Drag = "drag"` -### Image File + - `Keys []string` -- `type ImageFile struct{…}` + The keys being held while dragging the mouse. - - `FileID string` + - `type BetaComputerActionKeypress struct{…}` - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + A collection of keypresses the model would like to perform. - - `Detail ImageFileDetail` + - `Keys []string` - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `const ImageFileDetailAuto ImageFileDetail = "auto"` + - `Type Keypress` - - `const ImageFileDetailLow ImageFileDetail = "low"` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `const ImageFileDetailHigh ImageFileDetail = "high"` + - `const KeypressKeypress Keypress = "keypress"` -### Image File Content Block + - `type BetaComputerActionMove struct{…}` -- `type ImageFileContentBlockParam struct{…}` + A mouse move action. - References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + - `Type Move` - - `ImageFile ImageFile` + Specifies the event type. For a move action, this property is always set to `move`. - - `FileID string` + - `const MoveMove Move = "move"` - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + - `X int64` - - `Detail ImageFileDetail` + The x-coordinate to move to. - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + - `Y int64` - - `const ImageFileDetailAuto ImageFileDetail = "auto"` + The y-coordinate to move to. - - `const ImageFileDetailLow ImageFileDetail = "low"` + - `Keys []string` - - `const ImageFileDetailHigh ImageFileDetail = "high"` + The keys being held while moving the mouse. - - `Type ImageFile` + - `type BetaComputerActionScreenshot struct{…}` - Always `image_file`. + A screenshot action. - - `const ImageFileImageFile ImageFile = "image_file"` + - `Type Screenshot` -### Image File Delta + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. -- `type ImageFileDelta struct{…}` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `Detail ImageFileDeltaDetail` + - `type BetaComputerActionScroll struct{…}` - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + A scroll action. - - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` + - `ScrollX int64` - - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` + The horizontal scroll distance. - - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` + - `ScrollY int64` - - `FileID string` + The vertical scroll distance. - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + - `Type Scroll` -### Image File Delta Block + Specifies the event type. For a scroll action, this property is always set to `scroll`. -- `type ImageFileDeltaBlock struct{…}` + - `const ScrollScroll Scroll = "scroll"` - References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + - `X int64` - - `Index int64` + The x-coordinate where the scroll occurred. - The index of the content part in the message. + - `Y int64` - - `Type ImageFile` + The y-coordinate where the scroll occurred. - Always `image_file`. + - `Keys []string` - - `const ImageFileImageFile ImageFile = "image_file"` + The keys being held while scrolling. - - `ImageFile ImageFileDelta` + - `type BetaComputerActionType struct{…}` - - `Detail ImageFileDeltaDetail` + An action to type in text. - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + - `Text string` - - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` + The text to type. - - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` + - `Type Type` - - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` + Specifies the event type. For a type action, this property is always set to `type`. - - `FileID string` + - `const TypeType Type = "type"` - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + - `type BetaComputerActionWait struct{…}` -### Image URL + A wait action. -- `type ImageURL struct{…}` + - `Type Wait` - - `URL string` + Specifies the event type. For a wait action, this property is always set to `wait`. - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + - `const WaitWait Wait = "wait"` - - `Detail ImageURLDetail` + - `Actions BetaComputerActionList` - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `const ImageURLDetailAuto ImageURLDetail = "auto"` + - `type BetaComputerActionClick struct{…}` - - `const ImageURLDetailLow ImageURLDetail = "low"` + A click action. - - `const ImageURLDetailHigh ImageURLDetail = "high"` + - `type BetaComputerActionDoubleClick struct{…}` -### Image URL Content Block + A double click action. -- `type ImageURLContentBlockParam struct{…}` + - `type BetaComputerActionDrag struct{…}` - References an image URL in the content of a message. + A drag action. - - `ImageURL ImageURL` + - `type BetaComputerActionKeypress struct{…}` - - `URL string` + A collection of keypresses the model would like to perform. - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + - `type BetaComputerActionMove struct{…}` - - `Detail ImageURLDetail` + A mouse move action. - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` + - `type BetaComputerActionScreenshot struct{…}` - - `const ImageURLDetailAuto ImageURLDetail = "auto"` + A screenshot action. - - `const ImageURLDetailLow ImageURLDetail = "low"` + - `type BetaComputerActionScroll struct{…}` - - `const ImageURLDetailHigh ImageURLDetail = "high"` + A scroll action. - - `Type ImageURL` + - `type BetaComputerActionType struct{…}` - The type of the content part. + An action to type in text. - - `const ImageURLImageURL ImageURL = "image_url"` + - `type BetaComputerActionWait struct{…}` -### Image URL Delta + A wait action. -- `type ImageURLDelta struct{…}` + - `Agent BetaResponseComputerToolCallAgent` - - `Detail ImageURLDeltaDetail` + The agent that produced this item. - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. + - `AgentName string` - - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` + The canonical name of the agent that produced this item. - - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` + - `type BetaResponseInputItemComputerCallOutput struct{…}` - - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` + The output of a computer tool call. - - `URL string` + - `CallID string` - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + The ID of the computer tool call that produced the output. -### Image URL Delta Block + - `Output BetaResponseComputerToolCallOutputScreenshot` -- `type ImageURLDeltaBlock struct{…}` + A computer screenshot image used with the computer use tool. - References an image URL in the content of a message. + - `Type ComputerScreenshot` - - `Index int64` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - The index of the content part in the message. + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `Type ImageURL` + - `FileID string` - Always `image_url`. + The identifier of an uploaded file that contains the screenshot. - - `const ImageURLImageURL ImageURL = "image_url"` + - `ImageURL string` - - `ImageURL ImageURLDelta` + The URL of the screenshot image. - - `Detail ImageURLDeltaDetail` + - `Type ComputerCallOutput` - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. + The type of the computer tool call output. Always `computer_call_output`. - - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` + - `ID string` - - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` + The ID of the computer tool call output. - - `URL string` + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + The safety checks reported by the API that have been acknowledged by the developer. -### Message + - `ID string` -- `type Message struct{…}` + The ID of the pending safety check. - Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + - `Code string` - - `ID string` + The type of the pending safety check. - The identifier, which can be referenced in API endpoints. + - `Message string` - - `AssistantID string` + Details about the pending safety check. - If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + - `Agent BetaResponseInputItemComputerCallOutputAgent` - - `Attachments []MessageAttachment` + The agent that produced this item. - A list of files attached to the message, and the tools they were added to. + - `AgentName string` - - `FileID string` + The canonical name of the agent that produced this item. - The ID of the file to attach to the message. + - `Status string` - - `Tools []MessageAttachmentToolUnion` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - The tools to add this file to. + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `type CodeInterpreterTool struct{…}` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - - `Type CodeInterpreter` + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - The type of tool being defined: `code_interpreter` + - `type BetaResponseFunctionWebSearch struct{…}` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` + - `ID string` - - `Type FileSearch` + The unique ID of the web search tool call. - The type of tool being defined: `file_search` + - `Action BetaResponseFunctionWebSearchActionUnion` - - `const FileSearchFileSearch FileSearch = "file_search"` + 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). - - `CompletedAt int64` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - The Unix timestamp (in seconds) for when the message was completed. + Action type "search" - Performs a web search query. - - `Content []any` + - `Type Search` - The content of the message in array of text and/or images. + The action type. - - `CreatedAt int64` + - `const SearchSearch Search = "search"` - The Unix timestamp (in seconds) for when the message was created. + - `Queries []string` - - `IncompleteAt int64` + The search queries. - The Unix timestamp (in seconds) for when the message was marked as incomplete. + - `Query string` - - `IncompleteDetails MessageIncompleteDetails` + The search query. - On an incomplete message, details about why the message is incomplete. + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `Reason string` + The sources used in the search. - The reason the message is incomplete. + - `Type URL` - - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` + The type of source. Always `url`. - - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` + - `const URLURL URL = "url"` - - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` + - `URL string` - - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` + The URL of the source. - - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `Metadata Metadata` + Action type "open_page" - Opens a specific URL from search results. - 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. + - `Type OpenPage` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The action type. - - `Object ThreadMessage` + - `const OpenPageOpenPage OpenPage = "open_page"` - The object type, which is always `thread.message`. + - `URL string` - - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` + The URL opened by the model. - - `Role MessageRole` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - The entity that produced the message. One of `user` or `assistant`. + Action type "find_in_page": Searches for a pattern within a loaded page. - - `const MessageRoleUser MessageRole = "user"` + - `Pattern string` - - `const MessageRoleAssistant MessageRole = "assistant"` + The pattern or text to search for within the page. - - `RunID string` + - `Type FindInPage` - The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + The action type. - - `Status MessageStatus` + - `const FindInPageFindInPage FindInPage = "find_in_page"` - The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + - `URL string` - - `const MessageStatusInProgress MessageStatus = "in_progress"` + The URL of the page searched for the pattern. - - `const MessageStatusIncomplete MessageStatus = "incomplete"` + - `Status BetaResponseFunctionWebSearchStatus` - - `const MessageStatusCompleted MessageStatus = "completed"` + The status of the web search tool call. - - `ThreadID string` + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` -### Message Content + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` -- `type MessageContent interface{…}` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` -### Message Content Delta + - `Type WebSearchCall` -- `type MessageContentDelta interface{…}` + The type of the web search tool call. Always `web_search_call`. -### Message Content Part Param + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` -- `type MessageContentPartParamUnionResp interface{…}` + - `Agent BetaResponseFunctionWebSearchAgent` - References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + The agent that produced this item. - - `type ImageFileContentBlockParam struct{…}` + - `AgentName string` - References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + The canonical name of the agent that produced this item. - - `ImageFile ImageFile` + - `type BetaResponseFunctionToolCall struct{…}` - - `FileID string` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. + - `Arguments string` - - `Detail ImageFileDetail` + A JSON string of the arguments to pass to the function. - Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + - `CallID string` - - `const ImageFileDetailAuto ImageFileDetail = "auto"` + The unique ID of the function tool call generated by the model. - - `const ImageFileDetailLow ImageFileDetail = "low"` + - `Name string` - - `const ImageFileDetailHigh ImageFileDetail = "high"` + The name of the function to run. - - `Type ImageFile` + - `Type FunctionCall` - Always `image_file`. + The type of the function tool call. Always `function_call`. - - `const ImageFileImageFile ImageFile = "image_file"` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `type ImageURLContentBlockParam struct{…}` + - `ID string` - References an image URL in the content of a message. + The unique ID of the function tool call. - - `ImageURL ImageURL` + - `Agent BetaResponseFunctionToolCallAgent` - - `URL string` + The agent that produced this item. - The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + - `AgentName string` - - `Detail ImageURLDetail` + The canonical name of the agent that produced this item. - Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` + - `Caller BetaResponseFunctionToolCallCallerUnion` - - `const ImageURLDetailAuto ImageURLDetail = "auto"` + The execution context that produced this tool call. - - `const ImageURLDetailLow ImageURLDetail = "low"` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `const ImageURLDetailHigh ImageURLDetail = "high"` + - `Type Direct` - - `Type ImageURL` + - `const DirectDirect Direct = "direct"` - The type of the content part. + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - `const ImageURLImageURL ImageURL = "image_url"` + - `CallerID string` - - `type TextContentBlockParam struct{…}` + The call ID of the program item that produced this tool call. - The text content that is part of a message. + - `Type Program` - - `Text string` + - `const ProgramProgram Program = "program"` - Text content to be sent to the model + - `Namespace string` - - `Type Text` + The namespace of the function to run. - Always `text`. + - `Status BetaResponseFunctionToolCallStatus` - - `const TextText Text = "text"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. -### Message Deleted + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` -- `type MessageDeleted struct{…}` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `ID string` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `Deleted bool` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `Object ThreadMessageDeleted` + The output of a function tool call. - - `const ThreadMessageDeletedThreadMessageDeleted ThreadMessageDeleted = "thread.message.deleted"` + - `CallID string` -### Message Delta + The unique ID of the function tool call generated by the model. -- `type MessageDelta struct{…}` + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - The delta containing the fields that have changed on the Message. + Text, image, or file output of the function tool call. - - `Content []any` + - `string` - The content of the message in array of text and/or images. + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `Role MessageDeltaRole` + An array of content outputs (text, image, file) for the function tool call. - The entity that produced the message. One of `user` or `assistant`. + - `type BetaResponseInputTextContent struct{…}` - - `const MessageDeltaRoleUser MessageDeltaRole = "user"` - - - `const MessageDeltaRoleAssistant MessageDeltaRole = "assistant"` - -### Message Delta Event - -- `type MessageDeltaEvent struct{…}` - - Represents a message delta i.e. any changed fields on a message during streaming. - - - `ID string` - - The identifier of the message, which can be referenced in API endpoints. + A text input to the model. - - `Delta MessageDelta` + - `Text string` - The delta containing the fields that have changed on the Message. + The text input to the model. - - `Content []any` + - `Type InputText` - The content of the message in array of text and/or images. + The type of the input item. Always `input_text`. - - `Role MessageDeltaRole` + - `const InputTextInputText InputText = "input_text"` - The entity that produced the message. One of `user` or `assistant`. + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `const MessageDeltaRoleUser MessageDeltaRole = "user"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const MessageDeltaRoleAssistant MessageDeltaRole = "assistant"` + - `Mode Explicit` - - `Object ThreadMessageDelta` + The breakpoint mode. Always `explicit`. - The object type, which is always `thread.message.delta`. + - `const ExplicitExplicit Explicit = "explicit"` - - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` + - `type BetaResponseInputImageContent struct{…}` -### Refusal Content Block + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) -- `type RefusalContentBlock struct{…}` + - `Type InputImage` - The refusal content generated by the assistant. + The type of the input item. Always `input_image`. - - `Refusal string` + - `const InputImageInputImage InputImage = "input_image"` - - `Type Refusal` + - `Detail BetaResponseInputImageContentDetail` - Always `refusal`. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const RefusalRefusal Refusal = "refusal"` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` -### Refusal Delta Block + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` -- `type RefusalDeltaBlock struct{…}` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - The refusal content that is part of a message. + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - - `Index int64` + - `FileID string` - The index of the refusal part in the message. + The ID of the file to be sent to the model. - - `Type Refusal` + - `ImageURL string` - Always `refusal`. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `const RefusalRefusal Refusal = "refusal"` + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `Refusal string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. -### Text + - `Mode Explicit` -- `type Text struct{…}` + The breakpoint mode. Always `explicit`. - - `Annotations []any` + - `const ExplicitExplicit Explicit = "explicit"` - - `Value string` + - `type BetaResponseInputFileContent struct{…}` - The data that makes up the text. + A file input to the model. -### Text Content Block + - `Type InputFile` -- `type TextContentBlock struct{…}` + The type of the input item. Always `input_file`. - The text content that is part of a message. + - `const InputFileInputFile InputFile = "input_file"` - - `Text Text` + - `Detail BetaResponseInputFileContentDetail` - - `Annotations []any` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `Value string` + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - The data that makes up the text. + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - - `Type Text` + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - Always `text`. + - `FileData string` - - `const TextText Text = "text"` + The base64-encoded data of the file to be sent to the model. -### Text Content Block Param + - `FileID string` -- `type TextContentBlockParam struct{…}` + The ID of the file to be sent to the model. - The text content that is part of a message. + - `FileURL string` - - `Text string` + The URL of the file to be sent to the model. - Text content to be sent to the model + - `Filename string` - - `Type Text` + The name of the file to be sent to the model. - Always `text`. + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - - `const TextText Text = "text"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. -### Text Delta + - `Mode Explicit` -- `type TextDelta struct{…}` + The breakpoint mode. Always `explicit`. - - `Annotations []any` + - `const ExplicitExplicit Explicit = "explicit"` - - `Value string` + - `Type FunctionCallOutput` - The data that makes up the text. + The type of the function tool call output. Always `function_call_output`. -### Text Delta Block + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` -- `type TextDeltaBlock struct{…}` + - `ID string` - The text content that is part of a message. + The unique ID of the function tool call output. Populated when this item is returned via API. - - `Index int64` + - `Agent BetaResponseInputItemFunctionCallOutputAgent` - The index of the content part in the message. + The agent that produced this item. - - `Type Text` + - `AgentName string` - Always `text`. + The canonical name of the agent that produced this item. - - `const TextText Text = "text"` + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - - `Text TextDelta` + The execution context that produced this tool call. - - `Annotations []any` + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - - `Value string` + - `Type Direct` - The data that makes up the text. + The caller type. Always `direct`. -# Responses + - `const DirectDirect Direct = "direct"` -## Create a model response + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` -`client.Beta.Responses.New(ctx, params) (*BetaResponse, error)` + - `CallerID string` -**post** `/responses?beta=true` + The call ID of the program item that produced this tool call. -Create a model response + - `Type Program` -### Parameters + The caller type. Always `program`. -- `params BetaResponseNewParams` + - `const ProgramProgram Program = "program"` - - `Background param.Field[bool]` + - `Status string` - Body param: Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `ContextManagement param.Field[[]BetaResponseNewParamsContextManagement]` + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - Body param: Context management configuration for this request. + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - - `Type string` + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - The context management entry type. Currently only 'compaction' is supported. + - `type BetaResponseInputItemAgentMessage struct{…}` - - `CompactThreshold int64` + A message routed between agents. - Token threshold at which compaction should be triggered for this entry. + - `Author string` - - `Conversation param.Field[BetaResponseNewParamsConversationUnion]` + The sending agent identity. - Body param: The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. - Input items and output items from this response are automatically added to this conversation after this response completes. + - `Content []BetaResponseInputItemAgentMessageContentUnion` - - `string` + Plaintext, image, or encrypted content sent between agents. - - `type BetaResponseConversationParamResp struct{…}` + - `type BetaResponseInputTextContent struct{…}` - The conversation that this response belongs to. + A text input to the model. - - `ID string` + - `type BetaResponseInputImageContent struct{…}` - The unique ID of the conversation. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `Include param.Field[[]BetaResponseIncludable]` + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - Body param: Specify additional output data to include in the model response. Currently supported values are: + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `web_search_call.action.sources`: Include the sources of the web search tool call. - - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - - `computer_call_output.output.image_url`: Include image urls from the computer call output. - - `file_search_call.results`: Include the search results of the file search tool call. - - `message.input_image.image_url`: Include image urls from the input message. - - `message.output_text.logprobs`: Include logprobs with assistant messages. - - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). + - `EncryptedContent string` - - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` + Opaque encrypted content. - - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` + - `Type EncryptedContent` - - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` + The type of the input item. Always `encrypted_content`. - - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` + - `Recipient string` - - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` + The destination agent identity. - - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` + - `Type AgentMessage` - - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` + The item type. Always `agent_message`. - - `Input param.Field[BetaResponseNewParamsInputUnion]` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - Body param: Text, image, or file inputs to the model, used to generate a response. + - `ID string` - Learn more: + The unique ID of this agent message item. - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Image inputs](https://platform.openai.com/docs/guides/images) - - [File inputs](https://platform.openai.com/docs/guides/pdf-files) - - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) - - [Function calling](https://platform.openai.com/docs/guides/function-calling) + - `Agent BetaResponseInputItemAgentMessageAgent` - - `string` + The agent that produced this item. - - `type BetaResponseInput []BetaResponseInputItemUnion` + - `AgentName string` - A list of one or many input items to the model, containing - different content types. + The canonical name of the agent that produced this item. - - `type BetaEasyInputMessage struct{…}` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `Action string` - - `Content BetaEasyInputMessageContentUnion` + The multi-agent action that was executed. - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - - `string` + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - A list of one or many input items to the model, containing different content - types. + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `type BetaResponseInputText struct{…}` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - A text input to the model. + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `Text string` + - `Arguments string` - The text input to the model. + The action arguments as a JSON string. - - `Type InputText` + - `CallID string` - The type of the input item. Always `input_text`. + The unique ID linking this call to its output. - - `const InputTextInputText InputText = "input_text"` + - `Type MultiAgentCall` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + The item type. Always `multi_agent_call`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `Mode Explicit` + - `ID string` - The breakpoint mode. Always `explicit`. + The unique ID of this multi-agent call. - - `const ExplicitExplicit Explicit = "explicit"` + - `Agent BetaResponseInputItemMultiAgentCallAgent` - - `type BetaResponseInputImage struct{…}` + The agent that produced this item. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `AgentName string` - - `Detail BetaResponseInputImageDetail` + The canonical name of the agent that produced this item. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `Action string` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + The multi-agent action that produced this result. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `Type InputImage` + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - The type of the input item. Always `input_image`. + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - - `const InputImageInputImage InputImage = "input_image"` + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - - `FileID string` + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - The ID of the file to be sent to the model. + - `CallID string` - - `ImageURL string` + The unique ID of the multi-agent call. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + Text output returned by the multi-agent action. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Text string` - - `Mode Explicit` + The text content. - The breakpoint mode. Always `explicit`. + - `Type OutputText` - - `const ExplicitExplicit Explicit = "explicit"` + The content type. Always `output_text`. - - `type BetaResponseInputFile struct{…}` + - `const OutputTextOutputText OutputText = "output_text"` - A file input to the model. + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - `Type InputFile` + Citations associated with the text content. - The type of the input item. Always `input_file`. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `const InputFileInputFile InputFile = "input_file"` + - `FileID string` - - `Detail BetaResponseInputFileDetail` + The ID of the file. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Filename string` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + The filename of the file cited. - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `Index int64` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + The index of the file in the list of files. - - `FileData string` + - `Type FileCitation` - The content of the file to be sent to the model. + The citation type. Always `file_citation`. - - `FileID string` + - `const FileCitationFileCitation FileCitation = "file_citation"` - The ID of the file to be sent to the model. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - - `FileURL string` + - `EndIndex int64` - The URL of the file to be sent to the model. + The index of the last character of the citation in the message. - - `Filename string` + - `StartIndex int64` - The name of the file to be sent to the model. + The index of the first character of the citation in the message. - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `Title string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The title of the cited resource. - - `Mode Explicit` + - `Type URLCitation` - The breakpoint mode. Always `explicit`. + The citation type. Always `url_citation`. - - `const ExplicitExplicit Explicit = "explicit"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `Role BetaEasyInputMessageRole` + - `URL string` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + The URL of the cited resource. - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + - `ContainerID string` - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + The ID of the container. - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `EndIndex int64` - - `Phase BetaEasyInputMessagePhase` + The index of the last character of the citation in the message. - 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. + - `FileID string` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + The ID of the container file. - - `Type BetaEasyInputMessageType` + - `Filename string` - The type of the message input. Always `message`. + The filename of the container file cited. - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + - `StartIndex int64` - - `type BetaResponseInputItemMessage struct{…}` + The index of the first character of the citation in the message. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `Type ContainerFileCitation` - - `Content BetaResponseInputMessageContentList` + The citation type. Always `container_file_citation`. - A list of one or many input items to the model, containing different content - types. + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `Role string` + - `Type MultiAgentCallOutput` - The role of the message input. One of `user`, `system`, or `developer`. + The item type. Always `multi_agent_call_output`. - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + - `ID string` - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + The unique ID of this multi-agent call output. - - `Agent BetaResponseInputItemMessageAgent` + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` The agent that produced this item. @@ -14314,1232 +12840,1271 @@ Create a model response The canonical name of the agent that produced this item. - - `Status string` + - `type BetaResponseInputItemToolSearchCall struct{…}` - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Arguments any` - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + The arguments supplied to the tool search call. - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + - `Type ToolSearchCall` - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + The item type. Always `tool_search_call`. - - `Type string` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - The type of the message input. Always set to `message`. + - `ID string` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + The unique ID of this tool search call. - - `type BetaResponseOutputMessage struct{…}` + - `Agent BetaResponseInputItemToolSearchCallAgent` - An output message from the model. + The agent that produced this item. - - `ID string` + - `AgentName string` - The unique ID of the output message. + The canonical name of the agent that produced this item. - - `Content []BetaResponseOutputMessageContentUnion` + - `CallID string` - The content of the output message. + The unique ID of the tool search call generated by the model. - - `type BetaResponseOutputText struct{…}` + - `Execution string` - A text output from the model. + Whether tool search was executed by the server or by the client. - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - The annotations of the text output. + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `Status string` - A citation to a file. + The status of the tool search call. - - `FileID string` + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - The ID of the file. + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - - `Filename string` + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - The filename of the file cited. + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - - `Index int64` + - `Tools []BetaToolUnion` - The index of the file in the list of files. + The loaded tool definitions returned by the tool search output. - - `Type FileCitation` + - `type BetaFunctionTool struct{…}` - The type of the file citation. Always `file_citation`. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `Name string` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + The name of the function to call. - A citation for a web resource used to generate a model response. + - `Parameters map[string, any]` - - `EndIndex int64` + A JSON schema object describing the parameters of the function. - The index of the last character of the URL citation in the message. + - `Strict bool` - - `StartIndex int64` + Whether strict parameter validation is enforced for this function tool. - The index of the first character of the URL citation in the message. + - `Type Function` - - `Title string` + The type of the function tool. Always `function`. - The title of the web resource. + - `const FunctionFunction Function = "function"` - - `Type URLCitation` + - `AllowedCallers []string` - The type of the URL citation. Always `url_citation`. + The tool invocation context(s). - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `URL string` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - The URL of the web resource. + - `DeferLoading bool` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + Whether this function is deferred and loaded via tool search. - A citation for a container file used to generate a model response. + - `Description string` - - `ContainerID string` + A description of the function. Used by the model to determine whether or not to call the function. - The ID of the container file. + - `OutputSchema map[string, any]` - - `EndIndex int64` + A JSON schema object describing the JSON value encoded in string outputs for this function. - The index of the last character of the container file citation in the message. + - `type BetaFileSearchTool struct{…}` - - `FileID string` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The ID of the file. + - `Type FileSearch` - - `Filename string` + The type of the file search tool. Always `file_search`. - The filename of the container file cited. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `StartIndex int64` + - `VectorStoreIDs []string` - The index of the first character of the container file citation in the message. + The IDs of the vector stores to search. - - `Type ContainerFileCitation` + - `Filters BetaFileSearchToolFiltersUnion` - The type of the container file citation. Always `container_file_citation`. + A filter to apply. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - A path to a file. + - `Key string` - - `FileID string` + The key to compare against the value. - The ID of the file. + - `Type string` - - `Index int64` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - The index of the file in the list of files. + - `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 - - `Type FilePath` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - The type of the file path. Always `file_path`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - `const FilePathFilePath FilePath = "file_path"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `Text string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - The text output from the model. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Type OutputText` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The type of the output text. Always `output_text`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `const OutputTextOutputText OutputText = "output_text"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `Logprobs []BetaResponseOutputTextLogprob` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - `Token string` + The value to compare against the attribute key; supports string, number, or boolean types. - - `Bytes []int64` + - `string` - - `Logprob float64` + - `float64` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `bool` - - `Token string` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `Bytes []int64` + - `string` - - `Logprob float64` + - `float64` - - `type BetaResponseOutputRefusal struct{…}` + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - A refusal from the model. + Combine multiple filters using `and` or `or`. - - `Refusal string` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - The refusal explanation from the model. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `Type Refusal` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - The type of the refusal. Always `refusal`. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const RefusalRefusal Refusal = "refusal"` + - `Key string` - - `Role Assistant` + The key to compare against the value. - The role of the output message. Always `assistant`. + - `Type string` - - `const AssistantAssistant Assistant = "assistant"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `Status BetaResponseOutputMessageStatus` + - `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 - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `Type Message` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - The type of the output message. Always `message`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `const MessageMessage Message = "message"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - `Agent BetaResponseOutputMessageAgent` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - The agent that produced this item. + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - `AgentName string` + The value to compare against the attribute key; supports string, number, or boolean types. - The canonical name of the agent that produced this item. + - `string` - - `Phase BetaResponseOutputMessagePhase` + - `float64` - 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. + - `bool` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `type BetaResponseFileSearchToolCall struct{…}` + - `string` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `float64` - - `ID string` + - `Type string` - The unique ID of the file search tool call. + Type of operation: `and` or `or`. - - `Queries []string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - The queries used to search for files. + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - `Status BetaResponseFileSearchToolCallStatus` + - `MaxNumResults int64` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + - `RankingOptions BetaFileSearchToolRankingOptions` - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + Ranking options for search. - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + - `EmbeddingWeight float64` - - `Type FileSearchCall` + The weight of the embedding in the reciprocal ranking fusion. - The type of the file search tool call. Always `file_search_call`. + - `TextWeight float64` - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + The weight of the text in the reciprocal ranking fusion. - - `Agent BetaResponseFileSearchToolCallAgent` + - `Ranker string` - The agent that produced this item. + The ranker to use for the file search. - - `AgentName string` + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - The canonical name of the agent that produced this item. + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - - `Results []BetaResponseFileSearchToolCallResult` + - `ScoreThreshold float64` - The results of the file search tool call. + 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. - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + - `type BetaComputerTool struct{…}` - 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. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `string` + - `Type Computer` - - `float64` + The type of the computer tool. Always `computer`. - - `bool` + - `const ComputerComputer Computer = "computer"` - - `FileID string` + - `type BetaComputerUsePreviewTool struct{…}` - The unique ID of the file. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Filename string` + - `DisplayHeight int64` - The name of the file. + The height of the computer display. - - `Score float64` + - `DisplayWidth int64` - The relevance score of the file - a value between 0 and 1. + The width of the computer display. - - `Text string` + - `Environment BetaComputerUsePreviewToolEnvironment` - The text that was retrieved from the file. + The type of computer environment to control. - - `type BetaResponseComputerToolCall struct{…}` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `ID string` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - The unique ID of the computer call. + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `CallID string` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - An identifier used when responding to the tool call with output. + - `Type ComputerUsePreview` - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + The type of the computer use tool. Always `computer_use_preview`. - The pending safety checks for the computer call. + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - - `ID string` + - `type BetaWebSearchTool struct{…}` - The ID of the pending safety check. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Code string` + - `Type BetaWebSearchToolType` - The type of the pending safety check. + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `Message string` + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - Details about the pending safety check. + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - - `Status BetaResponseComputerToolCallStatus` + - `Filters BetaWebSearchToolFilters` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Filters for the search. - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `AllowedDomains []string` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `Type BetaResponseComputerToolCallType` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - The type of the computer call. Always `computer_call`. + 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 BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - - `Action BetaComputerActionUnion` + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - A click action. + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - - `type BetaComputerActionClick struct{…}` + - `UserLocation BetaWebSearchToolUserLocation` - A click action. + The approximate location of the user. - - `Button string` + - `City string` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + Free text input for the city of the user, e.g. `San Francisco`. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `Country string` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `Region string` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + Free text input for the region of the user, e.g. `California`. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `Timezone string` - - `Type Click` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - Specifies the event type. For a click action, this property is always `click`. + - `Type string` - - `const ClickClick Click = "click"` + The type of location approximation. Always `approximate`. - - `X int64` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - The x-coordinate where the click occurred. + - `type BetaToolMcp struct{…}` - - `Y int64` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The y-coordinate where the click occurred. + - `ServerLabel string` - - `Keys []string` + A label for this MCP server, used to identify it in tool calls. - The keys being held while clicking. + - `Type Mcp` - - `type BetaComputerActionDoubleClick struct{…}` + The type of the MCP tool. Always `mcp`. - A double click action. + - `const McpMcp Mcp = "mcp"` - - `Keys []string` + - `AllowedCallers []string` - The keys being held while double-clicking. + The tool invocation context(s). - - `Type DoubleClick` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `X int64` + List of allowed tool names or a filter object. - The x-coordinate where the double click occurred. + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `Y int64` + A string array of allowed tool names - The y-coordinate where the double click occurred. + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `type BetaComputerActionDrag struct{…}` + A filter object to specify which tools are allowed. - A drag action. + - `ReadOnly bool` - - `Path []BetaComputerActionDragPath` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `ToolNames []string` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + List of allowed tool names. - - `X int64` + - `Authorization string` - The x-coordinate. + 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. - - `Y int64` + - `ConnectorID string` - The y-coordinate. + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `Type Drag` + Currently supported `connector_id` values are: - Specifies the event type. For a drag action, this property is always set to `drag`. + - 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 DragDrag Drag = "drag"` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `Keys []string` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - The keys being held while dragging the mouse. + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `type BetaComputerActionKeypress struct{…}` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - A collection of keypresses the model would like to perform. + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - - `Keys []string` + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - - `Type Keypress` + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `DeferLoading bool` - - `const KeypressKeypress Keypress = "keypress"` + Whether this MCP tool is deferred and discovered via tool search. - - `type BetaComputerActionMove struct{…}` + - `Headers map[string, string]` - A mouse move action. + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `Type Move` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - Specifies the event type. For a move action, this property is always set to `move`. + Specify which of the MCP server's tools require approval. - - `const MoveMove Move = "move"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `X int64` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - The x-coordinate to move to. + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `Y int64` + A filter object to specify which tools are allowed. - The y-coordinate to move to. + - `ReadOnly bool` - - `Keys []string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The keys being held while moving the mouse. + - `ToolNames []string` - - `type BetaComputerActionScreenshot struct{…}` + List of allowed tool names. - A screenshot action. + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - - `Type Screenshot` + A filter object to specify which tools are allowed. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `ReadOnly bool` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `type BetaComputerActionScroll struct{…}` + - `ToolNames []string` - A scroll action. + List of allowed tool names. - - `ScrollX int64` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - The horizontal scroll distance. + 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. - - `ScrollY int64` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - The vertical scroll distance. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - - `Type Scroll` + - `ServerDescription string` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + Optional description of the MCP server, used to provide more context. - - `const ScrollScroll Scroll = "scroll"` + - `ServerURL string` - - `X int64` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - The x-coordinate where the scroll occurred. + - `TunnelID string` - - `Y int64` + 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. - The y-coordinate where the scroll occurred. + - `type BetaToolCodeInterpreter struct{…}` - - `Keys []string` + A tool that runs Python code to help generate a response to a prompt. - The keys being held while scrolling. + - `Container BetaToolCodeInterpreterContainerUnion` - - `type BetaComputerActionType struct{…}` + 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. - An action to type in text. + - `string` - - `Text string` + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - The text to type. + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `Type Type` + - `Type Auto` - Specifies the event type. For a type action, this property is always set to `type`. + Always `auto`. - - `const TypeType Type = "type"` + - `const AutoAuto Auto = "auto"` - - `type BetaComputerActionWait struct{…}` + - `FileIDs []string` - A wait action. + An optional list of uploaded files to make available to your code. - - `Type Wait` + - `MemoryLimit string` - Specifies the event type. For a wait action, this property is always set to `wait`. + The memory limit for the code interpreter container. - - `const WaitWait Wait = "wait"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - - `Actions BetaComputerActionList` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - - `type BetaComputerActionClick struct{…}` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - A click action. + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - - `type BetaComputerActionDoubleClick struct{…}` + Network access policy for the container. - A double click action. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `type BetaComputerActionDrag struct{…}` + - `Type Disabled` - A drag action. + Disable outbound network access. Always `disabled`. - - `type BetaComputerActionKeypress struct{…}` + - `const DisabledDisabled Disabled = "disabled"` - A collection of keypresses the model would like to perform. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `type BetaComputerActionMove struct{…}` + - `AllowedDomains []string` - A mouse move action. + A list of allowed domains when type is `allowlist`. - - `type BetaComputerActionScreenshot struct{…}` + - `Type Allowlist` - A screenshot action. + Allow outbound network access only to specified domains. Always `allowlist`. - - `type BetaComputerActionScroll struct{…}` + - `const AllowlistAllowlist Allowlist = "allowlist"` - A scroll action. + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `type BetaComputerActionType struct{…}` + Optional domain-scoped secrets for allowlisted domains. - An action to type in text. + - `Domain string` - - `type BetaComputerActionWait struct{…}` + The domain associated with the secret. - A wait action. + - `Name string` - - `Agent BetaResponseComputerToolCallAgent` + The name of the secret to inject for the domain. - The agent that produced this item. + - `Value string` - - `AgentName string` + The secret value to inject for the domain. - The canonical name of the agent that produced this item. + - `Type CodeInterpreter` - - `type BetaResponseInputItemComputerCallOutput struct{…}` + The type of the code interpreter tool. Always `code_interpreter`. - The output of a computer tool call. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `CallID string` + - `AllowedCallers []string` - The ID of the computer tool call that produced the output. + The tool invocation context(s). - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - A computer screenshot image used with the computer use tool. + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `Type ComputerScreenshot` + - `type BetaToolProgrammaticToolCalling struct{…}` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `Type ProgrammaticToolCalling` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + The type of the tool. Always `programmatic_tool_calling`. - - `FileID string` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - The identifier of an uploaded file that contains the screenshot. + - `type BetaToolImageGeneration struct{…}` - - `ImageURL string` + A tool that generates images using the GPT image models. - The URL of the screenshot image. + - `Type ImageGeneration` - - `Type ComputerCallOutput` + The type of the image generation tool. Always `image_generation`. - The type of the computer tool call output. Always `computer_call_output`. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `Action string` - - `ID string` + Whether to generate a new image or edit an existing image. Default: `auto`. - The ID of the computer tool call output. + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - The safety checks reported by the API that have been acknowledged by the developer. + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - - `ID string` + - `Background string` - The ID of the pending safety check. + 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. - - `Code string` + `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. - The type of the pending safety check. + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - - `Message string` + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - Details about the pending safety check. + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - - `Agent BetaResponseInputItemComputerCallOutputAgent` + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - The agent that produced this item. + - `InputFidelity string` - - `AgentName 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`. - The canonical name of the agent that produced this item. + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - - `Status string` + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + - `InputImageMask BetaToolImageGenerationInputImageMask` - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `FileID string` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + File ID for the mask image. - - `type BetaResponseFunctionWebSearch struct{…}` + - `ImageURL string` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + Base64-encoded mask image. - - `ID string` + - `Model string` - The unique ID of the web search tool call. + The image generation model to use. Default: `gpt-image-1`. - - `Action BetaResponseFunctionWebSearchActionUnion` + - `string` - 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). + - `string` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - Action type "search" - Performs a web search query. + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `Type Search` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - The action type. + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `const SearchSearch Search = "search"` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - - `Queries []string` + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - The search queries. + - `Moderation string` - - `Query string` + Moderation level for the generated image. Default: `auto`. - The search query. + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - The sources used in the search. + - `OutputCompression int64` - - `Type URL` + Compression level for the output image. Default: 100. - The type of source. Always `url`. + - `OutputFormat string` - - `const URLURL URL = "url"` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `URL string` + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - The URL of the source. + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - Action type "open_page" - Opens a specific URL from search results. + - `PartialImages int64` - - `Type OpenPage` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The action type. + - `Quality string` - - `const OpenPageOpenPage OpenPage = "open_page"` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `URL string` + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - The URL opened by the model. + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - Action type "find_in_page": Searches for a pattern within a loaded page. + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - - `Pattern string` + - `Size string` - The pattern or text to search for within the page. + 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`. - - `Type FindInPage` + - `string` - The action type. + - `string` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - - `URL string` + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - The URL of the page searched for the pattern. + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - - `Status BetaResponseFunctionWebSearchStatus` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - The status of the web search tool call. + - `type BetaToolLocalShell struct{…}` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + A tool that allows the model to execute shell commands in a local environment. - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + - `Type LocalShell` - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + The type of the local shell tool. Always `local_shell`. - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `Type WebSearchCall` + - `type BetaFunctionShellTool struct{…}` - The type of the web search tool call. Always `web_search_call`. + A tool that allows the model to execute shell commands. - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `Type Shell` - - `Agent BetaResponseFunctionWebSearchAgent` + The type of the shell tool. Always `shell`. - The agent that produced this item. + - `const ShellShell Shell = "shell"` - - `AgentName string` + - `AllowedCallers []string` - The canonical name of the agent that produced this item. + The tool invocation context(s). - - `type BetaResponseFunctionToolCall struct{…}` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - `Arguments string` + - `Environment BetaFunctionShellToolEnvironmentUnion` - A JSON string of the arguments to pass to the function. + - `type BetaContainerAuto struct{…}` - - `CallID string` + - `Type ContainerAuto` - The unique ID of the function tool call generated by the model. + Automatically creates a container for this request - - `Name string` + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - The name of the function to run. + - `FileIDs []string` - - `Type FunctionCall` + An optional list of uploaded files to make available to your code. - The type of the function tool call. Always `function_call`. + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + The memory limit for the container. - - `ID string` + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - The unique ID of the function tool call. + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `Agent BetaResponseFunctionToolCallAgent` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - The agent that produced this item. + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `AgentName string` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - The canonical name of the agent that produced this item. + Network access policy for the container. - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The execution context that produced this tool call. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `Skills []BetaContainerAutoSkillUnion` - - `Type Direct` + An optional list of skills referenced by id or inline data. - - `const DirectDirect Direct = "direct"` + - `type BetaSkillReference struct{…}` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `SkillID string` - - `CallerID string` + The ID of the referenced skill. - The call ID of the program item that produced this tool call. + - `Type SkillReference` - - `Type Program` + References a skill created with the /v1/skills endpoint. - - `const ProgramProgram Program = "program"` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `Namespace string` + - `Version string` - The namespace of the function to run. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `Status BetaResponseFunctionToolCallStatus` + - `type BetaInlineSkill struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Description string` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + The description of the skill. - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `Name string` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + The name of the skill. - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `Source BetaInlineSkillSource` - The output of a function tool call. + Inline skill payload - - `CallID string` + - `Data string` - The unique ID of the function tool call generated by the model. + Base64-encoded skill zip bundle. - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + - `MediaType ApplicationZip` - Text, image, or file output of the function tool call. + The media type of the inline skill payload. Must be `application/zip`. - - `string` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `Type Base64` - An array of content outputs (text, image, file) for the function tool call. + The type of the inline skill source. Must be `base64`. - - `type BetaResponseInputTextContent struct{…}` + - `const Base64Base64 Base64 = "base64"` - A text input to the model. + - `Type Inline` - - `Text string` + Defines an inline skill for this request. - The text input to the model. + - `const InlineInline Inline = "inline"` - - `Type InputText` + - `type BetaLocalEnvironment struct{…}` - The type of the input item. Always `input_text`. + - `Type Local` - - `const InputTextInputText InputText = "input_text"` + Use a local computer environment. - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + - `const LocalLocal Local = "local"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Skills []BetaLocalSkill` - - `Mode Explicit` + An optional list of skills. - The breakpoint mode. Always `explicit`. + - `Description string` - - `const ExplicitExplicit Explicit = "explicit"` + The description of the skill. - - `type BetaResponseInputImageContent struct{…}` + - `Name string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + The name of the skill. - - `Type InputImage` + - `Path string` - The type of the input item. Always `input_image`. + The path to the directory containing the skill. - - `const InputImageInputImage InputImage = "input_image"` + - `type BetaContainerReference struct{…}` - - `Detail BetaResponseInputImageContentDetail` + - `ContainerID string` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The ID of the referenced container. - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `Type ContainerReference` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + References a container created with the /v1/containers endpoint - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `type BetaCustomTool struct{…}` - - `FileID string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The ID of the file to be sent to the model. + - `Name string` - - `ImageURL string` + The name of the custom tool, used to identify it in tool calls. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `Type Custom` - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + The type of the custom tool. Always `custom`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const CustomCustom Custom = "custom"` - - `Mode Explicit` + - `AllowedCallers []string` - The breakpoint mode. Always `explicit`. + The tool invocation context(s). - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `type BetaResponseInputFileContent struct{…}` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - A file input to the model. + - `DeferLoading bool` - - `Type InputFile` + Whether this tool should be deferred and discovered via tool search. - The type of the input item. Always `input_file`. + - `Description string` - - `const InputFileInputFile InputFile = "input_file"` + Optional description of the custom tool, used to provide more context. - - `Detail BetaResponseInputFileContentDetail` + - `Format BetaCustomToolFormatUnion` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + The input format for the custom tool. Default is unconstrained text. - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `type BetaCustomToolFormatText struct{…}` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + Unconstrained free-form text. - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + - `Type Text` - - `FileData string` + Unconstrained text format. Always `text`. - The base64-encoded data of the file to be sent to the model. + - `const TextText Text = "text"` - - `FileID string` + - `type BetaCustomToolFormatGrammar struct{…}` - The ID of the file to be sent to the model. + A grammar defined by the user. - - `FileURL string` + - `Definition string` - The URL of the file to be sent to the model. + The grammar definition. - - `Filename string` + - `Syntax string` - The name of the file to be sent to the model. + The syntax of the grammar definition. One of `lark` or `regex`. - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `Mode Explicit` + - `Type Grammar` - The breakpoint mode. Always `explicit`. + Grammar format. Always `grammar`. - - `const ExplicitExplicit Explicit = "explicit"` + - `const GrammarGrammar Grammar = "grammar"` - - `Type FunctionCallOutput` + - `type BetaNamespaceTool struct{…}` - The type of the function tool call output. Always `function_call_output`. + Groups function/custom tools under a shared namespace. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `Description string` - - `ID string` + A description of the namespace shown to the model. - The unique ID of the function tool call output. Populated when this item is returned via API. + - `Name string` - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + The namespace name used in tool calls (for example, `crm`). - The agent that produced this item. + - `Tools []BetaNamespaceToolToolUnion` - - `AgentName string` + The function/custom tools available inside this namespace. - The canonical name of the agent that produced this item. + - `type BetaNamespaceToolToolFunction struct{…}` - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `Name string` - The execution context that produced this tool call. + - `Type Function` - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + - `const FunctionFunction Function = "function"` - - `Type Direct` + - `AllowedCallers []string` - The caller type. Always `direct`. + The tool invocation context(s). - - `const DirectDirect Direct = "direct"` + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `CallerID string` + - `DeferLoading bool` - The call ID of the program item that produced this tool call. + Whether this function should be deferred and discovered via tool search. - - `Type Program` + - `Description string` - The caller type. Always `program`. + - `OutputSchema map[string, any]` - - `const ProgramProgram Program = "program"` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `Status string` + - `Parameters any` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + - `Strict bool` - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + - `type BetaCustomTool struct{…}` - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `type BetaResponseInputItemAgentMessage struct{…}` + - `Type Namespace` - A message routed between agents. + The type of the tool. Always `namespace`. - - `Author string` + - `const NamespaceNamespace Namespace = "namespace"` - The sending agent identity. + - `type BetaToolSearchTool struct{…}` - - `Content []BetaResponseInputItemAgentMessageContentUnion` + Hosted or BYOT tool search configuration for deferred tools. - Plaintext, image, or encrypted content sent between agents. + - `Type ToolSearch` - - `type BetaResponseInputTextContent struct{…}` + The type of the tool. Always `tool_search`. - A text input to the model. + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `type BetaResponseInputImageContent struct{…}` + - `Description string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + Description shown to the model for a client-executed tool search tool. - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + - `Execution BetaToolSearchToolExecution` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + Whether tool search is executed by the server or by the client. - - `EncryptedContent string` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - Opaque encrypted content. + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `Type EncryptedContent` + - `Parameters any` - The type of the input item. Always `encrypted_content`. + Parameter schema for a client-executed tool search tool. - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `type BetaWebSearchPreviewTool struct{…}` - - `Recipient string` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The destination agent identity. + - `Type BetaWebSearchPreviewToolType` - - `Type AgentMessage` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The item type. Always `agent_message`. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `ID string` + - `SearchContentTypes []string` - The unique ID of this agent message item. + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `Agent BetaResponseInputItemAgentMessageAgent` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - The agent that produced this item. + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - `AgentName string` + 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. - The canonical name of the agent that produced this item. + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - - `type BetaResponseInputItemMultiAgentCall struct{…}` + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `Action string` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - The multi-agent action that was executed. + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + The user's location. - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + - `Type Approximate` - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + The type of location approximation. Always `approximate`. - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + - `const ApproximateApproximate Approximate = "approximate"` - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `City string` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + Free text input for the city of the user, e.g. `San Francisco`. - - `Arguments string` + - `Country string` - The action arguments as a JSON string. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `CallID string` + - `Region string` - The unique ID linking this call to its output. + Free text input for the region of the user, e.g. `California`. - - `Type MultiAgentCall` + - `Timezone string` - The item type. Always `multi_agent_call`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `type BetaApplyPatchTool struct{…}` - - `ID string` + Allows the assistant to create, delete, or update files using unified diffs. - The unique ID of this multi-agent call. + - `Type ApplyPatch` - - `Agent BetaResponseInputItemMultiAgentCallAgent` + The type of the tool. Always `apply_patch`. - The agent that produced this item. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `AgentName string` + - `AllowedCallers []string` - The canonical name of the agent that produced this item. + The tool invocation context(s). - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - - `Action string` + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - The multi-agent action that produced this result. + - `Type ToolSearchOutput` - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + The item type. Always `tool_search_output`. - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + - `ID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + The unique ID of this tool search output. - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. - `CallID string` - The unique ID of the multi-agent call. + The unique ID of the tool search call generated by the model. - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - Text output returned by the multi-agent action. + Whether tool search was executed by the server or by the client. - - `Text string` + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - The text content. + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - `Type OutputText` + - `Status BetaResponseToolSearchOutputItemParamStatus` - The content type. Always `output_text`. + The status of the tool search output. - - `const OutputTextOutputText OutputText = "output_text"` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - Citations associated with the text content. + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `FileID string` + - `Role Developer` - The ID of the file. + The role that provided the additional tools. Only `developer` is supported. - - `Filename string` + - `const DeveloperDeveloper Developer = "developer"` - The filename of the file cited. + - `Tools []BetaToolUnion` - - `Index int64` + A list of additional tools made available at this item. - The index of the file in the list of files. + - `type BetaFunctionTool struct{…}` - - `Type FileCitation` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The citation type. Always `file_citation`. + - `type BetaFileSearchTool struct{…}` - - `const FileCitationFileCitation FileCitation = "file_citation"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + - `type BetaComputerTool struct{…}` - - `EndIndex int64` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The index of the last character of the citation in the message. + - `type BetaComputerUsePreviewTool struct{…}` - - `StartIndex int64` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The index of the first character of the citation in the message. + - `type BetaWebSearchTool struct{…}` - - `Title string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The title of the cited resource. + - `type BetaToolMcp struct{…}` - - `Type URLCitation` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The citation type. Always `url_citation`. + - `type BetaToolCodeInterpreter struct{…}` - - `const URLCitationURLCitation URLCitation = "url_citation"` + A tool that runs Python code to help generate a response to a prompt. - - `URL string` + - `type BetaToolProgrammaticToolCalling struct{…}` - The URL of the cited resource. + - `type BetaToolImageGeneration struct{…}` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + A tool that generates images using the GPT image models. - - `ContainerID string` + - `type BetaToolLocalShell struct{…}` - The ID of the container. + A tool that allows the model to execute shell commands in a local environment. - - `EndIndex int64` + - `type BetaFunctionShellTool struct{…}` - The index of the last character of the citation in the message. + A tool that allows the model to execute shell commands. - - `FileID string` + - `type BetaCustomTool struct{…}` - The ID of the container file. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Filename string` + - `type BetaNamespaceTool struct{…}` - The filename of the container file cited. + Groups function/custom tools under a shared namespace. - - `StartIndex int64` + - `type BetaToolSearchTool struct{…}` - The index of the first character of the citation in the message. + Hosted or BYOT tool search configuration for deferred tools. - - `Type ContainerFileCitation` + - `type BetaWebSearchPreviewTool struct{…}` - The citation type. Always `container_file_citation`. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `type BetaApplyPatchTool struct{…}` - - `Type MultiAgentCallOutput` + Allows the assistant to create, delete, or update files using unified diffs. - The item type. Always `multi_agent_call_output`. + - `Type AdditionalTools` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + The item type. Always `additional_tools`. + + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - `ID string` - The unique ID of this multi-agent call output. + The unique ID of this additional tools item. - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + - `Agent BetaResponseInputItemAdditionalToolsAgent` The agent that produced this item. @@ -15547,1147 +14112,1091 @@ Create a model response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemToolSearchCall struct{…}` + - `type BetaResponseReasoningItem struct{…}` - - `Arguments any` + 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](https://platform.openai.com/docs/guides/conversation-state). - The arguments supplied to the tool search call. + - `ID string` - - `Type ToolSearchCall` + The unique identifier of the reasoning content. - The item type. Always `tool_search_call`. + - `Summary []BetaResponseReasoningItemSummary` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + Reasoning summary content. - - `ID string` + - `Text string` - The unique ID of this tool search call. + A summary of the reasoning output from the model so far. - - `Agent BetaResponseInputItemToolSearchCallAgent` + - `Type SummaryText` - The agent that produced this item. + The type of the object. Always `summary_text`. - - `AgentName string` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - The canonical name of the agent that produced this item. + - `Type Reasoning` - - `CallID string` + The type of the object. Always `reasoning`. - The unique ID of the tool search call generated by the model. + - `const ReasoningReasoning Reasoning = "reasoning"` - - `Execution string` + - `Agent BetaResponseReasoningItemAgent` - Whether tool search was executed by the server or by the client. + The agent that produced this item. - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + - `AgentName string` - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + The canonical name of the agent that produced this item. - - `Status string` + - `Content []BetaResponseReasoningItemContent` - The status of the tool search call. + Reasoning text content. - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + - `Text string` - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + The reasoning text from the model. - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + - `Type ReasoningText` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + The type of the reasoning text. Always `reasoning_text`. - - `Tools []BetaToolUnion` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - The loaded tool definitions returned by the tool search output. + - `EncryptedContent string` - - `type BetaFunctionTool struct{…}` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Status BetaResponseReasoningItemStatus` - - `Name string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The name of the function to call. + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - `Parameters map[string, any]` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - A JSON schema object describing the parameters of the function. + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `Strict bool` + - `type BetaResponseCompactionItemParamResp struct{…}` - Whether strict parameter validation is enforced for this function tool. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `Type Function` + - `EncryptedContent string` - The type of the function tool. Always `function`. + The encrypted content of the compaction summary. - - `const FunctionFunction Function = "function"` + - `Type Compaction` - - `AllowedCallers []string` + The type of the item. Always `compaction`. - The tool invocation context(s). + - `const CompactionCompaction Compaction = "compaction"` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `ID string` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + The ID of the compaction item. - - `DeferLoading bool` + - `Agent BetaResponseCompactionItemParamAgentResp` - Whether this function is deferred and loaded via tool search. + The agent that produced this item. - - `Description string` + - `AgentName string` - A description of the function. Used by the model to determine whether or not to call the function. + The canonical name of the agent that produced this item. - - `OutputSchema map[string, any]` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - A JSON schema object describing the JSON value encoded in string outputs for this function. + An image generation request made by the model. - - `type BetaFileSearchTool struct{…}` + - `ID string` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The unique ID of the image generation call. - - `Type FileSearch` + - `Result string` - The type of the file search tool. Always `file_search`. + The generated image encoded in base64. - - `const FileSearchFileSearch FileSearch = "file_search"` + - `Status string` - - `VectorStoreIDs []string` + The status of the image generation call. - The IDs of the vector stores to search. + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - - `Filters BetaFileSearchToolFiltersUnion` + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - A filter to apply. + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `Type ImageGenerationCall` - - `Key string` + The type of the image generation call. Always `image_generation_call`. - The key to compare against the value. + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Type string` + - `Agent BetaResponseInputItemImageGenerationCallAgent` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The agent that produced this item. - - `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 + - `AgentName string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + The canonical name of the agent that produced this item. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + A tool call to run code. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `ID string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + The unique ID of the code interpreter tool call. - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + - `Code string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + The code to run, or null if not available. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `ContainerID string` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + The ID of the container used to run the code. - The value to compare against the attribute key; supports string, number, or boolean types. + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `string` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `float64` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `bool` + The logs output from the code interpreter. - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `Logs string` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + The logs output from the code interpreter. - Combine multiple filters using `and` or `or`. + - `Type Logs` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + The type of the output. Always `logs`. - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `const LogsLogs Logs = "logs"` - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + The image output from the code interpreter. - - `Key string` + - `Type Image` - The key to compare against the value. + The type of the output. Always `image`. - - `Type string` + - `const ImageImage Image = "image"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `URL string` - - `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 + The URL of the image output from the code interpreter. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `Type CodeInterpreterCall` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + The type of the code interpreter tool call. Always `code_interpreter_call`. - The value to compare against the attribute key; supports string, number, or boolean types. + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - `string` + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `float64` + The agent that produced this item. - - `bool` + - `AgentName string` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + The canonical name of the agent that produced this item. - - `Type string` + - `type BetaResponseInputItemLocalShellCall struct{…}` - Type of operation: `and` or `or`. + A tool call to run a command on the local shell. - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + - `ID string` - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + The unique ID of the local shell call. - - `MaxNumResults int64` + - `Action BetaResponseInputItemLocalShellCallAction` - The maximum number of results to return. This number should be between 1 and 50 inclusive. + Execute a shell command on the server. - - `RankingOptions BetaFileSearchToolRankingOptions` + - `Command []string` - Ranking options for search. + The command to run. - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `Env map[string, string]` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + Environment variables to set for the command. - - `EmbeddingWeight float64` + - `Type Exec` - The weight of the embedding in the reciprocal ranking fusion. + The type of the local shell action. Always `exec`. - - `TextWeight float64` + - `const ExecExec Exec = "exec"` - The weight of the text in the reciprocal ranking fusion. + - `TimeoutMs int64` - - `Ranker string` + Optional timeout in milliseconds for the command. - The ranker to use for the file search. + - `User string` - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + Optional user to run the command as. - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + - `WorkingDirectory string` - - `ScoreThreshold float64` + Optional working directory to run the command in. - 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. + - `CallID string` - - `type BetaComputerTool struct{…}` + The unique ID of the local shell tool call generated by the model. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Status string` - - `Type Computer` + The status of the local shell call. - The type of the computer tool. Always `computer`. + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - - `const ComputerComputer Computer = "computer"` + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Type LocalShellCall` - - `DisplayHeight int64` + The type of the local shell call. Always `local_shell_call`. - The height of the computer display. + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `DisplayWidth int64` + - `Agent BetaResponseInputItemLocalShellCallAgent` - The width of the computer display. + The agent that produced this item. - - `Environment BetaComputerUsePreviewToolEnvironment` + - `AgentName string` - The type of computer environment to control. + The canonical name of the agent that produced this item. - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + The output of a local shell tool call. - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `ID string` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + The unique ID of the local shell tool call generated by the model. - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + - `Output string` - - `Type ComputerUsePreview` + A JSON string of the output of the local shell tool call. - The type of the computer use tool. Always `computer_use_preview`. + - `Type LocalShellCallOutput` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + The type of the local shell tool call output. Always `local_shell_call_output`. - - `type BetaWebSearchTool struct{…}` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - - `Type BetaWebSearchToolType` + The agent that produced this item. - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `AgentName string` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + The canonical name of the agent that produced this item. - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `Status string` - - `Filters BetaWebSearchToolFilters` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - Filters for the search. + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - - `AllowedDomains []string` + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `type BetaResponseInputItemShellCall struct{…}` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + A tool representing a request to execute one or more shell commands. - 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. + - `Action BetaResponseInputItemShellCallAction` - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + The shell commands and limits that describe how to run the tool call. - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `Commands []string` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + Ordered shell commands for the execution environment to run. - - `UserLocation BetaWebSearchToolUserLocation` + - `MaxOutputLength int64` - The approximate location of the user. + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - `City string` + - `TimeoutMs int64` - Free text input for the city of the user, e.g. `San Francisco`. + Maximum wall-clock time in milliseconds to allow the shell commands to run. - - `Country string` + - `CallID string` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + The unique ID of the shell tool call generated by the model. - - `Region string` - - Free text input for the region of the user, e.g. `California`. - - - `Timezone string` - - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - - `Type string` + - `Type ShellCall` - The type of location approximation. Always `approximate`. + The type of the item. Always `shell_call`. - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `const ShellCallShellCall ShellCall = "shell_call"` - - `type BetaToolMcp struct{…}` + - `ID string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The unique ID of the shell tool call. Populated when this item is returned via API. - - `ServerLabel string` + - `Agent BetaResponseInputItemShellCallAgent` - A label for this MCP server, used to identify it in tool calls. + The agent that produced this item. - - `Type Mcp` + - `AgentName string` - The type of the MCP tool. Always `mcp`. + The canonical name of the agent that produced this item. - - `const McpMcp Mcp = "mcp"` + - `Caller BetaResponseInputItemShellCallCallerUnion` - - `AllowedCallers []string` + The execution context that produced this tool call. - The tool invocation context(s). + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + - `Type Direct` - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + The caller type. Always `direct`. - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `const DirectDirect Direct = "direct"` - List of allowed tool names or a filter object. + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `CallerID string` - A string array of allowed tool names + The call ID of the program item that produced this tool call. - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `Type Program` - A filter object to specify which tools are allowed. + The caller type. Always `program`. - - `ReadOnly bool` + - `const ProgramProgram Program = "program"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - `ToolNames []string` + The environment to execute the shell commands in. - List of allowed tool names. + - `type BetaLocalEnvironment struct{…}` - - `Authorization string` + - `type BetaContainerReference struct{…}` - 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. + - `Status string` - - `ConnectorID string` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - Currently supported `connector_id` values are: + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - - 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 BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + The streamed output items emitted by a shell tool call. - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `CallID string` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + The unique ID of the shell tool call generated by the model. - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `Output []BetaResponseFunctionShellCallOutputContent` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + The exit or timeout outcome associated with this shell call. - - `DeferLoading bool` + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - Whether this MCP tool is deferred and discovered via tool search. + Indicates that the shell call exceeded its configured time limit. - - `Headers map[string, string]` + - `Type Timeout` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + The outcome type. Always `timeout`. - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `const TimeoutTimeout Timeout = "timeout"` - Specify which of the MCP server's tools require approval. + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + Indicates that the shell commands finished and returned an exit code. - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `ExitCode int64` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + The exit code returned by the shell process. - A filter object to specify which tools are allowed. + - `Type Exit` - - `ReadOnly bool` + The outcome type. Always `exit`. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `const ExitExit Exit = "exit"` - - `ToolNames []string` + - `Stderr string` - List of allowed tool names. + Captured stderr output for the shell call. - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `Stdout string` - A filter object to specify which tools are allowed. + Captured stdout output for the shell call. - - `ReadOnly bool` + - `Type ShellCallOutput` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The type of the item. Always `shell_call_output`. - - `ToolNames []string` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - List of allowed tool names. + - `ID string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + The unique ID of the shell tool call output. Populated when this item is returned via API. - 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. + - `Agent BetaResponseInputItemShellCallOutputAgent` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + The agent that produced this item. - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + - `AgentName string` - - `ServerDescription string` + The canonical name of the agent that produced this item. - Optional description of the MCP server, used to provide more context. + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - - `ServerURL string` + The execution context that produced this tool call. - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - `TunnelID string` + - `Type Direct` - 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. + The caller type. Always `direct`. - - `type BetaToolCodeInterpreter struct{…}` + - `const DirectDirect Direct = "direct"` - A tool that runs Python code to help generate a response to a prompt. + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - `Container BetaToolCodeInterpreterContainerUnion` + - `CallerID string` - 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. + The call ID of the program item that produced this tool call. - - `string` + - `Type Program` - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + The caller type. Always `program`. - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `const ProgramProgram Program = "program"` - - `Type Auto` + - `MaxOutputLength int64` - Always `auto`. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `const AutoAuto Auto = "auto"` + - `Status string` - - `FileIDs []string` + The status of the shell call output. - An optional list of uploaded files to make available to your code. + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - - `MemoryLimit string` + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - The memory limit for the code interpreter container. + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + - `type BetaResponseInputItemApplyPatchCall struct{…}` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + A tool call representing a request to create, delete, or update files using diff patches. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `CallID string` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + The unique ID of the apply patch tool call generated by the model. - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - Network access policy for the container. + The specific create, delete, or update instruction for the apply_patch tool call. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - - `Type Disabled` + Instruction for creating a new file via the apply_patch tool. - Disable outbound network access. Always `disabled`. + - `Diff string` - - `const DisabledDisabled Disabled = "disabled"` + Unified diff content to apply when creating the file. - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `Path string` - - `AllowedDomains []string` + Path of the file to create relative to the workspace root. - A list of allowed domains when type is `allowlist`. + - `Type CreateFile` - - `Type Allowlist` + The operation type. Always `create_file`. - Allow outbound network access only to specified domains. Always `allowlist`. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + Instruction for deleting an existing file via the apply_patch tool. - Optional domain-scoped secrets for allowlisted domains. + - `Path string` - - `Domain string` + Path of the file to delete relative to the workspace root. - The domain associated with the secret. + - `Type DeleteFile` - - `Name string` + The operation type. Always `delete_file`. - The name of the secret to inject for the domain. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `Value string` + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - The secret value to inject for the domain. + Instruction for updating an existing file via the apply_patch tool. - - `Type CodeInterpreter` + - `Diff string` - The type of the code interpreter tool. Always `code_interpreter`. + Unified diff content to apply to the existing file. - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `Path string` - - `AllowedCallers []string` + Path of the file to update relative to the workspace root. - The tool invocation context(s). + - `Type UpdateFile` - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + The operation type. Always `update_file`. - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `Status string` - - `Type ProgrammaticToolCalling` + The status of the apply patch tool call. One of `in_progress` or `completed`. - The type of the tool. Always `programmatic_tool_calling`. + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - - `type BetaToolImageGeneration struct{…}` + - `Type ApplyPatchCall` - A tool that generates images using the GPT image models. + The type of the item. Always `apply_patch_call`. - - `Type ImageGeneration` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - The type of the image generation tool. Always `image_generation`. + - `ID string` - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `Action string` + - `Agent BetaResponseInputItemApplyPatchCallAgent` - Whether to generate a new image or edit an existing image. Default: `auto`. + The agent that produced this item. - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + - `AgentName string` - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + The canonical name of the agent that produced this item. - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - - `Background string` + The execution context that produced this tool call. - 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. + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - `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. + - `Type Direct` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + The caller type. Always `direct`. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `const DirectDirect Direct = "direct"` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `CallerID string` - - `InputFidelity string` + The call ID of the program item that produced this tool call. - 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`. + - `Type Program` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + The caller type. Always `program`. - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + - `const ProgramProgram Program = "program"` - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + The streamed output emitted by an apply patch tool call. - - `FileID string` + - `CallID string` - File ID for the mask image. + The unique ID of the apply patch tool call generated by the model. - - `ImageURL string` + - `Status string` - Base64-encoded mask image. + The status of the apply patch tool call output. One of `completed` or `failed`. - - `Model string` + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - The image generation model to use. Default: `gpt-image-1`. + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - - `string` + - `Type ApplyPatchCallOutput` - - `string` + The type of the item. Always `apply_patch_call_output`. - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `ID string` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + The agent that produced this item. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `AgentName string` - - `Moderation string` + The canonical name of the agent that produced this item. - Moderation level for the generated image. Default: `auto`. + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + The execution context that produced this tool call. - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - - `OutputCompression int64` + - `Type Direct` - Compression level for the output image. Default: 100. + The caller type. Always `direct`. - - `OutputFormat string` + - `const DirectDirect Direct = "direct"` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + - `CallerID string` - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + The call ID of the program item that produced this tool call. - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + - `Type Program` - - `PartialImages int64` + The caller type. Always `program`. - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `const ProgramProgram Program = "program"` - - `Quality string` + - `Output string` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `type BetaResponseInputItemMcpListTools struct{…}` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + A list of tools available on an MCP server. - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `ID string` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The unique ID of the list. - - `Size string` + - `ServerLabel 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`. + The label of the MCP server. - - `string` + - `Tools []BetaResponseInputItemMcpListToolsTool` - - `string` + The tools available on the server. - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `InputSchema any` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + The JSON schema describing the tool's input. - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `Name string` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + The name of the tool. - - `type BetaToolLocalShell struct{…}` + - `Annotations any` - A tool that allows the model to execute shell commands in a local environment. + Additional annotations about the tool. - - `Type LocalShell` + - `Description string` - The type of the local shell tool. Always `local_shell`. + The description of the tool. - - `const LocalShellLocalShell LocalShell = "local_shell"` + - `Type McpListTools` - - `type BetaFunctionShellTool struct{…}` + The type of the item. Always `mcp_list_tools`. - A tool that allows the model to execute shell commands. + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Type Shell` + - `Agent BetaResponseInputItemMcpListToolsAgent` - The type of the shell tool. Always `shell`. + The agent that produced this item. - - `const ShellShell Shell = "shell"` + - `AgentName string` - - `AllowedCallers []string` + The canonical name of the agent that produced this item. - The tool invocation context(s). + - `Error string` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + Error message if the server could not list tools. - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - - `Environment BetaFunctionShellToolEnvironmentUnion` + A request for human approval of a tool invocation. - - `type BetaContainerAuto struct{…}` + - `ID string` - - `Type ContainerAuto` + The unique ID of the approval request. - Automatically creates a container for this request + - `Arguments string` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + A JSON string of arguments for the tool. - - `FileIDs []string` + - `Name string` - An optional list of uploaded files to make available to your code. + The name of the tool to run. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `ServerLabel string` - The memory limit for the container. + The label of the MCP server making the request. - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `Type McpApprovalRequest` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The type of the item. Always `mcp_approval_request`. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + The agent that produced this item. - Network access policy for the container. + - `AgentName string` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + The canonical name of the agent that produced this item. - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - - `Skills []BetaContainerAutoSkillUnion` + A response to an MCP approval request. - An optional list of skills referenced by id or inline data. + - `ApprovalRequestID string` - - `type BetaSkillReference struct{…}` + The ID of the approval request being answered. - - `SkillID string` + - `Approve bool` - The ID of the referenced skill. + Whether the request was approved. - - `Type SkillReference` + - `Type McpApprovalResponse` - References a skill created with the /v1/skills endpoint. + The type of the item. Always `mcp_approval_response`. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `Version string` + - `ID string` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + The unique ID of the approval response - - `type BetaInlineSkill struct{…}` + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` - - `Description string` + The agent that produced this item. - The description of the skill. + - `AgentName string` - - `Name string` + The canonical name of the agent that produced this item. - The name of the skill. + - `Reason string` - - `Source BetaInlineSkillSource` + Optional reason for the decision. - Inline skill payload + - `type BetaResponseInputItemMcpCall struct{…}` - - `Data string` + An invocation of a tool on an MCP server. - Base64-encoded skill zip bundle. + - `ID string` - - `MediaType ApplicationZip` + The unique ID of the tool call. - The media type of the inline skill payload. Must be `application/zip`. + - `Arguments string` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + A JSON string of the arguments passed to the tool. - - `Type Base64` + - `Name string` - The type of the inline skill source. Must be `base64`. + The name of the tool that was run. - - `const Base64Base64 Base64 = "base64"` + - `ServerLabel string` - - `Type Inline` + The label of the MCP server running the tool. - Defines an inline skill for this request. + - `Type McpCall` - - `const InlineInline Inline = "inline"` + The type of the item. Always `mcp_call`. - - `type BetaLocalEnvironment struct{…}` + - `const McpCallMcpCall McpCall = "mcp_call"` - - `Type Local` + - `Agent BetaResponseInputItemMcpCallAgent` - Use a local computer environment. + The agent that produced this item. - - `const LocalLocal Local = "local"` + - `AgentName string` - - `Skills []BetaLocalSkill` + The canonical name of the agent that produced this item. - An optional list of skills. + - `ApprovalRequestID string` - - `Description 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. - The description of the skill. + - `Error string` - - `Name string` + The error from the tool call, if any. - The name of the skill. + - `Output string` - - `Path string` + The output from the tool call. - The path to the directory containing the skill. + - `Status string` - - `type BetaContainerReference struct{…}` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `ContainerID string` + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - The ID of the referenced container. + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - `Type ContainerReference` + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - References a container created with the /v1/containers endpoint + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `type BetaCustomTool struct{…}` + - `type BetaResponseCustomToolCallOutput struct{…}` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The output of a custom tool call from your code, being sent back to the model. - - `Name string` + - `CallID string` - The name of the custom tool, used to identify it in tool calls. + The call ID, used to map this custom tool call output to a custom tool call. - - `Type Custom` + - `Output BetaResponseCustomToolCallOutputOutputUnion` - The type of the custom tool. Always `custom`. + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `const CustomCustom Custom = "custom"` + - `string` - - `AllowedCallers []string` + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - The tool invocation context(s). + Text, image, or file output of the custom tool call. - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `type BetaResponseInputText struct{…}` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + A text input to the model. - - `DeferLoading bool` + - `type BetaResponseInputImage struct{…}` - Whether this tool should be deferred and discovered via tool search. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Description string` + - `type BetaResponseInputFile struct{…}` - Optional description of the custom tool, used to provide more context. + A file input to the model. - - `Format BetaCustomToolFormatUnion` + - `Type CustomToolCallOutput` - The input format for the custom tool. Default is unconstrained text. + The type of the custom tool call output. Always `custom_tool_call_output`. - - `type BetaCustomToolFormatText struct{…}` + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - Unconstrained free-form text. + - `ID string` - - `Type Text` + The unique ID of the custom tool call output in the OpenAI platform. - Unconstrained text format. Always `text`. + - `Agent BetaResponseCustomToolCallOutputAgent` - - `const TextText Text = "text"` + The agent that produced this item. - - `type BetaCustomToolFormatGrammar struct{…}` + - `AgentName string` - A grammar defined by the user. + The canonical name of the agent that produced this item. - - `Definition string` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - The grammar definition. + The execution context that produced this tool call. - - `Syntax string` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - The syntax of the grammar definition. One of `lark` or `regex`. + - `Type Direct` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + The caller type. Always `direct`. - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `const DirectDirect Direct = "direct"` - - `Type Grammar` + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - Grammar format. Always `grammar`. + - `CallerID string` - - `const GrammarGrammar Grammar = "grammar"` + The call ID of the program item that produced this tool call. - - `type BetaNamespaceTool struct{…}` + - `Type Program` - Groups function/custom tools under a shared namespace. + The caller type. Always `program`. - - `Description string` + - `const ProgramProgram Program = "program"` - A description of the namespace shown to the model. + - `type BetaResponseCustomToolCall struct{…}` - - `Name string` + A call to a custom tool created by the model. - The namespace name used in tool calls (for example, `crm`). + - `CallID string` - - `Tools []BetaNamespaceToolToolUnion` + An identifier used to map this custom tool call to a tool call output. - The function/custom tools available inside this namespace. + - `Input string` - - `type BetaNamespaceToolToolFunction struct{…}` + The input for the custom tool call generated by the model. - `Name string` - - `Type Function` - - - `const FunctionFunction Function = "function"` + The name of the custom tool being called. - - `AllowedCallers []string` + - `Type CustomToolCall` - The tool invocation context(s). + The type of the custom tool call. Always `custom_tool_call`. - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `ID string` - - `DeferLoading bool` + The unique ID of the custom tool call in the OpenAI platform. - Whether this function should be deferred and discovered via tool search. + - `Agent BetaResponseCustomToolCallAgent` - - `Description string` + The agent that produced this item. - - `OutputSchema map[string, any]` + - `AgentName string` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + The canonical name of the agent that produced this item. - - `Parameters any` + - `Caller BetaResponseCustomToolCallCallerUnion` - - `Strict bool` + The execution context that produced this tool call. - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - `type BetaCustomTool struct{…}` + - `Type Direct` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const DirectDirect Direct = "direct"` - - `Type Namespace` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - The type of the tool. Always `namespace`. + - `CallerID string` - - `const NamespaceNamespace Namespace = "namespace"` + The call ID of the program item that produced this tool call. - - `type BetaToolSearchTool struct{…}` + - `Type Program` - Hosted or BYOT tool search configuration for deferred tools. + - `const ProgramProgram Program = "program"` - - `Type ToolSearch` + - `Namespace string` - The type of the tool. Always `tool_search`. + The namespace of the custom tool being called. - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - - `Description string` + Compacts the current context. Must be the final input item. - Description shown to the model for a client-executed tool search tool. + - `Type CompactionTrigger` - - `Execution BetaToolSearchToolExecution` + The type of the item. Always `compaction_trigger`. - Whether tool search is executed by the server or by the client. + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + The agent that produced this item. - - `Parameters any` + - `AgentName string` - Parameter schema for a client-executed tool search tool. + The canonical name of the agent that produced this item. - - `type BetaWebSearchPreviewTool struct{…}` + - `type BetaResponseInputItemItemReference struct{…}` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + An internal identifier for an item to reference. - - `Type BetaWebSearchPreviewToolType` + - `ID string` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + The ID of the item to reference. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `Agent BetaResponseInputItemItemReferenceAgent` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + The agent that produced this item. - - `SearchContentTypes []string` + - `AgentName string` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + The canonical name of the agent that produced this item. - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + - `Type string` - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + The type of item to reference. Always `item_reference`. - 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 BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `type BetaResponseInputItemProgram struct{…}` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `ID string` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + The unique ID of this program item. - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `CallID string` - The user's location. + The stable call ID of the program item. - - `Type Approximate` + - `Code string` - The type of location approximation. Always `approximate`. + The JavaScript source executed by programmatic tool calling. - - `const ApproximateApproximate Approximate = "approximate"` + - `Fingerprint string` - - `City string` + Opaque program replay fingerprint that must be round-tripped. - Free text input for the city of the user, e.g. `San Francisco`. + - `Type Program` - - `Country string` + The item type. Always `program`. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `const ProgramProgram Program = "program"` - - `Region string` + - `Agent BetaResponseInputItemProgramAgent` - Free text input for the region of the user, e.g. `California`. + The agent that produced this item. - - `Timezone string` + - `AgentName string` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + The canonical name of the agent that produced this item. - - `type BetaApplyPatchTool struct{…}` + - `type BetaResponseInputItemProgramOutput struct{…}` - Allows the assistant to create, delete, or update files using unified diffs. + - `ID string` - - `Type ApplyPatch` + The unique ID of this program output item. - The type of the tool. Always `apply_patch`. + - `CallID string` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + The call ID of the program item. - - `AllowedCallers []string` + - `Result string` - The tool invocation context(s). + The result produced by the program item. - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `Status string` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + The terminal status of the program output. - - `Type ToolSearchOutput` + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - The item type. Always `tool_search_output`. + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `Type ProgramOutput` - - `ID string` + The item type. Always `program_output`. - The unique ID of this tool search output. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - `Agent BetaResponseInputItemProgramOutputAgent` The agent that produced this item. @@ -16695,469 +15204,475 @@ Create a model response The canonical name of the agent that produced this item. - - `CallID string` + - `Metadata map[string, string]` - The unique ID of the tool search call generated by the model. + 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. - - `Execution BetaResponseToolSearchOutputItemParamExecution` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - Whether tool search was executed by the server or by the client. + - `Model BetaResponseModel` - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + - `type BetaResponseModel string` - - `Status BetaResponseToolSearchOutputItemParamStatus` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - The status of the tool search output. + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - - `Role Developer` + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - The role that provided the additional tools. Only `developer` is supported. + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - - `const DeveloperDeveloper Developer = "developer"` + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - - `Tools []BetaToolUnion` + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - A list of additional tools made available at this item. + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - - `type BetaFunctionTool struct{…}` + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - - `type BetaFileSearchTool struct{…}` + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - - `type BetaComputerTool struct{…}` + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - - `type BetaWebSearchTool struct{…}` + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - - `type BetaToolMcp struct{…}` + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - - `type BetaToolCodeInterpreter struct{…}` + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - A tool that runs Python code to help generate a response to a prompt. + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - - `type BetaToolImageGeneration struct{…}` + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - A tool that generates images using the GPT image models. + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - - `type BetaToolLocalShell struct{…}` + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - A tool that allows the model to execute shell commands in a local environment. + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - - `type BetaFunctionShellTool struct{…}` + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - A tool that allows the model to execute shell commands. + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - - `type BetaCustomTool struct{…}` + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - - `type BetaNamespaceTool struct{…}` + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - Groups function/custom tools under a shared namespace. + - `const BetaResponseModelO3 BetaResponseModel = "o3"` - - `type BetaToolSearchTool struct{…}` + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - Hosted or BYOT tool search configuration for deferred tools. + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseModelO1 BetaResponseModel = "o1"` - - `type BetaApplyPatchTool struct{…}` + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - Allows the assistant to create, delete, or update files using unified diffs. + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - - `Type AdditionalTools` + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - The item type. Always `additional_tools`. + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - `ID string` + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - The unique ID of this additional tools item. + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - - `Agent BetaResponseInputItemAdditionalToolsAgent` + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - The agent that produced this item. + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - - `AgentName string` + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - - `type BetaResponseReasoningItem struct{…}` + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - 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](https://platform.openai.com/docs/guides/conversation-state). + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - - `ID string` + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - The unique identifier of the reasoning content. + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - `Summary []BetaResponseReasoningItemSummary` + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - Reasoning summary content. + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - - `Text string` + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - A summary of the reasoning output from the model so far. + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `Type SummaryText` + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - The type of the object. Always `summary_text`. + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` - - `Type Reasoning` + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` - The type of the object. Always `reasoning`. + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - - `const ReasoningReasoning Reasoning = "reasoning"` + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - - `Agent BetaResponseReasoningItemAgent` + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - The agent that produced this item. + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - - `AgentName string` + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - - `Content []BetaResponseReasoningItemContent` + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - Reasoning text content. + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - - `Text string` + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - The reasoning text from the model. + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - - `Type ReasoningText` + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - The type of the reasoning text. Always `reasoning_text`. + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - - `EncryptedContent string` + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - - `Status BetaResponseReasoningItemStatus` + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - - `type BetaResponseCompactionItemParamResp struct{…}` + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - - `EncryptedContent string` + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - The encrypted content of the compaction summary. + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - - `Type Compaction` + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - The type of the item. Always `compaction`. + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - - `const CompactionCompaction Compaction = "compaction"` + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - - `ID string` + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - The ID of the compaction item. + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - - `Agent BetaResponseCompactionItemParamAgentResp` + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - The agent that produced this item. + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - - `AgentName string` + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - - `type BetaResponseInputItemImageGenerationCall struct{…}` + - `string` - An image generation request made by the model. + - `Object Response` - - `ID string` + The object type of this resource - always set to `response`. - The unique ID of the image generation call. + - `const ResponseResponse Response = "response"` - - `Result string` - - The generated image encoded in base64. - - - `Status string` - - The status of the image generation call. + - `Output []BetaResponseOutputItemUnion` - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + An array of content items generated by the model. - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + - `type BetaResponseOutputMessage struct{…}` - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + An output message from the model. - - `Type ImageGenerationCall` + - `type BetaResponseFileSearchToolCall struct{…}` - The type of the image generation call. Always `image_generation_call`. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `type BetaResponseFunctionToolCall struct{…}` - - `Agent BetaResponseInputItemImageGenerationCallAgent` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - The agent that produced this item. + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `AgentName string` + - `ID string` - The canonical name of the agent that produced this item. + The unique ID of the function call tool output. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `CallID string` - A tool call to run code. + The unique ID of the function tool call generated by the model. - - `ID string` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - The unique ID of the code interpreter tool call. + The output from the function call generated by your code. + Can be a string or an list of output content. - - `Code string` + - `string` - The code to run, or null if not available. + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - - `ContainerID string` + Text, image, or file output of the function call. - The ID of the container used to run the code. + - `type BetaResponseInputText struct{…}` - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + A text input to the model. - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - `type BetaResponseInputImage struct{…}` - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The logs output from the code interpreter. + - `type BetaResponseInputFile struct{…}` - - `Logs string` + A file input to the model. - The logs output from the code interpreter. + - `Status BetaResponseFunctionToolCallOutputItemStatus` - - `Type Logs` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The type of the output. Always `logs`. + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `const LogsLogs Logs = "logs"` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - The image output from the code interpreter. + - `Type FunctionCallOutput` - - `Type Image` + The type of the function tool call output. Always `function_call_output`. - The type of the output. Always `image`. + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `const ImageImage Image = "image"` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - - `URL string` + The agent that produced this item. - The URL of the image output from the code interpreter. + - `AgentName string` - - `Status BetaResponseCodeInterpreterToolCallStatus` + The canonical name of the agent that produced this item. - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + The execution context that produced this tool call. - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `Type Direct` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + The caller type. Always `direct`. - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + - `const DirectDirect Direct = "direct"` - - `Type CodeInterpreterCall` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `CallerID string` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + The call ID of the program item that produced this tool call. - - `Agent BetaResponseCodeInterpreterToolCallAgent` + - `Type Program` - The agent that produced this item. + The caller type. Always `program`. - - `AgentName string` + - `const ProgramProgram Program = "program"` - The canonical name of the agent that produced this item. + - `CreatedBy string` - - `type BetaResponseInputItemLocalShellCall struct{…}` + The identifier of the actor that created the item. - A tool call to run a command on the local shell. + - `type BetaResponseOutputItemAgentMessage struct{…}` - `ID string` - The unique ID of the local shell call. + The unique ID of the agent message. - - `Action BetaResponseInputItemLocalShellCallAction` + - `Author string` - Execute a shell command on the server. + The sending agent identity. - - `Command []string` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - The command to run. + Encrypted content sent between agents. - - `Env map[string, string]` + - `type BetaResponseInputText struct{…}` - Environment variables to set for the command. + A text input to the model. - - `Type Exec` + - `type BetaResponseOutputText struct{…}` - The type of the local shell action. Always `exec`. + A text output from the model. - - `const ExecExec Exec = "exec"` + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - - `TimeoutMs int64` + A text content. - Optional timeout in milliseconds for the command. + - `Text string` - - `User string` + - `Type Text` - Optional user to run the command as. + - `const TextText Text = "text"` - - `WorkingDirectory string` + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - Optional working directory to run the command in. + A summary text from the model. - - `CallID string` + - `Text string` - The unique ID of the local shell tool call generated by the model. + A summary of the reasoning output from the model so far. - - `Status string` + - `Type SummaryText` - The status of the local shell call. + The type of the object. Always `summary_text`. - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + Reasoning text from the model. - - `Type LocalShellCall` + - `Text string` - The type of the local shell call. Always `local_shell_call`. + The reasoning text from the model. - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `Type ReasoningText` - - `Agent BetaResponseInputItemLocalShellCallAgent` + The type of the reasoning text. Always `reasoning_text`. - The agent that produced this item. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `AgentName string` + - `type BetaResponseOutputRefusal struct{…}` - The canonical name of the agent that produced this item. + A refusal from the model. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `type BetaResponseInputImage struct{…}` - The output of a local shell tool call. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `ID string` + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - The unique ID of the local shell tool call generated by the model. + A screenshot of a computer. - - `Output string` + - `Detail string` - A JSON string of the output of the local shell tool call. + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `Type LocalShellCallOutput` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - The type of the local shell tool call output. Always `local_shell_call_output`. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - The agent that produced this item. + - `FileID string` - - `AgentName string` + The identifier of an uploaded file that contains the screenshot. - The canonical name of the agent that produced this item. + - `ImageURL string` - - `Status string` + The URL of the screenshot image. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `Type ComputerScreenshot` - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - - `type BetaResponseInputItemShellCall struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A tool representing a request to execute one or more shell commands. + - `Mode Explicit` - - `Action BetaResponseInputItemShellCallAction` + The breakpoint mode. Always `explicit`. - The shell commands and limits that describe how to run the tool call. + - `const ExplicitExplicit Explicit = "explicit"` - - `Commands []string` + - `type BetaResponseInputFile struct{…}` - Ordered shell commands for the execution environment to run. + A file input to the model. - - `MaxOutputLength int64` + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `TimeoutMs int64` + - `EncryptedContent string` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + Opaque encrypted content. - - `CallID string` + - `Type EncryptedContent` - The unique ID of the shell tool call generated by the model. + The type of the input item. Always `encrypted_content`. - - `Type ShellCall` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - The type of the item. Always `shell_call`. + - `Recipient string` - - `const ShellCallShellCall ShellCall = "shell_call"` + The destination agent identity. - - `ID string` + - `Type AgentMessage` - The unique ID of the shell tool call. Populated when this item is returned via API. + The type of the item. Always `agent_message`. - - `Agent BetaResponseInputItemShellCallAgent` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + + - `Agent BetaResponseOutputItemAgentMessageAgent` The agent that produced this item. @@ -17165,107 +15680,101 @@ Create a model response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemShellCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - - `Type Direct` + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - The caller type. Always `direct`. + - `ID string` - - `const DirectDirect Direct = "direct"` + The unique ID of the multi-agent call item. - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `Action string` - - `CallerID string` + The multi-agent action to execute. - The call ID of the program item that produced this tool call. + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - - `Type Program` + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - The caller type. Always `program`. + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - The environment to execute the shell commands in. + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - - `type BetaLocalEnvironment struct{…}` + - `Arguments string` - - `type BetaContainerReference struct{…}` + The JSON string of arguments generated for the action. - - `Status string` + - `CallID string` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + The unique ID linking this call to its output. - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + - `Type MultiAgentCall` - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + The type of the multi-agent call. Always `multi_agent_call`. - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `Agent BetaResponseOutputItemMultiAgentCallAgent` - The streamed output items emitted by a shell tool call. + The agent that produced this item. - - `CallID string` + - `AgentName string` - The unique ID of the shell tool call generated by the model. + The canonical name of the agent that produced this item. - - `Output []BetaResponseFunctionShellCallOutputContent` + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - Captured chunks of stdout and stderr output, along with their associated outcomes. + - `ID string` - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + The unique ID of the multi-agent call output item. - The exit or timeout outcome associated with this shell call. + - `Action string` - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + The multi-agent action that produced this result. - Indicates that the shell call exceeded its configured time limit. + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `Type Timeout` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - The outcome type. Always `timeout`. + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `const TimeoutTimeout Timeout = "timeout"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - Indicates that the shell commands finished and returned an exit code. + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - - `ExitCode int64` + - `CallID string` - The exit code returned by the shell process. + The unique ID of the multi-agent call. - - `Type Exit` + - `Output []BetaResponseOutputText` - The outcome type. Always `exit`. + Text output returned by the multi-agent action. - - `const ExitExit Exit = "exit"` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `Stderr string` + The annotations of the text output. - Captured stderr output for the shell call. + - `Text string` - - `Stdout string` + The text output from the model. - Captured stdout output for the shell call. + - `Type OutputText` - - `Type ShellCallOutput` + The type of the output text. Always `output_text`. - The type of the item. Always `shell_call_output`. + - `Logprobs []BetaResponseOutputTextLogprob` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `Type MultiAgentCallOutput` - - `ID string` + The type of the multi-agent result. Always `multi_agent_call_output`. - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` The agent that produced this item. @@ -17273,183 +15782,192 @@ Create a model response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + - `type BetaResponseFunctionWebSearch struct{…}` - The execution context that produced this tool call. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + - `type BetaResponseComputerToolCall struct{…}` - - `Type Direct` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - The caller type. Always `direct`. + - `type BetaResponseComputerToolCallOutputItem struct{…}` - - `const DirectDirect Direct = "direct"` + - `ID string` - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + The unique ID of the computer call tool output. - - `CallerID string` + - `CallID string` - The call ID of the program item that produced this tool call. + The ID of the computer tool call that produced the output. - - `Type Program` + - `Output BetaResponseComputerToolCallOutputScreenshot` - The caller type. Always `program`. + A computer screenshot image used with the computer use tool. - - `const ProgramProgram Program = "program"` + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `MaxOutputLength int64` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - The maximum number of UTF-8 characters captured for this shell call's combined output. + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - - `Status string` + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - The status of the shell call output. + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + - `Type ComputerCallOutput` - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + The type of the computer tool call output. Always `computer_call_output`. - - `type BetaResponseInputItemApplyPatchCall struct{…}` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - A tool call representing a request to create, delete, or update files using diff patches. + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `CallID string` + The safety checks reported by the API that have been acknowledged by the + developer. - The unique ID of the apply patch tool call generated by the model. + - `ID string` - - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + The ID of the pending safety check. - The specific create, delete, or update instruction for the apply_patch tool call. + - `Code string` - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + The type of the pending safety check. - Instruction for creating a new file via the apply_patch tool. + - `Message string` - - `Diff string` + Details about the pending safety check. - Unified diff content to apply when creating the file. + - `Agent BetaResponseComputerToolCallOutputItemAgent` - - `Path string` + The agent that produced this item. - Path of the file to create relative to the workspace root. + - `AgentName string` - - `Type CreateFile` + The canonical name of the agent that produced this item. - The operation type. Always `create_file`. + - `CreatedBy string` - - `const CreateFileCreateFile CreateFile = "create_file"` + The identifier of the actor that created the item. - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + - `type BetaResponseReasoningItem struct{…}` - Instruction for deleting an existing file via the apply_patch tool. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `Path string` + - `type BetaResponseOutputItemProgram struct{…}` - Path of the file to delete relative to the workspace root. + - `ID string` - - `Type DeleteFile` + The unique ID of the program item. - The operation type. Always `delete_file`. + - `CallID string` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + The stable call ID of the program item. - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + - `Code string` - Instruction for updating an existing file via the apply_patch tool. + The JavaScript source executed by programmatic tool calling. - - `Diff string` + - `Fingerprint string` - Unified diff content to apply to the existing file. + Opaque program replay fingerprint that must be round-tripped. - - `Path string` + - `Type Program` - Path of the file to update relative to the workspace root. + The type of the item. Always `program`. - - `Type UpdateFile` + - `const ProgramProgram Program = "program"` - The operation type. Always `update_file`. + - `Agent BetaResponseOutputItemProgramAgent` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + The agent that produced this item. - - `Status string` + - `AgentName string` - The status of the apply patch tool call. One of `in_progress` or `completed`. + The canonical name of the agent that produced this item. - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + - `type BetaResponseOutputItemProgramOutput struct{…}` - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + - `ID string` - - `Type ApplyPatchCall` + The unique ID of the program output item. - The type of the item. Always `apply_patch_call`. + - `CallID string` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + The call ID of the program item. - - `ID string` + - `Result string` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + The result produced by the program item. - - `Agent BetaResponseInputItemApplyPatchCallAgent` + - `Status string` - The agent that produced this item. + The terminal status of the program output item. - - `AgentName string` + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - The canonical name of the agent that produced this item. + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + - `Type ProgramOutput` - The execution context that produced this tool call. + The type of the item. Always `program_output`. - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `Type Direct` + - `Agent BetaResponseOutputItemProgramOutputAgent` - The caller type. Always `direct`. + The agent that produced this item. - - `const DirectDirect Direct = "direct"` + - `AgentName string` - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + The canonical name of the agent that produced this item. - - `CallerID string` + - `type BetaResponseToolSearchCall struct{…}` - The call ID of the program item that produced this tool call. + - `ID string` - - `Type Program` + The unique ID of the tool search call item. - The caller type. Always `program`. + - `Arguments any` - - `const ProgramProgram Program = "program"` + Arguments used for the tool search call. - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `CallID string` - The streamed output emitted by an apply patch tool call. + The unique ID of the tool search call generated by the model. - - `CallID string` + - `Execution BetaResponseToolSearchCallExecution` - The unique ID of the apply patch tool call generated by the model. + Whether tool search was executed by the server or by the client. - - `Status string` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `Status BetaResponseToolSearchCallStatus` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + The status of the tool search call item that was recorded. - - `Type ApplyPatchCallOutput` + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - The type of the item. Always `apply_patch_call_output`. + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - - `ID string` + - `Type ToolSearchCall` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The type of the item. Always `tool_search_call`. - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + + - `Agent BetaResponseToolSearchCallAgent` The agent that produced this item. @@ -17457,111 +15975,113 @@ Create a model response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + - `CreatedBy string` - The execution context that produced this tool call. + The identifier of the actor that created the item. - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + - `type BetaResponseToolSearchOutputItem struct{…}` - - `Type Direct` + - `ID string` - The caller type. Always `direct`. + The unique ID of the tool search output item. - - `const DirectDirect Direct = "direct"` + - `CallID string` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + The unique ID of the tool search call generated by the model. - - `CallerID string` + - `Execution BetaResponseToolSearchOutputItemExecution` - The call ID of the program item that produced this tool call. + Whether tool search was executed by the server or by the client. - - `Type Program` + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - The caller type. Always `program`. + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - - `const ProgramProgram Program = "program"` + - `Status BetaResponseToolSearchOutputItemStatus` - - `Output string` + The status of the tool search output item that was recorded. - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - - `type BetaResponseInputItemMcpListTools struct{…}` + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - A list of tools available on an MCP server. + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - - `ID string` + - `Tools []BetaToolUnion` - The unique ID of the list. + The loaded tool definitions returned by tool search. - - `ServerLabel string` + - `type BetaFunctionTool struct{…}` - The label of the MCP server. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Tools []BetaResponseInputItemMcpListToolsTool` + - `type BetaFileSearchTool struct{…}` - The tools available on the server. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `InputSchema any` + - `type BetaComputerTool struct{…}` - The JSON schema describing the tool's input. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Name string` + - `type BetaComputerUsePreviewTool struct{…}` - The name of the tool. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Annotations any` + - `type BetaWebSearchTool struct{…}` - Additional annotations about the tool. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Description string` + - `type BetaToolMcp struct{…}` - The description of the tool. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Type McpListTools` + - `type BetaToolCodeInterpreter struct{…}` - The type of the item. Always `mcp_list_tools`. + A tool that runs Python code to help generate a response to a prompt. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Agent BetaResponseInputItemMcpListToolsAgent` + - `type BetaToolImageGeneration struct{…}` - The agent that produced this item. + A tool that generates images using the GPT image models. - - `AgentName string` + - `type BetaToolLocalShell struct{…}` - The canonical name of the agent that produced this item. + A tool that allows the model to execute shell commands in a local environment. - - `Error string` + - `type BetaFunctionShellTool struct{…}` - Error message if the server could not list tools. + A tool that allows the model to execute shell commands. - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + - `type BetaCustomTool struct{…}` - A request for human approval of a tool invocation. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `ID string` + - `type BetaNamespaceTool struct{…}` - The unique ID of the approval request. + Groups function/custom tools under a shared namespace. - - `Arguments string` + - `type BetaToolSearchTool struct{…}` - A JSON string of arguments for the tool. + Hosted or BYOT tool search configuration for deferred tools. - - `Name string` + - `type BetaWebSearchPreviewTool struct{…}` - The name of the tool to run. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `ServerLabel string` + - `type BetaApplyPatchTool struct{…}` - The label of the MCP server making the request. + Allows the assistant to create, delete, or update files using unified diffs. - - `Type McpApprovalRequest` + - `Type ToolSearchOutput` - The type of the item. Always `mcp_approval_request`. + The type of the item. Always `tool_search_output`. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `Agent BetaResponseToolSearchOutputItemAgent` The agent that produced this item. @@ -17569,143 +16089,137 @@ Create a model response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - - A response to an MCP approval request. - - - `ApprovalRequestID string` - - The ID of the approval request being answered. + - `CreatedBy string` - - `Approve bool` + The identifier of the actor that created the item. - Whether the request was approved. + - `type BetaResponseOutputItemAdditionalTools struct{…}` - - `Type McpApprovalResponse` + - `ID string` - The type of the item. Always `mcp_approval_response`. + The unique ID of the additional tools item. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `Role string` - - `ID string` + The role that provided the additional tools. - The unique ID of the approval response + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - The agent that produced this item. + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - - `AgentName string` + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - The canonical name of the agent that produced this item. + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - `Reason string` + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - Optional reason for the decision. + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - - `type BetaResponseInputItemMcpCall struct{…}` + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - An invocation of a tool on an MCP server. + - `Tools []BetaToolUnion` - - `ID string` + The additional tool definitions made available at this item. - The unique ID of the tool call. + - `type BetaFunctionTool struct{…}` - - `Arguments string` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - A JSON string of the arguments passed to the tool. + - `type BetaFileSearchTool struct{…}` - - `Name string` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The name of the tool that was run. + - `type BetaComputerTool struct{…}` - - `ServerLabel string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The label of the MCP server running the tool. + - `type BetaComputerUsePreviewTool struct{…}` - - `Type McpCall` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The type of the item. Always `mcp_call`. + - `type BetaWebSearchTool struct{…}` - - `const McpCallMcpCall McpCall = "mcp_call"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Agent BetaResponseInputItemMcpCallAgent` + - `type BetaToolMcp struct{…}` - The agent that produced this item. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `AgentName string` + - `type BetaToolCodeInterpreter struct{…}` - The canonical name of the agent that produced this item. + A tool that runs Python code to help generate a response to a prompt. - - `ApprovalRequestID string` + - `type BetaToolProgrammaticToolCalling struct{…}` - 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. + - `type BetaToolImageGeneration struct{…}` - - `Error string` + A tool that generates images using the GPT image models. - The error from the tool call, if any. + - `type BetaToolLocalShell struct{…}` - - `Output string` + A tool that allows the model to execute shell commands in a local environment. - The output from the tool call. + - `type BetaFunctionShellTool struct{…}` - - `Status string` + A tool that allows the model to execute shell commands. - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `type BetaCustomTool struct{…}` - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + - `type BetaNamespaceTool struct{…}` - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + Groups function/custom tools under a shared namespace. - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + - `type BetaToolSearchTool struct{…}` - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + Hosted or BYOT tool search configuration for deferred tools. - - `type BetaResponseCustomToolCallOutput struct{…}` + - `type BetaWebSearchPreviewTool struct{…}` - The output of a custom tool call from your code, being sent back to the model. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `CallID string` + - `type BetaApplyPatchTool struct{…}` - The call ID, used to map this custom tool call output to a custom tool call. + Allows the assistant to create, delete, or update files using unified diffs. - - `Output BetaResponseCustomToolCallOutputOutputUnion` + - `Type AdditionalTools` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + The type of the item. Always `additional_tools`. - - `string` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + - `Agent BetaResponseOutputItemAdditionalToolsAgent` - Text, image, or file output of the custom tool call. + The agent that produced this item. - - `type BetaResponseInputText struct{…}` + - `AgentName string` - A text input to the model. + The canonical name of the agent that produced this item. - - `type BetaResponseInputImage struct{…}` + - `type BetaResponseCompactionItem struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `type BetaResponseInputFile struct{…}` + - `ID string` - A file input to the model. + The unique ID of the compaction item. - - `Type CustomToolCallOutput` + - `EncryptedContent string` - The type of the custom tool call output. Always `custom_tool_call_output`. + The encrypted content that was produced by compaction. - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `Type Compaction` - - `ID string` + The type of the item. Always `compaction`. - The unique ID of the custom tool call output in the OpenAI platform. + - `const CompactionCompaction Compaction = "compaction"` - - `Agent BetaResponseCustomToolCallOutputAgent` + - `Agent BetaResponseCompactionItemAgent` The agent that produced this item. @@ -17713,99 +16227,111 @@ Create a model response The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallOutputCallerUnion` + - `CreatedBy string` - The execution context that produced this tool call. + The identifier of the actor that created the item. - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - - `Type Direct` + An image generation request made by the model. - The caller type. Always `direct`. + - `ID string` - - `const DirectDirect Direct = "direct"` + The unique ID of the image generation call. - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `Result string` - - `CallerID string` + The generated image encoded in base64. - The call ID of the program item that produced this tool call. + - `Status string` - - `Type Program` + The status of the image generation call. - The caller type. Always `program`. + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - `type BetaResponseCustomToolCall struct{…}` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - A call to a custom tool created by the model. + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - - `CallID string` + - `Type ImageGenerationCall` - An identifier used to map this custom tool call to a tool call output. + The type of the image generation call. Always `image_generation_call`. - - `Input string` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - The input for the custom tool call generated by the model. + - `Agent BetaResponseOutputItemImageGenerationCallAgent` - - `Name string` + The agent that produced this item. - The name of the custom tool being called. + - `AgentName string` - - `Type CustomToolCall` + The canonical name of the agent that produced this item. - The type of the custom tool call. Always `custom_tool_call`. + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + A tool call to run code. + + - `type BetaResponseOutputItemLocalShellCall struct{…}` + + A tool call to run a command on the local shell. - `ID string` - The unique ID of the custom tool call in the OpenAI platform. + The unique ID of the local shell call. - - `Agent BetaResponseCustomToolCallAgent` + - `Action BetaResponseOutputItemLocalShellCallAction` - The agent that produced this item. + Execute a shell command on the server. - - `AgentName string` + - `Command []string` - The canonical name of the agent that produced this item. + The command to run. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `Env map[string, string]` - The execution context that produced this tool call. + Environment variables to set for the command. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `Type Exec` - - `Type Direct` + The type of the local shell action. Always `exec`. - - `const DirectDirect Direct = "direct"` + - `const ExecExec Exec = "exec"` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `TimeoutMs int64` - - `CallerID string` + Optional timeout in milliseconds for the command. - The call ID of the program item that produced this tool call. + - `User string` - - `Type Program` + Optional user to run the command as. - - `const ProgramProgram Program = "program"` + - `WorkingDirectory string` - - `Namespace string` + Optional working directory to run the command in. - The namespace of the custom tool being called. + - `CallID string` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + The unique ID of the local shell tool call generated by the model. - Compacts the current context. Must be the final input item. + - `Status string` - - `Type CompactionTrigger` + The status of the local shell call. - The type of the item. Always `compaction_trigger`. + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - - `Agent BetaResponseInputItemCompactionTriggerAgent` + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + + - `Type LocalShellCall` + + The type of the local shell call. Always `local_shell_call`. + + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + + - `Agent BetaResponseOutputItemLocalShellCallAgent` The agent that produced this item. @@ -17813,15 +16339,25 @@ Create a model response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemItemReference struct{…}` + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - An internal identifier for an item to reference. + The output of a local shell tool call. - `ID string` - The ID of the item to reference. + The unique ID of the local shell tool call generated by the model. - - `Agent BetaResponseInputItemItemReferenceAgent` + - `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"` + + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` The agent that produced this item. @@ -17829,73 +16365,85 @@ Create a model response The canonical name of the agent that produced this item. - - `Type string` + - `Status string` - The type of item to reference. Always `item_reference`. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - - `type BetaResponseInputItemProgram struct{…}` + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + + - `type BetaResponseFunctionShellToolCall struct{…}` + + A tool call that executes one or more shell commands in a managed environment. - `ID string` - The unique ID of this program item. + The unique ID of the shell tool call. Populated when this item is returned via API. - - `CallID string` + - `Action BetaResponseFunctionShellToolCallAction` - The stable call ID of the program item. + The shell commands and limits that describe how to run the tool call. - - `Code string` + - `Commands []string` - The JavaScript source executed by programmatic tool calling. + - `MaxOutputLength int64` - - `Fingerprint string` + Optional maximum number of characters to return from each command. - Opaque program replay fingerprint that must be round-tripped. + - `TimeoutMs int64` - - `Type Program` + Optional timeout in milliseconds for the commands. - The item type. Always `program`. + - `CallID string` - - `const ProgramProgram Program = "program"` + The unique ID of the shell tool call generated by the model. - - `Agent BetaResponseInputItemProgramAgent` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - The agent that produced this item. + Represents the use of a local environment to perform shell actions. - - `AgentName string` + - `type BetaResponseLocalEnvironment struct{…}` - The canonical name of the agent that produced this item. + Represents the use of a local environment to perform shell actions. - - `type BetaResponseInputItemProgramOutput struct{…}` + - `Type Local` - - `ID string` + The environment type. Always `local`. - The unique ID of this program output item. + - `const LocalLocal Local = "local"` - - `CallID string` + - `type BetaResponseContainerReference struct{…}` - The call ID of the program item. + Represents a container created with /v1/containers. - - `Result string` + - `ContainerID string` - The result produced by the program item. + - `Type ContainerReference` - - `Status string` + The environment type. Always `container_reference`. - The terminal status of the program output. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `Status BetaResponseFunctionShellToolCallStatus` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `Type ProgramOutput` + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - The item type. Always `program_output`. + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `Agent BetaResponseInputItemProgramOutputAgent` + - `Type ShellCall` + + The type of the item. Always `shell_call`. + + - `const ShellCallShellCall ShellCall = "shell_call"` + + - `Agent BetaResponseFunctionShellToolCallAgent` The agent that produced this item. @@ -17903,481 +16451,530 @@ Create a model response The canonical name of the agent that produced this item. - - `Instructions param.Field[string]` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - Body param: A system (or developer) message inserted into the model's context. + The execution context that produced this tool call. - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - - `MaxOutputTokens param.Field[int64]` + - `Type Direct` - Body param: An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + - `const DirectDirect Direct = "direct"` - - `MaxToolCalls param.Field[int64]` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - Body param: The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + - `CallerID string` - - `Metadata param.Field[map[string, string]]` + The call ID of the program item that produced this tool call. - Body param: 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. + - `Type Program` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const ProgramProgram Program = "program"` - - `Model param.Field[BetaResponseNewParamsModel]` + - `CreatedBy string` - Body param: Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + The ID of the entity that created this tool call. - - `BetaResponseNewParamsModel` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - - `const BetaResponseNewParamsModelGPT5_6Sol BetaResponseNewParamsModel = "gpt-5.6-sol"` + The output of a shell tool call that was emitted. - - `const BetaResponseNewParamsModelGPT5_6Terra BetaResponseNewParamsModel = "gpt-5.6-terra"` + - `ID string` - - `const BetaResponseNewParamsModelGPT5_6Luna BetaResponseNewParamsModel = "gpt-5.6-luna"` + The unique ID of the shell call output. Populated when this item is returned via API. - - `const BetaResponseNewParamsModelGPT5_4 BetaResponseNewParamsModel = "gpt-5.4"` + - `CallID string` - - `const BetaResponseNewParamsModelGPT5_4Mini BetaResponseNewParamsModel = "gpt-5.4-mini"` + The unique ID of the shell tool call generated by the model. - - `const BetaResponseNewParamsModelGPT5_4Nano BetaResponseNewParamsModel = "gpt-5.4-nano"` + - `MaxOutputLength int64` - - `const BetaResponseNewParamsModelGPT5_4Mini2026_03_17 BetaResponseNewParamsModel = "gpt-5.4-mini-2026-03-17"` + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `const BetaResponseNewParamsModelGPT5_4Nano2026_03_17 BetaResponseNewParamsModel = "gpt-5.4-nano-2026-03-17"` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - - `const BetaResponseNewParamsModelGPT5_3ChatLatest BetaResponseNewParamsModel = "gpt-5.3-chat-latest"` + An array of shell call output contents - - `const BetaResponseNewParamsModelGPT5_2 BetaResponseNewParamsModel = "gpt-5.2"` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - - `const BetaResponseNewParamsModelGPT5_2_2025_12_11 BetaResponseNewParamsModel = "gpt-5.2-2025-12-11"` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - - `const BetaResponseNewParamsModelGPT5_2ChatLatest BetaResponseNewParamsModel = "gpt-5.2-chat-latest"` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - - `const BetaResponseNewParamsModelGPT5_2Pro BetaResponseNewParamsModel = "gpt-5.2-pro"` + Indicates that the shell call exceeded its configured time limit. - - `const BetaResponseNewParamsModelGPT5_2Pro2025_12_11 BetaResponseNewParamsModel = "gpt-5.2-pro-2025-12-11"` + - `Type Timeout` - - `const BetaResponseNewParamsModelGPT5_1 BetaResponseNewParamsModel = "gpt-5.1"` + The outcome type. Always `timeout`. - - `const BetaResponseNewParamsModelGPT5_1_2025_11_13 BetaResponseNewParamsModel = "gpt-5.1-2025-11-13"` + - `const TimeoutTimeout Timeout = "timeout"` - - `const BetaResponseNewParamsModelGPT5_1Codex BetaResponseNewParamsModel = "gpt-5.1-codex"` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - - `const BetaResponseNewParamsModelGPT5_1Mini BetaResponseNewParamsModel = "gpt-5.1-mini"` + Indicates that the shell commands finished and returned an exit code. - - `const BetaResponseNewParamsModelGPT5_1ChatLatest BetaResponseNewParamsModel = "gpt-5.1-chat-latest"` + - `ExitCode int64` - - `const BetaResponseNewParamsModelGPT5 BetaResponseNewParamsModel = "gpt-5"` + Exit code from the shell process. - - `const BetaResponseNewParamsModelGPT5Mini BetaResponseNewParamsModel = "gpt-5-mini"` + - `Type Exit` - - `const BetaResponseNewParamsModelGPT5Nano BetaResponseNewParamsModel = "gpt-5-nano"` + The outcome type. Always `exit`. - - `const BetaResponseNewParamsModelGPT5_2025_08_07 BetaResponseNewParamsModel = "gpt-5-2025-08-07"` + - `const ExitExit Exit = "exit"` - - `const BetaResponseNewParamsModelGPT5Mini2025_08_07 BetaResponseNewParamsModel = "gpt-5-mini-2025-08-07"` + - `Stderr string` - - `const BetaResponseNewParamsModelGPT5Nano2025_08_07 BetaResponseNewParamsModel = "gpt-5-nano-2025-08-07"` + The standard error output that was captured. - - `const BetaResponseNewParamsModelGPT5ChatLatest BetaResponseNewParamsModel = "gpt-5-chat-latest"` + - `Stdout string` - - `const BetaResponseNewParamsModelGPT4_1 BetaResponseNewParamsModel = "gpt-4.1"` + The standard output that was captured. - - `const BetaResponseNewParamsModelGPT4_1Mini BetaResponseNewParamsModel = "gpt-4.1-mini"` + - `CreatedBy string` - - `const BetaResponseNewParamsModelGPT4_1Nano BetaResponseNewParamsModel = "gpt-4.1-nano"` + The identifier of the actor that created the item. - - `const BetaResponseNewParamsModelGPT4_1_2025_04_14 BetaResponseNewParamsModel = "gpt-4.1-2025-04-14"` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `const BetaResponseNewParamsModelGPT4_1Mini2025_04_14 BetaResponseNewParamsModel = "gpt-4.1-mini-2025-04-14"` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaResponseNewParamsModelGPT4_1Nano2025_04_14 BetaResponseNewParamsModel = "gpt-4.1-nano-2025-04-14"` + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `const BetaResponseNewParamsModelO4Mini BetaResponseNewParamsModel = "o4-mini"` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - - `const BetaResponseNewParamsModelO4Mini2025_04_16 BetaResponseNewParamsModel = "o4-mini-2025-04-16"` + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - - `const BetaResponseNewParamsModelO3 BetaResponseNewParamsModel = "o3"` + - `Type ShellCallOutput` - - `const BetaResponseNewParamsModelO3_2025_04_16 BetaResponseNewParamsModel = "o3-2025-04-16"` + The type of the shell call output. Always `shell_call_output`. - - `const BetaResponseNewParamsModelO3Mini BetaResponseNewParamsModel = "o3-mini"` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `const BetaResponseNewParamsModelO3Mini2025_01_31 BetaResponseNewParamsModel = "o3-mini-2025-01-31"` + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - - `const BetaResponseNewParamsModelO1 BetaResponseNewParamsModel = "o1"` + The agent that produced this item. - - `const BetaResponseNewParamsModelO1_2024_12_17 BetaResponseNewParamsModel = "o1-2024-12-17"` + - `AgentName string` - - `const BetaResponseNewParamsModelO1Preview BetaResponseNewParamsModel = "o1-preview"` + The canonical name of the agent that produced this item. - - `const BetaResponseNewParamsModelO1Preview2024_09_12 BetaResponseNewParamsModel = "o1-preview-2024-09-12"` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - - `const BetaResponseNewParamsModelO1Mini BetaResponseNewParamsModel = "o1-mini"` + The execution context that produced this tool call. - - `const BetaResponseNewParamsModelO1Mini2024_09_12 BetaResponseNewParamsModel = "o1-mini-2024-09-12"` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `const BetaResponseNewParamsModelGPT4o BetaResponseNewParamsModel = "gpt-4o"` + - `Type Direct` - - `const BetaResponseNewParamsModelGPT4o2024_11_20 BetaResponseNewParamsModel = "gpt-4o-2024-11-20"` + - `const DirectDirect Direct = "direct"` - - `const BetaResponseNewParamsModelGPT4o2024_08_06 BetaResponseNewParamsModel = "gpt-4o-2024-08-06"` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - - `const BetaResponseNewParamsModelGPT4o2024_05_13 BetaResponseNewParamsModel = "gpt-4o-2024-05-13"` + - `CallerID string` - - `const BetaResponseNewParamsModelGPT4oAudioPreview BetaResponseNewParamsModel = "gpt-4o-audio-preview"` + The call ID of the program item that produced this tool call. - - `const BetaResponseNewParamsModelGPT4oAudioPreview2024_10_01 BetaResponseNewParamsModel = "gpt-4o-audio-preview-2024-10-01"` + - `Type Program` - - `const BetaResponseNewParamsModelGPT4oAudioPreview2024_12_17 BetaResponseNewParamsModel = "gpt-4o-audio-preview-2024-12-17"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseNewParamsModelGPT4oAudioPreview2025_06_03 BetaResponseNewParamsModel = "gpt-4o-audio-preview-2025-06-03"` + - `CreatedBy string` - - `const BetaResponseNewParamsModelGPT4oMiniAudioPreview BetaResponseNewParamsModel = "gpt-4o-mini-audio-preview"` + The identifier of the actor that created the item. - - `const BetaResponseNewParamsModelGPT4oMiniAudioPreview2024_12_17 BetaResponseNewParamsModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `type BetaResponseApplyPatchToolCall struct{…}` - - `const BetaResponseNewParamsModelGPT4oSearchPreview BetaResponseNewParamsModel = "gpt-4o-search-preview"` + A tool call that applies file diffs by creating, deleting, or updating files. - - `const BetaResponseNewParamsModelGPT4oMiniSearchPreview BetaResponseNewParamsModel = "gpt-4o-mini-search-preview"` + - `ID string` - - `const BetaResponseNewParamsModelGPT4oSearchPreview2025_03_11 BetaResponseNewParamsModel = "gpt-4o-search-preview-2025-03-11"` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaResponseNewParamsModelGPT4oMiniSearchPreview2025_03_11 BetaResponseNewParamsModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `CallID string` - - `const BetaResponseNewParamsModelChatgpt4oLatest BetaResponseNewParamsModel = "chatgpt-4o-latest"` + The unique ID of the apply patch tool call generated by the model. - - `const BetaResponseNewParamsModelCodexMiniLatest BetaResponseNewParamsModel = "codex-mini-latest"` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - - `const BetaResponseNewParamsModelGPT4oMini BetaResponseNewParamsModel = "gpt-4o-mini"` + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `const BetaResponseNewParamsModelGPT4oMini2024_07_18 BetaResponseNewParamsModel = "gpt-4o-mini-2024-07-18"` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - - `const BetaResponseNewParamsModelGPT4Turbo BetaResponseNewParamsModel = "gpt-4-turbo"` + Instruction describing how to create a file via the apply_patch tool. - - `const BetaResponseNewParamsModelGPT4Turbo2024_04_09 BetaResponseNewParamsModel = "gpt-4-turbo-2024-04-09"` + - `Diff string` - - `const BetaResponseNewParamsModelGPT4_0125Preview BetaResponseNewParamsModel = "gpt-4-0125-preview"` + Diff to apply. - - `const BetaResponseNewParamsModelGPT4TurboPreview BetaResponseNewParamsModel = "gpt-4-turbo-preview"` + - `Path string` - - `const BetaResponseNewParamsModelGPT4_1106Preview BetaResponseNewParamsModel = "gpt-4-1106-preview"` + Path of the file to create. - - `const BetaResponseNewParamsModelGPT4VisionPreview BetaResponseNewParamsModel = "gpt-4-vision-preview"` + - `Type CreateFile` - - `const BetaResponseNewParamsModelGPT4 BetaResponseNewParamsModel = "gpt-4"` + Create a new file with the provided diff. - - `const BetaResponseNewParamsModelGPT4_0314 BetaResponseNewParamsModel = "gpt-4-0314"` + - `const CreateFileCreateFile CreateFile = "create_file"` - - `const BetaResponseNewParamsModelGPT4_0613 BetaResponseNewParamsModel = "gpt-4-0613"` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - - `const BetaResponseNewParamsModelGPT4_32k BetaResponseNewParamsModel = "gpt-4-32k"` + Instruction describing how to delete a file via the apply_patch tool. - - `const BetaResponseNewParamsModelGPT4_32k0314 BetaResponseNewParamsModel = "gpt-4-32k-0314"` + - `Path string` - - `const BetaResponseNewParamsModelGPT4_32k0613 BetaResponseNewParamsModel = "gpt-4-32k-0613"` + Path of the file to delete. - - `const BetaResponseNewParamsModelGPT3_5Turbo BetaResponseNewParamsModel = "gpt-3.5-turbo"` + - `Type DeleteFile` - - `const BetaResponseNewParamsModelGPT3_5Turbo16k BetaResponseNewParamsModel = "gpt-3.5-turbo-16k"` + Delete the specified file. - - `const BetaResponseNewParamsModelGPT3_5Turbo0301 BetaResponseNewParamsModel = "gpt-3.5-turbo-0301"` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `const BetaResponseNewParamsModelGPT3_5Turbo0613 BetaResponseNewParamsModel = "gpt-3.5-turbo-0613"` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `const BetaResponseNewParamsModelGPT3_5Turbo1106 BetaResponseNewParamsModel = "gpt-3.5-turbo-1106"` + Instruction describing how to update a file via the apply_patch tool. - - `const BetaResponseNewParamsModelGPT3_5Turbo0125 BetaResponseNewParamsModel = "gpt-3.5-turbo-0125"` + - `Diff string` - - `const BetaResponseNewParamsModelGPT3_5Turbo16k0613 BetaResponseNewParamsModel = "gpt-3.5-turbo-16k-0613"` + Diff to apply. - - `const BetaResponseNewParamsModelO1Pro BetaResponseNewParamsModel = "o1-pro"` + - `Path string` - - `const BetaResponseNewParamsModelO1Pro2025_03_19 BetaResponseNewParamsModel = "o1-pro-2025-03-19"` + Path of the file to update. - - `const BetaResponseNewParamsModelO3Pro BetaResponseNewParamsModel = "o3-pro"` + - `Type UpdateFile` - - `const BetaResponseNewParamsModelO3Pro2025_06_10 BetaResponseNewParamsModel = "o3-pro-2025-06-10"` + Update an existing file with the provided diff. - - `const BetaResponseNewParamsModelO3DeepResearch BetaResponseNewParamsModel = "o3-deep-research"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `const BetaResponseNewParamsModelO3DeepResearch2025_06_26 BetaResponseNewParamsModel = "o3-deep-research-2025-06-26"` + - `Status BetaResponseApplyPatchToolCallStatus` - - `const BetaResponseNewParamsModelO4MiniDeepResearch BetaResponseNewParamsModel = "o4-mini-deep-research"` + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaResponseNewParamsModelO4MiniDeepResearch2025_06_26 BetaResponseNewParamsModel = "o4-mini-deep-research-2025-06-26"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `const BetaResponseNewParamsModelComputerUsePreview BetaResponseNewParamsModel = "computer-use-preview"` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - `const BetaResponseNewParamsModelComputerUsePreview2025_03_11 BetaResponseNewParamsModel = "computer-use-preview-2025-03-11"` + - `Type ApplyPatchCall` - - `const BetaResponseNewParamsModelGPT5Codex BetaResponseNewParamsModel = "gpt-5-codex"` + The type of the item. Always `apply_patch_call`. - - `const BetaResponseNewParamsModelGPT5Pro BetaResponseNewParamsModel = "gpt-5-pro"` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `const BetaResponseNewParamsModelGPT5Pro2025_10_06 BetaResponseNewParamsModel = "gpt-5-pro-2025-10-06"` + - `Agent BetaResponseApplyPatchToolCallAgent` - - `const BetaResponseNewParamsModelGPT5_1CodexMax BetaResponseNewParamsModel = "gpt-5.1-codex-max"` + The agent that produced this item. - - `string` + - `AgentName string` - - `Moderation param.Field[BetaResponseNewParamsModeration]` + The canonical name of the agent that produced this item. - Body param: Configuration for running moderation on the input and output of this response. + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - `Model string` + The execution context that produced this tool call. - The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'. + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `Policy BetaResponseNewParamsModerationPolicy` + - `Type Direct` - The policy to apply to moderated response input and output. + - `const DirectDirect Direct = "direct"` - - `Input BetaResponseNewParamsModerationPolicyInput` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - The moderation policy for the response input. + - `CallerID string` - - `Mode string` + The call ID of the program item that produced this tool call. - - `const BetaResponseNewParamsModerationPolicyInputModeScore BetaResponseNewParamsModerationPolicyInputMode = "score"` + - `Type Program` - - `const BetaResponseNewParamsModerationPolicyInputModeBlock BetaResponseNewParamsModerationPolicyInputMode = "block"` + - `const ProgramProgram Program = "program"` - - `Output BetaResponseNewParamsModerationPolicyOutput` + - `CreatedBy string` - The moderation policy for the response output. + The ID of the entity that created this tool call. - - `Mode string` + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `const BetaResponseNewParamsModerationPolicyOutputModeScore BetaResponseNewParamsModerationPolicyOutputMode = "score"` + The output emitted by an apply patch tool call. - - `const BetaResponseNewParamsModerationPolicyOutputModeBlock BetaResponseNewParamsModerationPolicyOutputMode = "block"` + - `ID string` - - `MultiAgent param.Field[BetaResponseNewParamsMultiAgent]` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - Body param: Configuration for server-hosted multi-agent execution. + - `CallID string` - - `Enabled bool` + The unique ID of the apply patch tool call generated by the model. - Whether to enable server-hosted multi-agent execution for this response. + - `Status BetaResponseApplyPatchToolCallOutputStatus` - - `MaxConcurrentSubagents int64` + The status of the apply patch tool call output. One of `completed` or `failed`. - `max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent. - The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run. + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `ParallelToolCalls param.Field[bool]` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - Body param: Whether to allow the model to run tool calls in parallel. + - `Type ApplyPatchCallOutput` - - `PreviousResponseID param.Field[string]` + The type of the item. Always `apply_patch_call_output`. - Body param: The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `Prompt param.Field[BetaResponsePrompt]` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - Body param: Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + The agent that produced this item. - - `PromptCacheKey param.Field[string]` + - `AgentName string` - Body param: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + The canonical name of the agent that produced this item. - - `PromptCacheOptions param.Field[BetaResponseNewParamsPromptCacheOptions]` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - Body param: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details. + The execution context that produced this tool call. - - `Mode string` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. + - `Type Direct` - - `const BetaResponseNewParamsPromptCacheOptionsModeImplicit BetaResponseNewParamsPromptCacheOptionsMode = "implicit"` + - `const DirectDirect Direct = "direct"` - - `const BetaResponseNewParamsPromptCacheOptionsModeExplicit BetaResponseNewParamsPromptCacheOptionsMode = "explicit"` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - `Ttl string` + - `CallerID string` - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. + The call ID of the program item that produced this tool call. - - `const BetaResponseNewParamsPromptCacheOptionsTtl30m BetaResponseNewParamsPromptCacheOptionsTtl = "30m"` + - `Type Program` - - `PromptCacheRetention param.Field[BetaResponseNewParamsPromptCacheRetention]` + - `const ProgramProgram Program = "program"` - Body param: Deprecated. Use `prompt_cache_options.ttl` instead. + - `CreatedBy string` - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + The ID of the entity that created this tool call output. - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + - `Output string` - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + Optional textual output returned by the apply patch tool. - - `const BetaResponseNewParamsPromptCacheRetentionInMemory BetaResponseNewParamsPromptCacheRetention = "in_memory"` + - `type BetaResponseOutputItemMcpCall struct{…}` - - `const BetaResponseNewParamsPromptCacheRetention24h BetaResponseNewParamsPromptCacheRetention = "24h"` + An invocation of a tool on an MCP server. - - `Reasoning param.Field[BetaResponseNewParamsReasoning]` + - `ID string` - Body param: **gpt-5 and o-series models only** + The unique ID of the tool call. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `Arguments string` - - `Context string` + A JSON string of the arguments passed to the tool. - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + - `Name string` - - `const BetaResponseNewParamsReasoningContextAuto BetaResponseNewParamsReasoningContext = "auto"` + The name of the tool that was run. - - `const BetaResponseNewParamsReasoningContextCurrentTurn BetaResponseNewParamsReasoningContext = "current_turn"` + - `ServerLabel string` - - `const BetaResponseNewParamsReasoningContextAllTurns BetaResponseNewParamsReasoningContext = "all_turns"` + The label of the MCP server running the tool. - - `Effort string` + - `Type McpCall` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + The type of the item. Always `mcp_call`. - - `const BetaResponseNewParamsReasoningEffortNone BetaResponseNewParamsReasoningEffort = "none"` + - `const McpCallMcpCall McpCall = "mcp_call"` - - `const BetaResponseNewParamsReasoningEffortMinimal BetaResponseNewParamsReasoningEffort = "minimal"` + - `Agent BetaResponseOutputItemMcpCallAgent` - - `const BetaResponseNewParamsReasoningEffortLow BetaResponseNewParamsReasoningEffort = "low"` + The agent that produced this item. - - `const BetaResponseNewParamsReasoningEffortMedium BetaResponseNewParamsReasoningEffort = "medium"` + - `AgentName string` - - `const BetaResponseNewParamsReasoningEffortHigh BetaResponseNewParamsReasoningEffort = "high"` + The canonical name of the agent that produced this item. - - `const BetaResponseNewParamsReasoningEffortXhigh BetaResponseNewParamsReasoningEffort = "xhigh"` + - `ApprovalRequestID string` - - `const BetaResponseNewParamsReasoningEffortMax BetaResponseNewParamsReasoningEffort = "max"` + 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. - - `GenerateSummary string` + - `Error string` - **Deprecated:** use `summary` instead. + The error from the tool call, if any. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `Output string` - - `const BetaResponseNewParamsReasoningGenerateSummaryAuto BetaResponseNewParamsReasoningGenerateSummary = "auto"` + The output from the tool call. - - `const BetaResponseNewParamsReasoningGenerateSummaryConcise BetaResponseNewParamsReasoningGenerateSummary = "concise"` + - `Status string` - - `const BetaResponseNewParamsReasoningGenerateSummaryDetailed BetaResponseNewParamsReasoningGenerateSummary = "detailed"` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `Mode string` + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - Controls the reasoning execution mode for the request. + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - When returned on a response, this is the effective execution mode. + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `string` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - `string` + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - `const BetaResponseNewParamsReasoningModeStandard BetaResponseNewParamsReasoningMode = "standard"` + - `type BetaResponseOutputItemMcpListTools struct{…}` - - `const BetaResponseNewParamsReasoningModePro BetaResponseNewParamsReasoningMode = "pro"` + A list of tools available on an MCP server. - - `Summary string` + - `ID string` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + The unique ID of the list. - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `ServerLabel string` - - `const BetaResponseNewParamsReasoningSummaryAuto BetaResponseNewParamsReasoningSummary = "auto"` + The label of the MCP server. - - `const BetaResponseNewParamsReasoningSummaryConcise BetaResponseNewParamsReasoningSummary = "concise"` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - - `const BetaResponseNewParamsReasoningSummaryDetailed BetaResponseNewParamsReasoningSummary = "detailed"` + The tools available on the server. - - `SafetyIdentifier param.Field[string]` + - `InputSchema any` - Body param: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + The JSON schema describing the tool's input. - - `ServiceTier param.Field[BetaResponseNewParamsServiceTier]` + - `Name string` - Body param: Specifies the processing type used for serving the request. + The name of the tool. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `Annotations any` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + Additional annotations about the tool. - - `const BetaResponseNewParamsServiceTierAuto BetaResponseNewParamsServiceTier = "auto"` + - `Description string` - - `const BetaResponseNewParamsServiceTierDefault BetaResponseNewParamsServiceTier = "default"` + The description of the tool. - - `const BetaResponseNewParamsServiceTierFlex BetaResponseNewParamsServiceTier = "flex"` + - `Type McpListTools` - - `const BetaResponseNewParamsServiceTierScale BetaResponseNewParamsServiceTier = "scale"` + The type of the item. Always `mcp_list_tools`. - - `const BetaResponseNewParamsServiceTierPriority BetaResponseNewParamsServiceTier = "priority"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Store param.Field[bool]` + - `Agent BetaResponseOutputItemMcpListToolsAgent` - Body param: Whether to store the generated model response for later retrieval via - API. + The agent that produced this item. - - `` + - `AgentName string` - - `StreamOptions param.Field[BetaResponseNewParamsStreamOptions]` + The canonical name of the agent that produced this item. - Body param: Options for streaming responses. Only set this when you set `stream: true`. + - `Error string` - - `IncludeObfuscation bool` + Error message if the server could not list tools. - When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events to - normalize payload sizes as a mitigation to certain side-channel attacks. - These obfuscation fields are included by default, but add a small amount - of overhead to the data stream. You can set `include_obfuscation` to - false to optimize for bandwidth if you trust the network links between - your application and the OpenAI API. + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - `Temperature param.Field[float64]` + A request for human approval of a tool invocation. - Body param: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `ID string` - - `Text param.Field[BetaResponseTextConfig]` + The unique ID of the approval request. - Body param: Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `Arguments string` - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + A JSON string of arguments for the tool. - - `ToolChoice param.Field[BetaResponseNewParamsToolChoiceUnion]` + - `Name string` - Body param: How the model should select which tool (or tools) to use when generating + 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"` + + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMcpApprovalResponse 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"` + + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Reason string` + + Optional reason for the decision. + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. + + - `type BetaResponseCustomToolCallOutputItem 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 BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `ParallelToolCalls bool` + + Whether to allow the model to run tool calls in parallel. + + - `Temperature float64` + + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. + + - `ToolChoice BetaResponseToolChoiceUnion` + + How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call. @@ -18517,7 +17114,7 @@ Create a model response - `const CustomCustom Custom = "custom"` - - `BetaResponseNewParamsToolChoiceBetaSpecificProgrammaticToolCallingParam` + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - `Type ProgrammaticToolCalling` @@ -18545,9 +17142,9 @@ Create a model response - `const ShellShell Shell = "shell"` - - `Tools param.Field[[]BetaToolUnion]` + - `Tools []BetaToolUnion` - Body param: An array of tools the model may call while generating a response. You + An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. We support the following categories of tools: @@ -18629,447 +17226,1201 @@ Create a model response Allows the assistant to create, delete, or update files using unified diffs. - - `TopLogprobs param.Field[int64]` - - Body param: An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. - - - `TopP param.Field[float64]` + - `TopP float64` - Body param: An alternative to sampling with temperature, called nucleus sampling, + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - - `Truncation param.Field[BetaResponseNewParamsTruncation]` - - Body param: The truncation strategy to use for the model response. - - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `Background bool` - - `const BetaResponseNewParamsTruncationAuto BetaResponseNewParamsTruncation = "auto"` + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). - - `const BetaResponseNewParamsTruncationDisabled BetaResponseNewParamsTruncation = "disabled"` + - `CompletedAt float64` - - `User param.Field[string]` + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - Body param: This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `Conversation BetaResponseConversation` - - `Betas param.Field[[]string]` + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - Header param: Optional beta features to enable for this request. + - `ID string` - - `const BetaResponseNewParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseNewParamsOpenAIBeta = "responses_multi_agent=v1"` + The unique ID of the conversation that this response was associated with. -### Returns + - `MaxOutputTokens int64` -- `type BetaResponse struct{…}` + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - - `ID string` + - `MaxToolCalls int64` - Unique identifier for this Response. + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `CreatedAt float64` + - `Moderation BetaResponseModeration` - Unix timestamp (in seconds) of when this Response was created. + Moderation results for the response input and output, if moderated completions were requested. - - `Error BetaResponseError` + - `Input BetaResponseModerationInputUnion` - An error object returned when the model fails to generate a Response. + Moderation for the response input. - - `Code BetaResponseErrorCode` + - `type BetaResponseModerationInputModerationResult struct{…}` - The error code for the response. + A moderation result produced for the response input or output. - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + - `Categories map[string, bool]` - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + - `CategoryAppliedInputTypes map[string, []string]` - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + Which modalities of input are reflected by the score for each category. - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + - `CategoryScores map[string, float64]` - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + A dictionary of moderation categories to scores. - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + - `Flagged bool` - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + A boolean indicating whether the content was flagged by any category. - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + - `Model string` - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + The moderation model that produced this result. - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + - `Type ModerationResult` - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + The object type, which was always `moderation_result` for successful moderation results. - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + - `type BetaResponseModerationInputError struct{…}` - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + An error produced while attempting moderation for the response input or output. - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `Code string` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + The error code. - `Message string` - A human-readable description of the error. - - - `IncompleteDetails BetaResponseIncompleteDetails` + The error message. - Details about why the response is incomplete. + - `Type Error` - - `Reason string` + The object type, which was always `error` for moderation failures. - The reason why the response is incomplete. + - `const ErrorError Error = "error"` - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + - `Output BetaResponseModerationOutputUnion` - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + Moderation for the response output. - - `Instructions BetaResponseInstructionsUnion` + - `type BetaResponseModerationOutputModerationResult struct{…}` - A system (or developer) message inserted into the model's context. + A moderation result produced for the response input or output. - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + - `Categories map[string, bool]` - - `string` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + - `CategoryAppliedInputTypes map[string, []string]` - A list of one or many input items to the model, containing - different content types. + Which modalities of input are reflected by the score for each category. - - `type BetaEasyInputMessage struct{…}` + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` - - `Content BetaEasyInputMessageContentUnion` + - `CategoryScores map[string, float64]` - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + A dictionary of moderation categories to scores. - - `string` + - `Flagged bool` - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + A boolean indicating whether the content was flagged by any category. - A list of one or many input items to the model, containing different content - types. + - `Model string` - - `type BetaResponseInputText struct{…}` + The moderation model that produced this result. - A text input to the model. + - `Type ModerationResult` - - `Text string` + The object type, which was always `moderation_result` for successful moderation results. - The text input to the model. + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `Type InputText` + - `type BetaResponseModerationOutputError struct{…}` - The type of the input item. Always `input_text`. + An error produced while attempting moderation for the response input or output. - - `const InputTextInputText InputText = "input_text"` + - `Code string` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + The error code. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Message string` - - `Mode Explicit` + The error message. - The breakpoint mode. Always `explicit`. + - `Type Error` - - `const ExplicitExplicit Explicit = "explicit"` + The object type, which was always `error` for moderation failures. - - `type BetaResponseInputImage struct{…}` + - `const ErrorError Error = "error"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `PreviousResponseID string` - - `Detail BetaResponseInputImageDetail` + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Prompt BetaResponsePrompt` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `ID string` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + The unique identifier of the prompt template to use. - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `Variables map[string, BetaResponsePromptVariableUnion]` - - `Type InputImage` + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - The type of the input item. Always `input_image`. + - `string` - - `const InputImageInputImage InputImage = "input_image"` + - `type BetaResponseInputText struct{…}` - - `FileID string` + A text input to the model. - The ID of the file to be sent to the model. + - `type BetaResponseInputImage struct{…}` - - `ImageURL string` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `type BetaResponseInputFile struct{…}` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + A file input to the model. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Version string` - - `Mode Explicit` + Optional version of the prompt template. - The breakpoint mode. Always `explicit`. + - `PromptCacheKey string` - - `const ExplicitExplicit Explicit = "explicit"` + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - - `type BetaResponseInputFile struct{…}` + - `PromptCacheOptions BetaResponsePromptCacheOptions` - A file input to the model. + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - `Type InputFile` + - `Mode string` - The type of the input item. Always `input_file`. + Whether implicit prompt-cache breakpoints were enabled. - - `const InputFileInputFile InputFile = "input_file"` + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` - - `Detail BetaResponseInputFileDetail` + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Ttl string` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + The minimum lifetime applied to each cache breakpoint. - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `PromptCacheRetention BetaResponsePromptCacheRetention` - - `FileData string` + Deprecated. Use `prompt_cache_options.ttl` instead. - The content of the file to be sent to the model. + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - `FileID string` + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - The ID of the file to be sent to the model. + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - `FileURL string` + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` - The URL of the file to be sent to the model. + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` - - `Filename string` + - `Reasoning BetaResponseReasoning` - The name of the file to be sent to the model. + **gpt-5 and o-series models only** - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Context string` - - `Mode Explicit` + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - The breakpoint mode. Always `explicit`. + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` - - `Role BetaEasyInputMessageRole` + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + - `Effort string` - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` - - `Phase BetaEasyInputMessagePhase` + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` - 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 BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` - - `Type BetaEasyInputMessageType` + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` - The type of the message input. Always `message`. + - `GenerateSummary string` - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + **Deprecated:** use `summary` instead. - - `type BetaResponseInputItemMessage struct{…}` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` - - `Content BetaResponseInputMessageContentList` + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` - A list of one or many input items to the model, containing different content - types. + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` - - `Role string` + - `Mode string` - The role of the message input. One of `user`, `system`, or `developer`. + Controls the reasoning execution mode for the request. - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + When returned on a response, this is the effective execution mode. - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + - `string` - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + - `string` - - `Agent BetaResponseInputItemMessageAgent` + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` - The agent that produced this item. + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` - - `AgentName string` + - `Summary string` - The canonical name of the agent that produced this item. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `Status string` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + - `SafetyIdentifier string` - - `Type string` + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - The type of the message input. Always set to `message`. + - `ServiceTier BetaResponseServiceTier` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + Specifies the processing type used for serving the request. - - `type BetaResponseOutputMessage struct{…}` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - An output message from the model. + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - `ID string` + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` - The unique ID of the output message. + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` - - `Content []BetaResponseOutputMessageContentUnion` + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` - The content of the output message. + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` - - `type BetaResponseOutputText struct{…}` + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` - A text output from the model. + - `Status BetaResponseStatus` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. - The annotations of the text output. + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` - A citation to a file. + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` - - `FileID string` + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` - The ID of the file. + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` - - `Filename string` + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` - The filename of the file cited. + - `Text BetaResponseTextConfig` - - `Index int64` + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - The index of the file in the list of files. + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - - `Type FileCitation` + - `Format BetaResponseFormatTextConfigUnion` - The type of the file citation. Always `file_citation`. + An object specifying the format that the model must output. - - `const FileCitationFileCitation FileCitation = "file_citation"` + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + The default format is `{ "type": "text" }` with no additional options. - A citation for a web resource used to generate a model response. + **Not recommended for gpt-4o and newer models:** - - `EndIndex int64` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - The index of the last character of the URL citation in the message. + - `type BetaResponseFormatTextConfigText struct{…}` - - `StartIndex int64` + Default response format. Used to generate text responses. - The index of the first character of the URL citation in the message. + - `Type Text` - - `Title string` + The type of response format being defined. Always `text`. - The title of the web resource. + - `const TextText Text = "text"` - - `Type URLCitation` + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - The type of the URL citation. Always `url_citation`. + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Name string` - - `URL string` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The URL of the web resource. + - `Schema map[string, any]` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - A citation for a container file used to generate a model response. + - `Type JSONSchema` - - `ContainerID string` + The type of response format being defined. Always `json_schema`. - The ID of the container file. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `EndIndex int64` + - `Description string` - The index of the last character of the container file citation in the message. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `FileID string` + - `Strict bool` - The ID of the file. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Filename string` + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - The filename of the container file cited. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `StartIndex int64` + - `Type JSONObject` - The index of the first character of the container file citation in the message. + The type of response format being defined. Always `json_object`. - - `Type ContainerFileCitation` + - `const JSONObjectJSONObject JSONObject = "json_object"` - The type of the container file citation. Always `container_file_citation`. + - `Verbosity BetaResponseTextConfigVerbosity` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - A path to a file. + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - - `FileID string` + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - The ID of the file. + - `TopLogprobs int64` - - `Index int64` + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. + + - `Truncation BetaResponseTruncation` + + The truncation strategy to use for the model response. + + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. + + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + + - `Usage BetaResponseUsage` + + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. + + - `InputTokens int64` + + The number of input tokens. + + - `InputTokensDetails BetaResponseUsageInputTokensDetails` + + A detailed breakdown of the input tokens. + + - `CacheWriteTokens int64` + + The number of input tokens that were written to the cache. + + - `CachedTokens int64` + + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + + - `OutputTokens int64` + + The number of output tokens. + + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + + A detailed breakdown of the output tokens. + + - `ReasoningTokens int64` + + The number of reasoning tokens. + + - `TotalTokens int64` + + The total number of tokens used. + + - `User string` + + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + +### Example + +```go +package main + +import ( + "context" + "fmt" + + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) + +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + betaResponse, err := client.Beta.Responses.Get( + context.TODO(), + "resp_677efb5139a88190b512bc3fef8e535d", + openai.BetaResponseGetParams{ + + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", betaResponse.ID) +} +``` + +#### Response + +```json +{ + "id": "id", + "created_at": 0, + "error": { + "code": "server_error", + "message": "message" + }, + "incomplete_details": { + "reason": "max_output_tokens" + }, + "instructions": "string", + "metadata": { + "foo": "string" + }, + "model": "gpt-5.1", + "object": "response", + "output": [ + { + "id": "id", + "content": [ + { + "annotations": [ + { + "file_id": "file_id", + "filename": "filename", + "index": 0, + "type": "file_citation" + } + ], + "text": "text", + "type": "output_text", + "logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0, + "top_logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0 + } + ] + } + ] + } + ], + "role": "assistant", + "status": "in_progress", + "type": "message", + "agent": { + "agent_name": "agent_name" + }, + "phase": "commentary" + } + ], + "parallel_tool_calls": true, + "temperature": 1, + "tool_choice": "none", + "tools": [ + { + "name": "name", + "parameters": { + "foo": "bar" + }, + "strict": true, + "type": "function", + "allowed_callers": [ + "direct" + ], + "defer_loading": true, + "description": "description", + "output_schema": { + "foo": "bar" + } + } + ], + "top_p": 1, + "background": true, + "completed_at": 0, + "conversation": { + "id": "id" + }, + "max_output_tokens": 0, + "max_tool_calls": 0, + "moderation": { + "input": { + "categories": { + "foo": true + }, + "category_applied_input_types": { + "foo": [ + "text" + ] + }, + "category_scores": { + "foo": 0 + }, + "flagged": true, + "model": "model", + "type": "moderation_result" + }, + "output": { + "categories": { + "foo": true + }, + "category_applied_input_types": { + "foo": [ + "text" + ] + }, + "category_scores": { + "foo": 0 + }, + "flagged": true, + "model": "model", + "type": "moderation_result" + } + }, + "output_text": "output_text", + "previous_response_id": "previous_response_id", + "prompt": { + "id": "id", + "variables": { + "foo": "string" + }, + "version": "version" + }, + "prompt_cache_key": "prompt-cache-key-1234", + "prompt_cache_options": { + "mode": "implicit", + "ttl": "30m" + }, + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": "auto", + "effort": "none", + "generate_summary": "auto", + "mode": "standard", + "summary": "auto" + }, + "safety_identifier": "safety-identifier-1234", + "service_tier": "auto", + "status": "completed", + "text": { + "format": { + "type": "text" + }, + "verbosity": "low" + }, + "top_logprobs": 0, + "truncation": "auto", + "usage": { + "input_tokens": 0, + "input_tokens_details": { + "cache_write_tokens": 0, + "cached_tokens": 0 + }, + "output_tokens": 0, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 0 + }, + "user": "user-1234" +} +``` + +## Delete a model response + +`client.Beta.Responses.Delete(ctx, responseID, body) error` + +**delete** `/responses/{response_id}?beta=true` + +Deletes a model response with the given ID. + +### Parameters + +- `responseID string` + +- `body BetaResponseDeleteParams` + + - `Betas param.Field[[]string]` + + Optional beta features to enable for this request. + + - `const BetaResponseDeleteParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseDeleteParamsOpenAIBeta = "responses_multi_agent=v1"` + +### Example + +```go +package main + +import ( + "context" + + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) + +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + err := client.Beta.Responses.Delete( + context.TODO(), + "resp_677efb5139a88190b512bc3fef8e535d", + openai.BetaResponseDeleteParams{ + + }, + ) + if err != nil { + panic(err.Error()) + } +} +``` + +## Cancel a response + +`client.Beta.Responses.Cancel(ctx, responseID, body) (*BetaResponse, error)` + +**post** `/responses/{response_id}/cancel?beta=true` + +Cancels a model response with the given ID. Only responses created with +the `background` parameter set to `true` can be cancelled. +[Learn more](https://platform.openai.com/docs/guides/background). + +### Parameters + +- `responseID string` + +- `body BetaResponseCancelParams` + + - `Betas param.Field[[]string]` + + Optional beta features to enable for this request. + + - `const BetaResponseCancelParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseCancelParamsOpenAIBeta = "responses_multi_agent=v1"` + +### Returns + +- `type BetaResponse struct{…}` + + - `ID string` + + Unique identifier for this Response. + + - `CreatedAt float64` + + Unix timestamp (in seconds) of when this Response was created. + + - `Error BetaResponseError` + + An error object returned when the model fails to generate a Response. + + - `Code BetaResponseErrorCode` + + The error code for the response. + + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + + - `Message string` + + A human-readable description of the error. + + - `IncompleteDetails BetaResponseIncompleteDetails` + + Details about why the response is incomplete. + + - `Reason string` + + The reason why the response is incomplete. + + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + + - `Instructions BetaResponseInstructionsUnion` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + + - `string` + + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + + A list of one or many input items to the model, containing + different content types. + + - `type BetaEasyInputMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + + - `Content BetaEasyInputMessageContentUnion` + + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. + + - `string` + + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + + A list of one or many input items to the model, containing different content + types. + + - `type BetaResponseInputText 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"` + + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `Detail BetaResponseInputImageDetail` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type InputFile` + + The type of the input item. Always `input_file`. + + - `const InputFileInputFile InputFile = "input_file"` + + - `Detail BetaResponseInputFileDetail` + + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `Role BetaEasyInputMessageRole` + + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. + + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + + - `Phase BetaEasyInputMessagePhase` + + 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 BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + + - `Type BetaEasyInputMessageType` + + The type of the message input. Always `message`. + + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + + - `type BetaResponseInputItemMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + + - `Content BetaResponseInputMessageContentList` + + A list of one or many input items to the model, containing different content + types. + + - `Role string` + + The role of the message input. One of `user`, `system`, or `developer`. + + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + + - `Agent BetaResponseInputItemMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + + - `Type string` + + The type of the message input. Always set to `message`. + + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + + - `type BetaResponseOutputMessage struct{…}` + + An output message from the model. + + - `ID string` + + The unique ID of the output message. + + - `Content []BetaResponseOutputMessageContentUnion` + + The content of the output message. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation 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 BetaResponseOutputTextAnnotationFilePath 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. @@ -19158,6 +18509,8 @@ Create a model response - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -20338,7 +19691,11 @@ Create a model response - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -20395,7 +19752,11 @@ Create a model response - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -25085,16 +24446,19 @@ import ( "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"), ) - betaResponse, err := client.Beta.Responses.New(context.TODO(), responses.BetaResponseNewParams{ + betaResponse, err := client.Beta.Responses.Cancel( + context.TODO(), + "resp_677efb5139a88190b512bc3fef8e535d", + openai.BetaResponseCancelParams{ - }) + }, + ) if err != nil { panic(err.Error()) } @@ -25277,151 +24641,229 @@ func main() { } ``` -## Get a model response +## Compact a response -`client.Beta.Responses.Get(ctx, responseID, params) (*BetaResponse, error)` +`client.Beta.Responses.Compact(ctx, params) (*BetaCompactedResponse, error)` -**get** `/responses/{response_id}?beta=true` +**post** `/responses/compact?beta=true` + +Compact a conversation. Returns a compacted response object. -Get a model response +Learn when and how to compact long-running conversations in the [conversation state guide](https://platform.openai.com/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](https://platform.openai.com/docs/guides/conversation-state#compaction-advanced). ### Parameters -- `responseID string` +- `params BetaResponseCompactParams` -- `params BetaResponseGetParams` + - `Model param.Field[BetaResponseCompactParamsModel]` - - `Include param.Field[[]BetaResponseIncludable]` + Body param: Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models. - Query param: Additional fields to include in the response. See the `include` - parameter for Response creation above for more information. + - `type BetaResponseCompactParamsModel string` - - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` + Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models. - - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` + - `const BetaResponseCompactParamsModelGPT5_6Sol BetaResponseCompactParamsModel = "gpt-5.6-sol"` - - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` + - `const BetaResponseCompactParamsModelGPT5_6Terra BetaResponseCompactParamsModel = "gpt-5.6-terra"` - - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` + - `const BetaResponseCompactParamsModelGPT5_6Luna BetaResponseCompactParamsModel = "gpt-5.6-luna"` - - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` + - `const BetaResponseCompactParamsModelGPT5_4 BetaResponseCompactParamsModel = "gpt-5.4"` - - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` + - `const BetaResponseCompactParamsModelGPT5_4Mini BetaResponseCompactParamsModel = "gpt-5.4-mini"` - - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` + - `const BetaResponseCompactParamsModelGPT5_4Nano BetaResponseCompactParamsModel = "gpt-5.4-nano"` - - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` + - `const BetaResponseCompactParamsModelGPT5_4Mini2026_03_17 BetaResponseCompactParamsModel = "gpt-5.4-mini-2026-03-17"` - - `IncludeObfuscation param.Field[bool]` + - `const BetaResponseCompactParamsModelGPT5_4Nano2026_03_17 BetaResponseCompactParamsModel = "gpt-5.4-nano-2026-03-17"` - Query param: When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events - to normalize payload sizes as a mitigation to certain side-channel - attacks. These obfuscation fields are included by default, but add a - small amount of overhead to the data stream. You can set - `include_obfuscation` to false to optimize for bandwidth if you trust - the network links between your application and the OpenAI API. + - `const BetaResponseCompactParamsModelGPT5_3ChatLatest BetaResponseCompactParamsModel = "gpt-5.3-chat-latest"` - - `StartingAfter param.Field[int64]` + - `const BetaResponseCompactParamsModelGPT5_2 BetaResponseCompactParamsModel = "gpt-5.2"` - Query param: The sequence number of the event after which to start streaming. + - `const BetaResponseCompactParamsModelGPT5_2_2025_12_11 BetaResponseCompactParamsModel = "gpt-5.2-2025-12-11"` - - `` + - `const BetaResponseCompactParamsModelGPT5_2ChatLatest BetaResponseCompactParamsModel = "gpt-5.2-chat-latest"` - - `Betas param.Field[[]string]` + - `const BetaResponseCompactParamsModelGPT5_2Pro BetaResponseCompactParamsModel = "gpt-5.2-pro"` - Header param: Optional beta features to enable for this request. + - `const BetaResponseCompactParamsModelGPT5_2Pro2025_12_11 BetaResponseCompactParamsModel = "gpt-5.2-pro-2025-12-11"` - - `const BetaResponseGetParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseGetParamsOpenAIBeta = "responses_multi_agent=v1"` + - `const BetaResponseCompactParamsModelGPT5_1 BetaResponseCompactParamsModel = "gpt-5.1"` -### Returns + - `const BetaResponseCompactParamsModelGPT5_1_2025_11_13 BetaResponseCompactParamsModel = "gpt-5.1-2025-11-13"` -- `type BetaResponse struct{…}` + - `const BetaResponseCompactParamsModelGPT5_1Codex BetaResponseCompactParamsModel = "gpt-5.1-codex"` - - `ID string` + - `const BetaResponseCompactParamsModelGPT5_1Mini BetaResponseCompactParamsModel = "gpt-5.1-mini"` - Unique identifier for this Response. + - `const BetaResponseCompactParamsModelGPT5_1ChatLatest BetaResponseCompactParamsModel = "gpt-5.1-chat-latest"` - - `CreatedAt float64` + - `const BetaResponseCompactParamsModelGPT5 BetaResponseCompactParamsModel = "gpt-5"` - Unix timestamp (in seconds) of when this Response was created. + - `const BetaResponseCompactParamsModelGPT5Mini BetaResponseCompactParamsModel = "gpt-5-mini"` - - `Error BetaResponseError` + - `const BetaResponseCompactParamsModelGPT5Nano BetaResponseCompactParamsModel = "gpt-5-nano"` - An error object returned when the model fails to generate a Response. + - `const BetaResponseCompactParamsModelGPT5_2025_08_07 BetaResponseCompactParamsModel = "gpt-5-2025-08-07"` - - `Code BetaResponseErrorCode` + - `const BetaResponseCompactParamsModelGPT5Mini2025_08_07 BetaResponseCompactParamsModel = "gpt-5-mini-2025-08-07"` - The error code for the response. + - `const BetaResponseCompactParamsModelGPT5Nano2025_08_07 BetaResponseCompactParamsModel = "gpt-5-nano-2025-08-07"` - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + - `const BetaResponseCompactParamsModelGPT5ChatLatest BetaResponseCompactParamsModel = "gpt-5-chat-latest"` - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + - `const BetaResponseCompactParamsModelGPT4_1 BetaResponseCompactParamsModel = "gpt-4.1"` - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + - `const BetaResponseCompactParamsModelGPT4_1Mini BetaResponseCompactParamsModel = "gpt-4.1-mini"` - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + - `const BetaResponseCompactParamsModelGPT4_1Nano BetaResponseCompactParamsModel = "gpt-4.1-nano"` - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `const BetaResponseCompactParamsModelGPT4_1_2025_04_14 BetaResponseCompactParamsModel = "gpt-4.1-2025-04-14"` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + - `const BetaResponseCompactParamsModelGPT4_1Mini2025_04_14 BetaResponseCompactParamsModel = "gpt-4.1-mini-2025-04-14"` - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + - `const BetaResponseCompactParamsModelGPT4_1Nano2025_04_14 BetaResponseCompactParamsModel = "gpt-4.1-nano-2025-04-14"` - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + - `const BetaResponseCompactParamsModelO4Mini BetaResponseCompactParamsModel = "o4-mini"` - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + - `const BetaResponseCompactParamsModelO4Mini2025_04_16 BetaResponseCompactParamsModel = "o4-mini-2025-04-16"` - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + - `const BetaResponseCompactParamsModelO3 BetaResponseCompactParamsModel = "o3"` - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + - `const BetaResponseCompactParamsModelO3_2025_04_16 BetaResponseCompactParamsModel = "o3-2025-04-16"` - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + - `const BetaResponseCompactParamsModelO3Mini BetaResponseCompactParamsModel = "o3-mini"` - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + - `const BetaResponseCompactParamsModelO3Mini2025_01_31 BetaResponseCompactParamsModel = "o3-mini-2025-01-31"` - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + - `const BetaResponseCompactParamsModelO1 BetaResponseCompactParamsModel = "o1"` - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + - `const BetaResponseCompactParamsModelO1_2024_12_17 BetaResponseCompactParamsModel = "o1-2024-12-17"` - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + - `const BetaResponseCompactParamsModelO1Preview BetaResponseCompactParamsModel = "o1-preview"` - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + - `const BetaResponseCompactParamsModelO1Preview2024_09_12 BetaResponseCompactParamsModel = "o1-preview-2024-09-12"` - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `const BetaResponseCompactParamsModelO1Mini BetaResponseCompactParamsModel = "o1-mini"` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + - `const BetaResponseCompactParamsModelO1Mini2024_09_12 BetaResponseCompactParamsModel = "o1-mini-2024-09-12"` - - `Message string` + - `const BetaResponseCompactParamsModelGPT4o BetaResponseCompactParamsModel = "gpt-4o"` - A human-readable description of the error. + - `const BetaResponseCompactParamsModelGPT4o2024_11_20 BetaResponseCompactParamsModel = "gpt-4o-2024-11-20"` - - `IncompleteDetails BetaResponseIncompleteDetails` + - `const BetaResponseCompactParamsModelGPT4o2024_08_06 BetaResponseCompactParamsModel = "gpt-4o-2024-08-06"` - Details about why the response is incomplete. + - `const BetaResponseCompactParamsModelGPT4o2024_05_13 BetaResponseCompactParamsModel = "gpt-4o-2024-05-13"` - - `Reason string` + - `const BetaResponseCompactParamsModelGPT4oAudioPreview BetaResponseCompactParamsModel = "gpt-4o-audio-preview"` - The reason why the response is incomplete. + - `const BetaResponseCompactParamsModelGPT4oAudioPreview2024_10_01 BetaResponseCompactParamsModel = "gpt-4o-audio-preview-2024-10-01"` - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + - `const BetaResponseCompactParamsModelGPT4oAudioPreview2024_12_17 BetaResponseCompactParamsModel = "gpt-4o-audio-preview-2024-12-17"` - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + - `const BetaResponseCompactParamsModelGPT4oAudioPreview2025_06_03 BetaResponseCompactParamsModel = "gpt-4o-audio-preview-2025-06-03"` - - `Instructions BetaResponseInstructionsUnion` + - `const BetaResponseCompactParamsModelGPT4oMiniAudioPreview BetaResponseCompactParamsModel = "gpt-4o-mini-audio-preview"` - A system (or developer) message inserted into the model's context. + - `const BetaResponseCompactParamsModelGPT4oMiniAudioPreview2024_12_17 BetaResponseCompactParamsModel = "gpt-4o-mini-audio-preview-2024-12-17"` - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + - `const BetaResponseCompactParamsModelGPT4oSearchPreview BetaResponseCompactParamsModel = "gpt-4o-search-preview"` + + - `const BetaResponseCompactParamsModelGPT4oMiniSearchPreview BetaResponseCompactParamsModel = "gpt-4o-mini-search-preview"` + + - `const BetaResponseCompactParamsModelGPT4oSearchPreview2025_03_11 BetaResponseCompactParamsModel = "gpt-4o-search-preview-2025-03-11"` + + - `const BetaResponseCompactParamsModelGPT4oMiniSearchPreview2025_03_11 BetaResponseCompactParamsModel = "gpt-4o-mini-search-preview-2025-03-11"` + + - `const BetaResponseCompactParamsModelChatgpt4oLatest BetaResponseCompactParamsModel = "chatgpt-4o-latest"` + + - `const BetaResponseCompactParamsModelCodexMiniLatest BetaResponseCompactParamsModel = "codex-mini-latest"` + + - `const BetaResponseCompactParamsModelGPT4oMini BetaResponseCompactParamsModel = "gpt-4o-mini"` + + - `const BetaResponseCompactParamsModelGPT4oMini2024_07_18 BetaResponseCompactParamsModel = "gpt-4o-mini-2024-07-18"` + + - `const BetaResponseCompactParamsModelGPT4Turbo BetaResponseCompactParamsModel = "gpt-4-turbo"` + + - `const BetaResponseCompactParamsModelGPT4Turbo2024_04_09 BetaResponseCompactParamsModel = "gpt-4-turbo-2024-04-09"` + + - `const BetaResponseCompactParamsModelGPT4_0125Preview BetaResponseCompactParamsModel = "gpt-4-0125-preview"` + + - `const BetaResponseCompactParamsModelGPT4TurboPreview BetaResponseCompactParamsModel = "gpt-4-turbo-preview"` + + - `const BetaResponseCompactParamsModelGPT4_1106Preview BetaResponseCompactParamsModel = "gpt-4-1106-preview"` + + - `const BetaResponseCompactParamsModelGPT4VisionPreview BetaResponseCompactParamsModel = "gpt-4-vision-preview"` + + - `const BetaResponseCompactParamsModelGPT4 BetaResponseCompactParamsModel = "gpt-4"` + + - `const BetaResponseCompactParamsModelGPT4_0314 BetaResponseCompactParamsModel = "gpt-4-0314"` + + - `const BetaResponseCompactParamsModelGPT4_0613 BetaResponseCompactParamsModel = "gpt-4-0613"` + + - `const BetaResponseCompactParamsModelGPT4_32k BetaResponseCompactParamsModel = "gpt-4-32k"` + + - `const BetaResponseCompactParamsModelGPT4_32k0314 BetaResponseCompactParamsModel = "gpt-4-32k-0314"` + + - `const BetaResponseCompactParamsModelGPT4_32k0613 BetaResponseCompactParamsModel = "gpt-4-32k-0613"` + + - `const BetaResponseCompactParamsModelGPT3_5Turbo BetaResponseCompactParamsModel = "gpt-3.5-turbo"` + + - `const BetaResponseCompactParamsModelGPT3_5Turbo16k BetaResponseCompactParamsModel = "gpt-3.5-turbo-16k"` + + - `const BetaResponseCompactParamsModelGPT3_5Turbo0301 BetaResponseCompactParamsModel = "gpt-3.5-turbo-0301"` + + - `const BetaResponseCompactParamsModelGPT3_5Turbo0613 BetaResponseCompactParamsModel = "gpt-3.5-turbo-0613"` + + - `const BetaResponseCompactParamsModelGPT3_5Turbo1106 BetaResponseCompactParamsModel = "gpt-3.5-turbo-1106"` + + - `const BetaResponseCompactParamsModelGPT3_5Turbo0125 BetaResponseCompactParamsModel = "gpt-3.5-turbo-0125"` + + - `const BetaResponseCompactParamsModelGPT3_5Turbo16k0613 BetaResponseCompactParamsModel = "gpt-3.5-turbo-16k-0613"` + + - `const BetaResponseCompactParamsModelO1Pro BetaResponseCompactParamsModel = "o1-pro"` + + - `const BetaResponseCompactParamsModelO1Pro2025_03_19 BetaResponseCompactParamsModel = "o1-pro-2025-03-19"` + + - `const BetaResponseCompactParamsModelO3Pro BetaResponseCompactParamsModel = "o3-pro"` + + - `const BetaResponseCompactParamsModelO3Pro2025_06_10 BetaResponseCompactParamsModel = "o3-pro-2025-06-10"` + + - `const BetaResponseCompactParamsModelO3DeepResearch BetaResponseCompactParamsModel = "o3-deep-research"` + + - `const BetaResponseCompactParamsModelO3DeepResearch2025_06_26 BetaResponseCompactParamsModel = "o3-deep-research-2025-06-26"` + + - `const BetaResponseCompactParamsModelO4MiniDeepResearch BetaResponseCompactParamsModel = "o4-mini-deep-research"` + + - `const BetaResponseCompactParamsModelO4MiniDeepResearch2025_06_26 BetaResponseCompactParamsModel = "o4-mini-deep-research-2025-06-26"` + + - `const BetaResponseCompactParamsModelComputerUsePreview BetaResponseCompactParamsModel = "computer-use-preview"` + + - `const BetaResponseCompactParamsModelComputerUsePreview2025_03_11 BetaResponseCompactParamsModel = "computer-use-preview-2025-03-11"` + + - `const BetaResponseCompactParamsModelGPT5Codex BetaResponseCompactParamsModel = "gpt-5-codex"` + + - `const BetaResponseCompactParamsModelGPT5Pro BetaResponseCompactParamsModel = "gpt-5-pro"` + + - `const BetaResponseCompactParamsModelGPT5Pro2025_10_06 BetaResponseCompactParamsModel = "gpt-5-pro-2025-10-06"` + + - `const BetaResponseCompactParamsModelGPT5_1CodexMax BetaResponseCompactParamsModel = "gpt-5.1-codex-max"` - `string` - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + - `Input param.Field[BetaResponseCompactParamsInputUnion]` - A list of one or many input items to the model, containing - different content types. + Body param: Text, image, or file inputs to the model, used to generate a response + + - `string` + + - `type BetaResponseCompactParamsInputArray []BetaResponseInputItemUnion` + + A list of one or many input items to the model, containing different content types. - `type BetaEasyInputMessage struct{…}` @@ -25574,6 +25016,8 @@ Get a model response - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + - `Type BetaEasyInputMessageType` The type of the message input. Always `message`. @@ -25821,6 +25265,8 @@ Get a model response - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -27001,7 +26447,11 @@ Get a model response - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -27058,7 +26508,11 @@ Get a model response - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -29198,252 +28652,428 @@ Get a model response The canonical name of the agent that produced this item. - - `Metadata map[string, string]` + - `Instructions param.Field[string]` - 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. + Body param: A system (or developer) message inserted into the model's context. + When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `PreviousResponseID param.Field[string]` - - `Model BetaResponseModel` + Body param: The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `PromptCacheKey param.Field[string]` - - `type BetaResponseModel string` + Body param: A key to use when reading from or writing to the prompt cache. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `PromptCacheOptions param.Field[BetaResponseCompactParamsPromptCacheOptions]` - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + Body param: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details. - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + - `Mode string` - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + - `const BetaResponseCompactParamsPromptCacheOptionsModeImplicit BetaResponseCompactParamsPromptCacheOptionsMode = "implicit"` - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + - `const BetaResponseCompactParamsPromptCacheOptionsModeExplicit BetaResponseCompactParamsPromptCacheOptionsMode = "explicit"` - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + - `Ttl string` - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + - `const BetaResponseCompactParamsPromptCacheOptionsTtl30m BetaResponseCompactParamsPromptCacheOptionsTtl = "30m"` - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + - `PromptCacheRetention param.Field[BetaResponseCompactParamsPromptCacheRetention]` - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + Body param: How long to retain a prompt cache entry created by this request. - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + - `const BetaResponseCompactParamsPromptCacheRetentionInMemory BetaResponseCompactParamsPromptCacheRetention = "in_memory"` - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + - `const BetaResponseCompactParamsPromptCacheRetention24h BetaResponseCompactParamsPromptCacheRetention = "24h"` - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + - `ServiceTier param.Field[BetaResponseCompactParamsServiceTier]` - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + Body param: The service tier to use for this request. - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + - `const BetaResponseCompactParamsServiceTierAuto BetaResponseCompactParamsServiceTier = "auto"` - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + - `const BetaResponseCompactParamsServiceTierDefault BetaResponseCompactParamsServiceTier = "default"` - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + - `const BetaResponseCompactParamsServiceTierFlex BetaResponseCompactParamsServiceTier = "flex"` - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + - `const BetaResponseCompactParamsServiceTierPriority BetaResponseCompactParamsServiceTier = "priority"` - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + - `Betas param.Field[[]string]` - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + Header param: Optional beta features to enable for this request. - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + - `const BetaResponseCompactParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseCompactParamsOpenAIBeta = "responses_multi_agent=v1"` - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` +### Returns - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` +- `type BetaCompactedResponse struct{…}` - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + - `ID string` - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + The unique identifier for the compacted response. - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + - `CreatedAt int64` - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + Unix timestamp (in seconds) when the compacted conversation was created. - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + - `Object ResponseCompaction` - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + The object type. Always `response.compaction`. - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + - `const ResponseCompactionResponseCompaction ResponseCompaction = "response.compaction"` - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + - `Output []BetaResponseOutputItemUnion` - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + The compacted list of output items. This is a list of all user messages, followed by a single compaction item. - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + - `type BetaResponseOutputMessage struct{…}` - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + An output message from the model. - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + - `ID string` - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + The unique ID of the output message. - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + - `Content []BetaResponseOutputMessageContentUnion` - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + The content of the output message. - - `const BetaResponseModelO1 BetaResponseModel = "o1"` + - `type BetaResponseOutputText struct{…}` - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + A text output from the model. - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + The annotations of the text output. - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + A citation to a file. - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + - `FileID string` - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + The ID of the file. - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + - `Filename string` - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + The filename of the file cited. - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + - `Index int64` - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + The index of the file in the list of files. - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + - `Type FileCitation` - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + The type of the file citation. Always `file_citation`. - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + A citation for a web resource used to generate a model response. - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + - `EndIndex int64` - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + The index of the last character of the URL citation in the message. - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `StartIndex int64` - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + The index of the first character of the URL citation in the message. - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + - `Title string` - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + The title of the web resource. - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + - `Type URLCitation` - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + The type of the URL citation. Always `url_citation`. - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + - `URL string` - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + The URL of the web resource. - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + A citation for a container file used to generate a model response. - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + - `ContainerID string` - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + The ID of the container file. - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + - `EndIndex int64` - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + The index of the last character of the container file citation in the message. - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + - `FileID string` - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + The ID of the file. - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + - `Filename string` - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + The filename of the container file cited. - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + - `StartIndex int64` - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + The index of the first character of the container file citation in the message. - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + - `Type ContainerFileCitation` - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + The type of the container file citation. Always `container_file_citation`. - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + A path to a file. - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + - `FileID string` - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + The ID of the file. - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + - `Index int64` - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + The index of the file in the list of files. - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + - `Type FilePath` - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + The type of the file path. Always `file_path`. - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + - `const FilePathFilePath FilePath = "file_path"` - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + - `Text string` - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + The text output from the model. - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + - `Type OutputText` - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + The type of the output text. Always `output_text`. - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + - `const OutputTextOutputText OutputText = "output_text"` - - `string` + - `Logprobs []BetaResponseOutputTextLogprob` - - `Object Response` + - `Token string` - The object type of this resource - always set to `response`. + - `Bytes []int64` - - `const ResponseResponse Response = "response"` + - `Logprob float64` - - `Output []BetaResponseOutputItemUnion` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - An array of content items generated by the model. + - `Token string` - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + - `Bytes []int64` - - `type BetaResponseOutputMessage struct{…}` + - `Logprob float64` - An output message from the model. + - `type BetaResponseOutputRefusal 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 BetaResponseOutputMessageStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + + - `Type Message` + + The type of the output message. Always `message`. + + - `const MessageMessage Message = "message"` + + - `Agent BetaResponseOutputMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Phase BetaResponseOutputMessagePhase` + + 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 BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `ID string` + + The unique ID of the file search tool call. + + - `Queries []string` + + The queries used to search for files. + + - `Status BetaResponseFileSearchToolCallStatus` + + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + + - `Type FileSearchCall` + + The type of the file search tool call. Always `file_search_call`. + + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + + - `Agent BetaResponseFileSearchToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Results []BetaResponseFileSearchToolCallResult` + + The results of the file search tool call. + + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + + 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 BetaResponseFunctionToolCall struct{…}` A tool call to run a function. See the [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `Arguments string` + + A JSON string of the arguments to pass to the function. + + - `CallID string` + + The unique ID of the function tool call generated by the model. + + - `Name string` + + The name of the function to run. + + - `Type FunctionCall` + + The type of the function tool call. Always `function_call`. + + - `const FunctionCallFunctionCall FunctionCall = "function_call"` + + - `ID string` + + The unique ID of the function tool call. + + - `Agent BetaResponseFunctionToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `Namespace string` + + The namespace of the function to run. + + - `Status BetaResponseFunctionToolCallStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - `ID string` @@ -29469,14 +29099,112 @@ Get a model response 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"` + + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaResponseInputImage struct{…}` An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Detail BetaResponseInputImageDetail` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaResponseInputFile struct{…}` A file input to the model. + - `Type InputFile` + + The type of the input item. Always `input_file`. + + - `const InputFileInputFile InputFile = "input_file"` + + - `Detail BetaResponseInputFileDetail` + + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + - `Status BetaResponseFunctionToolCallOutputItemStatus` The status of the item. One of `in_progress`, `completed`, or @@ -29781,105 +29509,98 @@ Get a model response The results of a web search tool call. See the [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `type BetaResponseComputerToolCall struct{…}` - - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `ID string` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + The unique ID of the web search tool call. - - `ID string` + - `Action BetaResponseFunctionWebSearchActionUnion` - The unique ID of the computer call tool output. + 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). - - `CallID string` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - The ID of the computer tool call that produced the output. + Action type "search" - Performs a web search query. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Type Search` - A computer screenshot image used with the computer use tool. + The action type. - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `const SearchSearch Search = "search"` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `Queries []string` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + The search queries. - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `Query string` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + The search query. - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `Type ComputerCallOutput` + The sources used in the search. - The type of the computer tool call output. Always `computer_call_output`. + - `Type URL` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + The type of source. Always `url`. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `const URLURL URL = "url"` - The safety checks reported by the API that have been acknowledged by the - developer. + - `URL string` - - `ID string` + The URL of the source. - The ID of the pending safety check. + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `Code string` + Action type "open_page" - Opens a specific URL from search results. - The type of the pending safety check. + - `Type OpenPage` - - `Message string` + The action type. - Details about the pending safety check. + - `const OpenPageOpenPage OpenPage = "open_page"` - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `URL string` - The agent that produced this item. + The URL opened by the model. - - `AgentName string` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - The canonical name of the agent that produced this item. + Action type "find_in_page": Searches for a pattern within a loaded page. - - `CreatedBy string` + - `Pattern string` - The identifier of the actor that created the item. + The pattern or text to search for within the page. - - `type BetaResponseReasoningItem struct{…}` + - `Type FindInPage` - 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](https://platform.openai.com/docs/guides/conversation-state). + The action type. - - `type BetaResponseOutputItemProgram struct{…}` + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `ID string` + - `URL string` - The unique ID of the program item. + The URL of the page searched for the pattern. - - `CallID string` + - `Status BetaResponseFunctionWebSearchStatus` - The stable call ID of the program item. + The status of the web search tool call. - - `Code string` + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - The JavaScript source executed by programmatic tool calling. + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - `Fingerprint string` + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - Opaque program replay fingerprint that must be round-tripped. + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `Type Program` + - `Type WebSearchCall` - The type of the item. Always `program`. + The type of the web search tool call. Always `web_search_call`. - - `const ProgramProgram Program = "program"` + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `Agent BetaResponseOutputItemProgramAgent` + - `Agent BetaResponseFunctionWebSearchAgent` The agent that produced this item. @@ -29887,333 +29608,362 @@ Get a model response The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `type BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - `ID string` - The unique ID of the program output item. + The unique ID of the computer call. - `CallID string` - The call ID of the program item. + An identifier used when responding to the tool call with output. - - `Result string` + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - The result produced by the program item. + The pending safety checks for the computer call. - - `Status string` + - `ID string` - The terminal status of the program output item. + The ID of the pending safety check. - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + - `Code string` - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + The type of the pending safety check. - - `Type ProgramOutput` + - `Message string` - The type of the item. Always `program_output`. + Details about the pending safety check. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `Status BetaResponseComputerToolCallStatus` - - `Agent BetaResponseOutputItemProgramOutputAgent` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The agent that produced this item. + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `AgentName string` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - The canonical name of the agent that produced this item. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `type BetaResponseToolSearchCall struct{…}` + - `Type BetaResponseComputerToolCallType` - - `ID string` + The type of the computer call. Always `computer_call`. - The unique ID of the tool search call item. + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `Arguments any` + - `Action BetaComputerActionUnion` - Arguments used for the tool search call. + A click action. - - `CallID string` + - `type BetaComputerActionClick struct{…}` - The unique ID of the tool search call generated by the model. + A click action. - - `Execution BetaResponseToolSearchCallExecution` + - `Button string` - Whether tool search was executed by the server or by the client. + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - `Status BetaResponseToolSearchCallStatus` + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - The status of the tool search call item that was recorded. + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `Type Click` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + Specifies the event type. For a click action, this property is always `click`. - - `Type ToolSearchCall` + - `const ClickClick Click = "click"` - The type of the item. Always `tool_search_call`. + - `X int64` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + The x-coordinate where the click occurred. - - `Agent BetaResponseToolSearchCallAgent` + - `Y int64` - The agent that produced this item. + The y-coordinate where the click occurred. - - `AgentName string` + - `Keys []string` - The canonical name of the agent that produced this item. + The keys being held while clicking. - - `CreatedBy string` + - `type BetaComputerActionDoubleClick struct{…}` - The identifier of the actor that created the item. + A double click action. - - `type BetaResponseToolSearchOutputItem struct{…}` + - `Keys []string` - - `ID string` + The keys being held while double-clicking. - The unique ID of the tool search output item. + - `Type DoubleClick` - - `CallID string` + Specifies the event type. For a double click action, this property is always set to `double_click`. - The unique ID of the tool search call generated by the model. + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `Execution BetaResponseToolSearchOutputItemExecution` + - `X int64` - Whether tool search was executed by the server or by the client. + The x-coordinate where the double click occurred. - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + - `Y int64` - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + The y-coordinate where the double click occurred. - - `Status BetaResponseToolSearchOutputItemStatus` + - `type BetaComputerActionDrag struct{…}` - The status of the tool search output item that was recorded. + A drag action. - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `Path []BetaComputerActionDragPath` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `Tools []BetaToolUnion` + - `X int64` - The loaded tool definitions returned by tool search. + The x-coordinate. - - `type BetaFunctionTool struct{…}` + - `Y int64` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The y-coordinate. - - `type BetaFileSearchTool struct{…}` + - `Type Drag` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + Specifies the event type. For a drag action, this property is always set to `drag`. - - `type BetaComputerTool struct{…}` + - `const DragDrag Drag = "drag"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Keys []string` - - `type BetaComputerUsePreviewTool struct{…}` + The keys being held while dragging the mouse. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `type BetaComputerActionKeypress struct{…}` - - `type BetaWebSearchTool struct{…}` + A collection of keypresses the model would like to perform. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Keys []string` - - `type BetaToolMcp struct{…}` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Type Keypress` - - `type BetaToolCodeInterpreter struct{…}` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - A tool that runs Python code to help generate a response to a prompt. + - `const KeypressKeypress Keypress = "keypress"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `type BetaComputerActionMove struct{…}` - - `type BetaToolImageGeneration struct{…}` + A mouse move action. - A tool that generates images using the GPT image models. + - `Type Move` - - `type BetaToolLocalShell struct{…}` + Specifies the event type. For a move action, this property is always set to `move`. - A tool that allows the model to execute shell commands in a local environment. + - `const MoveMove Move = "move"` - - `type BetaFunctionShellTool struct{…}` + - `X int64` - A tool that allows the model to execute shell commands. + The x-coordinate to move to. - - `type BetaCustomTool struct{…}` + - `Y int64` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The y-coordinate to move to. - - `type BetaNamespaceTool struct{…}` + - `Keys []string` - Groups function/custom tools under a shared namespace. + The keys being held while moving the mouse. - - `type BetaToolSearchTool struct{…}` + - `type BetaComputerActionScreenshot struct{…}` - Hosted or BYOT tool search configuration for deferred tools. + A screenshot action. - - `type BetaWebSearchPreviewTool struct{…}` + - `Type Screenshot` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `type BetaApplyPatchTool struct{…}` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - Allows the assistant to create, delete, or update files using unified diffs. + - `type BetaComputerActionScroll struct{…}` - - `Type ToolSearchOutput` + A scroll action. - The type of the item. Always `tool_search_output`. + - `ScrollX int64` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + The horizontal scroll distance. - - `Agent BetaResponseToolSearchOutputItemAgent` + - `ScrollY int64` - The agent that produced this item. + The vertical scroll distance. - - `AgentName string` + - `Type Scroll` - The canonical name of the agent that produced this item. + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `CreatedBy string` + - `const ScrollScroll Scroll = "scroll"` - The identifier of the actor that created the item. + - `X int64` - - `type BetaResponseOutputItemAdditionalTools struct{…}` + The x-coordinate where the scroll occurred. - - `ID string` + - `Y int64` - The unique ID of the additional tools item. + The y-coordinate where the scroll occurred. - - `Role string` + - `Keys []string` - The role that provided the additional tools. + The keys being held while scrolling. - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + - `type BetaComputerActionType struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + An action to type in text. - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + - `Text string` - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + The text to type. - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + - `Type Type` - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + Specifies the event type. For a type action, this property is always set to `type`. - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + - `const TypeType Type = "type"` - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + - `type BetaComputerActionWait struct{…}` - - `Tools []BetaToolUnion` + A wait action. - The additional tool definitions made available at this item. + - `Type Wait` - - `type BetaFunctionTool struct{…}` + Specifies the event type. For a wait action, this property is always set to `wait`. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const WaitWait Wait = "wait"` - - `type BetaFileSearchTool struct{…}` + - `Actions BetaComputerActionList` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `type BetaComputerTool struct{…}` + - `type BetaComputerActionClick struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + A click action. - - `type BetaComputerUsePreviewTool struct{…}` + - `type BetaComputerActionDoubleClick struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + A double click action. - - `type BetaWebSearchTool struct{…}` + - `type BetaComputerActionDrag struct{…}` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + A drag action. - - `type BetaToolMcp struct{…}` + - `type BetaComputerActionKeypress struct{…}` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + A collection of keypresses the model would like to perform. - - `type BetaToolCodeInterpreter struct{…}` + - `type BetaComputerActionMove struct{…}` - A tool that runs Python code to help generate a response to a prompt. + A mouse move action. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `type BetaComputerActionScreenshot struct{…}` - - `type BetaToolImageGeneration struct{…}` + A screenshot action. - A tool that generates images using the GPT image models. + - `type BetaComputerActionScroll struct{…}` - - `type BetaToolLocalShell struct{…}` + A scroll action. - A tool that allows the model to execute shell commands in a local environment. + - `type BetaComputerActionType struct{…}` - - `type BetaFunctionShellTool struct{…}` + An action to type in text. - A tool that allows the model to execute shell commands. + - `type BetaComputerActionWait struct{…}` - - `type BetaCustomTool struct{…}` + A wait action. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Agent BetaResponseComputerToolCallAgent` - - `type BetaNamespaceTool struct{…}` + The agent that produced this item. - Groups function/custom tools under a shared namespace. + - `AgentName string` - - `type BetaToolSearchTool struct{…}` + The canonical name of the agent that produced this item. - Hosted or BYOT tool search configuration for deferred tools. + - `type BetaResponseComputerToolCallOutputItem struct{…}` - - `type BetaWebSearchPreviewTool struct{…}` + - `ID string` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The unique ID of the computer call tool output. - - `type BetaApplyPatchTool struct{…}` + - `CallID string` - Allows the assistant to create, delete, or update files using unified diffs. + The ID of the computer tool call that produced the output. - - `Type AdditionalTools` + - `Output BetaResponseComputerToolCallOutputScreenshot` - The type of the item. Always `additional_tools`. + A computer screenshot image used with the computer use tool. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `Type ComputerScreenshot` - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - The agent that produced this item. + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `AgentName string` + - `FileID string` - The canonical name of the agent that produced this item. + The identifier of an uploaded file that contains the screenshot. - - `type BetaResponseCompactionItem struct{…}` + - `ImageURL string` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The URL of the screenshot image. - - `ID string` + - `Status BetaResponseComputerToolCallOutputItemStatus` - The unique ID of the compaction item. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `EncryptedContent string` + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - The encrypted content that was produced by compaction. + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - - `Type Compaction` + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - The type of the item. Always `compaction`. + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - `const CompactionCompaction Compaction = "compaction"` + - `Type ComputerCallOutput` - - `Agent BetaResponseCompactionItemAgent` + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + + 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. + + - `Agent BetaResponseComputerToolCallOutputItemAgent` The agent that produced this item. @@ -30225,37 +29975,38 @@ Get a model response The identifier of the actor that created the item. - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `type BetaResponseReasoningItem struct{…}` - An image generation request made by the model. + 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](https://platform.openai.com/docs/guides/conversation-state). - `ID string` - The unique ID of the image generation call. - - - `Result string` + The unique identifier of the reasoning content. - The generated image encoded in base64. + - `Summary []BetaResponseReasoningItemSummary` - - `Status string` + Reasoning summary content. - The status of the image generation call. + - `Text string` - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + A summary of the reasoning output from the model so far. - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + - `Type SummaryText` - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + The type of the object. Always `summary_text`. - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `Type ImageGenerationCall` + - `Type Reasoning` - The type of the image generation call. Always `image_generation_call`. + The type of the object. Always `reasoning`. - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `const ReasoningReasoning Reasoning = "reasoning"` - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `Agent BetaResponseReasoningItemAgent` The agent that produced this item. @@ -30263,69 +30014,61 @@ Get a model response The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCall struct{…}` - - A tool call to run code. - - - `type BetaResponseOutputItemLocalShellCall struct{…}` - - A tool call to run a command on the local shell. - - - `ID string` + - `Content []BetaResponseReasoningItemContent` - The unique ID of the local shell call. + Reasoning text content. - - `Action BetaResponseOutputItemLocalShellCallAction` + - `Text string` - Execute a shell command on the server. + The reasoning text from the model. - - `Command []string` + - `Type ReasoningText` - The command to run. + The type of the reasoning text. Always `reasoning_text`. - - `Env map[string, string]` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - Environment variables to set for the command. + - `EncryptedContent string` - - `Type Exec` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - The type of the local shell action. Always `exec`. + - `Status BetaResponseReasoningItemStatus` - - `const ExecExec Exec = "exec"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `TimeoutMs int64` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - Optional timeout in milliseconds for the command. + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `User string` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - Optional user to run the command as. + - `type BetaResponseOutputItemProgram struct{…}` - - `WorkingDirectory string` + - `ID string` - Optional working directory to run the command in. + The unique ID of the program item. - `CallID string` - The unique ID of the local shell tool call generated by the model. - - - `Status string` + The stable call ID of the program item. - The status of the local shell call. + - `Code string` - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + The JavaScript source executed by programmatic tool calling. - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + - `Fingerprint string` - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + Opaque program replay fingerprint that must be round-tripped. - - `Type LocalShellCall` + - `Type Program` - The type of the local shell call. Always `local_shell_call`. + The type of the item. Always `program`. - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `const ProgramProgram Program = "program"` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + - `Agent BetaResponseOutputItemProgramAgent` The agent that produced this item. @@ -30333,2209 +30076,1930 @@ Get a model response The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - The output of a local shell tool call. + - `type BetaResponseOutputItemProgramOutput struct{…}` - `ID string` - The unique ID of the local shell tool call generated by the model. + The unique ID of the program output item. - - `Output string` + - `CallID string` - A JSON string of the output of the local shell tool call. + The call ID of the program item. - - `Type LocalShellCallOutput` + - `Result string` - The type of the local shell tool call output. Always `local_shell_call_output`. + The result produced by the program item. - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `Status string` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + The terminal status of the program output item. - The agent that produced this item. + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - - `AgentName string` + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - The canonical name of the agent that produced this item. + - `Type ProgramOutput` - - `Status string` + The type of the item. Always `program_output`. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + - `Agent BetaResponseOutputItemProgramOutputAgent` - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + The agent that produced this item. - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + - `AgentName string` - - `type BetaResponseFunctionShellToolCall struct{…}` + The canonical name of the agent that produced this item. - A tool call that executes one or more shell commands in a managed environment. + - `type BetaResponseToolSearchCall struct{…}` - `ID string` - The unique ID of the shell tool call. Populated when this item is returned via API. + The unique ID of the tool search call item. - - `Action BetaResponseFunctionShellToolCallAction` + - `Arguments any` - The shell commands and limits that describe how to run the tool call. + Arguments used for the tool search call. - - `Commands []string` + - `CallID string` - - `MaxOutputLength int64` + The unique ID of the tool search call generated by the model. - Optional maximum number of characters to return from each command. + - `Execution BetaResponseToolSearchCallExecution` - - `TimeoutMs int64` + Whether tool search was executed by the server or by the client. - Optional timeout in milliseconds for the commands. + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - `CallID string` + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - The unique ID of the shell tool call generated by the model. + - `Status BetaResponseToolSearchCallStatus` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + The status of the tool search call item that was recorded. - Represents the use of a local environment to perform shell actions. + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - - `type BetaResponseLocalEnvironment struct{…}` + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - Represents the use of a local environment to perform shell actions. + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - - `Type Local` + - `Type ToolSearchCall` - The environment type. Always `local`. + The type of the item. Always `tool_search_call`. - - `const LocalLocal Local = "local"` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `type BetaResponseContainerReference struct{…}` + - `Agent BetaResponseToolSearchCallAgent` - Represents a container created with /v1/containers. + The agent that produced this item. - - `ContainerID string` + - `AgentName string` - - `Type ContainerReference` + The canonical name of the agent that produced this item. - The environment type. Always `container_reference`. + - `CreatedBy string` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + The identifier of the actor that created the item. - - `Status BetaResponseFunctionShellToolCallStatus` + - `type BetaResponseToolSearchOutputItem struct{…}` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `ID string` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + The unique ID of the tool search output item. - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `CallID string` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + The unique ID of the tool search call generated by the model. - - `Type ShellCall` + - `Execution BetaResponseToolSearchOutputItemExecution` - The type of the item. Always `shell_call`. + Whether tool search was executed by the server or by the client. - - `const ShellCallShellCall ShellCall = "shell_call"` + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - `Agent BetaResponseFunctionShellToolCallAgent` + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - The agent that produced this item. + - `Status BetaResponseToolSearchOutputItemStatus` - - `AgentName string` + The status of the tool search output item that was recorded. - The canonical name of the agent that produced this item. + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - The execution context that produced this tool call. + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `Tools []BetaToolUnion` - - `Type Direct` + The loaded tool definitions returned by tool search. - - `const DirectDirect Direct = "direct"` + - `type BetaFunctionTool struct{…}` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `CallerID string` + - `Name string` - The call ID of the program item that produced this tool call. + The name of the function to call. - - `Type Program` + - `Parameters map[string, any]` - - `const ProgramProgram Program = "program"` + A JSON schema object describing the parameters of the function. - - `CreatedBy string` + - `Strict bool` - The ID of the entity that created this tool call. + Whether strict parameter validation is enforced for this function tool. - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `Type Function` - The output of a shell tool call that was emitted. + The type of the function tool. Always `function`. - - `ID string` + - `const FunctionFunction Function = "function"` - The unique ID of the shell call output. Populated when this item is returned via API. + - `AllowedCallers []string` - - `CallID string` + The tool invocation context(s). - The unique ID of the shell tool call generated by the model. + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `MaxOutputLength int64` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `DeferLoading bool` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + Whether this function is deferred and loaded via tool search. - An array of shell call output contents + - `Description string` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + A description of the function. Used by the model to determine whether or not to call the function. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `OutputSchema map[string, any]` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + A JSON schema object describing the JSON value encoded in string outputs for this function. - Indicates that the shell call exceeded its configured time limit. + - `type BetaFileSearchTool struct{…}` - - `Type Timeout` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The outcome type. Always `timeout`. + - `Type FileSearch` - - `const TimeoutTimeout Timeout = "timeout"` + The type of the file search tool. Always `file_search`. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - Indicates that the shell commands finished and returned an exit code. + - `VectorStoreIDs []string` - - `ExitCode int64` + The IDs of the vector stores to search. - Exit code from the shell process. + - `Filters BetaFileSearchToolFiltersUnion` - - `Type Exit` + A filter to apply. - The outcome type. Always `exit`. + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `const ExitExit Exit = "exit"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `Stderr string` + - `Key string` - The standard error output that was captured. + The key to compare against the value. - - `Stdout string` + - `Type string` - The standard output that was captured. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `CreatedBy string` + - `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 - The identifier of the actor that created the item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - - `Type ShellCallOutput` + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - The type of the shell call output. Always `shell_call_output`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + The value to compare against the attribute key; supports string, number, or boolean types. - The agent that produced this item. + - `string` - - `AgentName string` + - `float64` - The canonical name of the agent that produced this item. + - `bool` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - The execution context that produced this tool call. + - `string` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `float64` - - `Type Direct` + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `const DirectDirect Direct = "direct"` + Combine multiple filters using `and` or `or`. - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `CallerID string` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - The call ID of the program item that produced this tool call. + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `Type Program` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const ProgramProgram Program = "program"` + - `Key string` - - `CreatedBy string` + The key to compare against the value. - The identifier of the actor that created the item. + - `Type string` - - `type BetaResponseApplyPatchToolCall struct{…}` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - A tool call that applies file diffs by creating, deleting, or updating files. + - `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 - - `ID string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `CallID string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - The unique ID of the apply patch tool call generated by the model. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - Instruction describing how to create a file via the apply_patch tool. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `Diff string` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - Diff to apply. + The value to compare against the attribute key; supports string, number, or boolean types. - - `Path string` + - `string` - Path of the file to create. + - `float64` - - `Type CreateFile` + - `bool` - Create a new file with the provided diff. + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `const CreateFileCreateFile CreateFile = "create_file"` + - `string` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `float64` - Instruction describing how to delete a file via the apply_patch tool. + - `Type string` - - `Path string` + Type of operation: `and` or `or`. - Path of the file to delete. + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `Type DeleteFile` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - Delete the specified file. + - `MaxNumResults int64` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `RankingOptions BetaFileSearchToolRankingOptions` - Instruction describing how to update a file via the apply_patch tool. + Ranking options for search. - - `Diff string` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - Diff to apply. + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `Path string` + - `EmbeddingWeight float64` - Path of the file to update. + The weight of the embedding in the reciprocal ranking fusion. - - `Type UpdateFile` + - `TextWeight float64` - Update an existing file with the provided diff. + The weight of the text in the reciprocal ranking fusion. - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `Ranker string` - - `Status BetaResponseApplyPatchToolCallStatus` + The ranker to use for the file search. - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + - `ScoreThreshold float64` - - `Type ApplyPatchCall` + 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. - The type of the item. Always `apply_patch_call`. + - `type BetaComputerTool struct{…}` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Agent BetaResponseApplyPatchToolCallAgent` + - `Type Computer` - The agent that produced this item. + The type of the computer tool. Always `computer`. - - `AgentName string` + - `const ComputerComputer Computer = "computer"` - The canonical name of the agent that produced this item. + - `type BetaComputerUsePreviewTool struct{…}` - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The execution context that produced this tool call. + - `DisplayHeight int64` - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + The height of the computer display. - - `Type Direct` + - `DisplayWidth int64` - - `const DirectDirect Direct = "direct"` + The width of the computer display. - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `Environment BetaComputerUsePreviewToolEnvironment` - - `CallerID string` + The type of computer environment to control. - The call ID of the program item that produced this tool call. + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - - `Type Program` + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `const ProgramProgram Program = "program"` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `CreatedBy string` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - The ID of the entity that created this tool call. + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + - `Type ComputerUsePreview` - The output emitted by an apply patch tool call. + The type of the computer use tool. Always `computer_use_preview`. - - `ID string` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `type BetaWebSearchTool struct{…}` - - `CallID string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The unique ID of the apply patch tool call generated by the model. + - `Type BetaWebSearchToolType` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `Filters BetaWebSearchToolFilters` - - `Type ApplyPatchCallOutput` + Filters for the search. - The type of the item. Always `apply_patch_call_output`. + - `AllowedDomains []string` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - The agent that produced this item. + - `SearchContextSize BetaWebSearchToolSearchContextSize` - - `AgentName string` + 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. - The canonical name of the agent that produced this item. + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - The execution context that produced this tool call. + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `UserLocation BetaWebSearchToolUserLocation` - - `Type Direct` + The approximate location of the user. - - `const DirectDirect Direct = "direct"` + - `City string` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + Free text input for the city of the user, e.g. `San Francisco`. - - `CallerID string` + - `Country string` - The call ID of the program item that produced this tool call. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `Type Program` + - `Region string` - - `const ProgramProgram Program = "program"` + Free text input for the region of the user, e.g. `California`. - - `CreatedBy string` + - `Timezone string` - The ID of the entity that created this tool call output. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `Output string` + - `Type string` - Optional textual output returned by the apply patch tool. + The type of location approximation. Always `approximate`. - - `type BetaResponseOutputItemMcpCall struct{…}` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - An invocation of a tool on an MCP server. + - `type BetaToolMcp struct{…}` - - `ID string` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The unique ID of the tool call. + - `ServerLabel string` - - `Arguments string` + A label for this MCP server, used to identify it in tool calls. - A JSON string of the arguments passed to the tool. + - `Type Mcp` - - `Name string` + The type of the MCP tool. Always `mcp`. - The name of the tool that was run. + - `const McpMcp Mcp = "mcp"` - - `ServerLabel string` + - `AllowedCallers []string` - The label of the MCP server running the tool. + The tool invocation context(s). - - `Type McpCall` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - The type of the item. Always `mcp_call`. + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `const McpCallMcpCall McpCall = "mcp_call"` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `Agent BetaResponseOutputItemMcpCallAgent` + List of allowed tool names or a filter object. - The agent that produced this item. + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `AgentName string` + A string array of allowed tool names - The canonical name of the agent that produced this item. + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `ApprovalRequestID string` + A filter object to specify which tools are allowed. - 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. + - `ReadOnly bool` - - `Error string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The error from the tool call, if any. + - `ToolNames []string` - - `Output string` + List of allowed tool names. - The output from the tool call. + - `Authorization string` - - `Status 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. - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `ConnectorID string` - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + Currently supported `connector_id` values are: - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + - 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 BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - A list of tools available on an MCP server. + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - - `ID string` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - The unique ID of the list. + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `ServerLabel string` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - The label of the MCP server. + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + - `DeferLoading bool` - The tools available on the server. + Whether this MCP tool is deferred and discovered via tool search. - - `InputSchema any` + - `Headers map[string, string]` - The JSON schema describing the tool's input. + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `Name string` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - The name of the tool. + Specify which of the MCP server's tools require approval. - - `Annotations any` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - Additional annotations about the tool. + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `Description string` + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - The description of the tool. + A filter object to specify which tools are allowed. - - `Type McpListTools` + - `ReadOnly bool` - The type of the item. Always `mcp_list_tools`. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `ToolNames []string` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + List of allowed tool names. - The agent that produced this item. + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - - `AgentName string` + A filter object to specify which tools are allowed. - The canonical name of the agent that produced this item. + - `ReadOnly bool` - - `Error string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - Error message if the server could not list tools. + - `ToolNames []string` - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + List of allowed tool names. - A request for human approval of a tool invocation. + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `ID 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. - The unique ID of the approval request. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - - `Arguments string` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - A JSON string of arguments for the tool. + - `ServerDescription string` - - `Name string` + Optional description of the MCP server, used to provide more context. - The name of the tool to run. + - `ServerURL string` - - `ServerLabel string` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - The label of the MCP server making the request. + - `TunnelID string` - - `Type McpApprovalRequest` + 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. - The type of the item. Always `mcp_approval_request`. + - `type BetaToolCodeInterpreter struct{…}` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + A tool that runs Python code to help generate a response to a prompt. - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `Container BetaToolCodeInterpreterContainerUnion` - The agent that produced this item. + 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. - - `AgentName string` + - `string` - The canonical name of the agent that produced this item. + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - A response to an MCP approval request. + - `Type Auto` - - `ID string` + Always `auto`. - The unique ID of the approval response + - `const AutoAuto Auto = "auto"` - - `ApprovalRequestID string` + - `FileIDs []string` - The ID of the approval request being answered. + An optional list of uploaded files to make available to your code. - - `Approve bool` + - `MemoryLimit string` - Whether the request was approved. + The memory limit for the code interpreter container. - - `Type McpApprovalResponse` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - The type of the item. Always `mcp_approval_response`. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - The agent that produced this item. + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - - `AgentName string` + Network access policy for the container. - The canonical name of the agent that produced this item. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `Reason string` + - `Type Disabled` - Optional reason for the decision. + Disable outbound network access. Always `disabled`. - - `type BetaResponseCustomToolCall struct{…}` + - `const DisabledDisabled Disabled = "disabled"` - A call to a custom tool created by the model. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `AllowedDomains []string` - The output of a custom tool call from your code, being sent back to the model. + A list of allowed domains when type is `allowlist`. - - `ID string` + - `Type Allowlist` - The unique ID of the custom tool call output item. + Allow outbound network access only to specified domains. Always `allowlist`. - - `Status string` + - `const AllowlistAllowlist Allowlist = "allowlist"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + Optional domain-scoped secrets for allowlisted domains. - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + - `Domain string` - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + The domain associated with the secret. - - `CreatedBy string` + - `Name string` - The identifier of the actor that created the item. + The name of the secret to inject for the domain. - - `ParallelToolCalls bool` + - `Value string` - Whether to allow the model to run tool calls in parallel. + The secret value to inject for the domain. - - `Temperature float64` + - `Type CodeInterpreter` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + The type of the code interpreter tool. Always `code_interpreter`. - - `ToolChoice BetaResponseToolChoiceUnion` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `AllowedCallers []string` - - `type BetaToolChoiceOptions string` + The tool invocation context(s). - Controls which (if any) tool is called by the model. + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - `none` means the model will not call any tool and instead generates a message. + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - `auto` means the model can pick between generating a message or calling one or - more tools. + - `type BetaToolProgrammaticToolCalling struct{…}` - `required` means the model must call one or more tools. + - `Type ProgrammaticToolCalling` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + The type of the tool. Always `programmatic_tool_calling`. - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + - `type BetaToolImageGeneration struct{…}` - - `type BetaToolChoiceAllowed struct{…}` + A tool that generates images using the GPT image models. - Constrains the tools available to the model to a pre-defined set. + - `Type ImageGeneration` - - `Mode BetaToolChoiceAllowedMode` + The type of the image generation tool. Always `image_generation`. - Constrains the tools available to the model to a pre-defined set. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `Action string` - `required` requires the model to call one or more of the allowed tools. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `Tools []map[string, any]` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - A list of tool definitions that the model should be allowed to call. + - `Background string` - For the Responses API, the list of tool definitions might look like: + 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. - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + `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. - - `Type AllowedTools` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - Allowed tool configuration type. Always `allowed_tools`. + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - - `type BetaToolChoiceTypes struct{…}` + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `InputFidelity string` - - `Type BetaToolChoiceTypesType` + 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`. - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - Allowed values are: + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + - `InputImageMask BetaToolImageGenerationInputImageMask` - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + - `FileID string` - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + File ID for the mask image. - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `ImageURL string` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + Base64-encoded mask image. - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `Model string` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + The image generation model to use. Default: `gpt-image-1`. - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `string` - - `type BetaToolChoiceFunction struct{…}` + - `string` - Use this option to force the model to call a specific function. + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - - `Name string` + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - The name of the function to call. + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - - `Type Function` + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - For function calling, the type is always `function`. + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - - `const FunctionFunction Function = "function"` + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - `type BetaToolChoiceMcp struct{…}` + - `Moderation string` - Use this option to force the model to call a specific tool on a remote MCP server. + Moderation level for the generated image. Default: `auto`. - - `ServerLabel string` + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - The label of the MCP server to use. + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - - `Type Mcp` + - `OutputCompression int64` - For MCP tools, the type is always `mcp`. + Compression level for the output image. Default: 100. - - `const McpMcp Mcp = "mcp"` + - `OutputFormat string` - - `Name string` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - The name of the tool to call on the server. + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `type BetaToolChoiceCustom struct{…}` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - Use this option to force the model to call a specific custom tool. + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - - `Name string` + - `PartialImages int64` - The name of the custom tool to call. + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `Type Custom` + - `Quality string` - For custom tool calling, the type is always `custom`. + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `const CustomCustom Custom = "custom"` + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - - `Type ProgrammaticToolCalling` + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - The tool to call. Always `programmatic_tool_calling`. + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `Size string` - - `type BetaToolChoiceApplyPatch struct{…}` + 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`. - Forces the model to call the apply_patch tool when executing a tool call. + - `string` - - `Type ApplyPatch` + - `string` - The tool to call. Always `apply_patch`. + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `type BetaToolChoiceShell struct{…}` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - Forces the model to call the shell tool when a tool call is required. + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - - `Type Shell` + - `type BetaToolLocalShell struct{…}` - The tool to call. Always `shell`. + A tool that allows the model to execute shell commands in a local environment. - - `const ShellShell Shell = "shell"` + - `Type LocalShell` - - `Tools []BetaToolUnion` + The type of the local shell tool. Always `local_shell`. - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + - `const LocalShellLocalShell LocalShell = "local_shell"` - We support the following categories of tools: + - `type BetaFunctionShellTool struct{…}` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + A tool that allows the model to execute shell commands. - - `type BetaFunctionTool struct{…}` + - `Type Shell` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The type of the shell tool. Always `shell`. - - `type BetaFileSearchTool struct{…}` + - `const ShellShell Shell = "shell"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `AllowedCallers []string` - - `type BetaComputerTool struct{…}` + The tool invocation context(s). - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Environment BetaFunctionShellToolEnvironmentUnion` - - `type BetaWebSearchTool struct{…}` + - `type BetaContainerAuto struct{…}` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Type ContainerAuto` - - `type BetaToolMcp struct{…}` + Automatically creates a container for this request - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `type BetaToolCodeInterpreter struct{…}` + - `FileIDs []string` - A tool that runs Python code to help generate a response to a prompt. + An optional list of uploaded files to make available to your code. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `type BetaToolImageGeneration struct{…}` + The memory limit for the container. - A tool that generates images using the GPT image models. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `type BetaToolLocalShell struct{…}` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - A tool that allows the model to execute shell commands in a local environment. + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `type BetaFunctionShellTool struct{…}` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - A tool that allows the model to execute shell commands. + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - `type BetaCustomTool struct{…}` + Network access policy for the container. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `type BetaNamespaceTool struct{…}` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - Groups function/custom tools under a shared namespace. + - `Skills []BetaContainerAutoSkillUnion` - - `type BetaToolSearchTool struct{…}` + An optional list of skills referenced by id or inline data. - Hosted or BYOT tool search configuration for deferred tools. + - `type BetaSkillReference struct{…}` - - `type BetaWebSearchPreviewTool struct{…}` + - `SkillID string` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The ID of the referenced skill. - - `type BetaApplyPatchTool struct{…}` + - `Type SkillReference` - Allows the assistant to create, delete, or update files using unified diffs. + References a skill created with the /v1/skills endpoint. - - `TopP float64` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + - `Version string` - We generally recommend altering this or `temperature` but not both. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `Background bool` + - `type BetaInlineSkill struct{…}` - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + - `Description string` - - `CompletedAt float64` + The description of the skill. - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. + - `Name string` - - `Conversation BetaResponseConversation` + The name of the skill. - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + - `Source BetaInlineSkillSource` - - `ID string` + Inline skill payload - The unique ID of the conversation that this response was associated with. + - `Data string` - - `MaxOutputTokens int64` + Base64-encoded skill zip bundle. - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + - `MediaType ApplicationZip` - - `MaxToolCalls int64` + The media type of the inline skill payload. Must be `application/zip`. - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `Moderation BetaResponseModeration` + - `Type Base64` - Moderation results for the response input and output, if moderated completions were requested. + The type of the inline skill source. Must be `base64`. - - `Input BetaResponseModerationInputUnion` + - `const Base64Base64 Base64 = "base64"` - Moderation for the response input. + - `Type Inline` - - `type BetaResponseModerationInputModerationResult struct{…}` + Defines an inline skill for this request. - A moderation result produced for the response input or output. + - `const InlineInline Inline = "inline"` - - `Categories map[string, bool]` + - `type BetaLocalEnvironment struct{…}` - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `Type Local` - - `CategoryAppliedInputTypes map[string, []string]` + Use a local computer environment. - Which modalities of input are reflected by the score for each category. + - `const LocalLocal Local = "local"` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + - `Skills []BetaLocalSkill` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + An optional list of skills. - - `CategoryScores map[string, float64]` + - `Description string` - A dictionary of moderation categories to scores. + The description of the skill. - - `Flagged bool` + - `Name string` - A boolean indicating whether the content was flagged by any category. + The name of the skill. - - `Model string` + - `Path string` - The moderation model that produced this result. + The path to the directory containing the skill. - - `Type ModerationResult` + - `type BetaContainerReference struct{…}` - The object type, which was always `moderation_result` for successful moderation results. + - `ContainerID string` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + The ID of the referenced container. - - `type BetaResponseModerationInputError struct{…}` + - `Type ContainerReference` - An error produced while attempting moderation for the response input or output. + References a container created with the /v1/containers endpoint - - `Code string` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - The error code. + - `type BetaCustomTool struct{…}` - - `Message string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The error message. + - `Name string` - - `Type Error` + The name of the custom tool, used to identify it in tool calls. - The object type, which was always `error` for moderation failures. + - `Type Custom` - - `const ErrorError Error = "error"` + The type of the custom tool. Always `custom`. - - `Output BetaResponseModerationOutputUnion` + - `const CustomCustom Custom = "custom"` - Moderation for the response output. + - `AllowedCallers []string` - - `type BetaResponseModerationOutputModerationResult struct{…}` + The tool invocation context(s). - A moderation result produced for the response input or output. + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `Categories map[string, bool]` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `DeferLoading bool` - - `CategoryAppliedInputTypes map[string, []string]` + Whether this tool should be deferred and discovered via tool search. - Which modalities of input are reflected by the score for each category. + - `Description string` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + Optional description of the custom tool, used to provide more context. - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + - `Format BetaCustomToolFormatUnion` - - `CategoryScores map[string, float64]` + The input format for the custom tool. Default is unconstrained text. - A dictionary of moderation categories to scores. + - `type BetaCustomToolFormatText struct{…}` - - `Flagged bool` + Unconstrained free-form text. - A boolean indicating whether the content was flagged by any category. + - `Type Text` - - `Model string` + Unconstrained text format. Always `text`. - The moderation model that produced this result. + - `const TextText Text = "text"` - - `Type ModerationResult` + - `type BetaCustomToolFormatGrammar struct{…}` - The object type, which was always `moderation_result` for successful moderation results. + A grammar defined by the user. - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + - `Definition string` - - `type BetaResponseModerationOutputError struct{…}` + The grammar definition. - An error produced while attempting moderation for the response input or output. + - `Syntax string` - - `Code string` + The syntax of the grammar definition. One of `lark` or `regex`. - The error code. + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `Message string` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - The error message. + - `Type Grammar` - - `Type Error` + Grammar format. Always `grammar`. - The object type, which was always `error` for moderation failures. + - `const GrammarGrammar Grammar = "grammar"` - - `const ErrorError Error = "error"` + - `type BetaNamespaceTool struct{…}` - - `PreviousResponseID string` + Groups function/custom tools under a shared namespace. - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + - `Description string` - - `Prompt BetaResponsePrompt` + A description of the namespace shown to the model. - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + - `Name string` - - `ID string` + The namespace name used in tool calls (for example, `crm`). - The unique identifier of the prompt template to use. + - `Tools []BetaNamespaceToolToolUnion` - - `Variables map[string, BetaResponsePromptVariableUnion]` + The function/custom tools available inside this namespace. - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + - `type BetaNamespaceToolToolFunction struct{…}` - - `string` + - `Name string` - - `type BetaResponseInputText struct{…}` + - `Type Function` - A text input to the model. + - `const FunctionFunction Function = "function"` - - `type BetaResponseInputImage struct{…}` + - `AllowedCallers []string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The tool invocation context(s). - - `type BetaResponseInputFile struct{…}` + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - A file input to the model. + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `Version string` + - `DeferLoading bool` - Optional version of the prompt template. + Whether this function should be deferred and discovered via tool search. - - `PromptCacheKey string` + - `Description string` - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + - `OutputSchema map[string, any]` - - `PromptCacheOptions BetaResponsePromptCacheOptions` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + - `Parameters any` - - `Mode string` + - `Strict bool` - Whether implicit prompt-cache breakpoints were enabled. + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `type BetaCustomTool struct{…}` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Ttl string` + - `Type Namespace` - The minimum lifetime applied to each cache breakpoint. + The type of the tool. Always `namespace`. - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + - `const NamespaceNamespace Namespace = "namespace"` - - `PromptCacheRetention BetaResponsePromptCacheRetention` + - `type BetaToolSearchTool struct{…}` - Deprecated. Use `prompt_cache_options.ttl` instead. + Hosted or BYOT tool search configuration for deferred tools. - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + - `Type ToolSearch` - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + The type of the tool. Always `tool_search`. - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `Description string` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + Description shown to the model for a client-executed tool search tool. - - `Reasoning BetaResponseReasoning` + - `Execution BetaToolSearchToolExecution` - **gpt-5 and o-series models only** + Whether tool search is executed by the server or by the client. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `Context string` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + - `Parameters any` - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + Parameter schema for a client-executed tool search tool. - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Effort string` + - `Type BetaWebSearchPreviewToolType` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + - `SearchContentTypes []string` - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + 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. - - `GenerateSummary string` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - **Deprecated:** use `summary` instead. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + The user's location. - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + - `Type Approximate` - - `Mode string` + The type of location approximation. Always `approximate`. - Controls the reasoning execution mode for the request. + - `const ApproximateApproximate Approximate = "approximate"` - When returned on a response, this is the effective execution mode. + - `City string` - - `string` + Free text input for the city of the user, e.g. `San Francisco`. - - `string` + - `Country string` - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + - `Region string` - - `Summary string` + Free text input for the region of the user, e.g. `California`. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `Timezone string` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + - `type BetaApplyPatchTool struct{…}` - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + Allows the assistant to create, delete, or update files using unified diffs. - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + - `Type ApplyPatch` - - `SafetyIdentifier string` + The type of the tool. Always `apply_patch`. - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `ServiceTier BetaResponseServiceTier` + - `AllowedCallers []string` - Specifies the processing type used for serving the request. + The tool invocation context(s). - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `Type ToolSearchOutput` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + The type of the item. Always `tool_search_output`. - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + - `Agent BetaResponseToolSearchOutputItemAgent` - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + The agent that produced this item. - - `Status BetaResponseStatus` + - `AgentName string` - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + The canonical name of the agent that produced this item. - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + - `CreatedBy string` - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + The identifier of the actor that created the item. - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + - `type BetaResponseOutputItemAdditionalTools struct{…}` - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + - `ID string` - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + The unique ID of the additional tools item. - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + - `Role string` - - `Text BetaResponseTextConfig` + The role that provided the additional tools. - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - - `Format BetaResponseFormatTextConfigUnion` + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - An object specifying the format that the model must output. + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - The default format is `{ "type": "text" }` with no additional options. + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - **Not recommended for gpt-4o and newer models:** + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - - `type BetaResponseFormatTextConfigText struct{…}` + - `Tools []BetaToolUnion` - Default response format. Used to generate text responses. + The additional tool definitions made available at this item. - - `Type Text` + - `type BetaFunctionTool struct{…}` - The type of response format being defined. Always `text`. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const TextText Text = "text"` + - `type BetaFileSearchTool struct{…}` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `type BetaComputerTool struct{…}` - - `Name string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `type BetaComputerUsePreviewTool struct{…}` - - `Schema map[string, any]` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `type BetaWebSearchTool struct{…}` - - `Type JSONSchema` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The type of response format being defined. Always `json_schema`. + - `type BetaToolMcp struct{…}` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Description string` + - `type BetaToolCodeInterpreter struct{…}` - A description of what the response format is for, used by the model to - determine how to respond in the format. + A tool that runs Python code to help generate a response to a prompt. - - `Strict bool` + - `type BetaToolProgrammaticToolCalling struct{…}` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `type BetaToolImageGeneration struct{…}` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + A tool that generates images using the GPT image models. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `type BetaToolLocalShell struct{…}` - - `Type JSONObject` + A tool that allows the model to execute shell commands in a local environment. - The type of response format being defined. Always `json_object`. + - `type BetaFunctionShellTool struct{…}` - - `const JSONObjectJSONObject JSONObject = "json_object"` + A tool that allows the model to execute shell commands. - - `Verbosity BetaResponseTextConfigVerbosity` + - `type BetaCustomTool struct{…}` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + - `type BetaNamespaceTool struct{…}` - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + Groups function/custom tools under a shared namespace. - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + - `type BetaToolSearchTool struct{…}` - - `TopLogprobs int64` + Hosted or BYOT tool search configuration for deferred tools. - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + - `type BetaWebSearchPreviewTool struct{…}` - - `Truncation BetaResponseTruncation` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The truncation strategy to use for the model response. + - `type BetaApplyPatchTool struct{…}` - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + Allows the assistant to create, delete, or update files using unified diffs. - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + - `Type AdditionalTools` - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + The type of the item. Always `additional_tools`. - - `Usage BetaResponseUsage` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + - `Agent BetaResponseOutputItemAdditionalToolsAgent` - - `InputTokens int64` + The agent that produced this item. - The number of input tokens. + - `AgentName string` - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + The canonical name of the agent that produced this item. - A detailed breakdown of the input tokens. + - `type BetaResponseCompactionItem struct{…}` - - `CacheWriteTokens int64` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - The number of input tokens that were written to the cache. + - `ID string` - - `CachedTokens int64` + The unique ID of the compaction item. - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + - `EncryptedContent string` - - `OutputTokens int64` + The encrypted content that was produced by compaction. - The number of output tokens. + - `Type Compaction` - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + The type of the item. Always `compaction`. - A detailed breakdown of the output tokens. + - `const CompactionCompaction Compaction = "compaction"` - - `ReasoningTokens int64` + - `Agent BetaResponseCompactionItemAgent` - The number of reasoning tokens. + The agent that produced this item. - - `TotalTokens int64` + - `AgentName string` - The total number of tokens used. + The canonical name of the agent that produced this item. - - `User string` + - `CreatedBy string` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + The identifier of the actor that created the item. -### Example + - `type BetaResponseOutputItemImageGenerationCall struct{…}` -```go -package main + An image generation request made by the model. -import ( - "context" - "fmt" + - `ID string` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" - "github.com/openai/openai-go/responses" -) + The unique ID of the image generation call. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - betaResponse, err := client.Beta.Responses.Get( - context.TODO(), - "resp_677efb5139a88190b512bc3fef8e535d", - responses.BetaResponseGetParams{ + - `Result string` - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", betaResponse.ID) -} -``` + The generated image encoded in base64. -#### Response + - `Status string` -```json -{ - "id": "id", - "created_at": 0, - "error": { - "code": "server_error", - "message": "message" - }, - "incomplete_details": { - "reason": "max_output_tokens" - }, - "instructions": "string", - "metadata": { - "foo": "string" - }, - "model": "gpt-5.1", - "object": "response", - "output": [ - { - "id": "id", - "content": [ - { - "annotations": [ - { - "file_id": "file_id", - "filename": "filename", - "index": 0, - "type": "file_citation" - } - ], - "text": "text", - "type": "output_text", - "logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0, - "top_logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0 - } - ] - } - ] - } - ], - "role": "assistant", - "status": "in_progress", - "type": "message", - "agent": { - "agent_name": "agent_name" - }, - "phase": "commentary" - } - ], - "parallel_tool_calls": true, - "temperature": 1, - "tool_choice": "none", - "tools": [ - { - "name": "name", - "parameters": { - "foo": "bar" - }, - "strict": true, - "type": "function", - "allowed_callers": [ - "direct" - ], - "defer_loading": true, - "description": "description", - "output_schema": { - "foo": "bar" - } - } - ], - "top_p": 1, - "background": true, - "completed_at": 0, - "conversation": { - "id": "id" - }, - "max_output_tokens": 0, - "max_tool_calls": 0, - "moderation": { - "input": { - "categories": { - "foo": true - }, - "category_applied_input_types": { - "foo": [ - "text" - ] - }, - "category_scores": { - "foo": 0 - }, - "flagged": true, - "model": "model", - "type": "moderation_result" - }, - "output": { - "categories": { - "foo": true - }, - "category_applied_input_types": { - "foo": [ - "text" - ] - }, - "category_scores": { - "foo": 0 - }, - "flagged": true, - "model": "model", - "type": "moderation_result" - } - }, - "output_text": "output_text", - "previous_response_id": "previous_response_id", - "prompt": { - "id": "id", - "variables": { - "foo": "string" - }, - "version": "version" - }, - "prompt_cache_key": "prompt-cache-key-1234", - "prompt_cache_options": { - "mode": "implicit", - "ttl": "30m" - }, - "prompt_cache_retention": "in_memory", - "reasoning": { - "context": "auto", - "effort": "none", - "generate_summary": "auto", - "mode": "standard", - "summary": "auto" - }, - "safety_identifier": "safety-identifier-1234", - "service_tier": "auto", - "status": "completed", - "text": { - "format": { - "type": "text" - }, - "verbosity": "low" - }, - "top_logprobs": 0, - "truncation": "auto", - "usage": { - "input_tokens": 0, - "input_tokens_details": { - "cache_write_tokens": 0, - "cached_tokens": 0 - }, - "output_tokens": 0, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 0 - }, - "user": "user-1234" -} -``` + The status of the image generation call. -## Delete a model response + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` -`client.Beta.Responses.Delete(ctx, responseID, body) error` + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` -**delete** `/responses/{response_id}?beta=true` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` -Delete a model response + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` -### Parameters + - `Type ImageGenerationCall` -- `responseID string` + The type of the image generation call. Always `image_generation_call`. -- `body BetaResponseDeleteParams` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Betas param.Field[[]string]` + - `Agent BetaResponseOutputItemImageGenerationCallAgent` - Optional beta features to enable for this request. + The agent that produced this item. - - `const BetaResponseDeleteParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseDeleteParamsOpenAIBeta = "responses_multi_agent=v1"` + - `AgentName string` -### Example + The canonical name of the agent that produced this item. -```go -package main + - `type BetaResponseCodeInterpreterToolCall struct{…}` -import ( - "context" + A tool call to run code. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" - "github.com/openai/openai-go/responses" -) + - `ID string` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - err := client.Beta.Responses.Delete( - context.TODO(), - "resp_677efb5139a88190b512bc3fef8e535d", - responses.BetaResponseDeleteParams{ + The unique ID of the code interpreter tool call. - }, - ) - if err != nil { - panic(err.Error()) - } -} -``` + - `Code string` -## Cancel a response + The code to run, or null if not available. -`client.Beta.Responses.Cancel(ctx, responseID, body) (*BetaResponse, error)` + - `ContainerID string` -**post** `/responses/{response_id}/cancel?beta=true` + The ID of the container used to run the code. -Cancel a response + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` -### Parameters + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. -- `responseID string` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` -- `body BetaResponseCancelParams` + The logs output from the code interpreter. - - `Betas param.Field[[]string]` + - `Logs string` - Optional beta features to enable for this request. + The logs output from the code interpreter. - - `const BetaResponseCancelParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseCancelParamsOpenAIBeta = "responses_multi_agent=v1"` + - `Type Logs` -### Returns + The type of the output. Always `logs`. -- `type BetaResponse struct{…}` + - `const LogsLogs Logs = "logs"` - - `ID string` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - Unique identifier for this Response. + The image output from the code interpreter. - - `CreatedAt float64` + - `Type Image` - Unix timestamp (in seconds) of when this Response was created. + The type of the output. Always `image`. - - `Error BetaResponseError` + - `const ImageImage Image = "image"` - An error object returned when the model fails to generate a Response. + - `URL string` - - `Code BetaResponseErrorCode` + The URL of the image output from the code interpreter. - The error code for the response. + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + - `Type CodeInterpreterCall` - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + The agent that produced this item. - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + - `AgentName string` - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + The canonical name of the agent that produced this item. - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + - `type BetaResponseOutputItemLocalShellCall struct{…}` - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + A tool call to run a command on the local shell. - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + - `ID string` - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + The unique ID of the local shell call. - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `Action BetaResponseOutputItemLocalShellCallAction` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + Execute a shell command on the server. - - `Message string` + - `Command []string` - A human-readable description of the error. + The command to run. - - `IncompleteDetails BetaResponseIncompleteDetails` + - `Env map[string, string]` - Details about why the response is incomplete. + Environment variables to set for the command. - - `Reason string` + - `Type Exec` - The reason why the response is incomplete. + The type of the local shell action. Always `exec`. - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + - `const ExecExec Exec = "exec"` - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + - `TimeoutMs int64` - - `Instructions BetaResponseInstructionsUnion` + Optional timeout in milliseconds for the command. - A system (or developer) message inserted into the model's context. + - `User string` - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + Optional user to run the command as. - - `string` + - `WorkingDirectory string` - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + Optional working directory to run the command in. - A list of one or many input items to the model, containing - different content types. + - `CallID string` - - `type BetaEasyInputMessage struct{…}` + The unique ID of the local shell tool call generated by the model. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `Status string` - - `Content BetaEasyInputMessageContentUnion` + The status of the local shell call. - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `string` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - A list of one or many input items to the model, containing different content - types. + - `Type LocalShellCall` - - `type BetaResponseInputText struct{…}` + The type of the local shell call. Always `local_shell_call`. - A text input to the model. + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `Text string` + - `Agent BetaResponseOutputItemLocalShellCallAgent` - The text input to the model. + The agent that produced this item. - - `Type InputText` + - `AgentName string` - The type of the input item. Always `input_text`. + The canonical name of the agent that produced this item. - - `const InputTextInputText InputText = "input_text"` + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + The output of a local shell tool call. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `ID string` - - `Mode Explicit` + The unique ID of the local shell tool call generated by the model. - The breakpoint mode. Always `explicit`. + - `Output string` - - `const ExplicitExplicit Explicit = "explicit"` + A JSON string of the output of the local shell tool call. - - `type BetaResponseInputImage struct{…}` + - `Type LocalShellCallOutput` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The type of the local shell tool call output. Always `local_shell_call_output`. - - `Detail BetaResponseInputImageDetail` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + The agent that produced this item. - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `AgentName string` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + The canonical name of the agent that produced this item. - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `Status string` - - `Type InputImage` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - The type of the input item. Always `input_image`. + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - - `const InputImageInputImage InputImage = "input_image"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - - `FileID string` + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - The ID of the file to be sent to the model. + - `type BetaResponseFunctionShellToolCall struct{…}` - - `ImageURL string` + A tool call that executes one or more shell commands in a managed environment. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `ID string` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + The unique ID of the shell tool call. Populated when this item is returned via API. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Action BetaResponseFunctionShellToolCallAction` - - `Mode Explicit` + The shell commands and limits that describe how to run the tool call. - The breakpoint mode. Always `explicit`. + - `Commands []string` - - `const ExplicitExplicit Explicit = "explicit"` + - `MaxOutputLength int64` - - `type BetaResponseInputFile struct{…}` + Optional maximum number of characters to return from each command. - A file input to the model. + - `TimeoutMs int64` - - `Type InputFile` + Optional timeout in milliseconds for the commands. - The type of the input item. Always `input_file`. + - `CallID string` - - `const InputFileInputFile InputFile = "input_file"` + The unique ID of the shell tool call generated by the model. - - `Detail BetaResponseInputFileDetail` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + Represents the use of a local environment to perform shell actions. - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `type BetaResponseLocalEnvironment struct{…}` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + Represents the use of a local environment to perform shell actions. - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `Type Local` - - `FileData string` + The environment type. Always `local`. - The content of the file to be sent to the model. + - `const LocalLocal Local = "local"` - - `FileID string` + - `type BetaResponseContainerReference struct{…}` - The ID of the file to be sent to the model. + Represents a container created with /v1/containers. - - `FileURL string` + - `ContainerID string` - The URL of the file to be sent to the model. + - `Type ContainerReference` - - `Filename string` + The environment type. Always `container_reference`. - The name of the file to be sent to the model. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `Status BetaResponseFunctionShellToolCallStatus` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `Mode Explicit` + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - The breakpoint mode. Always `explicit`. + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `Role BetaEasyInputMessageRole` + - `Type ShellCall` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + The type of the item. Always `shell_call`. - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + - `const ShellCallShellCall ShellCall = "shell_call"` - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + - `Agent BetaResponseFunctionShellToolCallAgent` - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + The agent that produced this item. - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `AgentName string` - - `Phase BetaEasyInputMessagePhase` + The canonical name of the agent that produced this item. - 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. + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + The execution context that produced this tool call. - - `Type BetaEasyInputMessageType` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - The type of the message input. Always `message`. + - `Type Direct` - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemMessage struct{…}` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `CallerID string` - - `Content BetaResponseInputMessageContentList` + The call ID of the program item that produced this tool call. - A list of one or many input items to the model, containing different content - types. + - `Type Program` - - `Role string` + - `const ProgramProgram Program = "program"` - The role of the message input. One of `user`, `system`, or `developer`. + - `CreatedBy string` - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + The ID of the entity that created this tool call. - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + The output of a shell tool call that was emitted. - - `Agent BetaResponseInputItemMessageAgent` + - `ID string` - The agent that produced this item. + The unique ID of the shell call output. Populated when this item is returned via API. - - `AgentName string` + - `CallID string` - The canonical name of the agent that produced this item. + The unique ID of the shell tool call generated by the model. - - `Status string` + - `MaxOutputLength int64` - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + An array of shell call output contents - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - - `Type string` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - The type of the message input. Always set to `message`. + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + Indicates that the shell call exceeded its configured time limit. - - `type BetaResponseOutputMessage struct{…}` + - `Type Timeout` - An output message from the model. + The outcome type. Always `timeout`. - - `ID string` + - `const TimeoutTimeout Timeout = "timeout"` - The unique ID of the output message. + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - - `Content []BetaResponseOutputMessageContentUnion` + Indicates that the shell commands finished and returned an exit code. - The content of the output message. + - `ExitCode int64` - - `type BetaResponseOutputText struct{…}` + Exit code from the shell process. - A text output from the model. + - `Type Exit` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The outcome type. Always `exit`. - The annotations of the text output. + - `const ExitExit Exit = "exit"` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `Stderr string` - A citation to a file. + The standard error output that was captured. - - `FileID string` + - `Stdout string` - The ID of the file. + The standard output that was captured. - - `Filename string` + - `CreatedBy string` - The filename of the file cited. + The identifier of the actor that created the item. - - `Index int64` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - The index of the file in the list of files. + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - `Type FileCitation` + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - The type of the file citation. Always `file_citation`. + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `Type ShellCallOutput` - A citation for a web resource used to generate a model response. + The type of the shell call output. Always `shell_call_output`. - - `EndIndex int64` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - The index of the last character of the URL citation in the message. + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - - `StartIndex int64` + The agent that produced this item. - The index of the first character of the URL citation in the message. + - `AgentName string` - - `Title string` + The canonical name of the agent that produced this item. - The title of the web resource. + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - - `Type URLCitation` + The execution context that produced this tool call. - The type of the URL citation. Always `url_citation`. + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Type Direct` - - `URL string` + - `const DirectDirect Direct = "direct"` - The URL of the web resource. + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `CallerID string` - A citation for a container file used to generate a model response. + The call ID of the program item that produced this tool call. - - `ContainerID string` + - `Type Program` - The ID of the container file. + - `const ProgramProgram Program = "program"` - - `EndIndex int64` + - `CreatedBy string` - The index of the last character of the container file citation in the message. + The identifier of the actor that created the item. - - `FileID string` + - `type BetaResponseApplyPatchToolCall struct{…}` - The ID of the file. + A tool call that applies file diffs by creating, deleting, or updating files. - - `Filename string` + - `ID string` - The filename of the container file cited. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `StartIndex int64` + - `CallID string` - The index of the first character of the container file citation in the message. + The unique ID of the apply patch tool call generated by the model. - - `Type ContainerFileCitation` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - The type of the container file citation. Always `container_file_citation`. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + Instruction describing how to create a file via the apply_patch tool. - A path to a file. + - `Diff string` - - `FileID string` + Diff to apply. - The ID of the file. + - `Path string` - - `Index int64` + Path of the file to create. - The index of the file in the list of files. + - `Type CreateFile` - - `Type FilePath` + Create a new file with the provided diff. - The type of the file path. Always `file_path`. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `const FilePathFilePath FilePath = "file_path"` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - - `Text string` + Instruction describing how to delete a file via the apply_patch tool. - The text output from the model. + - `Path string` - - `Type OutputText` + Path of the file to delete. - The type of the output text. Always `output_text`. + - `Type DeleteFile` - - `const OutputTextOutputText OutputText = "output_text"` + Delete the specified file. - - `Logprobs []BetaResponseOutputTextLogprob` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `Token string` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `Bytes []int64` + Instruction describing how to update a file via the apply_patch tool. - - `Logprob float64` + - `Diff string` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + Diff to apply. - - `Token string` + - `Path string` - - `Bytes []int64` + Path of the file to update. - - `Logprob float64` + - `Type UpdateFile` - - `type BetaResponseOutputRefusal struct{…}` + Update an existing file with the provided diff. - A refusal from the model. + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Refusal string` + - `Status BetaResponseApplyPatchToolCallStatus` - The refusal explanation from the model. + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `Type Refusal` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - The type of the refusal. Always `refusal`. + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - `const RefusalRefusal Refusal = "refusal"` + - `Type ApplyPatchCall` - - `Role Assistant` + The type of the item. Always `apply_patch_call`. - The role of the output message. Always `assistant`. + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `const AssistantAssistant Assistant = "assistant"` + - `Agent BetaResponseApplyPatchToolCallAgent` - - `Status BetaResponseOutputMessageStatus` + The agent that produced this item. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `AgentName string` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + The canonical name of the agent that produced this item. - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + The execution context that produced this tool call. - - `Type Message` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - The type of the output message. Always `message`. + - `Type Direct` - - `const MessageMessage Message = "message"` + - `const DirectDirect Direct = "direct"` - - `Agent BetaResponseOutputMessageAgent` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - The agent that produced this item. + - `CallerID string` - - `AgentName string` + The call ID of the program item that produced this tool call. - The canonical name of the agent that produced this item. + - `Type Program` - - `Phase BetaResponseOutputMessagePhase` + - `const ProgramProgram Program = "program"` - 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. + - `CreatedBy string` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + The ID of the entity that created this tool call. - - `type BetaResponseFileSearchToolCall struct{…}` + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The output emitted by an apply patch tool call. - `ID string` - The unique ID of the file search tool call. - - - `Queries []string` - - The queries used to search for files. - - - `Status BetaResponseFileSearchToolCallStatus` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `CallID string` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + The unique ID of the apply patch tool call generated by the model. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `Status BetaResponseApplyPatchToolCallOutputStatus` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + The status of the apply patch tool call output. One of `completed` or `failed`. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - - `Type FileSearchCall` + - `Type ApplyPatchCallOutput` - The type of the file search tool call. Always `file_search_call`. + The type of the item. Always `apply_patch_call_output`. - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `Agent BetaResponseFileSearchToolCallAgent` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` The agent that produced this item. @@ -32543,498 +32007,700 @@ Cancel a response The canonical name of the agent that produced this item. - - `Results []BetaResponseFileSearchToolCallResult` - - The results of the file search tool call. + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + The execution context that produced this tool call. - 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. + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - `string` + - `Type Direct` - - `float64` + - `const DirectDirect Direct = "direct"` - - `bool` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - `FileID string` + - `CallerID string` - The unique ID of the file. + The call ID of the program item that produced this tool call. - - `Filename string` + - `Type Program` - The name of the file. + - `const ProgramProgram Program = "program"` - - `Score float64` + - `CreatedBy string` - The relevance score of the file - a value between 0 and 1. + The ID of the entity that created this tool call output. - - `Text string` + - `Output string` - The text that was retrieved from the file. + Optional textual output returned by the apply patch tool. - - `type BetaResponseComputerToolCall struct{…}` + - `type BetaResponseOutputItemMcpCall struct{…}` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + An invocation of a tool on an MCP server. - `ID string` - The unique ID of the computer call. + The unique ID of the tool call. - - `CallID string` + - `Arguments string` - An identifier used when responding to the tool call with output. + A JSON string of the arguments passed to the tool. - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + - `Name string` - The pending safety checks for the computer call. + The name of the tool that was run. - - `ID string` + - `ServerLabel string` - The ID of the pending safety check. + The label of the MCP server running the tool. - - `Code string` + - `Type McpCall` - The type of the pending safety check. + The type of the item. Always `mcp_call`. - - `Message string` + - `const McpCallMcpCall McpCall = "mcp_call"` - Details about the pending safety check. + - `Agent BetaResponseOutputItemMcpCallAgent` - - `Status BetaResponseComputerToolCallStatus` + The agent that produced this item. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `AgentName string` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + The canonical name of the agent that produced this item. - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `ApprovalRequestID string` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + 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. - - `Type BetaResponseComputerToolCallType` + - `Error string` - The type of the computer call. Always `computer_call`. + The error from the tool call, if any. - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `Output string` - - `Action BetaComputerActionUnion` + The output from the tool call. - A click action. + - `Status string` - - `type BetaComputerActionClick struct{…}` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - A click action. + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - `Button string` + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `type BetaResponseOutputItemMcpListTools struct{…}` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + A list of tools available on an MCP server. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `ID string` - - `Type Click` + The unique ID of the list. - Specifies the event type. For a click action, this property is always `click`. + - `ServerLabel string` - - `const ClickClick Click = "click"` + The label of the MCP server. - - `X int64` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - The x-coordinate where the click occurred. + The tools available on the server. - - `Y int64` + - `InputSchema any` - The y-coordinate where the click occurred. + The JSON schema describing the tool's input. - - `Keys []string` + - `Name string` - The keys being held while clicking. + The name of the tool. - - `type BetaComputerActionDoubleClick struct{…}` + - `Annotations any` - A double click action. + Additional annotations about the tool. - - `Keys []string` + - `Description string` - The keys being held while double-clicking. + The description of the tool. - - `Type DoubleClick` + - `Type McpListTools` - Specifies the event type. For a double click action, this property is always set to `double_click`. + The type of the item. Always `mcp_list_tools`. - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `X int64` + - `Agent BetaResponseOutputItemMcpListToolsAgent` - The x-coordinate where the double click occurred. + The agent that produced this item. - - `Y int64` + - `AgentName string` - The y-coordinate where the double click occurred. + The canonical name of the agent that produced this item. - - `type BetaComputerActionDrag struct{…}` + - `Error string` - A drag action. + Error message if the server could not list tools. - - `Path []BetaComputerActionDragPath` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + A request for human approval of a tool invocation. - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `ID string` - - `X int64` + The unique ID of the approval request. - The x-coordinate. + - `Arguments string` - - `Y int64` + A JSON string of arguments for the tool. - The y-coordinate. + - `Name string` - - `Type Drag` + The name of the tool to run. - Specifies the event type. For a drag action, this property is always set to `drag`. + - `ServerLabel string` - - `const DragDrag Drag = "drag"` + The label of the MCP server making the request. - - `Keys []string` + - `Type McpApprovalRequest` - The keys being held while dragging the mouse. + The type of the item. Always `mcp_approval_request`. - - `type BetaComputerActionKeypress struct{…}` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - A collection of keypresses the model would like to perform. + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` - - `Keys []string` + The agent that produced this item. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `AgentName string` - - `Type Keypress` + The canonical name of the agent that produced this item. - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - - `const KeypressKeypress Keypress = "keypress"` + A response to an MCP approval request. - - `type BetaComputerActionMove struct{…}` + - `ID string` - A mouse move action. + The unique ID of the approval response - - `Type Move` + - `ApprovalRequestID string` - Specifies the event type. For a move action, this property is always set to `move`. + The ID of the approval request being answered. - - `const MoveMove Move = "move"` + - `Approve bool` - - `X int64` + Whether the request was approved. - The x-coordinate to move to. + - `Type McpApprovalResponse` - - `Y int64` + The type of the item. Always `mcp_approval_response`. - The y-coordinate to move to. + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `Keys []string` + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - The keys being held while moving the mouse. + The agent that produced this item. - - `type BetaComputerActionScreenshot struct{…}` + - `AgentName string` - A screenshot action. + The canonical name of the agent that produced this item. - - `Type Screenshot` + - `Reason string` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + Optional reason for the decision. - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `type BetaResponseCustomToolCall struct{…}` - - `type BetaComputerActionScroll struct{…}` + A call to a custom tool created by the model. - A scroll action. + - `CallID string` - - `ScrollX int64` + An identifier used to map this custom tool call to a tool call output. - The horizontal scroll distance. + - `Input string` - - `ScrollY int64` + The input for the custom tool call generated by the model. - The vertical scroll distance. + - `Name string` - - `Type Scroll` + The name of the custom tool being called. - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `Type CustomToolCall` - - `const ScrollScroll Scroll = "scroll"` + The type of the custom tool call. Always `custom_tool_call`. - - `X int64` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - The x-coordinate where the scroll occurred. + - `ID string` - - `Y int64` + The unique ID of the custom tool call in the OpenAI platform. - The y-coordinate where the scroll occurred. + - `Agent BetaResponseCustomToolCallAgent` - - `Keys []string` + The agent that produced this item. - The keys being held while scrolling. + - `AgentName string` - - `type BetaComputerActionType struct{…}` + The canonical name of the agent that produced this item. - An action to type in text. + - `Caller BetaResponseCustomToolCallCallerUnion` - - `Text string` + The execution context that produced this tool call. - The text to type. + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - `Type Type` + - `Type Direct` - Specifies the event type. For a type action, this property is always set to `type`. + - `const DirectDirect Direct = "direct"` - - `const TypeType Type = "type"` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `type BetaComputerActionWait struct{…}` + - `CallerID string` - A wait action. + The call ID of the program item that produced this tool call. - - `Type Wait` + - `Type Program` - Specifies the event type. For a wait action, this property is always set to `wait`. + - `const ProgramProgram Program = "program"` - - `const WaitWait Wait = "wait"` + - `Namespace string` - - `Actions BetaComputerActionList` + The namespace of the custom tool being called. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `type BetaResponseCustomToolCallOutputItem struct{…}` - - `type BetaComputerActionClick struct{…}` + The output of a custom tool call from your code, being sent back to the model. - A click action. + - `ID string` - - `type BetaComputerActionDoubleClick struct{…}` + The unique ID of the custom tool call output item. - A double click action. + - `Status string` - - `type BetaComputerActionDrag struct{…}` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - A drag action. + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `type BetaComputerActionKeypress struct{…}` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - A collection of keypresses the model would like to perform. + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `type BetaComputerActionMove struct{…}` + - `CreatedBy string` - A mouse move action. + The identifier of the actor that created the item. - - `type BetaComputerActionScreenshot struct{…}` + - `Usage BetaResponseUsage` - A screenshot action. + Token accounting for the compaction pass, including cached, reasoning, and total tokens. - - `type BetaComputerActionScroll struct{…}` + - `InputTokens int64` - A scroll action. + The number of input tokens. - - `type BetaComputerActionType struct{…}` + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - An action to type in text. + A detailed breakdown of the input tokens. - - `type BetaComputerActionWait struct{…}` + - `CacheWriteTokens int64` - A wait action. + The number of input tokens that were written to the cache. - - `Agent BetaResponseComputerToolCallAgent` + - `CachedTokens int64` - The agent that produced this item. + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - - `AgentName string` + - `OutputTokens int64` - The canonical name of the agent that produced this item. + The number of output tokens. - - `type BetaResponseInputItemComputerCallOutput struct{…}` + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - The output of a computer tool call. + A detailed breakdown of the output tokens. - - `CallID string` + - `ReasoningTokens int64` - The ID of the computer tool call that produced the output. + The number of reasoning tokens. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `TotalTokens int64` - A computer screenshot image used with the computer use tool. + The total number of tokens used. - - `Type ComputerScreenshot` +### Example - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. +```go +package main - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` +import ( + "context" + "fmt" - - `FileID string` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The identifier of an uploaded file that contains the screenshot. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + betaCompactedResponse, err := client.Beta.Responses.Compact(context.TODO(), openai.BetaResponseCompactParams{ + Model: openai.BetaResponseCompactParamsModelGPT5_6Sol, + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", betaCompactedResponse.ID) +} +``` - - `ImageURL string` +#### Response - The URL of the screenshot image. +```json +{ + "id": "id", + "created_at": 0, + "object": "response.compaction", + "output": [ + { + "id": "id", + "content": [ + { + "annotations": [ + { + "file_id": "file_id", + "filename": "filename", + "index": 0, + "type": "file_citation" + } + ], + "text": "text", + "type": "output_text", + "logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0, + "top_logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0 + } + ] + } + ] + } + ], + "role": "assistant", + "status": "in_progress", + "type": "message", + "agent": { + "agent_name": "agent_name" + }, + "phase": "commentary" + } + ], + "usage": { + "input_tokens": 0, + "input_tokens_details": { + "cache_write_tokens": 0, + "cached_tokens": 0 + }, + "output_tokens": 0, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 0 + } +} +``` - - `Type ComputerCallOutput` +## Domain Types - The type of the computer tool call output. Always `computer_call_output`. +### Beta Apply Patch Tool - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` +- `type BetaApplyPatchTool struct{…}` - - `ID string` + Allows the assistant to create, delete, or update files using unified diffs. - The ID of the computer tool call output. + - `Type ApplyPatch` - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + The type of the tool. Always `apply_patch`. - The safety checks reported by the API that have been acknowledged by the developer. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `ID string` + - `AllowedCallers []string` - The ID of the pending safety check. + The tool invocation context(s). - - `Code string` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - The type of the pending safety check. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `Message string` +### Beta Compacted Response - Details about the pending safety check. +- `type BetaCompactedResponse struct{…}` - - `Agent BetaResponseInputItemComputerCallOutputAgent` + - `ID string` - The agent that produced this item. + The unique identifier for the compacted response. - - `AgentName string` + - `CreatedAt int64` - The canonical name of the agent that produced this item. + Unix timestamp (in seconds) when the compacted conversation was created. - - `Status string` + - `Object ResponseCompaction` - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + The object type. Always `response.compaction`. - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + - `const ResponseCompactionResponseCompaction ResponseCompaction = "response.compaction"` - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `Output []BetaResponseOutputItemUnion` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + The compacted list of output items. This is a list of all user messages, followed by a single compaction item. - - `type BetaResponseFunctionWebSearch struct{…}` + - `type BetaResponseOutputMessage struct{…}` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + An output message from the model. - `ID string` - The unique ID of the web search tool call. + The unique ID of the output message. - - `Action BetaResponseFunctionWebSearchActionUnion` + - `Content []BetaResponseOutputMessageContentUnion` - 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). + The content of the output message. - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `type BetaResponseOutputText struct{…}` - Action type "search" - Performs a web search query. + A text output from the model. - - `Type Search` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - The action type. + The annotations of the text output. - - `const SearchSearch Search = "search"` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `Queries []string` + A citation to a file. - The search queries. + - `FileID string` - - `Query string` + The ID of the file. - The search query. + - `Filename string` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + The filename of the file cited. - The sources used in the search. + - `Index int64` - - `Type URL` + The index of the file in the list of files. - The type of source. Always `url`. + - `Type FileCitation` - - `const URLURL URL = "url"` + The type of the file citation. Always `file_citation`. - - `URL string` + - `const FileCitationFileCitation FileCitation = "file_citation"` - The URL of the source. + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + A citation for a web resource used to generate a model response. - Action type "open_page" - Opens a specific URL from search results. + - `EndIndex int64` - - `Type OpenPage` + The index of the last character of the URL citation in the message. - The action type. + - `StartIndex int64` - - `const OpenPageOpenPage OpenPage = "open_page"` + 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 opened by the model. + The URL of the web resource. - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - Action type "find_in_page": Searches for a pattern within a loaded page. + A citation for a container file used to generate a model response. - - `Pattern string` + - `ContainerID string` - The pattern or text to search for within the page. + The ID of the container file. - - `Type FindInPage` + - `EndIndex int64` - The action type. + The index of the last character of the container file citation in the message. - - `const FindInPageFindInPage FindInPage = "find_in_page"` + - `FileID string` - - `URL string` + The ID of the file. - The URL of the page searched for the pattern. + - `Filename string` - - `Status BetaResponseFunctionWebSearchStatus` + The filename of the container file cited. - The status of the web search tool call. + - `StartIndex int64` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + The index of the first character of the container file citation in the message. - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + - `Type ContainerFileCitation` - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + The type of the container file citation. Always `container_file_citation`. - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `Type WebSearchCall` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - The type of the web search tool call. Always `web_search_call`. + A path to a file. - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `FileID string` - - `Agent BetaResponseFunctionWebSearchAgent` + 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 []BetaResponseOutputTextLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `type BetaResponseOutputRefusal 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 BetaResponseOutputMessageStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + + - `Type Message` + + The type of the output message. Always `message`. + + - `const MessageMessage Message = "message"` + + - `Agent BetaResponseOutputMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Phase BetaResponseOutputMessagePhase` + + 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 BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + + - `type BetaResponseFileSearchToolCall struct{…}` + + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + + - `ID string` + + The unique ID of the file search tool call. + + - `Queries []string` + + The queries used to search for files. + + - `Status BetaResponseFileSearchToolCallStatus` + + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + + - `Type FileSearchCall` + + The type of the file search tool call. Always `file_search_call`. + + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + + - `Agent BetaResponseFileSearchToolCallAgent` The agent that produced this item. @@ -33042,6 +32708,40 @@ Cancel a response The canonical name of the agent that produced this item. + - `Results []BetaResponseFileSearchToolCallResult` + + The results of the file search tool call. + + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + + 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 BetaResponseFunctionToolCall struct{…}` A tool call to run a function. See the @@ -33112,25 +32812,28 @@ Cancel a response - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - The output of a function tool call. + - `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 BetaResponseInputItemFunctionCallOutputOutputUnion` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - Text, image, or file output of the function tool call. + The output from the function call generated by your code. + Can be a string or an list of output content. - `string` - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - An array of content outputs (text, image, file) for the function tool call. + Text, image, or file output of the function call. - - `type BetaResponseInputTextContent struct{…}` + - `type BetaResponseInputText struct{…}` A text input to the model. @@ -33144,7 +32847,7 @@ Cancel a response - `const InputTextInputText InputText = "input_text"` - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -33154,27 +32857,27 @@ Cancel a response - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseInputImageContent struct{…}` + - `type BetaResponseInputImage struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Type InputImage` + - `Detail BetaResponseInputImageDetail` - The type of the input item. Always `input_image`. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const InputImageInputImage InputImage = "input_image"` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `Detail BetaResponseInputImageContentDetail` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + - `Type InputImage` - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + The type of the input item. Always `input_image`. - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `const InputImageInputImage InputImage = "input_image"` - `FileID string` @@ -33184,7 +32887,7 @@ Cancel a response The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -33194,7 +32897,7 @@ Cancel a response - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseInputFileContent struct{…}` + - `type BetaResponseInputFile struct{…}` A file input to the model. @@ -33204,19 +32907,19 @@ Cancel a response - `const InputFileInputFile InputFile = "input_file"` - - `Detail BetaResponseInputFileContentDetail` + - `Detail BetaResponseInputFileDetail` The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - `FileData string` - The base64-encoded data of the file to be sent to the model. + The content of the file to be sent to the model. - `FileID string` @@ -33230,7 +32933,7 @@ Cancel a response The name of the file to be sent to the model. - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -33240,17 +32943,24 @@ Cancel a response - `const ExplicitExplicit Explicit = "explicit"` + - `Status BetaResponseFunctionToolCallOutputItemStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `Type FunctionCallOutput` The type of the function tool call output. Always `function_call_output`. - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `ID string` - - The unique ID of the function tool call output. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` The agent that produced this item. @@ -33258,11 +32968,11 @@ Cancel a response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - `Type Direct` @@ -33270,7 +32980,7 @@ Cancel a response - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - `CallerID string` @@ -33282,37 +32992,123 @@ Cancel a response - `const ProgramProgram Program = "program"` - - `Status string` - - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + - `CreatedBy string` - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + The identifier of the actor that created the item. - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + - `type BetaResponseOutputItemAgentMessage struct{…}` - - `type BetaResponseInputItemAgentMessage struct{…}` + - `ID string` - A message routed between agents. + The unique ID of the agent message. - `Author string` The sending agent identity. - - `Content []BetaResponseInputItemAgentMessageContentUnion` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - Plaintext, image, or encrypted content sent between agents. + Encrypted content sent between agents. - - `type BetaResponseInputTextContent struct{…}` + - `type BetaResponseInputText struct{…}` A text input to the model. - - `type BetaResponseInputImageContent struct{…}` + - `type BetaResponseOutputText struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + A text output from the model. - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + + A text content. + + - `Text string` + + - `Type Text` + + - `const TextText Text = "text"` + + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + + A summary text from the model. + + - `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 BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + + Reasoning text from the model. + + - `Text string` + + The reasoning text from the model. + + - `Type ReasoningText` + + The type of the reasoning text. Always `reasoning_text`. + + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + + - `type BetaResponseOutputRefusal struct{…}` + + A refusal from the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + + A screenshot of a computer. + + - `Detail string` + + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + + - `FileID string` + + The identifier of an uploaded file that contains the screenshot. + + - `ImageURL string` + + The URL of the screenshot image. + + - `Type ComputerScreenshot` + + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` Opaque encrypted content that Responses API decrypts inside trusted model execution. @@ -33332,15 +33128,11 @@ Cancel a response - `Type AgentMessage` - The item type. Always `agent_message`. + The type of the item. Always `agent_message`. - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `ID string` - - The unique ID of this agent message item. - - - `Agent BetaResponseInputItemAgentMessageAgent` + - `Agent BetaResponseOutputItemAgentMessageAgent` The agent that produced this item. @@ -33348,27 +33140,31 @@ Cancel a response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCall struct{…}` + - `type BetaResponseOutputItemMultiAgentCall struct{…}` + + - `ID string` + + The unique ID of the multi-agent call item. - `Action string` - The multi-agent action that was executed. + The multi-agent action to execute. - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - `Arguments string` - The action arguments as a JSON string. + The JSON string of arguments generated for the action. - `CallID string` @@ -33376,15 +33172,11 @@ Cancel a response - `Type MultiAgentCall` - The item type. Always `multi_agent_call`. + The type of the multi-agent call. Always `multi_agent_call`. - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `ID string` - - The unique ID of this multi-agent call. - - - `Agent BetaResponseInputItemMultiAgentCallAgent` + - `Agent BetaResponseOutputItemMultiAgentCallAgent` The agent that produced this item. @@ -33392,153 +33184,161 @@ Cancel a response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + + - `ID string` + + The unique ID of the multi-agent call output item. - `Action string` The multi-agent action that produced this result. - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - `CallID string` The unique ID of the multi-agent call. - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + - `Output []BetaResponseOutputText` Text output returned by the multi-agent action. + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + - `Text string` - The text content. + The text output from the model. - `Type OutputText` - The content type. Always `output_text`. - - - `const OutputTextOutputText OutputText = "output_text"` + The type of the output text. Always `output_text`. - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + - `Logprobs []BetaResponseOutputTextLogprob` - Citations associated with the text content. + - `Type MultiAgentCallOutput` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + The type of the multi-agent result. Always `multi_agent_call_output`. - - `FileID string` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - The ID of the file. + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` - - `Filename string` + The agent that produced this item. - The filename of the file cited. + - `AgentName string` - - `Index int64` + The canonical name of the agent that produced this item. - The index of the file in the list of files. + - `type BetaResponseFunctionWebSearch struct{…}` - - `Type FileCitation` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - The citation type. Always `file_citation`. + - `ID string` - - `const FileCitationFileCitation FileCitation = "file_citation"` + The unique ID of the web search tool call. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + - `Action BetaResponseFunctionWebSearchActionUnion` - - `EndIndex int64` + 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). - The index of the last character of the citation in the message. + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - - `StartIndex int64` + Action type "search" - Performs a web search query. - The index of the first character of the citation in the message. + - `Type Search` - - `Title string` + The action type. - The title of the cited resource. + - `const SearchSearch Search = "search"` - - `Type URLCitation` + - `Queries []string` - The citation type. Always `url_citation`. + The search queries. - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Query string` - - `URL string` + The search query. - The URL of the cited resource. + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + The sources used in the search. - - `ContainerID string` + - `Type URL` - The ID of the container. + The type of source. Always `url`. - - `EndIndex int64` + - `const URLURL URL = "url"` - The index of the last character of the citation in the message. + - `URL string` - - `FileID string` + The URL of the source. - The ID of the container file. + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `Filename string` + Action type "open_page" - Opens a specific URL from search results. - The filename of the container file cited. + - `Type OpenPage` - - `StartIndex int64` + The action type. - The index of the first character of the citation in the message. + - `const OpenPageOpenPage OpenPage = "open_page"` - - `Type ContainerFileCitation` + - `URL string` - The citation type. Always `container_file_citation`. + The URL opened by the model. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - - `Type MultiAgentCallOutput` + Action type "find_in_page": Searches for a pattern within a loaded page. - The item type. Always `multi_agent_call_output`. + - `Pattern string` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + The pattern or text to search for within the page. - - `ID string` + - `Type FindInPage` - The unique ID of this multi-agent call output. + The action type. - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + - `const FindInPageFindInPage FindInPage = "find_in_page"` - The agent that produced this item. + - `URL string` - - `AgentName string` + The URL of the page searched for the pattern. - The canonical name of the agent that produced this item. + - `Status BetaResponseFunctionWebSearchStatus` - - `type BetaResponseInputItemToolSearchCall struct{…}` + The status of the web search tool call. - - `Arguments any` + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - The arguments supplied to the tool search call. + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - `Type ToolSearchCall` + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - The item type. Always `tool_search_call`. + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `Type WebSearchCall` - - `ID string` + The type of the web search tool call. Always `web_search_call`. - The unique ID of this tool search call. + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `Agent BetaResponseInputItemToolSearchCallAgent` + - `Agent BetaResponseFunctionWebSearchAgent` The agent that produced this item. @@ -33546,83 +33346,641 @@ Cancel a response The canonical name of the agent that produced this item. - - `CallID string` + - `type BetaResponseComputerToolCall struct{…}` - The unique ID of the tool search call generated by the model. + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `Execution string` + - `ID string` - Whether tool search was executed by the server or by the client. + The unique ID of the computer call. - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + - `CallID string` - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + An identifier used when responding to the tool call with output. - - `Status string` + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - The status of the tool search call. + The pending safety checks for the computer call. - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + - `ID string` - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + The ID of the pending safety check. - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + - `Code string` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + The type of the pending safety check. - - `Tools []BetaToolUnion` + - `Message string` - The loaded tool definitions returned by the tool search output. + Details about the pending safety check. - - `type BetaFunctionTool struct{…}` + - `Status BetaResponseComputerToolCallStatus` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Name string` + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - The name of the function to call. + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - - `Parameters map[string, any]` + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - A JSON schema object describing the parameters of the function. + - `Type BetaResponseComputerToolCallType` - - `Strict bool` + The type of the computer call. Always `computer_call`. - Whether strict parameter validation is enforced for this function tool. + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `Type Function` + - `Action BetaComputerActionUnion` - The type of the function tool. Always `function`. + A click action. - - `const FunctionFunction Function = "function"` + - `type BetaComputerActionClick struct{…}` - - `AllowedCallers []string` + A click action. - The tool invocation context(s). + - `Button string` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `DeferLoading bool` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - Whether this function is deferred and loaded via tool search. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `Description string` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - A description of the function. Used by the model to determine whether or not to call the function. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `OutputSchema map[string, any]` + - `Type Click` - A JSON schema object describing the JSON value encoded in string outputs for this function. + Specifies the event type. For a click action, this property is always `click`. - - `type BetaFileSearchTool struct{…}` + - `const ClickClick Click = "click"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `X int64` - - `Type FileSearch` + The x-coordinate where the click occurred. - The type of the file search tool. Always `file_search`. + - `Y int64` + + The y-coordinate where the click occurred. + + - `Keys []string` + + The keys being held while clicking. + + - `type BetaComputerActionDoubleClick 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 BetaComputerActionDrag struct{…}` + + A drag action. + + - `Path []BetaComputerActionDragPath` + + 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 BetaComputerActionKeypress 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 BetaComputerActionMove 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 BetaComputerActionScreenshot 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 BetaComputerActionScroll 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 BetaComputerActionType 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 BetaComputerActionWait 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 BetaComputerActionList` + + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `type BetaComputerActionDoubleClick struct{…}` + + A double click action. + + - `type BetaComputerActionDrag struct{…}` + + A drag action. + + - `type BetaComputerActionKeypress struct{…}` + + A collection of keypresses the model would like to perform. + + - `type BetaComputerActionMove struct{…}` + + A mouse move action. + + - `type BetaComputerActionScreenshot struct{…}` + + A screenshot action. + + - `type BetaComputerActionScroll struct{…}` + + A scroll action. + + - `type BetaComputerActionType struct{…}` + + An action to type in text. + + - `type BetaComputerActionWait struct{…}` + + A wait action. + + - `Agent BetaResponseComputerToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseComputerToolCallOutputItem 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 BetaResponseComputerToolCallOutputScreenshot` + + 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 BetaResponseComputerToolCallOutputItemStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + + - `Type ComputerCallOutput` + + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + + 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. + + - `Agent BetaResponseComputerToolCallOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + + - `ID string` + + The unique identifier of the reasoning content. + + - `Summary []BetaResponseReasoningItemSummary` + + 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"` + + - `Agent BetaResponseReasoningItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Content []BetaResponseReasoningItemContent` + + 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 BetaResponseReasoningItemStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + + - `type BetaResponseOutputItemProgram struct{…}` + + - `ID string` + + The unique ID of the program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The type of the item. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseOutputItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of the program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output item. + + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The type of the item. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseOutputItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseToolSearchCall 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 BetaResponseToolSearchCallExecution` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + + - `Status BetaResponseToolSearchCallStatus` + + The status of the tool search call item that was recorded. + + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + + - `Type ToolSearchCall` + + The type of the item. Always `tool_search_call`. + + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + + - `Agent BetaResponseToolSearchCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseToolSearchOutputItem 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 BetaResponseToolSearchOutputItemExecution` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + + - `Status BetaResponseToolSearchOutputItemStatus` + + The status of the tool search output item that was recorded. + + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + + - `Tools []BetaToolUnion` + + The loaded tool definitions returned by tool search. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `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 strict parameter validation is enforced for this function tool. + + - `Type Function` + + The type of the function tool. Always `function`. + + - `const FunctionFunction Function = "function"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + + - `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. + + - `OutputSchema map[string, any]` + + A JSON schema object describing the JSON value encoded in string outputs for this function. + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `Type FileSearch` + + The type of the file search tool. Always `file_search`. - `const FileSearchFileSearch FileSearch = "file_search"` @@ -33681,7 +34039,11 @@ Cancel a response - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -33738,7 +34100,11 @@ Cancel a response - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -34654,15 +35020,11 @@ Cancel a response - `Type ToolSearchOutput` - The item type. Always `tool_search_output`. + The type of the item. Always `tool_search_output`. - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `ID string` - - The unique ID of this tool search output. - - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - `Agent BetaResponseToolSearchOutputItemAgent` The agent that produced this item. @@ -34670,39 +35032,39 @@ Cancel a response The canonical name of the agent that produced this item. - - `CallID string` + - `CreatedBy string` - The unique ID of the tool search call generated by the model. + The identifier of the actor that created the item. - - `Execution BetaResponseToolSearchOutputItemParamExecution` + - `type BetaResponseOutputItemAdditionalTools struct{…}` - Whether tool search was executed by the server or by the client. + - `ID string` - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + The unique ID of the additional tools item. - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + - `Role string` - - `Status BetaResponseToolSearchOutputItemParamStatus` + The role that provided the additional tools. - The status of the tool search output. + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - `Role Developer` + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - The role that provided the additional tools. Only `developer` is supported. + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - - `const DeveloperDeveloper Developer = "developer"` + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - `Tools []BetaToolUnion` - A list of additional tools made available at this item. + The additional tool definitions made available at this item. - `type BetaFunctionTool struct{…}` @@ -34770,15 +35132,11 @@ Cancel a response - `Type AdditionalTools` - The item type. Always `additional_tools`. + The type of the item. Always `additional_tools`. - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `ID string` - - The unique ID of this additional tools item. - - - `Agent BetaResponseInputItemAdditionalToolsAgent` + - `Agent BetaResponseOutputItemAdditionalToolsAgent` The agent that produced this item. @@ -34786,82 +35144,17 @@ Cancel a response The canonical name of the agent that produced this item. - - `type BetaResponseReasoningItem struct{…}` + - `type BetaResponseCompactionItem 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](https://platform.openai.com/docs/guides/conversation-state). + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - `ID string` - The unique identifier of the reasoning content. - - - `Summary []BetaResponseReasoningItemSummary` - - 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"` - - - `Agent BetaResponseReasoningItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Content []BetaResponseReasoningItemContent` - - 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 BetaResponseReasoningItemStatus` - - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - - `type BetaResponseCompactionItemParamResp struct{…}` - - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The unique ID of the compaction item. - `EncryptedContent string` - The encrypted content of the compaction summary. + The encrypted content that was produced by compaction. - `Type Compaction` @@ -34869,11 +35162,7 @@ Cancel a response - `const CompactionCompaction Compaction = "compaction"` - - `ID string` - - The ID of the compaction item. - - - `Agent BetaResponseCompactionItemParamAgentResp` + - `Agent BetaResponseCompactionItemAgent` The agent that produced this item. @@ -34881,7 +35170,11 @@ Cancel a response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemImageGenerationCall struct{…}` + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemImageGenerationCall struct{…}` An image generation request made by the model. @@ -34897,13 +35190,13 @@ Cancel a response The status of the image generation call. - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - `Type ImageGenerationCall` @@ -34911,7 +35204,7 @@ Cancel a response - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseInputItemImageGenerationCallAgent` + - `Agent BetaResponseOutputItemImageGenerationCallAgent` The agent that produced this item. @@ -34996,7 +35289,7 @@ Cancel a response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `type BetaResponseOutputItemLocalShellCall struct{…}` A tool call to run a command on the local shell. @@ -35004,7 +35297,7 @@ Cancel a response The unique ID of the local shell call. - - `Action BetaResponseInputItemLocalShellCallAction` + - `Action BetaResponseOutputItemLocalShellCallAction` Execute a shell command on the server. @@ -35042,11 +35335,11 @@ Cancel a response The status of the local shell call. - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - `Type LocalShellCall` @@ -35054,7 +35347,7 @@ Cancel a response - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `Agent BetaResponseInputItemLocalShellCallAgent` + - `Agent BetaResponseOutputItemLocalShellCallAgent` The agent that produced this item. @@ -35062,7 +35355,7 @@ Cancel a response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` The output of a local shell tool call. @@ -35080,7 +35373,7 @@ Cancel a response - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` The agent that produced this item. @@ -35092,47 +35385,81 @@ Cancel a response The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - - `type BetaResponseInputItemShellCall struct{…}` + - `type BetaResponseFunctionShellToolCall struct{…}` - A tool representing a request to execute one or more shell commands. + A tool call that executes one or more shell commands in a managed environment. - - `Action BetaResponseInputItemShellCallAction` + - `ID string` + + The unique ID of the shell tool call. Populated when this item is returned via API. + + - `Action BetaResponseFunctionShellToolCallAction` The shell commands and limits that describe how to run the tool call. - `Commands []string` - Ordered shell commands for the execution environment to run. - - `MaxOutputLength int64` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + Optional maximum number of characters to return from each command. - `TimeoutMs int64` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + Optional timeout in milliseconds for the commands. - `CallID string` The unique ID of the shell tool call generated by the model. + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + + Represents the use of a local environment to perform shell actions. + + - `type BetaResponseLocalEnvironment struct{…}` + + Represents the use of a local environment to perform shell actions. + + - `Type Local` + + The environment type. Always `local`. + + - `const LocalLocal Local = "local"` + + - `type BetaResponseContainerReference struct{…}` + + Represents a container created with /v1/containers. + + - `ContainerID string` + + - `Type ContainerReference` + + The environment type. Always `container_reference`. + + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + + - `Status BetaResponseFunctionShellToolCallStatus` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `Type ShellCall` The type of the item. Always `shell_call`. - `const ShellCallShellCall ShellCall = "shell_call"` - - `ID string` - - The unique ID of the shell tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemShellCallAgent` + - `Agent BetaResponseFunctionShellToolCallAgent` The agent that produced this item. @@ -35140,19 +35467,17 @@ Cancel a response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemShellCallCallerUnion` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - `CallerID string` @@ -35160,45 +35485,37 @@ Cancel a response - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - The environment to execute the shell commands in. - - - `type BetaLocalEnvironment struct{…}` - - - `type BetaContainerReference struct{…}` - - - `Status string` - - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `CreatedBy string` - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + The ID of the entity that created this tool call. - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + The output of a shell tool call that was emitted. - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `ID string` - The streamed output items emitted by a shell tool call. + 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. - - `Output []BetaResponseFunctionShellCallOutputContent` + - `MaxOutputLength int64` - Captured chunks of stdout and stderr output, along with their associated outcomes. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - The exit or timeout outcome associated with this shell call. + An array of shell call output contents - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` Indicates that the shell call exceeded its configured time limit. @@ -35208,13 +35525,13 @@ Cancel a response - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` Indicates that the shell commands finished and returned an exit code. - `ExitCode int64` - The exit code returned by the shell process. + Exit code from the shell process. - `Type Exit` @@ -35224,23 +35541,33 @@ Cancel a response - `Stderr string` - Captured stderr output for the shell call. + The standard error output that was captured. - `Stdout string` - Captured stdout output for the shell call. + The standard output that was captured. - - `Type ShellCallOutput` + - `CreatedBy string` - The type of the item. Always `shell_call_output`. + The identifier of the actor that created the item. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `ID string` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + + - `Type ShellCallOutput` + + The type of the shell call output. Always `shell_call_output`. + + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + + - `Agent BetaResponseFunctionShellToolCallOutputAgent` The agent that produced this item. @@ -35248,19 +35575,17 @@ Cancel a response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - `CallerID string` @@ -35268,93 +35593,85 @@ Cancel a response - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `MaxOutputLength int64` - - The maximum number of UTF-8 characters captured for this shell call's combined output. - - - `Status string` - - The status of the shell call output. + - `CreatedBy string` - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + The identifier of the actor that created the item. - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + - `type BetaResponseApplyPatchToolCall struct{…}` - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + A tool call that applies file diffs by creating, deleting, or updating files. - - `type BetaResponseInputItemApplyPatchCall struct{…}` + - `ID string` - A tool call representing a request to create, delete, or update files using diff patches. + 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 BetaResponseInputItemApplyPatchCallOperationUnion` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - The specific create, delete, or update instruction for the apply_patch tool call. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - Instruction for creating a new file via the apply_patch tool. + Instruction describing how to create a file via the apply_patch tool. - `Diff string` - Unified diff content to apply when creating the file. + Diff to apply. - `Path string` - Path of the file to create relative to the workspace root. + Path of the file to create. - `Type CreateFile` - The operation type. Always `create_file`. + Create a new file with the provided diff. - `const CreateFileCreateFile CreateFile = "create_file"` - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - Instruction for deleting an existing file via the apply_patch tool. + Instruction describing how to delete a file via the apply_patch tool. - `Path string` - Path of the file to delete relative to the workspace root. + Path of the file to delete. - `Type DeleteFile` - The operation type. Always `delete_file`. + Delete the specified file. - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - Instruction for updating an existing file via the apply_patch tool. + Instruction describing how to update a file via the apply_patch tool. - `Diff string` - Unified diff content to apply to the existing file. + Diff to apply. - `Path string` - Path of the file to update relative to the workspace root. + Path of the file to update. - `Type UpdateFile` - The operation type. Always `update_file`. + Update an existing file with the provided diff. - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Status string` + - `Status BetaResponseApplyPatchToolCallStatus` The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - `Type ApplyPatchCall` @@ -35362,11 +35679,7 @@ Cancel a response - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `ID string` - - The unique ID of the apply patch tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemApplyPatchCallAgent` + - `Agent BetaResponseApplyPatchToolCallAgent` The agent that produced this item. @@ -35374,19 +35687,17 @@ Cancel a response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - `CallerID string` @@ -35394,25 +35705,31 @@ Cancel a response - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `CreatedBy string` - The streamed output emitted by an apply patch tool call. + The ID of the entity that created this tool call. + + - `type BetaResponseApplyPatchToolCallOutput 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 string` + - `Status BetaResponseApplyPatchToolCallOutputStatus` The status of the apply patch tool call output. One of `completed` or `failed`. - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - `Type ApplyPatchCallOutput` @@ -35420,11 +35737,7 @@ Cancel a response - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `ID string` - - The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` The agent that produced this item. @@ -35432,19 +35745,17 @@ Cancel a response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - `CallerID string` @@ -35452,53 +35763,43 @@ Cancel a response - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `Output string` - - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - - `type BetaResponseInputItemMcpListTools struct{…}` + - `CreatedBy string` - A list of tools available on an MCP server. + The ID of the entity that created this tool call output. - - `ID string` + - `Output string` - The unique ID of the list. + Optional textual output returned by the apply patch tool. - - `ServerLabel string` + - `type BetaResponseOutputItemMcpCall struct{…}` - The label of the MCP server. + An invocation of a tool on an MCP server. - - `Tools []BetaResponseInputItemMcpListToolsTool` + - `ID string` - The tools available on the server. + The unique ID of the tool call. - - `InputSchema any` + - `Arguments string` - The JSON schema describing the tool's input. + A JSON string of the arguments passed to the tool. - `Name string` - The name of the tool. - - - `Annotations any` - - Additional annotations about the tool. + The name of the tool that was run. - - `Description string` + - `ServerLabel string` - The description of the tool. + The label of the MCP server running the tool. - - `Type McpListTools` + - `Type McpCall` - The type of the item. Always `mcp_list_tools`. + The type of the item. Always `mcp_call`. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `const McpCallMcpCall McpCall = "mcp_call"` - - `Agent BetaResponseInputItemMcpListToolsAgent` + - `Agent BetaResponseOutputItemMcpCallAgent` The agent that produced this item. @@ -35506,67 +35807,72 @@ Cancel a response The canonical name of the agent that produced this item. - - `Error string` + - `ApprovalRequestID string` - Error message if the server could not list tools. + 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. - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + - `Error string` - A request for human approval of a tool invocation. + The error from the tool call, if any. - - `ID string` + - `Output string` - The unique ID of the approval request. + The output from the tool call. - - `Arguments string` + - `Status string` - A JSON string of arguments for the tool. + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `Name string` + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - The name of the tool to run. + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - - `ServerLabel string` + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - The label of the MCP server making the request. + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - `Type McpApprovalRequest` + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - The type of the item. Always `mcp_approval_request`. + - `type BetaResponseOutputItemMcpListTools struct{…}` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + A list of tools available on an MCP server. - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `ID string` - The agent that produced this item. + The unique ID of the list. - - `AgentName string` + - `ServerLabel string` - The canonical name of the agent that produced this item. + The label of the MCP server. - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - A response to an MCP approval request. + The tools available on the server. - - `ApprovalRequestID string` + - `InputSchema any` - The ID of the approval request being answered. + The JSON schema describing the tool's input. - - `Approve bool` + - `Name string` - Whether the request was approved. + The name of the tool. - - `Type McpApprovalResponse` + - `Annotations any` - The type of the item. Always `mcp_approval_response`. + Additional annotations about the tool. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `Description string` - - `ID string` + The description of the tool. - The unique ID of the approval response + - `Type McpListTools` - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + The type of the item. Always `mcp_list_tools`. + + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + + - `Agent BetaResponseOutputItemMcpListToolsAgent` The agent that produced this item. @@ -35574,37 +35880,37 @@ Cancel a response The canonical name of the agent that produced this item. - - `Reason string` + - `Error string` - Optional reason for the decision. + Error message if the server could not list tools. - - `type BetaResponseInputItemMcpCall struct{…}` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - An invocation of a tool on an MCP server. + A request for human approval of a tool invocation. - `ID string` - The unique ID of the tool call. + The unique ID of the approval request. - `Arguments string` - A JSON string of the arguments passed to the tool. + A JSON string of arguments for the tool. - `Name string` - The name of the tool that was run. + The name of the tool to run. - `ServerLabel string` - The label of the MCP server running the tool. + The label of the MCP server making the request. - - `Type McpCall` + - `Type McpApprovalRequest` - The type of the item. Always `mcp_call`. + The type of the item. Always `mcp_approval_request`. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Agent BetaResponseInputItemMcpCallAgent` + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` The agent that produced this item. @@ -35612,75 +35918,29 @@ Cancel a response The canonical name of the agent that produced this item. - - `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 BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - - `type BetaResponseCustomToolCallOutput struct{…}` - - The output of a custom tool call from your code, being sent back to the model. - - - `CallID string` - - The call ID, used to map this custom tool call output to a custom tool call. - - - `Output BetaResponseCustomToolCallOutputOutputUnion` - - The output from the custom tool call generated by your code. - Can be a string or an list of output content. - - - `string` - - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - - Text, image, or file output of the custom tool call. - - - `type BetaResponseInputText struct{…}` + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - A text input to the model. + A response to an MCP approval request. - - `type BetaResponseInputImage struct{…}` + - `ID string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The unique ID of the approval response - - `type BetaResponseInputFile struct{…}` + - `ApprovalRequestID string` - A file input to the model. + The ID of the approval request being answered. - - `Type CustomToolCallOutput` + - `Approve bool` - The type of the custom tool call output. Always `custom_tool_call_output`. + Whether the request was approved. - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `Type McpApprovalResponse` - - `ID string` + The type of the item. Always `mcp_approval_response`. - The unique ID of the custom tool call output in the OpenAI platform. + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `Agent BetaResponseCustomToolCallOutputAgent` + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` The agent that produced this item. @@ -35688,29 +35948,9 @@ Cancel a response The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - The caller type. Always `program`. + - `Reason string` - - `const ProgramProgram Program = "program"` + Optional reason for the decision. - `type BetaResponseCustomToolCall struct{…}` @@ -35770,1805 +36010,1818 @@ Cancel a response The namespace of the custom tool being called. - - `type BetaResponseInputItemCompactionTrigger struct{…}` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - Compacts the current context. Must be the final input item. + The output of a custom tool call from your code, being sent back to the model. - - `Type CompactionTrigger` + - `ID string` - The type of the item. Always `compaction_trigger`. + The unique ID of the custom tool call output item. - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `Status string` - - `Agent BetaResponseInputItemCompactionTriggerAgent` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The agent that produced this item. + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `AgentName string` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - The canonical name of the agent that produced this item. + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `type BetaResponseInputItemItemReference struct{…}` + - `CreatedBy string` - An internal identifier for an item to reference. + The identifier of the actor that created the item. - - `ID string` + - `Usage BetaResponseUsage` - The ID of the item to reference. + Token accounting for the compaction pass, including cached, reasoning, and total tokens. - - `Agent BetaResponseInputItemItemReferenceAgent` + - `InputTokens int64` - The agent that produced this item. + The number of input tokens. - - `AgentName string` + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - The canonical name of the agent that produced this item. + A detailed breakdown of the input tokens. - - `Type string` + - `CacheWriteTokens int64` - The type of item to reference. Always `item_reference`. + The number of input tokens that were written to the cache. - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + - `CachedTokens int64` - - `type BetaResponseInputItemProgram struct{…}` + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - - `ID string` + - `OutputTokens int64` - The unique ID of this program item. + The number of output tokens. - - `CallID string` + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - The stable call ID of the program item. + A detailed breakdown of the output tokens. - - `Code string` + - `ReasoningTokens int64` - The JavaScript source executed by programmatic tool calling. + The number of reasoning tokens. - - `Fingerprint string` + - `TotalTokens int64` - Opaque program replay fingerprint that must be round-tripped. + The total number of tokens used. - - `Type Program` +### Beta Computer Action - The item type. Always `program`. +- `type BetaComputerActionUnion interface{…}` - - `const ProgramProgram Program = "program"` + A click action. - - `Agent BetaResponseInputItemProgramAgent` + - `type BetaComputerActionClick struct{…}` - The agent that produced this item. + A click action. - - `AgentName string` + - `Button string` - The canonical name of the agent that produced this item. + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `type BetaResponseInputItemProgramOutput struct{…}` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `ID string` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - The unique ID of this program output item. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `CallID string` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - The call ID of the program item. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `Result string` + - `Type Click` - The result produced by the program item. + Specifies the event type. For a click action, this property is always `click`. - - `Status string` + - `const ClickClick Click = "click"` - The terminal status of the program output. + - `X int64` - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + The x-coordinate where the click occurred. - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + - `Y int64` - - `Type ProgramOutput` + The y-coordinate where the click occurred. - The item type. Always `program_output`. + - `Keys []string` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + The keys being held while clicking. - - `Agent BetaResponseInputItemProgramOutputAgent` + - `type BetaComputerActionDoubleClick struct{…}` - The agent that produced this item. + A double click action. - - `AgentName string` + - `Keys []string` - The canonical name of the agent that produced this item. + The keys being held while double-clicking. - - `Metadata map[string, string]` + - `Type DoubleClick` - 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. + Specifies the event type. For a double click action, this property is always set to `double_click`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `Model BetaResponseModel` + - `X int64` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + The x-coordinate where the double click occurred. - - `type BetaResponseModel string` + - `Y int64` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + The y-coordinate where the double click occurred. - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + - `type BetaComputerActionDrag struct{…}` - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + A drag action. - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + - `Path []BetaComputerActionDragPath` - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + - `X int64` - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + The x-coordinate. - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + - `Y int64` - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + The y-coordinate. - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + - `Type Drag` - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + Specifies the event type. For a drag action, this property is always set to `drag`. - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + - `const DragDrag Drag = "drag"` - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + - `Keys []string` - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + The keys being held while dragging the mouse. - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + - `type BetaComputerActionKeypress struct{…}` - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + A collection of keypresses the model would like to perform. - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + - `Keys []string` - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + - `Type Keypress` - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + - `const KeypressKeypress Keypress = "keypress"` - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + - `type BetaComputerActionMove struct{…}` - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + A mouse move action. - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + - `Type Move` - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + Specifies the event type. For a move action, this property is always set to `move`. - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + - `const MoveMove Move = "move"` - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + - `X int64` - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + The x-coordinate to move to. - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + - `Y int64` - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + The y-coordinate to move to. - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + - `Keys []string` - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + The keys being held while moving the mouse. - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + - `type BetaComputerActionScreenshot struct{…}` - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + A screenshot action. - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + - `Type Screenshot` - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + - `type BetaComputerActionScroll struct{…}` - - `const BetaResponseModelO1 BetaResponseModel = "o1"` + A scroll action. - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + - `ScrollX int64` - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + The horizontal scroll distance. - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + - `ScrollY int64` - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + The vertical scroll distance. - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + - `Type Scroll` - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + - `const ScrollScroll Scroll = "scroll"` - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + - `X int64` - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + The x-coordinate where the scroll occurred. - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + - `Y int64` - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + The y-coordinate where the scroll occurred. - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + - `Keys []string` - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + The keys being held while scrolling. - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + - `type BetaComputerActionType struct{…}` - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + An action to type in text. - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + - `Text string` - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + The text to type. - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + - `Type Type` - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + Specifies the event type. For a type action, this property is always set to `type`. - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + - `const TypeType Type = "type"` - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + - `type BetaComputerActionWait struct{…}` - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + A wait action. - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + - `Type Wait` - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + Specifies the event type. For a wait action, this property is always set to `wait`. - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + - `const WaitWait Wait = "wait"` - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` +### Beta Computer Action List - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` +- `type BetaComputerActionList []BetaComputerActionUnion` - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + - `type BetaComputerActionClick struct{…}` - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + A click action. - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + - `Button string` - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + - `Type Click` - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + Specifies the event type. For a click action, this property is always `click`. - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + - `const ClickClick Click = "click"` - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + - `X int64` - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + The x-coordinate where the click occurred. - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + - `Y int64` - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + The y-coordinate where the click occurred. - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + - `Keys []string` - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + The keys being held while clicking. - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + - `type BetaComputerActionDoubleClick struct{…}` - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + A double click action. - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + - `Keys []string` - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + The keys being held while double-clicking. - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + - `Type DoubleClick` - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + - `X int64` - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + The x-coordinate where the double click occurred. - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + - `Y int64` - - `string` + The y-coordinate where the double click occurred. - - `Object Response` + - `type BetaComputerActionDrag struct{…}` - The object type of this resource - always set to `response`. + A drag action. - - `const ResponseResponse Response = "response"` + - `Path []BetaComputerActionDragPath` - - `Output []BetaResponseOutputItemUnion` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - An array of content items generated by the model. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + - `X int64` - - `type BetaResponseOutputMessage struct{…}` + The x-coordinate. - An output message from the model. + - `Y int64` - - `type BetaResponseFileSearchToolCall struct{…}` + The y-coordinate. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `Type Drag` - - `type BetaResponseFunctionToolCall struct{…}` + Specifies the event type. For a drag action, this property is always set to `drag`. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const DragDrag Drag = "drag"` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `Keys []string` - - `ID string` + The keys being held while dragging the mouse. - The unique ID of the function call tool output. + - `type BetaComputerActionKeypress struct{…}` - - `CallID string` + A collection of keypresses the model would like to perform. - The unique ID of the function tool call generated by the model. + - `Keys []string` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - The output from the function call generated by your code. - Can be a string or an list of output content. + - `Type Keypress` - - `string` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `const KeypressKeypress Keypress = "keypress"` - Text, image, or file output of the function call. + - `type BetaComputerActionMove struct{…}` - - `type BetaResponseInputText struct{…}` + A mouse move action. - A text input to the model. + - `Type Move` - - `type BetaResponseInputImage struct{…}` + Specifies the event type. For a move action, this property is always set to `move`. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const MoveMove Move = "move"` - - `type BetaResponseInputFile struct{…}` + - `X int64` - A file input to the model. + The x-coordinate to move to. - - `Status BetaResponseFunctionToolCallOutputItemStatus` + - `Y int64` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The y-coordinate to move to. - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + - `Keys []string` - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + The keys being held while moving the mouse. - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `type BetaComputerActionScreenshot struct{…}` - - `Type FunctionCallOutput` + A screenshot action. - The type of the function tool call output. Always `function_call_output`. + - `Type Screenshot` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - The agent that produced this item. + - `type BetaComputerActionScroll struct{…}` - - `AgentName string` + A scroll action. - The canonical name of the agent that produced this item. + - `ScrollX int64` - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + The horizontal scroll distance. - The execution context that produced this tool call. + - `ScrollY int64` - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + The vertical scroll distance. - - `Type Direct` + - `Type Scroll` - The caller type. Always `direct`. + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `const DirectDirect Direct = "direct"` + - `const ScrollScroll Scroll = "scroll"` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `X int64` - - `CallerID string` + The x-coordinate where the scroll occurred. - The call ID of the program item that produced this tool call. + - `Y int64` - - `Type Program` + The y-coordinate where the scroll occurred. - The caller type. Always `program`. + - `Keys []string` - - `const ProgramProgram Program = "program"` + The keys being held while scrolling. - - `CreatedBy string` + - `type BetaComputerActionType struct{…}` - The identifier of the actor that created the item. + An action to type in text. - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `Text string` - - `ID string` + The text to type. - The unique ID of the agent message. + - `Type Type` - - `Author string` + Specifies the event type. For a type action, this property is always set to `type`. - The sending agent identity. + - `const TypeType Type = "type"` - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + - `type BetaComputerActionWait struct{…}` - Encrypted content sent between agents. + A wait action. - - `type BetaResponseInputText struct{…}` + - `Type Wait` - A text input to the model. + Specifies the event type. For a wait action, this property is always set to `wait`. - - `type BetaResponseOutputText struct{…}` + - `const WaitWait Wait = "wait"` - A text output from the model. +### Beta Computer Tool - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` +- `type BetaComputerTool struct{…}` - A text content. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Text string` + - `Type Computer` - - `Type Text` + The type of the computer tool. Always `computer`. - - `const TextText Text = "text"` + - `const ComputerComputer Computer = "computer"` - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` +### Beta Computer Use Preview Tool - A summary text from the model. +- `type BetaComputerUsePreviewTool struct{…}` - - `Text string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - A summary of the reasoning output from the model so far. + - `DisplayHeight int64` - - `Type SummaryText` + The height of the computer display. - The type of the object. Always `summary_text`. + - `DisplayWidth int64` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + The width of the computer display. - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `Environment BetaComputerUsePreviewToolEnvironment` - Reasoning text from the model. + The type of computer environment to control. - - `Text string` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - The reasoning text from the model. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `Type ReasoningText` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - The type of the reasoning text. Always `reasoning_text`. + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `type BetaResponseOutputRefusal struct{…}` + - `Type ComputerUsePreview` - A refusal from the model. + The type of the computer use tool. Always `computer_use_preview`. - - `type BetaResponseInputImage struct{…}` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). +### Beta Container Auto - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` +- `type BetaContainerAuto struct{…}` - A screenshot of a computer. + - `Type ContainerAuto` - - `Detail string` + Automatically creates a container for this request - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `FileIDs []string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + An optional list of uploaded files to make available to your code. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + The memory limit for the container. - - `FileID string` + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - The identifier of an uploaded file that contains the screenshot. + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `ImageURL string` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - The URL of the screenshot image. + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `Type ComputerScreenshot` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + Network access policy for the container. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `Type Disabled` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Disable outbound network access. Always `disabled`. - - `Mode Explicit` + - `const DisabledDisabled Disabled = "disabled"` - The breakpoint mode. Always `explicit`. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + - `AllowedDomains []string` - - `type BetaResponseInputFile struct{…}` + A list of allowed domains when type is `allowlist`. - A file input to the model. + - `Type Allowlist` - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + Allow outbound network access only to specified domains. Always `allowlist`. - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `EncryptedContent string` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - Opaque encrypted content. + Optional domain-scoped secrets for allowlisted domains. - - `Type EncryptedContent` + - `Domain string` - The type of the input item. Always `encrypted_content`. + The domain associated with the secret. - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `Name string` - - `Recipient string` + The name of the secret to inject for the domain. - The destination agent identity. + - `Value string` - - `Type AgentMessage` + The secret value to inject for the domain. - The type of the item. Always `agent_message`. + - `Skills []BetaContainerAutoSkillUnion` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + An optional list of skills referenced by id or inline data. - - `Agent BetaResponseOutputItemAgentMessageAgent` + - `type BetaSkillReference struct{…}` - The agent that produced this item. + - `SkillID string` - - `AgentName string` + The ID of the referenced skill. - The canonical name of the agent that produced this item. + - `Type SkillReference` - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + References a skill created with the /v1/skills endpoint. - - `ID string` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - The unique ID of the multi-agent call item. + - `Version string` - - `Action string` + Optional skill version. Use a positive integer or 'latest'. Omit for default. - The multi-agent action to execute. + - `type BetaInlineSkill struct{…}` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + - `Description string` - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + The description of the skill. - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + - `Name string` - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + The name of the skill. - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + - `Source BetaInlineSkillSource` - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + Inline skill payload - - `Arguments string` + - `Data string` - The JSON string of arguments generated for the action. + Base64-encoded skill zip bundle. - - `CallID string` + - `MediaType ApplicationZip` - The unique ID linking this call to its output. + The media type of the inline skill payload. Must be `application/zip`. - - `Type MultiAgentCall` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - The type of the multi-agent call. Always `multi_agent_call`. + - `Type Base64` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + The type of the inline skill source. Must be `base64`. - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + - `const Base64Base64 Base64 = "base64"` - The agent that produced this item. + - `Type Inline` - - `AgentName string` + Defines an inline skill for this request. - The canonical name of the agent that produced this item. + - `const InlineInline Inline = "inline"` - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` +### Beta Container Network Policy Allowlist - - `ID string` +- `type BetaContainerNetworkPolicyAllowlist struct{…}` - The unique ID of the multi-agent call output item. + - `AllowedDomains []string` - - `Action string` + A list of allowed domains when type is `allowlist`. - The multi-agent action that produced this result. + - `Type Allowlist` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + Allow outbound network access only to specified domains. Always `allowlist`. - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + Optional domain-scoped secrets for allowlisted domains. - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + - `Domain string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + The domain associated with the secret. - - `CallID string` + - `Name string` - The unique ID of the multi-agent call. + The name of the secret to inject for the domain. - - `Output []BetaResponseOutputText` + - `Value string` - Text output returned by the multi-agent action. + The secret value to inject for the domain. - - `Annotations []BetaResponseOutputTextAnnotationUnion` +### Beta Container Network Policy Disabled - The annotations of the text output. +- `type BetaContainerNetworkPolicyDisabled struct{…}` - - `Text string` + - `Type Disabled` - The text output from the model. + Disable outbound network access. Always `disabled`. - - `Type OutputText` + - `const DisabledDisabled Disabled = "disabled"` - The type of the output text. Always `output_text`. +### Beta Container Network Policy Domain Secret - - `Logprobs []BetaResponseOutputTextLogprob` +- `type BetaContainerNetworkPolicyDomainSecret struct{…}` - - `Type MultiAgentCallOutput` + - `Domain string` - The type of the multi-agent result. Always `multi_agent_call_output`. + The domain associated with the secret. - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `Name string` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + The name of the secret to inject for the domain. - The agent that produced this item. + - `Value string` - - `AgentName string` + The secret value to inject for the domain. - The canonical name of the agent that produced this item. +### Beta Container Reference - - `type BetaResponseFunctionWebSearch struct{…}` +- `type BetaContainerReference struct{…}` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `ContainerID string` - - `type BetaResponseComputerToolCall struct{…}` + The ID of the referenced container. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `Type ContainerReference` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + References a container created with the /v1/containers endpoint - - `ID string` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - The unique ID of the computer call tool output. +### Beta Custom Tool - - `CallID string` +- `type BetaCustomTool struct{…}` - The ID of the computer tool call that produced the output. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Name string` - A computer screenshot image used with the computer use tool. + The name of the custom tool, used to identify it in tool calls. - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `Type Custom` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + The type of the custom tool. Always `custom`. - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `const CustomCustom Custom = "custom"` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `AllowedCallers []string` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + The tool invocation context(s). - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `Type ComputerCallOutput` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - The type of the computer tool call output. Always `computer_call_output`. + - `DeferLoading bool` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + Whether this tool should be deferred and discovered via tool search. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `Description string` - The safety checks reported by the API that have been acknowledged by the - developer. + Optional description of the custom tool, used to provide more context. - - `ID string` + - `Format BetaCustomToolFormatUnion` - The ID of the pending safety check. + The input format for the custom tool. Default is unconstrained text. - - `Code string` + - `type BetaCustomToolFormatText struct{…}` - The type of the pending safety check. + Unconstrained free-form text. - - `Message string` + - `Type Text` - Details about the pending safety check. + Unconstrained text format. Always `text`. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `const TextText Text = "text"` - The agent that produced this item. + - `type BetaCustomToolFormatGrammar struct{…}` - - `AgentName string` + A grammar defined by the user. - The canonical name of the agent that produced this item. + - `Definition string` - - `CreatedBy string` + The grammar definition. - The identifier of the actor that created the item. + - `Syntax string` - - `type BetaResponseReasoningItem struct{…}` + The syntax of the grammar definition. One of `lark` or `regex`. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `type BetaResponseOutputItemProgram struct{…}` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `ID string` + - `Type Grammar` - The unique ID of the program item. + Grammar format. Always `grammar`. - - `CallID string` + - `const GrammarGrammar Grammar = "grammar"` - The stable call ID of the program item. +### Beta Easy Input Message - - `Code string` +- `type BetaEasyInputMessage struct{…}` - The JavaScript source executed by programmatic tool calling. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `Fingerprint string` + - `Content BetaEasyInputMessageContentUnion` - Opaque program replay fingerprint that must be round-tripped. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - - `Type Program` + - `string` - The type of the item. Always `program`. + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - `const ProgramProgram Program = "program"` + A list of one or many input items to the model, containing different content + types. - - `Agent BetaResponseOutputItemProgramAgent` + - `type BetaResponseInputText struct{…}` - The agent that produced this item. + A text input to the model. - - `AgentName string` + - `Text string` - The canonical name of the agent that produced this item. + The text input to the model. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `Type InputText` - - `ID string` + The type of the input item. Always `input_text`. - The unique ID of the program output item. + - `const InputTextInputText InputText = "input_text"` - - `CallID string` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - The call ID of the program item. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Result string` + - `Mode Explicit` - The result produced by the program item. + The breakpoint mode. Always `explicit`. - - `Status string` + - `const ExplicitExplicit Explicit = "explicit"` - The terminal status of the program output item. + - `type BetaResponseInputImage struct{…}` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + - `Detail BetaResponseInputImageDetail` - - `Type ProgramOutput` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The type of the item. Always `program_output`. - - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - - `Agent BetaResponseOutputItemProgramOutputAgent` - - The agent that produced this item. - - - `AgentName string` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - The canonical name of the agent that produced this item. + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `type BetaResponseToolSearchCall struct{…}` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `ID string` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - The unique ID of the tool search call item. + - `Type InputImage` - - `Arguments any` + The type of the input item. Always `input_image`. - Arguments used for the tool search call. + - `const InputImageInputImage InputImage = "input_image"` - - `CallID string` + - `FileID string` - The unique ID of the tool search call generated by the model. + The ID of the file to be sent to the model. - - `Execution BetaResponseToolSearchCallExecution` + - `ImageURL string` - Whether tool search was executed by the server or by the client. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Status BetaResponseToolSearchCallStatus` + - `Mode Explicit` - The status of the tool search call item that was recorded. + The breakpoint mode. Always `explicit`. - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + - `const ExplicitExplicit Explicit = "explicit"` - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `type BetaResponseInputFile struct{…}` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + A file input to the model. - - `Type ToolSearchCall` + - `Type InputFile` - The type of the item. Always `tool_search_call`. + The type of the input item. Always `input_file`. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `const InputFileInputFile InputFile = "input_file"` - - `Agent BetaResponseToolSearchCallAgent` + - `Detail BetaResponseInputFileDetail` - The agent that produced this item. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `AgentName string` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - The canonical name of the agent that produced this item. + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `CreatedBy string` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - The identifier of the actor that created the item. + - `FileData string` - - `type BetaResponseToolSearchOutputItem struct{…}` + The content of the file to be sent to the model. - - `ID string` + - `FileID string` - The unique ID of the tool search output item. + The ID of the file to be sent to the model. - - `CallID string` + - `FileURL string` - The unique ID of the tool search call generated by the model. + The URL of the file to be sent to the model. - - `Execution BetaResponseToolSearchOutputItemExecution` + - `Filename string` - Whether tool search was executed by the server or by the client. + The name of the file to be sent to the model. - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Status BetaResponseToolSearchOutputItemStatus` + - `Mode Explicit` - The status of the tool search output item that was recorded. + The breakpoint mode. Always `explicit`. - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `const ExplicitExplicit Explicit = "explicit"` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `Role BetaEasyInputMessageRole` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - - `Tools []BetaToolUnion` + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - The loaded tool definitions returned by tool search. + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - - `type BetaFunctionTool struct{…}` + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - - `type BetaFileSearchTool struct{…}` + - `Phase BetaEasyInputMessagePhase` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + 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. - - `type BetaComputerTool struct{…}` + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - - `type BetaComputerUsePreviewTool struct{…}` + - `Type BetaEasyInputMessageType` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The type of the message input. Always `message`. - - `type BetaWebSearchTool struct{…}` + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). +### Beta File Search Tool - - `type BetaToolMcp struct{…}` +- `type BetaFileSearchTool struct{…}` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `type BetaToolCodeInterpreter struct{…}` + - `Type FileSearch` - A tool that runs Python code to help generate a response to a prompt. + The type of the file search tool. Always `file_search`. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type BetaToolImageGeneration struct{…}` + - `VectorStoreIDs []string` - A tool that generates images using the GPT image models. + The IDs of the vector stores to search. - - `type BetaToolLocalShell struct{…}` + - `Filters BetaFileSearchToolFiltersUnion` - A tool that allows the model to execute shell commands in a local environment. + A filter to apply. - - `type BetaFunctionShellTool struct{…}` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - A tool that allows the model to execute shell commands. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `type BetaCustomTool struct{…}` + - `Key string` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The key to compare against the value. - - `type BetaNamespaceTool struct{…}` + - `Type string` - Groups function/custom tools under a shared namespace. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `type BetaToolSearchTool struct{…}` + - `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 - Hosted or BYOT tool search configuration for deferred tools. + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `type BetaApplyPatchTool struct{…}` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - Allows the assistant to create, delete, or update files using unified diffs. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Type ToolSearchOutput` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The type of the item. Always `tool_search_output`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `Agent BetaResponseToolSearchOutputItemAgent` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - The agent that produced this item. + The value to compare against the attribute key; supports string, number, or boolean types. - - `AgentName string` + - `string` - The canonical name of the agent that produced this item. + - `float64` - - `CreatedBy string` + - `bool` - The identifier of the actor that created the item. + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `string` - - `ID string` + - `float64` - The unique ID of the additional tools item. + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `Role string` + Combine multiple filters using `and` or `or`. - The role that provided the additional tools. + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `Key string` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + The key to compare against the value. - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + - `Type string` - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + - `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 - - `Tools []BetaToolUnion` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - The additional tool definitions made available at this item. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `type BetaFunctionTool struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `type BetaFileSearchTool struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `type BetaComputerTool struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `type BetaComputerUsePreviewTool struct{…}` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The value to compare against the attribute key; supports string, number, or boolean types. - - `type BetaWebSearchTool struct{…}` + - `string` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `float64` - - `type BetaToolMcp struct{…}` + - `bool` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `type BetaToolCodeInterpreter struct{…}` + - `string` - A tool that runs Python code to help generate a response to a prompt. + - `float64` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `Type string` - - `type BetaToolImageGeneration struct{…}` + Type of operation: `and` or `or`. - A tool that generates images using the GPT image models. + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `type BetaToolLocalShell struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - A tool that allows the model to execute shell commands in a local environment. + - `MaxNumResults int64` - - `type BetaFunctionShellTool struct{…}` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - A tool that allows the model to execute shell commands. + - `RankingOptions BetaFileSearchToolRankingOptions` - - `type BetaCustomTool struct{…}` + Ranking options for search. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `type BetaNamespaceTool struct{…}` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - Groups function/custom tools under a shared namespace. + - `EmbeddingWeight float64` - - `type BetaToolSearchTool struct{…}` + The weight of the embedding in the reciprocal ranking fusion. - Hosted or BYOT tool search configuration for deferred tools. + - `TextWeight float64` - - `type BetaWebSearchPreviewTool struct{…}` + The weight of the text in the reciprocal ranking fusion. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Ranker string` - - `type BetaApplyPatchTool struct{…}` + The ranker to use for the file search. - Allows the assistant to create, delete, or update files using unified diffs. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `Type AdditionalTools` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - The type of the item. Always `additional_tools`. + - `ScoreThreshold float64` - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + 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. - - `Agent BetaResponseOutputItemAdditionalToolsAgent` +### Beta Function Shell Tool - The agent that produced this item. +- `type BetaFunctionShellTool struct{…}` - - `AgentName string` + A tool that allows the model to execute shell commands. - The canonical name of the agent that produced this item. + - `Type Shell` - - `type BetaResponseCompactionItem struct{…}` + The type of the shell tool. Always `shell`. - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `const ShellShell Shell = "shell"` - - `ID string` + - `AllowedCallers []string` - The unique ID of the compaction item. + The tool invocation context(s). - - `EncryptedContent string` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - The encrypted content that was produced by compaction. + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - `Type Compaction` + - `Environment BetaFunctionShellToolEnvironmentUnion` - The type of the item. Always `compaction`. + - `type BetaContainerAuto struct{…}` - - `const CompactionCompaction Compaction = "compaction"` + - `Type ContainerAuto` - - `Agent BetaResponseCompactionItemAgent` + Automatically creates a container for this request - The agent that produced this item. + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `AgentName string` + - `FileIDs []string` - The canonical name of the agent that produced this item. + An optional list of uploaded files to make available to your code. - - `CreatedBy string` + - `MemoryLimit BetaContainerAutoMemoryLimit` - The identifier of the actor that created the item. + The memory limit for the container. - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - An image generation request made by the model. + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `ID string` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - The unique ID of the image generation call. + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `Result string` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - The generated image encoded in base64. + Network access policy for the container. - - `Status string` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The status of the image generation call. + - `Type Disabled` - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + Disable outbound network access. Always `disabled`. - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + - `const DisabledDisabled Disabled = "disabled"` - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + - `AllowedDomains []string` - - `Type ImageGenerationCall` + A list of allowed domains when type is `allowlist`. - The type of the image generation call. Always `image_generation_call`. + - `Type Allowlist` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + Allow outbound network access only to specified domains. Always `allowlist`. - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `const AllowlistAllowlist Allowlist = "allowlist"` - The agent that produced this item. + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `AgentName string` + Optional domain-scoped secrets for allowlisted domains. - The canonical name of the agent that produced this item. + - `Domain string` - - `type BetaResponseCodeInterpreterToolCall struct{…}` + The domain associated with the secret. - A tool call to run code. + - `Name string` - - `type BetaResponseOutputItemLocalShellCall struct{…}` + The name of the secret to inject for the domain. - A tool call to run a command on the local shell. + - `Value string` - - `ID string` + The secret value to inject for the domain. - The unique ID of the local shell call. + - `Skills []BetaContainerAutoSkillUnion` - - `Action BetaResponseOutputItemLocalShellCallAction` + An optional list of skills referenced by id or inline data. - Execute a shell command on the server. + - `type BetaSkillReference struct{…}` - - `Command []string` + - `SkillID string` - The command to run. + The ID of the referenced skill. - - `Env map[string, string]` + - `Type SkillReference` - Environment variables to set for the command. + References a skill created with the /v1/skills endpoint. - - `Type Exec` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - The type of the local shell action. Always `exec`. + - `Version string` - - `const ExecExec Exec = "exec"` + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `TimeoutMs int64` + - `type BetaInlineSkill struct{…}` - Optional timeout in milliseconds for the command. + - `Description string` - - `User string` + The description of the skill. - Optional user to run the command as. + - `Name string` - - `WorkingDirectory string` + The name of the skill. - Optional working directory to run the command in. + - `Source BetaInlineSkillSource` - - `CallID string` + Inline skill payload - The unique ID of the local shell tool call generated by the model. + - `Data string` - - `Status string` + Base64-encoded skill zip bundle. - The status of the local shell call. + - `MediaType ApplicationZip` - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + The media type of the inline skill payload. Must be `application/zip`. - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `Type Base64` - - `Type LocalShellCall` + The type of the inline skill source. Must be `base64`. - The type of the local shell call. Always `local_shell_call`. + - `const Base64Base64 Base64 = "base64"` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `Type Inline` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + Defines an inline skill for this request. - The agent that produced this item. + - `const InlineInline Inline = "inline"` - - `AgentName string` + - `type BetaLocalEnvironment struct{…}` - The canonical name of the agent that produced this item. + - `Type Local` - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + Use a local computer environment. - The output of a local shell tool call. + - `const LocalLocal Local = "local"` - - `ID string` + - `Skills []BetaLocalSkill` - The unique ID of the local shell tool call generated by the model. + An optional list of skills. - - `Output string` + - `Description string` - A JSON string of the output of the local shell tool call. + The description of the skill. - - `Type LocalShellCallOutput` + - `Name string` - The type of the local shell tool call output. Always `local_shell_call_output`. + The name of the skill. - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `Path string` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + The path to the directory containing the skill. - The agent that produced this item. + - `type BetaContainerReference struct{…}` - - `AgentName string` + - `ContainerID string` - The canonical name of the agent that produced this item. + The ID of the referenced container. - - `Status string` + - `Type ContainerReference` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + References a container created with the /v1/containers endpoint - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` +### Beta Function Tool - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` +- `type BetaFunctionTool struct{…}` - - `type BetaResponseFunctionShellToolCall struct{…}` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - A tool call that executes one or more shell commands in a managed environment. + - `Name string` - - `ID string` + The name of the function to call. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `Parameters map[string, any]` - - `Action BetaResponseFunctionShellToolCallAction` + A JSON schema object describing the parameters of the function. - The shell commands and limits that describe how to run the tool call. + - `Strict bool` - - `Commands []string` + Whether strict parameter validation is enforced for this function tool. - - `MaxOutputLength int64` + - `Type Function` - Optional maximum number of characters to return from each command. + The type of the function tool. Always `function`. - - `TimeoutMs int64` + - `const FunctionFunction Function = "function"` - Optional timeout in milliseconds for the commands. + - `AllowedCallers []string` - - `CallID string` + The tool invocation context(s). - The unique ID of the shell tool call generated by the model. + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - Represents the use of a local environment to perform shell actions. + - `DeferLoading bool` - - `type BetaResponseLocalEnvironment struct{…}` + Whether this function is deferred and loaded via tool search. - Represents the use of a local environment to perform shell actions. + - `Description string` - - `Type Local` + A description of the function. Used by the model to determine whether or not to call the function. - The environment type. Always `local`. + - `OutputSchema map[string, any]` - - `const LocalLocal Local = "local"` + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `type BetaResponseContainerReference struct{…}` +### Beta Inline Skill - Represents a container created with /v1/containers. +- `type BetaInlineSkill struct{…}` - - `ContainerID string` + - `Description string` - - `Type ContainerReference` + The description of the skill. - The environment type. Always `container_reference`. + - `Name string` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + The name of the skill. - - `Status BetaResponseFunctionShellToolCallStatus` + - `Source BetaInlineSkillSource` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + Inline skill payload - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + - `Data string` - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + Base64-encoded skill zip bundle. - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `MediaType ApplicationZip` - - `Type ShellCall` + The media type of the inline skill payload. Must be `application/zip`. - The type of the item. Always `shell_call`. + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `const ShellCallShellCall ShellCall = "shell_call"` + - `Type Base64` - - `Agent BetaResponseFunctionShellToolCallAgent` + The type of the inline skill source. Must be `base64`. - The agent that produced this item. + - `const Base64Base64 Base64 = "base64"` - - `AgentName string` + - `Type Inline` - The canonical name of the agent that produced this item. + Defines an inline skill for this request. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `const InlineInline Inline = "inline"` - The execution context that produced this tool call. +### Beta Inline Skill Source - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` +- `type BetaInlineSkillSource struct{…}` - - `Type Direct` + Inline skill payload - - `const DirectDirect Direct = "direct"` + - `Data string` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + Base64-encoded skill zip bundle. - - `CallerID string` + - `MediaType ApplicationZip` - The call ID of the program item that produced this tool call. + The media type of the inline skill payload. Must be `application/zip`. - - `Type Program` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `const ProgramProgram Program = "program"` + - `Type Base64` - - `CreatedBy string` + The type of the inline skill source. Must be `base64`. - The ID of the entity that created this tool call. + - `const Base64Base64 Base64 = "base64"` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` +### Beta Local Environment - The output of a shell tool call that was emitted. +- `type BetaLocalEnvironment struct{…}` - - `ID string` + - `Type Local` - The unique ID of the shell call output. Populated when this item is returned via API. + Use a local computer environment. - - `CallID string` + - `const LocalLocal Local = "local"` - The unique ID of the shell tool call generated by the model. + - `Skills []BetaLocalSkill` - - `MaxOutputLength int64` + An optional list of skills. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `Description string` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + The description of the skill. - An array of shell call output contents + - `Name string` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + The name of the skill. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Path string` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + The path to the directory containing the skill. - Indicates that the shell call exceeded its configured time limit. +### Beta Local Skill - - `Type Timeout` +- `type BetaLocalSkill struct{…}` - The outcome type. Always `timeout`. + - `Description string` - - `const TimeoutTimeout Timeout = "timeout"` + The description of the skill. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `Name string` - Indicates that the shell commands finished and returned an exit code. + The name of the skill. - - `ExitCode int64` + - `Path string` - Exit code from the shell process. + The path to the directory containing the skill. - - `Type Exit` +### Beta Namespace Tool - The outcome type. Always `exit`. +- `type BetaNamespaceTool struct{…}` - - `const ExitExit Exit = "exit"` + Groups function/custom tools under a shared namespace. - - `Stderr string` + - `Description string` - The standard error output that was captured. + A description of the namespace shown to the model. - - `Stdout string` + - `Name string` - The standard output that was captured. + The namespace name used in tool calls (for example, `crm`). - - `CreatedBy string` + - `Tools []BetaNamespaceToolToolUnion` - The identifier of the actor that created the item. + The function/custom tools available inside this namespace. - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `type BetaNamespaceToolToolFunction struct{…}` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `Name string` - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `Type Function` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `const FunctionFunction Function = "function"` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + - `AllowedCallers []string` - - `Type ShellCallOutput` + The tool invocation context(s). - The type of the shell call output. Always `shell_call_output`. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `DeferLoading bool` - The agent that produced this item. + Whether this function should be deferred and discovered via tool search. - - `AgentName string` + - `Description string` - The canonical name of the agent that produced this item. + - `OutputSchema map[string, any]` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - The execution context that produced this tool call. + - `Parameters any` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `Strict bool` - - `Type Direct` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `const DirectDirect Direct = "direct"` + - `type BetaCustomTool struct{…}` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `CallerID string` + - `Name string` - The call ID of the program item that produced this tool call. + The name of the custom tool, used to identify it in tool calls. - - `Type Program` + - `Type Custom` - - `const ProgramProgram Program = "program"` + The type of the custom tool. Always `custom`. - - `CreatedBy string` + - `const CustomCustom Custom = "custom"` - The identifier of the actor that created the item. + - `AllowedCallers []string` - - `type BetaResponseApplyPatchToolCall struct{…}` + The tool invocation context(s). - A tool call that applies file diffs by creating, deleting, or updating files. + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `ID string` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `DeferLoading bool` - - `CallID string` + Whether this tool should be deferred and discovered via tool search. - The unique ID of the apply patch tool call generated by the model. + - `Description string` - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + Optional description of the custom tool, used to provide more context. - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `Format BetaCustomToolFormatUnion` - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + The input format for the custom tool. Default is unconstrained text. - Instruction describing how to create a file via the apply_patch tool. + - `type BetaCustomToolFormatText struct{…}` - - `Diff string` + Unconstrained free-form text. - Diff to apply. + - `Type Text` - - `Path string` + Unconstrained text format. Always `text`. - Path of the file to create. + - `const TextText Text = "text"` - - `Type CreateFile` + - `type BetaCustomToolFormatGrammar struct{…}` - Create a new file with the provided diff. + A grammar defined by the user. - - `const CreateFileCreateFile CreateFile = "create_file"` + - `Definition string` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + The grammar definition. - Instruction describing how to delete a file via the apply_patch tool. + - `Syntax string` - - `Path string` + The syntax of the grammar definition. One of `lark` or `regex`. - Path of the file to delete. + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `Type DeleteFile` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - Delete the specified file. + - `Type Grammar` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + Grammar format. Always `grammar`. - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `const GrammarGrammar Grammar = "grammar"` - Instruction describing how to update a file via the apply_patch tool. + - `Type Namespace` - - `Diff string` + The type of the tool. Always `namespace`. - Diff to apply. + - `const NamespaceNamespace Namespace = "namespace"` - - `Path string` +### Beta Response - Path of the file to update. +- `type BetaResponse struct{…}` - - `Type UpdateFile` + - `ID string` - Update an existing file with the provided diff. + Unique identifier for this Response. - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `CreatedAt float64` - - `Status BetaResponseApplyPatchToolCallStatus` + Unix timestamp (in seconds) of when this Response was created. - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `Error BetaResponseError` - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + An error object returned when the model fails to generate a Response. - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + - `Code BetaResponseErrorCode` - - `Type ApplyPatchCall` + The error code for the response. - The type of the item. Always `apply_patch_call`. + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` - - `Agent BetaResponseApplyPatchToolCallAgent` + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` - The agent that produced this item. + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` - - `AgentName string` + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` - The canonical name of the agent that produced this item. + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` - The execution context that produced this tool call. + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` - - `Type Direct` + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` - - `const DirectDirect Direct = "direct"` + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` - - `CallerID string` + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` - The call ID of the program item that produced this tool call. + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` - - `Type Program` + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` - - `CreatedBy string` + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` - The ID of the entity that created this tool call. + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` - The output emitted by an apply patch tool call. + - `Message string` - - `ID string` + A human-readable description of the error. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `IncompleteDetails BetaResponseIncompleteDetails` - - `CallID string` + Details about why the response is incomplete. - The unique ID of the apply patch tool call generated by the model. + - `Reason string` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + The reason why the response is incomplete. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `Instructions BetaResponseInstructionsUnion` - - `Type ApplyPatchCallOutput` + A system (or developer) message inserted into the model's context. - The type of the item. Always `apply_patch_call_output`. + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `string` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` - The agent that produced this item. + A list of one or many input items to the model, containing + different content types. - - `AgentName string` + - `type BetaEasyInputMessage struct{…}` - The canonical name of the agent that produced this item. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `Content BetaEasyInputMessageContentUnion` - The execution context that produced this tool call. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `string` - - `Type Direct` + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - `const DirectDirect Direct = "direct"` + A list of one or many input items to the model, containing different content + types. - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + - `type BetaResponseInputText struct{…}` - - `CallerID string` + A text input to the model. - The call ID of the program item that produced this tool call. + - `Text string` - - `Type Program` + The text input to the model. - - `const ProgramProgram Program = "program"` + - `Type InputText` - - `CreatedBy string` + The type of the input item. Always `input_text`. - The ID of the entity that created this tool call output. + - `const InputTextInputText InputText = "input_text"` - - `Output string` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - Optional textual output returned by the apply patch tool. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `type BetaResponseOutputItemMcpCall struct{…}` + - `Mode Explicit` - An invocation of a tool on an MCP server. + The breakpoint mode. Always `explicit`. - - `ID string` + - `const ExplicitExplicit Explicit = "explicit"` - The unique ID of the tool call. + - `type BetaResponseInputImage struct{…}` - - `Arguments string` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - A JSON string of the arguments passed to the tool. + - `Detail BetaResponseInputImageDetail` - - `Name string` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The name of the tool that was run. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `ServerLabel string` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - The label of the MCP server running the tool. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `Type McpCall` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - The type of the item. Always `mcp_call`. + - `Type InputImage` - - `const McpCallMcpCall McpCall = "mcp_call"` + The type of the input item. Always `input_image`. - - `Agent BetaResponseOutputItemMcpCallAgent` + - `const InputImageInputImage InputImage = "input_image"` - The agent that produced this item. + - `FileID string` - - `AgentName string` + The ID of the file to be sent to the model. - The canonical name of the agent that produced this item. + - `ImageURL string` - - `ApprovalRequestID string` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - 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. + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `Error string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The error from the tool call, if any. + - `Mode Explicit` - - `Output string` + The breakpoint mode. Always `explicit`. - The output from the tool call. + - `const ExplicitExplicit Explicit = "explicit"` - - `Status string` + - `type BetaResponseInputFile struct{…}` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + A file input to the model. - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + - `Type InputFile` - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + The type of the input item. Always `input_file`. - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + - `const InputFileInputFile InputFile = "input_file"` - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + - `Detail BetaResponseInputFileDetail` - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - A list of tools available on an MCP server. + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `ID string` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - The unique ID of the list. + - `FileData string` - - `ServerLabel string` + The content of the file to be sent to the model. - The label of the MCP server. + - `FileID string` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + The ID of the file to be sent to the model. - The tools available on the server. + - `FileURL string` - - `InputSchema any` + The URL of the file to be sent to the model. - The JSON schema describing the tool's input. + - `Filename string` - - `Name string` + The name of the file to be sent to the model. - The name of the tool. + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `Annotations any` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Additional annotations about the tool. + - `Mode Explicit` - - `Description string` + The breakpoint mode. Always `explicit`. - The description of the tool. + - `const ExplicitExplicit Explicit = "explicit"` - - `Type McpListTools` + - `Role BetaEasyInputMessageRole` - The type of the item. Always `mcp_list_tools`. + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - The agent that produced this item. + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - - `AgentName string` + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - The canonical name of the agent that produced this item. + - `Phase BetaEasyInputMessagePhase` - - `Error string` + 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. - Error message if the server could not list tools. + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - A request for human approval of a tool invocation. + - `Type BetaEasyInputMessageType` - - `ID string` + The type of the message input. Always `message`. - The unique ID of the approval request. + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - - `Arguments string` + - `type BetaResponseInputItemMessage struct{…}` - A JSON string of arguments for the tool. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - - `Name string` + - `Content BetaResponseInputMessageContentList` - The name of the tool to run. + A list of one or many input items to the model, containing different content + types. - - `ServerLabel string` + - `Role string` - The label of the MCP server making the request. + The role of the message input. One of `user`, `system`, or `developer`. - - `Type McpApprovalRequest` + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` - The type of the item. Always `mcp_approval_request`. + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `Agent BetaResponseInputItemMessageAgent` The agent that produced this item. @@ -37576,29 +37829,203 @@ Cancel a response The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `Status string` - A response to an MCP approval request. + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `ID string` + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - The unique ID of the approval response + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - - `ApprovalRequestID string` + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - The ID of the approval request being answered. + - `Type string` - - `Approve bool` + The type of the message input. Always set to `message`. - Whether the request was approved. + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - - `Type McpApprovalResponse` + - `type BetaResponseOutputMessage struct{…}` - The type of the item. Always `mcp_approval_response`. + An output message from the model. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `ID string` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + The unique ID of the output message. + + - `Content []BetaResponseOutputMessageContentUnion` + + The content of the output message. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation 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 BetaResponseOutputTextAnnotationFilePath 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 []BetaResponseOutputTextLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `type BetaResponseOutputRefusal 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 BetaResponseOutputMessageStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + + - `Type Message` + + The type of the output message. Always `message`. + + - `const MessageMessage Message = "message"` + + - `Agent BetaResponseOutputMessageAgent` The agent that produced this item. @@ -37606,2484 +38033,16874 @@ Cancel a response The canonical name of the agent that produced this item. - - `Reason string` + - `Phase BetaResponseOutputMessagePhase` - Optional reason for the decision. + 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. - - `type BetaResponseCustomToolCall struct{…}` + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - A call to a custom tool created by the model. + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `type BetaResponseFileSearchToolCall struct{…}` - The output of a custom tool call from your code, being sent back to the model. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - `ID string` - The unique ID of the custom tool call output item. + The unique ID of the file search tool call. - - `Status string` + - `Queries []string` + + The queries used to search for files. + + - `Status BetaResponseFileSearchToolCallStatus` + + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + + - `Type FileSearchCall` + + The type of the file search tool call. Always `file_search_call`. + + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + + - `Agent BetaResponseFileSearchToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Results []BetaResponseFileSearchToolCallResult` + + The results of the file search tool call. + + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + + 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 BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) 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 []BetaResponseComputerToolCallPendingSafetyCheck` + + 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 BetaResponseComputerToolCallStatus` The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `CreatedBy string` + - `Type BetaResponseComputerToolCallType` - The identifier of the actor that created the item. + The type of the computer call. Always `computer_call`. - - `ParallelToolCalls bool` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - Whether to allow the model to run tool calls in parallel. + - `Action BetaComputerActionUnion` - - `Temperature float64` + A click action. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `type BetaComputerActionClick struct{…}` - - `ToolChoice BetaResponseToolChoiceUnion` + A click action. - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `Button string` - - `type BetaToolChoiceOptions string` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - Controls which (if any) tool is called by the model. + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - `none` means the model will not call any tool and instead generates a message. + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - `auto` means the model can pick between generating a message or calling one or - more tools. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - `required` means the model must call one or more tools. + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + - `Type Click` - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + Specifies the event type. For a click action, this property is always `click`. - - `type BetaToolChoiceAllowed struct{…}` + - `const ClickClick Click = "click"` - Constrains the tools available to the model to a pre-defined set. + - `X int64` - - `Mode BetaToolChoiceAllowedMode` + The x-coordinate where the click occurred. - Constrains the tools available to the model to a pre-defined set. + - `Y int64` - `auto` allows the model to pick from among the allowed tools and generate a - message. + The y-coordinate where the click occurred. - `required` requires the model to call one or more of the allowed tools. + - `Keys []string` - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + The keys being held while clicking. - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + - `type BetaComputerActionDoubleClick struct{…}` - - `Tools []map[string, any]` + A double click action. - A list of tool definitions that the model should be allowed to call. + - `Keys []string` - For the Responses API, the list of tool definitions might look like: + The keys being held while double-clicking. - ```json + - `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 BetaComputerActionDrag struct{…}` + + A drag action. + + - `Path []BetaComputerActionDragPath` + + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + + ``` [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } + { x: 100, y: 200 }, + { x: 200, y: 300 } ] ``` - - `Type AllowedTools` + - `X int64` - Allowed tool configuration type. Always `allowed_tools`. + The x-coordinate. - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `Y int64` - - `type BetaToolChoiceTypes struct{…}` + The y-coordinate. - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `Type Drag` - - `Type BetaToolChoiceTypesType` + Specifies the event type. For a drag action, this property is always set to `drag`. - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `const DragDrag Drag = "drag"` - Allowed values are: + - `Keys []string` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + The keys being held while dragging the mouse. - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + - `type BetaComputerActionKeypress struct{…}` - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + A collection of keypresses the model would like to perform. - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + - `Keys []string` - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + - `Type Keypress` - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + - `const KeypressKeypress Keypress = "keypress"` - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `type BetaComputerActionMove struct{…}` - - `type BetaToolChoiceFunction struct{…}` + A mouse move action. - Use this option to force the model to call a specific function. + - `Type Move` - - `Name string` + Specifies the event type. For a move action, this property is always set to `move`. - The name of the function to call. + - `const MoveMove Move = "move"` - - `Type Function` + - `X int64` - For function calling, the type is always `function`. + The x-coordinate to move to. - - `const FunctionFunction Function = "function"` + - `Y int64` - - `type BetaToolChoiceMcp struct{…}` + The y-coordinate to move to. - Use this option to force the model to call a specific tool on a remote MCP server. + - `Keys []string` - - `ServerLabel string` + The keys being held while moving the mouse. - The label of the MCP server to use. + - `type BetaComputerActionScreenshot struct{…}` - - `Type Mcp` + A screenshot action. - For MCP tools, the type is always `mcp`. + - `Type Screenshot` - - `const McpMcp Mcp = "mcp"` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `Name string` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - The name of the tool to call on the server. + - `type BetaComputerActionScroll struct{…}` - - `type BetaToolChoiceCustom struct{…}` + A scroll action. - Use this option to force the model to call a specific custom tool. + - `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 BetaComputerActionType 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 BetaComputerActionWait 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 BetaComputerActionList` + + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `type BetaComputerActionDoubleClick struct{…}` + + A double click action. + + - `type BetaComputerActionDrag struct{…}` + + A drag action. + + - `type BetaComputerActionKeypress struct{…}` + + A collection of keypresses the model would like to perform. + + - `type BetaComputerActionMove struct{…}` + + A mouse move action. + + - `type BetaComputerActionScreenshot struct{…}` + + A screenshot action. + + - `type BetaComputerActionScroll struct{…}` + + A scroll action. + + - `type BetaComputerActionType struct{…}` + + An action to type in text. + + - `type BetaComputerActionWait struct{…}` + + A wait action. + + - `Agent BetaResponseComputerToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemComputerCallOutput struct{…}` + + The output of a computer tool call. + + - `CallID string` + + The ID of the computer tool call that produced the output. + + - `Output BetaResponseComputerToolCallOutputScreenshot` + + 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. + + - `Type ComputerCallOutput` + + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + + - `ID string` + + The ID of the computer tool call output. + + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + + 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. + + - `Agent BetaResponseInputItemComputerCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + + - `type BetaResponseFunctionWebSearch struct{…}` + + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + + - `ID string` + + The unique ID of the web search tool call. + + - `Action BetaResponseFunctionWebSearchActionUnion` + + 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 BetaResponseFunctionWebSearchActionSearch 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 []BetaResponseFunctionWebSearchActionSearchSource` + + 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 BetaResponseFunctionWebSearchActionOpenPage 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 BetaResponseFunctionWebSearchActionFindInPage 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 BetaResponseFunctionWebSearchStatus` + + The status of the web search tool call. + + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + + - `Type WebSearchCall` + + The type of the web search tool call. Always `web_search_call`. + + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + + - `Agent BetaResponseFunctionWebSearchAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseFunctionToolCall struct{…}` + + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + + - `Arguments string` + + A JSON string of the arguments to pass to the function. + + - `CallID string` + + The unique ID of the function tool call generated by the model. - `Name string` - The name of the custom tool to call. + The name of the function to run. - - `Type Custom` + - `Type FunctionCall` - For custom tool calling, the type is always `custom`. + The type of the function tool call. Always `function_call`. - - `const CustomCustom Custom = "custom"` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `ID string` - - `Type ProgrammaticToolCalling` + The unique ID of the function tool call. - The tool to call. Always `programmatic_tool_calling`. + - `Agent BetaResponseFunctionToolCallAgent` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + The agent that produced this item. - - `type BetaToolChoiceApplyPatch struct{…}` + - `AgentName string` - Forces the model to call the apply_patch tool when executing a tool call. + The canonical name of the agent that produced this item. - - `Type ApplyPatch` + - `Caller BetaResponseFunctionToolCallCallerUnion` - The tool to call. Always `apply_patch`. + The execution context that produced this tool call. - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `type BetaToolChoiceShell struct{…}` + - `Type Direct` - Forces the model to call the shell tool when a tool call is required. + - `const DirectDirect Direct = "direct"` - - `Type Shell` + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - The tool to call. Always `shell`. + - `CallerID string` - - `const ShellShell Shell = "shell"` + The call ID of the program item that produced this tool call. - - `Tools []BetaToolUnion` + - `Type Program` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + - `const ProgramProgram Program = "program"` - We support the following categories of tools: + - `Namespace string` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + The namespace of the function to run. - - `type BetaFunctionTool struct{…}` + - `Status BetaResponseFunctionToolCallStatus` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `type BetaFileSearchTool struct{…}` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `type BetaComputerTool struct{…}` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `type BetaComputerUsePreviewTool struct{…}` + The output of a function tool call. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `CallID string` - - `type BetaWebSearchTool struct{…}` + The unique ID of the function tool call generated by the model. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - - `type BetaToolMcp struct{…}` + Text, image, or file output of the function tool call. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `string` - - `type BetaToolCodeInterpreter struct{…}` + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - A tool that runs Python code to help generate a response to a prompt. + An array of content outputs (text, image, file) for the function tool call. + + - `type BetaResponseInputTextContent 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"` + + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputImageContent struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + + - `Type InputImage` + + The type of the input item. Always `input_image`. + + - `const InputImageInputImage InputImage = "input_image"` + + - `Detail BetaResponseInputImageContentDetail` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + + - `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. + + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFileContent struct{…}` + + A file input to the model. + + - `Type InputFile` + + The type of the input item. Always `input_file`. + + - `const InputFileInputFile InputFile = "input_file"` + + - `Detail BetaResponseInputFileContentDetail` + + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + + - `FileData string` + + The base64-encoded data 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. + + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `Type FunctionCallOutput` + + The type of the function tool call output. Always `function_call_output`. + + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + + - `ID string` + + The unique ID of the function tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemFunctionCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Status string` + + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + + - `type BetaResponseInputItemAgentMessage struct{…}` + + A message routed between agents. + + - `Author string` + + The sending agent identity. + + - `Content []BetaResponseInputItemAgentMessageContentUnion` + + Plaintext, image, or encrypted content sent between agents. + + - `type BetaResponseInputTextContent struct{…}` + + A text input to the model. + + - `type BetaResponseInputImageContent struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + + Opaque encrypted content that Responses API decrypts inside trusted model execution. + + - `EncryptedContent string` + + Opaque encrypted content. + + - `Type EncryptedContent` + + The type of the input item. Always `encrypted_content`. + + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + + - `Recipient string` + + The destination agent identity. + + - `Type AgentMessage` + + The item type. Always `agent_message`. + + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + + - `ID string` + + The unique ID of this agent message item. + + - `Agent BetaResponseInputItemAgentMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemMultiAgentCall struct{…}` + + - `Action string` + + The multi-agent action that was executed. + + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + + - `Arguments string` + + The action arguments as a JSON string. + + - `CallID string` + + The unique ID linking this call to its output. + + - `Type MultiAgentCall` + + The item type. Always `multi_agent_call`. + + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + + - `ID string` + + The unique ID of this multi-agent call. + + - `Agent BetaResponseInputItemMultiAgentCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + + - `Action string` + + The multi-agent action that produced this result. + + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + + - `CallID string` + + The unique ID of the multi-agent call. + + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + + Text output returned by the multi-agent action. + + - `Text string` + + The text content. + + - `Type OutputText` + + The content type. Always `output_text`. + + - `const OutputTextOutputText OutputText = "output_text"` + + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + + Citations associated with the text content. + + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + + - `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 citation type. Always `file_citation`. + + - `const FileCitationFileCitation FileCitation = "file_citation"` + + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + + - `EndIndex int64` + + The index of the last character of the citation in the message. + + - `StartIndex int64` + + The index of the first character of the citation in the message. + + - `Title string` + + The title of the cited resource. + + - `Type URLCitation` + + The citation type. Always `url_citation`. + + - `const URLCitationURLCitation URLCitation = "url_citation"` + + - `URL string` + + The URL of the cited resource. + + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + + - `ContainerID string` + + The ID of the container. + + - `EndIndex int64` + + The index of the last character of the citation in the message. + + - `FileID string` + + The ID of the container file. + + - `Filename string` + + The filename of the container file cited. + + - `StartIndex int64` + + The index of the first character of the citation in the message. + + - `Type ContainerFileCitation` + + The citation type. Always `container_file_citation`. + + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + + - `Type MultiAgentCallOutput` + + The item type. Always `multi_agent_call_output`. + + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + + - `ID string` + + The unique ID of this multi-agent call output. + + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemToolSearchCall struct{…}` + + - `Arguments any` + + The arguments supplied to the tool search call. + + - `Type ToolSearchCall` + + The item type. Always `tool_search_call`. + + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + + - `ID string` + + The unique ID of this tool search call. + + - `Agent BetaResponseInputItemToolSearchCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CallID string` + + The unique ID of the tool search call generated by the model. + + - `Execution string` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + + - `Status string` + + The status of the tool search call. + + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + + - `Tools []BetaToolUnion` + + The loaded tool definitions returned by the tool search output. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `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 strict parameter validation is enforced for this function tool. + + - `Type Function` + + The type of the function tool. Always `function`. + + - `const FunctionFunction Function = "function"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + + - `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. + + - `OutputSchema map[string, any]` + + A JSON schema object describing the JSON value encoded in string outputs for this function. + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `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 BetaFileSearchToolFiltersUnion` + + A filter to apply. + + - `type BetaFileSearchToolFiltersComparisonFilter 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 string` + + 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 BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + + The value to compare against the attribute key; supports string, number, or boolean types. + + - `string` + + - `float64` + + - `bool` + + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` + + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + + Combine multiple filters using `and` or `or`. + + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + + - `type BetaFileSearchToolFiltersCompoundFilterFilter 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 string` + + 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 BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + + The value to compare against the attribute key; supports string, number, or boolean types. + + - `string` + + - `float64` + + - `bool` + + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` + + - `Type string` + + Type of operation: `and` or `or`. + + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + + - `MaxNumResults int64` + + The maximum number of results to return. This number should be between 1 and 50 inclusive. + + - `RankingOptions BetaFileSearchToolRankingOptions` + + Ranking options for search. + + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + + 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 BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "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 BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `Type Computer` + + The type of the computer tool. Always `computer`. + + - `const ComputerComputer Computer = "computer"` + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `DisplayHeight int64` + + The height of the computer display. + + - `DisplayWidth int64` + + The width of the computer display. + + - `Environment BetaComputerUsePreviewToolEnvironment` + + The type of computer environment to control. + + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + + - `Type ComputerUsePreview` + + The type of the computer use tool. Always `computer_use_preview`. + + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `Type BetaWebSearchToolType` + + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + + - `Filters BetaWebSearchToolFilters` + + 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 BetaWebSearchToolSearchContextSize` + + 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 BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + + - `UserLocation BetaWebSearchToolUserLocation` + + 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](https://en.wikipedia.org/wiki/ISO_3166-1) 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](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + + - `Type string` + + The type of location approximation. Always `approximate`. + + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + + - `AllowedTools BetaToolMcpAllowedToolsUnion` + + List of allowed tool names or a filter object. + + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + + A string array of allowed tool names + + - `type BetaToolMcpAllowedToolsMcpToolFilter 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`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + 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 BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "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 BetaToolMcpRequireApprovalUnion` + + Specify which of the MCP server's tools require approval. + + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter 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 BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + + 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`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + + - `ToolNames []string` + + List of allowed tool names. + + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + + 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`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + + - `ToolNames []string` + + List of allowed tool names. + + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting 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 BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "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 BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `Container BetaToolCodeInterpreterContainerUnion` + + 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 BetaToolCodeInterpreterContainerCodeInterpreterToolAuto 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 BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + + Network access policy for the container. + + - `type BetaContainerNetworkPolicyDisabled struct{…}` + + - `Type Disabled` + + Disable outbound network access. Always `disabled`. + + - `const DisabledDisabled Disabled = "disabled"` + + - `type BetaContainerNetworkPolicyAllowlist 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 []BetaContainerNetworkPolicyDomainSecret` + + 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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `Type ProgrammaticToolCalling` + + The type of the tool. Always `programmatic_tool_calling`. + + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + + - `type BetaToolImageGeneration 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 BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "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 BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "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 BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + + - `InputImageMask BetaToolImageGenerationInputImageMask` + + 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 BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + + - `Moderation string` + + Moderation level for the generated image. Default: `auto`. + + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "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 BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "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 BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "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 BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + + - `type BetaToolLocalShell 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 BetaFunctionShellTool 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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + + - `Environment BetaFunctionShellToolEnvironmentUnion` + + - `type BetaContainerAuto 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 BetaContainerAutoMemoryLimit` + + The memory limit for the container. + + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + + Network access policy for the container. + + - `type BetaContainerNetworkPolicyDisabled struct{…}` + + - `type BetaContainerNetworkPolicyAllowlist struct{…}` + + - `Skills []BetaContainerAutoSkillUnion` + + An optional list of skills referenced by id or inline data. + + - `type BetaSkillReference 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 BetaInlineSkill struct{…}` + + - `Description string` + + The description of the skill. + + - `Name string` + + The name of the skill. + + - `Source BetaInlineSkillSource` + + 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 BetaLocalEnvironment struct{…}` + + - `Type Local` + + Use a local computer environment. + + - `const LocalLocal Local = "local"` + + - `Skills []BetaLocalSkill` + + 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 BetaContainerReference 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 BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + + - `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 BetaCustomToolFormatUnion` + + The input format for the custom tool. Default is unconstrained text. + + - `type BetaCustomToolFormatText struct{…}` + + Unconstrained free-form text. + + - `Type Text` + + Unconstrained text format. Always `text`. + + - `const TextText Text = "text"` + + - `type BetaCustomToolFormatGrammar 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 BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + + - `Type Grammar` + + Grammar format. Always `grammar`. + + - `const GrammarGrammar Grammar = "grammar"` + + - `type BetaNamespaceTool 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 []BetaNamespaceToolToolUnion` + + The function/custom tools available inside this namespace. + + - `type BetaNamespaceToolToolFunction struct{…}` + + - `Name string` + + - `Type Function` + + - `const FunctionFunction Function = "function"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + + - `DeferLoading bool` + + Whether this function should be deferred and discovered via tool search. + + - `Description string` + + - `OutputSchema map[string, any]` + + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + + - `Parameters any` + + - `Strict bool` + + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `Type Namespace` + + The type of the tool. Always `namespace`. + + - `const NamespaceNamespace Namespace = "namespace"` + + - `type BetaToolSearchTool 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 BetaToolSearchToolExecution` + + Whether tool search is executed by the server or by the client. + + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + + - `Parameters any` + + Parameter schema for a client-executed tool search tool. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `Type BetaWebSearchPreviewToolType` + + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + + - `SearchContentTypes []string` + + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + + 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 BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + + - `UserLocation BetaWebSearchPreviewToolUserLocation` + + 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](https://en.wikipedia.org/wiki/ISO_3166-1) 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](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + + - `type BetaApplyPatchTool 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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + + - `Type ToolSearchOutput` + + The item type. Always `tool_search_output`. + + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + + - `ID string` + + The unique ID of this tool search output. + + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CallID string` + + The unique ID of the tool search call generated by the model. + + - `Execution BetaResponseToolSearchOutputItemParamExecution` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + + - `Status BetaResponseToolSearchOutputItemParamStatus` + + The status of the tool search output. + + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + + - `type BetaResponseInputItemAdditionalTools struct{…}` + + - `Role Developer` + + The role that provided the additional tools. Only `developer` is supported. + + - `const DeveloperDeveloper Developer = "developer"` + + - `Tools []BetaToolUnion` + + A list of additional tools made available at this item. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool struct{…}` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `Type AdditionalTools` + + The item type. Always `additional_tools`. + + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + + - `ID string` + + The unique ID of this additional tools item. + + - `Agent BetaResponseInputItemAdditionalToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + + - `ID string` + + The unique identifier of the reasoning content. + + - `Summary []BetaResponseReasoningItemSummary` + + 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"` + + - `Agent BetaResponseReasoningItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Content []BetaResponseReasoningItemContent` + + 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 BetaResponseReasoningItemStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + + - `type BetaResponseCompactionItemParamResp struct{…}` + + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + + - `EncryptedContent string` + + The encrypted content of the compaction summary. + + - `Type Compaction` + + The type of the item. Always `compaction`. + + - `const CompactionCompaction Compaction = "compaction"` + + - `ID string` + + The ID of the compaction item. + + - `Agent BetaResponseCompactionItemParamAgentResp` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemImageGenerationCall 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 BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + + - `Type ImageGenerationCall` + + The type of the image generation call. Always `image_generation_call`. + + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + + - `Agent BetaResponseInputItemImageGenerationCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseCodeInterpreterToolCall 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 []BetaResponseCodeInterpreterToolCallOutputUnion` + + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. + + - `type BetaResponseCodeInterpreterToolCallOutputLogs 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 BetaResponseCodeInterpreterToolCallOutputImage 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 BetaResponseCodeInterpreterToolCallStatus` + + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + + - `Type CodeInterpreterCall` + + The type of the code interpreter tool call. Always `code_interpreter_call`. + + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + + - `Agent BetaResponseCodeInterpreterToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemLocalShellCall struct{…}` + + A tool call to run a command on the local shell. + + - `ID string` + + The unique ID of the local shell call. + + - `Action BetaResponseInputItemLocalShellCallAction` + + 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 BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + + - `Type LocalShellCall` + + The type of the local shell call. Always `local_shell_call`. + + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + + - `Agent BetaResponseInputItemLocalShellCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemLocalShellCallOutput 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"` + + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of the item. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + + - `type BetaResponseInputItemShellCall struct{…}` + + A tool representing a request to execute one or more shell commands. + + - `Action BetaResponseInputItemShellCallAction` + + The shell commands and limits that describe how to run the tool call. + + - `Commands []string` + + Ordered shell commands for the execution environment to run. + + - `MaxOutputLength int64` + + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + + - `TimeoutMs int64` + + Maximum wall-clock time in milliseconds to allow the shell commands to run. + + - `CallID string` + + The unique ID of the shell tool call generated by the model. + + - `Type ShellCall` + + The type of the item. Always `shell_call`. + + - `const ShellCallShellCall ShellCall = "shell_call"` + + - `ID string` + + The unique ID of the shell tool call. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemShellCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemShellCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + + The environment to execute the shell commands in. + + - `type BetaLocalEnvironment struct{…}` + + - `type BetaContainerReference struct{…}` + + - `Status string` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + + - `type BetaResponseInputItemShellCallOutput struct{…}` + + The streamed output items emitted by a shell tool call. + + - `CallID string` + + The unique ID of the shell tool call generated by the model. + + - `Output []BetaResponseFunctionShellCallOutputContent` + + Captured chunks of stdout and stderr output, along with their associated outcomes. + + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + + The exit or timeout outcome associated with this shell call. + + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + + Indicates that the shell call exceeded its configured time limit. + + - `Type Timeout` + + The outcome type. Always `timeout`. + + - `const TimeoutTimeout Timeout = "timeout"` + + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + + Indicates that the shell commands finished and returned an exit code. + + - `ExitCode int64` + + The exit code returned by the shell process. + + - `Type Exit` + + The outcome type. Always `exit`. + + - `const ExitExit Exit = "exit"` + + - `Stderr string` + + Captured stderr output for the shell call. + + - `Stdout string` + + Captured stdout output for the shell call. + + - `Type ShellCallOutput` + + The type of the item. Always `shell_call_output`. + + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + + - `ID string` + + The unique ID of the shell tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemShellCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `MaxOutputLength int64` + + The maximum number of UTF-8 characters captured for this shell call's combined output. + + - `Status string` + + The status of the shell call output. + + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + + - `type BetaResponseInputItemApplyPatchCall struct{…}` + + A tool call representing a request to create, delete, or update files using diff patches. + + - `CallID string` + + The unique ID of the apply patch tool call generated by the model. + + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + + The specific create, delete, or update instruction for the apply_patch tool call. + + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + + Instruction for creating a new file via the apply_patch tool. + + - `Diff string` + + Unified diff content to apply when creating the file. + + - `Path string` + + Path of the file to create relative to the workspace root. + + - `Type CreateFile` + + The operation type. Always `create_file`. + + - `const CreateFileCreateFile CreateFile = "create_file"` + + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + + Instruction for deleting an existing file via the apply_patch tool. + + - `Path string` + + Path of the file to delete relative to the workspace root. + + - `Type DeleteFile` + + The operation type. Always `delete_file`. + + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + + Instruction for updating an existing file via the apply_patch tool. + + - `Diff string` + + Unified diff content to apply to the existing file. + + - `Path string` + + Path of the file to update relative to the workspace root. + + - `Type UpdateFile` + + The operation type. Always `update_file`. + + - `const UpdateFileUpdateFile UpdateFile = "update_file"` + + - `Status string` + + The status of the apply patch tool call. One of `in_progress` or `completed`. + + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + + - `Type ApplyPatchCall` + + The type of the item. Always `apply_patch_call`. + + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + + - `ID string` + + The unique ID of the apply patch tool call. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemApplyPatchCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + + The streamed output emitted by an apply patch tool call. + + - `CallID string` + + The unique ID of the apply patch tool call generated by the model. + + - `Status string` + + The status of the apply patch tool call output. One of `completed` or `failed`. + + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + + - `Type ApplyPatchCallOutput` + + The type of the item. Always `apply_patch_call_output`. + + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + + - `ID string` + + The unique ID of the apply patch tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Output string` + + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + + - `type BetaResponseInputItemMcpListTools 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 []BetaResponseInputItemMcpListToolsTool` + + 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"` + + - `Agent BetaResponseInputItemMcpListToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Error string` + + Error message if the server could not list tools. + + - `type BetaResponseInputItemMcpApprovalRequest 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"` + + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + + A response to an MCP approval request. + + - `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"` + + - `ID string` + + The unique ID of the approval response + + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Reason string` + + Optional reason for the decision. + + - `type BetaResponseInputItemMcpCall 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"` + + - `Agent BetaResponseInputItemMcpCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `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 BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + + - `type BetaResponseCustomToolCallOutput struct{…}` + + The output of a custom tool call from your code, being sent back to the model. + + - `CallID string` + + The call ID, used to map this custom tool call output to a custom tool call. + + - `Output BetaResponseCustomToolCallOutputOutputUnion` + + The output from the custom tool call generated by your code. + Can be a string or an list of output content. + + - `string` + + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + + Text, image, or file output of the custom tool call. + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type CustomToolCallOutput` + + The type of the custom tool call output. Always `custom_tool_call_output`. + + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + + - `ID string` + + The unique ID of the custom tool call output in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseCustomToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. + + - `CallID string` + + An identifier used to map this custom tool call to a tool call output. + + - `Input string` + + The input for the custom tool call generated by the model. + + - `Name string` + + The name of the custom tool being called. + + - `Type CustomToolCall` + + The type of the custom tool call. Always `custom_tool_call`. + + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + + - `ID string` + + The unique ID of the custom tool call in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseCustomToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `Namespace string` + + The namespace of the custom tool being called. + + - `type BetaResponseInputItemCompactionTrigger struct{…}` + + Compacts the current context. Must be the final input item. + + - `Type CompactionTrigger` + + The type of the item. Always `compaction_trigger`. + + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + + - `Agent BetaResponseInputItemCompactionTriggerAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemItemReference struct{…}` + + An internal identifier for an item to reference. + + - `ID string` + + The ID of the item to reference. + + - `Agent BetaResponseInputItemItemReferenceAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Type string` + + The type of item to reference. Always `item_reference`. + + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + + - `type BetaResponseInputItemProgram struct{…}` + + - `ID string` + + The unique ID of this program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The item type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseInputItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of this program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output. + + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The item type. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseInputItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Metadata map[string, string]` + + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + + - `Model BetaResponseModel` + + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + + - `type BetaResponseModel string` + + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + + - `const BetaResponseModelO3 BetaResponseModel = "o3"` + + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + + - `const BetaResponseModelO1 BetaResponseModel = "o1"` + + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + + - `string` + + - `Object Response` + + The object type of this resource - always set to `response`. + + - `const ResponseResponse Response = "response"` + + - `Output []BetaResponseOutputItemUnion` + + An array of content items generated by the model. + + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + + - `type BetaResponseOutputMessage struct{…}` + + An output message from the model. + + - `type BetaResponseFileSearchToolCall struct{…}` + + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + + - `type BetaResponseFunctionToolCall struct{…}` + + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + + - `type BetaResponseFunctionToolCallOutputItem 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 BetaResponseFunctionToolCallOutputItemOutputUnion` + + The output from the function call generated by your code. + Can be a string or an list of output content. + + - `string` + + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + + Text, image, or file output of the function call. + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Status BetaResponseFunctionToolCallOutputItemStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + + - `Type FunctionCallOutput` + + The type of the function tool call output. Always `function_call_output`. + + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + + - `Agent BetaResponseFunctionToolCallOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemAgentMessage struct{…}` + + - `ID string` + + The unique ID of the agent message. + + - `Author string` + + The sending agent identity. + + - `Content []BetaResponseOutputItemAgentMessageContentUnion` + + Encrypted content sent between agents. + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + + A text content. + + - `Text string` + + - `Type Text` + + - `const TextText Text = "text"` + + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + + A summary text from the model. + + - `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 BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + + Reasoning text from the model. + + - `Text string` + + The reasoning text from the model. + + - `Type ReasoningText` + + The type of the reasoning text. Always `reasoning_text`. + + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + + - `type BetaResponseOutputRefusal struct{…}` + + A refusal from the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + + A screenshot of a computer. + + - `Detail string` + + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + + - `FileID string` + + The identifier of an uploaded file that contains the screenshot. + + - `ImageURL string` + + The URL of the screenshot image. + + - `Type ComputerScreenshot` + + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + + Opaque encrypted content that Responses API decrypts inside trusted model execution. + + - `EncryptedContent string` + + Opaque encrypted content. + + - `Type EncryptedContent` + + The type of the input item. Always `encrypted_content`. + + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + + - `Recipient string` + + The destination agent identity. + + - `Type AgentMessage` + + The type of the item. Always `agent_message`. + + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + + - `Agent BetaResponseOutputItemAgentMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMultiAgentCall struct{…}` + + - `ID string` + + The unique ID of the multi-agent call item. + + - `Action string` + + The multi-agent action to execute. + + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + + - `Arguments string` + + The JSON string of arguments generated for the action. + + - `CallID string` + + The unique ID linking this call to its output. + + - `Type MultiAgentCall` + + The type of the multi-agent call. Always `multi_agent_call`. + + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + + - `Agent BetaResponseOutputItemMultiAgentCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + + - `ID string` + + The unique ID of the multi-agent call output item. + + - `Action string` + + The multi-agent action that produced this result. + + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + + - `CallID string` + + The unique ID of the multi-agent call. + + - `Output []BetaResponseOutputText` + + Text output returned by the multi-agent action. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `Text string` + + The text output from the model. + + - `Type OutputText` + + The type of the output text. Always `output_text`. + + - `Logprobs []BetaResponseOutputTextLogprob` + + - `Type MultiAgentCallOutput` + + The type of the multi-agent result. Always `multi_agent_call_output`. + + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseFunctionWebSearch struct{…}` + + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + + - `type BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + + - `type BetaResponseComputerToolCallOutputItem 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 BetaResponseComputerToolCallOutputScreenshot` + + A computer screenshot image used with the computer use tool. + + - `Status BetaResponseComputerToolCallOutputItemStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + + - `Type ComputerCallOutput` + + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + + 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. + + - `Agent BetaResponseComputerToolCallOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + + - `type BetaResponseOutputItemProgram struct{…}` + + - `ID string` + + The unique ID of the program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The type of the item. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseOutputItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of the program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output item. + + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The type of the item. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseOutputItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseToolSearchCall 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 BetaResponseToolSearchCallExecution` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + + - `Status BetaResponseToolSearchCallStatus` + + The status of the tool search call item that was recorded. + + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + + - `Type ToolSearchCall` + + The type of the item. Always `tool_search_call`. + + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + + - `Agent BetaResponseToolSearchCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseToolSearchOutputItem 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 BetaResponseToolSearchOutputItemExecution` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + + - `Status BetaResponseToolSearchOutputItemStatus` + + The status of the tool search output item that was recorded. + + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + + - `Tools []BetaToolUnion` + + The loaded tool definitions returned by tool search. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool struct{…}` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `Type ToolSearchOutput` + + The type of the item. Always `tool_search_output`. + + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + + - `Agent BetaResponseToolSearchOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemAdditionalTools struct{…}` + + - `ID string` + + The unique ID of the additional tools item. + + - `Role string` + + The role that provided the additional tools. + + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + + - `Tools []BetaToolUnion` + + The additional tool definitions made available at this item. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool 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"` + + - `Agent BetaResponseOutputItemAdditionalToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseCompactionItem struct{…}` + + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + + - `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"` + + - `Agent BetaResponseCompactionItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemImageGenerationCall 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 BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + + - `Type ImageGenerationCall` + + The type of the image generation call. Always `image_generation_call`. + + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + + - `Agent BetaResponseOutputItemImageGenerationCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseCodeInterpreterToolCall struct{…}` + + A tool call to run code. + + - `type BetaResponseOutputItemLocalShellCall struct{…}` + + A tool call to run a command on the local shell. + + - `ID string` + + The unique ID of the local shell call. + + - `Action BetaResponseOutputItemLocalShellCallAction` + + 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 BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + + - `Type LocalShellCall` + + The type of the local shell call. Always `local_shell_call`. + + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + + - `Agent BetaResponseOutputItemLocalShellCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemLocalShellCallOutput 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"` + + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of the item. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + + - `type BetaResponseFunctionShellToolCall 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 BetaResponseFunctionShellToolCallAction` + + 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 BetaResponseFunctionShellToolCallEnvironmentUnion` + + Represents the use of a local environment to perform shell actions. + + - `type BetaResponseLocalEnvironment struct{…}` + + Represents the use of a local environment to perform shell actions. + + - `Type Local` + + The environment type. Always `local`. + + - `const LocalLocal Local = "local"` + + - `type BetaResponseContainerReference struct{…}` + + Represents a container created with /v1/containers. + + - `ContainerID string` + + - `Type ContainerReference` + + The environment type. Always `container_reference`. + + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + + - `Status BetaResponseFunctionShellToolCallStatus` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + + - `Type ShellCall` + + The type of the item. Always `shell_call`. + + - `const ShellCallShellCall ShellCall = "shell_call"` + + - `Agent BetaResponseFunctionShellToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionShellToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The ID of the entity that created this tool call. + + - `type BetaResponseFunctionShellToolCallOutput 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 []BetaResponseFunctionShellToolCallOutputOutput` + + An array of shell call output contents + + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + + Indicates that the shell call exceeded its configured time limit. + + - `Type Timeout` + + The outcome type. Always `timeout`. + + - `const TimeoutTimeout Timeout = "timeout"` + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit 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 BetaResponseFunctionShellToolCallOutputStatus` + + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + + - `Type ShellCallOutput` + + The type of the shell call output. Always `shell_call_output`. + + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + + - `Agent BetaResponseFunctionShellToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseApplyPatchToolCall 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 BetaResponseApplyPatchToolCallOperationUnion` + + One of the create_file, delete_file, or update_file operations applied via apply_patch. + + - `type BetaResponseApplyPatchToolCallOperationCreateFile 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 BetaResponseApplyPatchToolCallOperationDeleteFile 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 BetaResponseApplyPatchToolCallOperationUpdateFile 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 BetaResponseApplyPatchToolCallStatus` + + The status of the apply patch tool call. One of `in_progress` or `completed`. + + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + + - `Type ApplyPatchCall` + + The type of the item. Always `apply_patch_call`. + + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + + - `Agent BetaResponseApplyPatchToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseApplyPatchToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The ID of the entity that created this tool call. + + - `type BetaResponseApplyPatchToolCallOutput 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 BetaResponseApplyPatchToolCallOutputStatus` + + The status of the apply patch tool call output. One of `completed` or `failed`. + + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + + - `Type ApplyPatchCallOutput` + + The type of the item. Always `apply_patch_call_output`. + + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + + - `Agent BetaResponseApplyPatchToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `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 BetaResponseOutputItemMcpCall 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"` + + - `Agent BetaResponseOutputItemMcpCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `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 BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + + - `type BetaResponseOutputItemMcpListTools 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 []BetaResponseOutputItemMcpListToolsTool` + + 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"` + + - `Agent BetaResponseOutputItemMcpListToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Error string` + + Error message if the server could not list tools. + + - `type BetaResponseOutputItemMcpApprovalRequest 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"` + + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMcpApprovalResponse 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"` + + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Reason string` + + Optional reason for the decision. + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. + + - `type BetaResponseCustomToolCallOutputItem 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 BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `ParallelToolCalls bool` + + Whether to allow the model to run tool calls in parallel. + + - `Temperature float64` + + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. + + - `ToolChoice BetaResponseToolChoiceUnion` + + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. + + - `type BetaToolChoiceOptions string` + + Controls which (if any) tool is called by the model. + + `none` means the model will not call any tool and instead generates a message. + + `auto` means the model can pick between generating a message or calling one or + more tools. + + `required` means the model must call one or more tools. + + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + + - `type BetaToolChoiceAllowed struct{…}` + + Constrains the tools available to the model to a pre-defined set. + + - `Mode BetaToolChoiceAllowedMode` + + Constrains the tools available to the model to a pre-defined set. + + `auto` allows the model to pick from among the allowed tools and generate a + message. + + `required` requires the model to call one or more of the allowed tools. + + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + + - `Tools []map[string, any]` + + A list of tool definitions that the model should be allowed to call. + + For the Responses API, the list of tool definitions might look like: + + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` + + - `Type AllowedTools` + + Allowed tool configuration type. Always `allowed_tools`. + + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + + - `type BetaToolChoiceTypes struct{…}` + + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + + - `Type BetaToolChoiceTypesType` + + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + + Allowed values are: + + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` + + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + + - `type BetaToolChoiceFunction struct{…}` + + Use this option to force the model to call a specific function. + + - `Name string` + + The name of the function to call. + + - `Type Function` + + For function calling, the type is always `function`. + + - `const FunctionFunction Function = "function"` + + - `type BetaToolChoiceMcp struct{…}` + + Use this option to force the model to call a specific tool on a remote MCP server. + + - `ServerLabel string` + + The label of the MCP server to use. + + - `Type Mcp` + + For MCP tools, the type is always `mcp`. + + - `const McpMcp Mcp = "mcp"` + + - `Name string` + + The name of the tool to call on the server. + + - `type BetaToolChoiceCustom struct{…}` + + Use this option to force the model to call a specific custom tool. + + - `Name string` + + The name of the custom tool to call. + + - `Type Custom` + + For custom tool calling, the type is always `custom`. + + - `const CustomCustom Custom = "custom"` + + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + + - `Type ProgrammaticToolCalling` + + The tool to call. Always `programmatic_tool_calling`. + + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + + - `type BetaToolChoiceApplyPatch struct{…}` + + Forces the model to call the apply_patch tool when executing a tool call. + + - `Type ApplyPatch` + + The tool to call. Always `apply_patch`. + + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + + - `type BetaToolChoiceShell struct{…}` + + Forces the model to call the shell tool when a tool call is required. + + - `Type Shell` + + The tool to call. Always `shell`. + + - `const ShellShell Shell = "shell"` + + - `Tools []BetaToolUnion` + + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool struct{…}` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `TopP float64` + + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. + + We generally recommend altering this or `temperature` but not both. + + - `Background bool` + + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). + + - `CompletedAt float64` + + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. + + - `Conversation BetaResponseConversation` + + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + + - `ID string` + + The unique ID of the conversation that this response was associated with. + + - `MaxOutputTokens int64` + + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + + - `MaxToolCalls int64` + + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + + - `Moderation BetaResponseModeration` + + Moderation results for the response input and output, if moderated completions were requested. + + - `Input BetaResponseModerationInputUnion` + + Moderation for the response input. + + - `type BetaResponseModerationInputModerationResult struct{…}` + + A moderation result produced for the response input or output. + + - `Categories map[string, bool]` + + A dictionary of moderation categories to booleans, True if the input is flagged under this category. + + - `CategoryAppliedInputTypes map[string, []string]` + + Which modalities of input are reflected by the score for each category. + + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + + - `CategoryScores map[string, float64]` + + A dictionary of moderation categories to scores. + + - `Flagged bool` + + A boolean indicating whether the content was flagged by any category. + + - `Model string` + + The moderation model that produced this result. + + - `Type ModerationResult` + + The object type, which was always `moderation_result` for successful moderation results. + + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + + - `type BetaResponseModerationInputError struct{…}` + + An error produced while attempting moderation for the response input or output. + + - `Code string` + + The error code. + + - `Message string` + + The error message. + + - `Type Error` + + The object type, which was always `error` for moderation failures. + + - `const ErrorError Error = "error"` + + - `Output BetaResponseModerationOutputUnion` + + Moderation for the response output. + + - `type BetaResponseModerationOutputModerationResult struct{…}` + + A moderation result produced for the response input or output. + + - `Categories map[string, bool]` + + A dictionary of moderation categories to booleans, True if the input is flagged under this category. + + - `CategoryAppliedInputTypes map[string, []string]` + + Which modalities of input are reflected by the score for each category. + + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + + - `CategoryScores map[string, float64]` + + A dictionary of moderation categories to scores. + + - `Flagged bool` + + A boolean indicating whether the content was flagged by any category. + + - `Model string` + + The moderation model that produced this result. + + - `Type ModerationResult` + + The object type, which was always `moderation_result` for successful moderation results. + + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + + - `type BetaResponseModerationOutputError struct{…}` + + An error produced while attempting moderation for the response input or output. + + - `Code string` + + The error code. + + - `Message string` + + The error message. + + - `Type Error` + + The object type, which was always `error` for moderation failures. + + - `const ErrorError Error = "error"` + + - `PreviousResponseID string` + + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + + - `Prompt BetaResponsePrompt` + + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + + - `ID string` + + The unique identifier of the prompt template to use. + + - `Variables map[string, BetaResponsePromptVariableUnion]` + + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. + + - `string` + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Version string` + + Optional version of the prompt template. + + - `PromptCacheKey string` + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + + - `PromptCacheOptions BetaResponsePromptCacheOptions` + + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + + - `Mode string` + + Whether implicit prompt-cache breakpoints were enabled. + + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + + - `Ttl string` + + The minimum lifetime applied to each cache breakpoint. + + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + + - `PromptCacheRetention BetaResponsePromptCacheRetention` + + Deprecated. Use `prompt_cache_options.ttl` instead. + + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + + - `Reasoning BetaResponseReasoning` + + **gpt-5 and o-series models only** + + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + + - `Context string` + + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. + + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + + - `Effort string` + + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. + + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + + - `GenerateSummary string` + + **Deprecated:** use `summary` instead. + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + + - `Mode string` + + Controls the reasoning execution mode for the request. + + When returned on a response, this is the effective execution mode. + + - `string` + + - `string` + + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + + - `Summary string` + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + + - `SafetyIdentifier string` + + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + + - `ServiceTier BetaResponseServiceTier` + + Specifies the processing type used for serving the request. + + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. + + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + + - `Status BetaResponseStatus` + + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + + - `Text BetaResponseTextConfig` + + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: + + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + + - `Format BetaResponseFormatTextConfigUnion` + + An object specifying the format that the model must output. + + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + The default format is `{ "type": "text" }` with no additional options. + + **Not recommended for gpt-4o and newer models:** + + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. + + - `type BetaResponseFormatTextConfigText struct{…}` + + Default response format. Used to generate text responses. + + - `Type Text` + + The type of response format being defined. Always `text`. + + - `const TextText Text = "text"` + + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + + - `Name string` + + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. + + - `Schema map[string, any]` + + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). + + - `Type JSONSchema` + + The type of response format being defined. Always `json_schema`. + + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + + - `Description string` + + A description of what the response format is for, used by the model to + determine how to respond in the format. + + - `Strict bool` + + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). + + - `type BetaResponseFormatTextConfigJSONObject struct{…}` + + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. + + - `Type JSONObject` + + The type of response format being defined. Always `json_object`. + + - `const JSONObjectJSONObject JSONObject = "json_object"` + + - `Verbosity BetaResponseTextConfigVerbosity` + + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. + + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + + - `TopLogprobs int64` + + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. + + - `Truncation BetaResponseTruncation` + + The truncation strategy to use for the model response. + + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. + + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + + - `Usage BetaResponseUsage` + + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. + + - `InputTokens int64` + + The number of input tokens. + + - `InputTokensDetails BetaResponseUsageInputTokensDetails` + + A detailed breakdown of the input tokens. + + - `CacheWriteTokens int64` + + The number of input tokens that were written to the cache. + + - `CachedTokens int64` + + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + + - `OutputTokens int64` + + The number of output tokens. + + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + + A detailed breakdown of the output tokens. + + - `ReasoningTokens int64` + + The number of reasoning tokens. + + - `TotalTokens int64` + + The total number of tokens used. + + - `User string` + + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + +### Beta Response Apply Patch Tool Call + +- `type BetaResponseApplyPatchToolCall 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 BetaResponseApplyPatchToolCallOperationUnion` + + One of the create_file, delete_file, or update_file operations applied via apply_patch. + + - `type BetaResponseApplyPatchToolCallOperationCreateFile 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 BetaResponseApplyPatchToolCallOperationDeleteFile 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 BetaResponseApplyPatchToolCallOperationUpdateFile 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 BetaResponseApplyPatchToolCallStatus` + + The status of the apply patch tool call. One of `in_progress` or `completed`. + + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + + - `Type ApplyPatchCall` + + The type of the item. Always `apply_patch_call`. + + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + + - `Agent BetaResponseApplyPatchToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseApplyPatchToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The ID of the entity that created this tool call. + +### Beta Response Apply Patch Tool Call Output + +- `type BetaResponseApplyPatchToolCallOutput 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 BetaResponseApplyPatchToolCallOutputStatus` + + The status of the apply patch tool call output. One of `completed` or `failed`. + + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + + - `Type ApplyPatchCallOutput` + + The type of the item. Always `apply_patch_call_output`. + + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + + - `Agent BetaResponseApplyPatchToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The ID of the entity that created this tool call output. + + - `Output string` + + Optional textual output returned by the apply patch tool. + +### Beta Response Audio Delta Event + +- `type BetaResponseAudioDeltaEvent struct{…}` + + Emitted when there is a partial audio response. + + - `Delta string` + + A chunk of Base64 encoded response audio bytes. + + - `SequenceNumber int64` + + A sequence number for this chunk of the stream response. + + - `Type ResponseAudioDelta` + + The type of the event. Always `response.audio.delta`. + + - `const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"` + + - `Agent BetaResponseAudioDeltaEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Audio Done Event + +- `type BetaResponseAudioDoneEvent struct{…}` + + Emitted when the audio response is complete. + + - `SequenceNumber int64` + + The sequence number of the delta. + + - `Type ResponseAudioDone` + + The type of the event. Always `response.audio.done`. + + - `const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"` + + - `Agent BetaResponseAudioDoneEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Audio Transcript Delta Event + +- `type BetaResponseAudioTranscriptDeltaEvent struct{…}` + + Emitted when there is a partial transcript of audio. + + - `Delta string` + + The partial transcript of the audio response. + + - `SequenceNumber int64` + + The sequence number of this event. + + - `Type ResponseAudioTranscriptDelta` + + The type of the event. Always `response.audio.transcript.delta`. + + - `const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"` + + - `Agent BetaResponseAudioTranscriptDeltaEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Audio Transcript Done Event + +- `type BetaResponseAudioTranscriptDoneEvent struct{…}` + + Emitted when the full audio transcript is completed. + + - `SequenceNumber int64` + + The sequence number of this event. + + - `Type ResponseAudioTranscriptDone` + + The type of the event. Always `response.audio.transcript.done`. + + - `const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"` + + - `Agent BetaResponseAudioTranscriptDoneEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Code Interpreter Call Code Delta Event + +- `type BetaResponseCodeInterpreterCallCodeDeltaEvent struct{…}` + + Emitted when a partial code snippet is streamed by the code interpreter. + + - `Delta string` + + The partial code snippet being streamed by the code interpreter. + + - `ItemID string` + + The unique identifier of the code interpreter tool call item. + + - `OutputIndex int64` + + The index of the output item in the response for which the code is being streamed. + + - `SequenceNumber int64` + + The sequence number of this event, used to order streaming events. + + - `Type ResponseCodeInterpreterCallCodeDelta` + + The type of the event. Always `response.code_interpreter_call_code.delta`. + + - `const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"` + + - `Agent BetaResponseCodeInterpreterCallCodeDeltaEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Code Interpreter Call Code Done Event + +- `type BetaResponseCodeInterpreterCallCodeDoneEvent struct{…}` + + Emitted when the code snippet is finalized by the code interpreter. + + - `Code string` + + The final code snippet output by the code interpreter. + + - `ItemID string` + + The unique identifier of the code interpreter tool call item. + + - `OutputIndex int64` + + The index of the output item in the response for which the code is finalized. + + - `SequenceNumber int64` + + The sequence number of this event, used to order streaming events. + + - `Type ResponseCodeInterpreterCallCodeDone` + + The type of the event. Always `response.code_interpreter_call_code.done`. + + - `const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"` + + - `Agent BetaResponseCodeInterpreterCallCodeDoneEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Code Interpreter Call Completed Event + +- `type BetaResponseCodeInterpreterCallCompletedEvent struct{…}` + + Emitted when the code interpreter call is completed. + + - `ItemID string` + + The unique identifier of the code interpreter tool call item. + + - `OutputIndex int64` + + The index of the output item in the response for which the code interpreter call is completed. + + - `SequenceNumber int64` + + The sequence number of this event, used to order streaming events. + + - `Type ResponseCodeInterpreterCallCompleted` + + The type of the event. Always `response.code_interpreter_call.completed`. + + - `const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"` + + - `Agent BetaResponseCodeInterpreterCallCompletedEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Code Interpreter Call In Progress Event + +- `type BetaResponseCodeInterpreterCallInProgressEvent struct{…}` + + Emitted when a code interpreter call is in progress. + + - `ItemID string` + + The unique identifier of the code interpreter tool call item. + + - `OutputIndex int64` + + The index of the output item in the response for which the code interpreter call is in progress. + + - `SequenceNumber int64` + + The sequence number of this event, used to order streaming events. + + - `Type ResponseCodeInterpreterCallInProgress` + + The type of the event. Always `response.code_interpreter_call.in_progress`. + + - `const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"` + + - `Agent BetaResponseCodeInterpreterCallInProgressEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Code Interpreter Call Interpreting Event + +- `type BetaResponseCodeInterpreterCallInterpretingEvent struct{…}` + + Emitted when the code interpreter is actively interpreting the code snippet. + + - `ItemID string` + + The unique identifier of the code interpreter tool call item. + + - `OutputIndex int64` + + The index of the output item in the response for which the code interpreter is interpreting code. + + - `SequenceNumber int64` + + The sequence number of this event, used to order streaming events. + + - `Type ResponseCodeInterpreterCallInterpreting` + + The type of the event. Always `response.code_interpreter_call.interpreting`. + + - `const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"` + + - `Agent BetaResponseCodeInterpreterCallInterpretingEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Code Interpreter Tool Call + +- `type BetaResponseCodeInterpreterToolCall 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 []BetaResponseCodeInterpreterToolCallOutputUnion` + + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. + + - `type BetaResponseCodeInterpreterToolCallOutputLogs 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 BetaResponseCodeInterpreterToolCallOutputImage 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 BetaResponseCodeInterpreterToolCallStatus` + + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + + - `Type CodeInterpreterCall` + + The type of the code interpreter tool call. Always `code_interpreter_call`. + + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + + - `Agent BetaResponseCodeInterpreterToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Compaction Item + +- `type BetaResponseCompactionItem struct{…}` + + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + + - `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"` + + - `Agent BetaResponseCompactionItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + +### Beta Response Compaction Item Param + +- `type BetaResponseCompactionItemParamResp struct{…}` + + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + + - `EncryptedContent string` + + The encrypted content of the compaction summary. + + - `Type Compaction` + + The type of the item. Always `compaction`. + + - `const CompactionCompaction Compaction = "compaction"` + + - `ID string` + + The ID of the compaction item. + + - `Agent BetaResponseCompactionItemParamAgentResp` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Completed Event + +- `type BetaResponseCompletedEvent struct{…}` + + Emitted when the model response is complete. + + - `Response BetaResponse` + + Properties of the completed response. + + - `ID string` + + Unique identifier for this Response. + + - `CreatedAt float64` + + Unix timestamp (in seconds) of when this Response was created. + + - `Error BetaResponseError` + + An error object returned when the model fails to generate a Response. + + - `Code BetaResponseErrorCode` + + The error code for the response. + + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + + - `Message string` + + A human-readable description of the error. + + - `IncompleteDetails BetaResponseIncompleteDetails` + + Details about why the response is incomplete. + + - `Reason string` + + The reason why the response is incomplete. + + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + + - `Instructions BetaResponseInstructionsUnion` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + + - `string` + + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + + A list of one or many input items to the model, containing + different content types. + + - `type BetaEasyInputMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + + - `Content BetaEasyInputMessageContentUnion` + + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. + + - `string` + + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + + A list of one or many input items to the model, containing different content + types. + + - `type BetaResponseInputText 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"` + + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `Detail BetaResponseInputImageDetail` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type InputFile` + + The type of the input item. Always `input_file`. + + - `const InputFileInputFile InputFile = "input_file"` + + - `Detail BetaResponseInputFileDetail` + + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `Role BetaEasyInputMessageRole` + + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. + + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + + - `Phase BetaEasyInputMessagePhase` + + 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 BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + + - `Type BetaEasyInputMessageType` + + The type of the message input. Always `message`. + + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + + - `type BetaResponseInputItemMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + + - `Content BetaResponseInputMessageContentList` + + A list of one or many input items to the model, containing different content + types. + + - `Role string` + + The role of the message input. One of `user`, `system`, or `developer`. + + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + + - `Agent BetaResponseInputItemMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + + - `Type string` + + The type of the message input. Always set to `message`. + + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + + - `type BetaResponseOutputMessage struct{…}` + + An output message from the model. + + - `ID string` + + The unique ID of the output message. + + - `Content []BetaResponseOutputMessageContentUnion` + + The content of the output message. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation 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 BetaResponseOutputTextAnnotationFilePath 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 []BetaResponseOutputTextLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `type BetaResponseOutputRefusal 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 BetaResponseOutputMessageStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + + - `Type Message` + + The type of the output message. Always `message`. + + - `const MessageMessage Message = "message"` + + - `Agent BetaResponseOutputMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Phase BetaResponseOutputMessagePhase` + + 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 BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + + - `type BetaResponseFileSearchToolCall struct{…}` + + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + + - `ID string` + + The unique ID of the file search tool call. + + - `Queries []string` + + The queries used to search for files. + + - `Status BetaResponseFileSearchToolCallStatus` + + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + + - `Type FileSearchCall` + + The type of the file search tool call. Always `file_search_call`. + + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + + - `Agent BetaResponseFileSearchToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Results []BetaResponseFileSearchToolCallResult` + + The results of the file search tool call. + + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + + 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 BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) 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 []BetaResponseComputerToolCallPendingSafetyCheck` + + 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 BetaResponseComputerToolCallStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + + - `Type BetaResponseComputerToolCallType` + + The type of the computer call. Always `computer_call`. + + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + + - `Action BetaComputerActionUnion` + + A click action. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `Button string` + + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "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 BetaComputerActionDoubleClick 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 BetaComputerActionDrag struct{…}` + + A drag action. + + - `Path []BetaComputerActionDragPath` + + 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 BetaComputerActionKeypress 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 BetaComputerActionMove 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 BetaComputerActionScreenshot 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 BetaComputerActionScroll 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 BetaComputerActionType 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 BetaComputerActionWait 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 BetaComputerActionList` + + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `type BetaComputerActionDoubleClick struct{…}` + + A double click action. + + - `type BetaComputerActionDrag struct{…}` + + A drag action. + + - `type BetaComputerActionKeypress struct{…}` + + A collection of keypresses the model would like to perform. + + - `type BetaComputerActionMove struct{…}` + + A mouse move action. + + - `type BetaComputerActionScreenshot struct{…}` + + A screenshot action. + + - `type BetaComputerActionScroll struct{…}` + + A scroll action. + + - `type BetaComputerActionType struct{…}` + + An action to type in text. + + - `type BetaComputerActionWait struct{…}` + + A wait action. + + - `Agent BetaResponseComputerToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemComputerCallOutput struct{…}` + + The output of a computer tool call. + + - `CallID string` + + The ID of the computer tool call that produced the output. + + - `Output BetaResponseComputerToolCallOutputScreenshot` + + 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. + + - `Type ComputerCallOutput` + + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + + - `ID string` + + The ID of the computer tool call output. + + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + + 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. + + - `Agent BetaResponseInputItemComputerCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + + - `type BetaResponseFunctionWebSearch struct{…}` + + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + + - `ID string` + + The unique ID of the web search tool call. + + - `Action BetaResponseFunctionWebSearchActionUnion` + + 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 BetaResponseFunctionWebSearchActionSearch 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 []BetaResponseFunctionWebSearchActionSearchSource` + + 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 BetaResponseFunctionWebSearchActionOpenPage 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 BetaResponseFunctionWebSearchActionFindInPage 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 BetaResponseFunctionWebSearchStatus` + + The status of the web search tool call. + + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + + - `Type WebSearchCall` + + The type of the web search tool call. Always `web_search_call`. + + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + + - `Agent BetaResponseFunctionWebSearchAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseFunctionToolCall struct{…}` + + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + + - `Arguments string` + + A JSON string of the arguments to pass to the function. + + - `CallID string` + + The unique ID of the function tool call generated by the model. + + - `Name string` + + The name of the function to run. + + - `Type FunctionCall` + + The type of the function tool call. Always `function_call`. + + - `const FunctionCallFunctionCall FunctionCall = "function_call"` + + - `ID string` + + The unique ID of the function tool call. + + - `Agent BetaResponseFunctionToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `Namespace string` + + The namespace of the function to run. + + - `Status BetaResponseFunctionToolCallStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + + - `type BetaResponseInputItemFunctionCallOutput struct{…}` + + The output of a function tool call. + + - `CallID string` + + The unique ID of the function tool call generated by the model. + + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + + Text, image, or file output of the function tool call. + + - `string` + + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + + An array of content outputs (text, image, file) for the function tool call. + + - `type BetaResponseInputTextContent 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"` + + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputImageContent struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + + - `Type InputImage` + + The type of the input item. Always `input_image`. + + - `const InputImageInputImage InputImage = "input_image"` + + - `Detail BetaResponseInputImageContentDetail` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + + - `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. + + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFileContent struct{…}` + + A file input to the model. + + - `Type InputFile` + + The type of the input item. Always `input_file`. + + - `const InputFileInputFile InputFile = "input_file"` + + - `Detail BetaResponseInputFileContentDetail` + + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + + - `FileData string` + + The base64-encoded data 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. + + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `Type FunctionCallOutput` + + The type of the function tool call output. Always `function_call_output`. + + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + + - `ID string` + + The unique ID of the function tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemFunctionCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Status string` + + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + + - `type BetaResponseInputItemAgentMessage struct{…}` + + A message routed between agents. + + - `Author string` + + The sending agent identity. + + - `Content []BetaResponseInputItemAgentMessageContentUnion` + + Plaintext, image, or encrypted content sent between agents. + + - `type BetaResponseInputTextContent struct{…}` + + A text input to the model. + + - `type BetaResponseInputImageContent struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + + Opaque encrypted content that Responses API decrypts inside trusted model execution. + + - `EncryptedContent string` + + Opaque encrypted content. + + - `Type EncryptedContent` + + The type of the input item. Always `encrypted_content`. + + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + + - `Recipient string` + + The destination agent identity. + + - `Type AgentMessage` + + The item type. Always `agent_message`. + + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + + - `ID string` + + The unique ID of this agent message item. + + - `Agent BetaResponseInputItemAgentMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemMultiAgentCall struct{…}` + + - `Action string` + + The multi-agent action that was executed. + + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + + - `Arguments string` + + The action arguments as a JSON string. + + - `CallID string` + + The unique ID linking this call to its output. + + - `Type MultiAgentCall` + + The item type. Always `multi_agent_call`. + + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + + - `ID string` + + The unique ID of this multi-agent call. + + - `Agent BetaResponseInputItemMultiAgentCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + + - `Action string` + + The multi-agent action that produced this result. + + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + + - `CallID string` + + The unique ID of the multi-agent call. + + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + + Text output returned by the multi-agent action. + + - `Text string` + + The text content. + + - `Type OutputText` + + The content type. Always `output_text`. + + - `const OutputTextOutputText OutputText = "output_text"` + + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + + Citations associated with the text content. + + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + + - `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 citation type. Always `file_citation`. + + - `const FileCitationFileCitation FileCitation = "file_citation"` + + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + + - `EndIndex int64` + + The index of the last character of the citation in the message. + + - `StartIndex int64` + + The index of the first character of the citation in the message. + + - `Title string` + + The title of the cited resource. + + - `Type URLCitation` + + The citation type. Always `url_citation`. + + - `const URLCitationURLCitation URLCitation = "url_citation"` + + - `URL string` + + The URL of the cited resource. + + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + + - `ContainerID string` + + The ID of the container. + + - `EndIndex int64` + + The index of the last character of the citation in the message. + + - `FileID string` + + The ID of the container file. + + - `Filename string` + + The filename of the container file cited. + + - `StartIndex int64` + + The index of the first character of the citation in the message. + + - `Type ContainerFileCitation` + + The citation type. Always `container_file_citation`. + + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + + - `Type MultiAgentCallOutput` + + The item type. Always `multi_agent_call_output`. + + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + + - `ID string` + + The unique ID of this multi-agent call output. + + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemToolSearchCall struct{…}` + + - `Arguments any` + + The arguments supplied to the tool search call. + + - `Type ToolSearchCall` + + The item type. Always `tool_search_call`. + + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + + - `ID string` + + The unique ID of this tool search call. + + - `Agent BetaResponseInputItemToolSearchCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CallID string` + + The unique ID of the tool search call generated by the model. + + - `Execution string` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + + - `Status string` + + The status of the tool search call. + + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + + - `Tools []BetaToolUnion` + + The loaded tool definitions returned by the tool search output. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `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 strict parameter validation is enforced for this function tool. + + - `Type Function` + + The type of the function tool. Always `function`. + + - `const FunctionFunction Function = "function"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + + - `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. + + - `OutputSchema map[string, any]` + + A JSON schema object describing the JSON value encoded in string outputs for this function. + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `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 BetaFileSearchToolFiltersUnion` + + A filter to apply. + + - `type BetaFileSearchToolFiltersComparisonFilter 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 string` + + 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 BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + + The value to compare against the attribute key; supports string, number, or boolean types. + + - `string` + + - `float64` + + - `bool` + + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` + + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + + Combine multiple filters using `and` or `or`. + + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + + - `type BetaFileSearchToolFiltersCompoundFilterFilter 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 string` + + 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 BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + + The value to compare against the attribute key; supports string, number, or boolean types. + + - `string` + + - `float64` + + - `bool` + + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` + + - `Type string` + + Type of operation: `and` or `or`. + + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + + - `MaxNumResults int64` + + The maximum number of results to return. This number should be between 1 and 50 inclusive. + + - `RankingOptions BetaFileSearchToolRankingOptions` + + Ranking options for search. + + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + + 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 BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "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 BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `Type Computer` + + The type of the computer tool. Always `computer`. + + - `const ComputerComputer Computer = "computer"` + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `DisplayHeight int64` + + The height of the computer display. + + - `DisplayWidth int64` + + The width of the computer display. + + - `Environment BetaComputerUsePreviewToolEnvironment` + + The type of computer environment to control. + + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + + - `Type ComputerUsePreview` + + The type of the computer use tool. Always `computer_use_preview`. + + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `Type BetaWebSearchToolType` + + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + + - `Filters BetaWebSearchToolFilters` + + 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 BetaWebSearchToolSearchContextSize` + + 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 BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + + - `UserLocation BetaWebSearchToolUserLocation` + + 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](https://en.wikipedia.org/wiki/ISO_3166-1) 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](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + + - `Type string` + + The type of location approximation. Always `approximate`. + + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + + - `AllowedTools BetaToolMcpAllowedToolsUnion` + + List of allowed tool names or a filter object. + + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + + A string array of allowed tool names + + - `type BetaToolMcpAllowedToolsMcpToolFilter 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`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + + 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 BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "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 BetaToolMcpRequireApprovalUnion` + + Specify which of the MCP server's tools require approval. + + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter 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 BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + + 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`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + + - `ToolNames []string` + + List of allowed tool names. + + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + + 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`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + + - `ToolNames []string` + + List of allowed tool names. + + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting 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 BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "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 BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `Container BetaToolCodeInterpreterContainerUnion` + + 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 BetaToolCodeInterpreterContainerCodeInterpreterToolAuto 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 BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + + Network access policy for the container. + + - `type BetaContainerNetworkPolicyDisabled struct{…}` + + - `Type Disabled` + + Disable outbound network access. Always `disabled`. + + - `const DisabledDisabled Disabled = "disabled"` + + - `type BetaContainerNetworkPolicyAllowlist 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 []BetaContainerNetworkPolicyDomainSecret` + + 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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `Type ProgrammaticToolCalling` + + The type of the tool. Always `programmatic_tool_calling`. + + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + + - `type BetaToolImageGeneration 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 BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "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 BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "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 BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + + - `InputImageMask BetaToolImageGenerationInputImageMask` + + 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 BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + + - `Moderation string` + + Moderation level for the generated image. Default: `auto`. + + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "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 BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "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 BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "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 BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + + - `type BetaToolLocalShell 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 BetaFunctionShellTool 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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + + - `Environment BetaFunctionShellToolEnvironmentUnion` + + - `type BetaContainerAuto 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 BetaContainerAutoMemoryLimit` + + The memory limit for the container. + + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + + Network access policy for the container. + + - `type BetaContainerNetworkPolicyDisabled struct{…}` + + - `type BetaContainerNetworkPolicyAllowlist struct{…}` + + - `Skills []BetaContainerAutoSkillUnion` + + An optional list of skills referenced by id or inline data. + + - `type BetaSkillReference 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 BetaInlineSkill struct{…}` + + - `Description string` + + The description of the skill. + + - `Name string` + + The name of the skill. + + - `Source BetaInlineSkillSource` + + 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 BetaLocalEnvironment struct{…}` + + - `Type Local` + + Use a local computer environment. + + - `const LocalLocal Local = "local"` + + - `Skills []BetaLocalSkill` + + 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 BetaContainerReference 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 BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + + - `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 BetaCustomToolFormatUnion` + + The input format for the custom tool. Default is unconstrained text. + + - `type BetaCustomToolFormatText struct{…}` + + Unconstrained free-form text. + + - `Type Text` + + Unconstrained text format. Always `text`. + + - `const TextText Text = "text"` + + - `type BetaCustomToolFormatGrammar 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 BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + + - `Type Grammar` + + Grammar format. Always `grammar`. + + - `const GrammarGrammar Grammar = "grammar"` + + - `type BetaNamespaceTool 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 []BetaNamespaceToolToolUnion` + + The function/custom tools available inside this namespace. + + - `type BetaNamespaceToolToolFunction struct{…}` + + - `Name string` + + - `Type Function` + + - `const FunctionFunction Function = "function"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + + - `DeferLoading bool` + + Whether this function should be deferred and discovered via tool search. + + - `Description string` + + - `OutputSchema map[string, any]` + + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + + - `Parameters any` + + - `Strict bool` + + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `Type Namespace` + + The type of the tool. Always `namespace`. + + - `const NamespaceNamespace Namespace = "namespace"` + + - `type BetaToolSearchTool 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 BetaToolSearchToolExecution` + + Whether tool search is executed by the server or by the client. + + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + + - `Parameters any` + + Parameter schema for a client-executed tool search tool. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `Type BetaWebSearchPreviewToolType` + + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + + - `SearchContentTypes []string` + + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + + 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 BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + + - `UserLocation BetaWebSearchPreviewToolUserLocation` + + 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](https://en.wikipedia.org/wiki/ISO_3166-1) 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](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + + - `type BetaApplyPatchTool 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"` + + - `AllowedCallers []string` + + The tool invocation context(s). + + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + + - `Type ToolSearchOutput` + + The item type. Always `tool_search_output`. + + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + + - `ID string` + + The unique ID of this tool search output. + + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CallID string` + + The unique ID of the tool search call generated by the model. + + - `Execution BetaResponseToolSearchOutputItemParamExecution` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + + - `Status BetaResponseToolSearchOutputItemParamStatus` + + The status of the tool search output. + + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + + - `type BetaResponseInputItemAdditionalTools struct{…}` + + - `Role Developer` + + The role that provided the additional tools. Only `developer` is supported. + + - `const DeveloperDeveloper Developer = "developer"` + + - `Tools []BetaToolUnion` + + A list of additional tools made available at this item. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool struct{…}` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `Type AdditionalTools` + + The item type. Always `additional_tools`. + + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + + - `ID string` + + The unique ID of this additional tools item. + + - `Agent BetaResponseInputItemAdditionalToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + + - `ID string` + + The unique identifier of the reasoning content. + + - `Summary []BetaResponseReasoningItemSummary` + + 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"` + + - `Agent BetaResponseReasoningItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Content []BetaResponseReasoningItemContent` + + 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 BetaResponseReasoningItemStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + + - `type BetaResponseCompactionItemParamResp struct{…}` + + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + + - `EncryptedContent string` + + The encrypted content of the compaction summary. + + - `Type Compaction` + + The type of the item. Always `compaction`. + + - `const CompactionCompaction Compaction = "compaction"` + + - `ID string` + + The ID of the compaction item. + + - `Agent BetaResponseCompactionItemParamAgentResp` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemImageGenerationCall 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 BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + + - `Type ImageGenerationCall` + + The type of the image generation call. Always `image_generation_call`. + + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + + - `Agent BetaResponseInputItemImageGenerationCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseCodeInterpreterToolCall 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 []BetaResponseCodeInterpreterToolCallOutputUnion` + + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. + + - `type BetaResponseCodeInterpreterToolCallOutputLogs 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 BetaResponseCodeInterpreterToolCallOutputImage 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 BetaResponseCodeInterpreterToolCallStatus` + + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + + - `Type CodeInterpreterCall` + + The type of the code interpreter tool call. Always `code_interpreter_call`. + + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + + - `Agent BetaResponseCodeInterpreterToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemLocalShellCall struct{…}` + + A tool call to run a command on the local shell. + + - `ID string` + + The unique ID of the local shell call. + + - `Action BetaResponseInputItemLocalShellCallAction` + + 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 BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + + - `Type LocalShellCall` + + The type of the local shell call. Always `local_shell_call`. + + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + + - `Agent BetaResponseInputItemLocalShellCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemLocalShellCallOutput 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"` + + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of the item. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + + - `type BetaResponseInputItemShellCall struct{…}` + + A tool representing a request to execute one or more shell commands. + + - `Action BetaResponseInputItemShellCallAction` + + The shell commands and limits that describe how to run the tool call. + + - `Commands []string` + + Ordered shell commands for the execution environment to run. + + - `MaxOutputLength int64` + + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + + - `TimeoutMs int64` + + Maximum wall-clock time in milliseconds to allow the shell commands to run. + + - `CallID string` + + The unique ID of the shell tool call generated by the model. + + - `Type ShellCall` + + The type of the item. Always `shell_call`. + + - `const ShellCallShellCall ShellCall = "shell_call"` + + - `ID string` + + The unique ID of the shell tool call. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemShellCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemShellCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + + The environment to execute the shell commands in. + + - `type BetaLocalEnvironment struct{…}` + + - `type BetaContainerReference struct{…}` + + - `Status string` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + + - `type BetaResponseInputItemShellCallOutput struct{…}` + + The streamed output items emitted by a shell tool call. + + - `CallID string` + + The unique ID of the shell tool call generated by the model. + + - `Output []BetaResponseFunctionShellCallOutputContent` + + Captured chunks of stdout and stderr output, along with their associated outcomes. + + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + + The exit or timeout outcome associated with this shell call. + + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + + Indicates that the shell call exceeded its configured time limit. + + - `Type Timeout` + + The outcome type. Always `timeout`. + + - `const TimeoutTimeout Timeout = "timeout"` + + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + + Indicates that the shell commands finished and returned an exit code. + + - `ExitCode int64` + + The exit code returned by the shell process. + + - `Type Exit` + + The outcome type. Always `exit`. + + - `const ExitExit Exit = "exit"` + + - `Stderr string` + + Captured stderr output for the shell call. + + - `Stdout string` + + Captured stdout output for the shell call. + + - `Type ShellCallOutput` + + The type of the item. Always `shell_call_output`. + + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + + - `ID string` + + The unique ID of the shell tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemShellCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `MaxOutputLength int64` + + The maximum number of UTF-8 characters captured for this shell call's combined output. + + - `Status string` + + The status of the shell call output. + + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + + - `type BetaResponseInputItemApplyPatchCall struct{…}` + + A tool call representing a request to create, delete, or update files using diff patches. + + - `CallID string` + + The unique ID of the apply patch tool call generated by the model. + + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + + The specific create, delete, or update instruction for the apply_patch tool call. + + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + + Instruction for creating a new file via the apply_patch tool. + + - `Diff string` + + Unified diff content to apply when creating the file. + + - `Path string` + + Path of the file to create relative to the workspace root. + + - `Type CreateFile` + + The operation type. Always `create_file`. + + - `const CreateFileCreateFile CreateFile = "create_file"` + + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + + Instruction for deleting an existing file via the apply_patch tool. + + - `Path string` + + Path of the file to delete relative to the workspace root. + + - `Type DeleteFile` + + The operation type. Always `delete_file`. + + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + + Instruction for updating an existing file via the apply_patch tool. + + - `Diff string` + + Unified diff content to apply to the existing file. + + - `Path string` + + Path of the file to update relative to the workspace root. + + - `Type UpdateFile` + + The operation type. Always `update_file`. + + - `const UpdateFileUpdateFile UpdateFile = "update_file"` + + - `Status string` + + The status of the apply patch tool call. One of `in_progress` or `completed`. + + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + + - `Type ApplyPatchCall` + + The type of the item. Always `apply_patch_call`. + + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + + - `ID string` + + The unique ID of the apply patch tool call. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemApplyPatchCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + + The streamed output emitted by an apply patch tool call. + + - `CallID string` + + The unique ID of the apply patch tool call generated by the model. + + - `Status string` + + The status of the apply patch tool call output. One of `completed` or `failed`. + + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + + - `Type ApplyPatchCallOutput` + + The type of the item. Always `apply_patch_call_output`. + + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + + - `ID string` + + The unique ID of the apply patch tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Output string` + + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + + - `type BetaResponseInputItemMcpListTools 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 []BetaResponseInputItemMcpListToolsTool` + + 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"` + + - `Agent BetaResponseInputItemMcpListToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Error string` + + Error message if the server could not list tools. + + - `type BetaResponseInputItemMcpApprovalRequest 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"` + + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + + A response to an MCP approval request. + + - `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"` + + - `ID string` + + The unique ID of the approval response + + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Reason string` + + Optional reason for the decision. + + - `type BetaResponseInputItemMcpCall 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"` + + - `Agent BetaResponseInputItemMcpCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `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 BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + + - `type BetaResponseCustomToolCallOutput struct{…}` + + The output of a custom tool call from your code, being sent back to the model. + + - `CallID string` + + The call ID, used to map this custom tool call output to a custom tool call. + + - `Output BetaResponseCustomToolCallOutputOutputUnion` + + The output from the custom tool call generated by your code. + Can be a string or an list of output content. + + - `string` + + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + + Text, image, or file output of the custom tool call. + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type CustomToolCallOutput` + + The type of the custom tool call output. Always `custom_tool_call_output`. + + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + + - `ID string` + + The unique ID of the custom tool call output in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseCustomToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. + + - `CallID string` + + An identifier used to map this custom tool call to a tool call output. + + - `Input string` + + The input for the custom tool call generated by the model. + + - `Name string` + + The name of the custom tool being called. + + - `Type CustomToolCall` + + The type of the custom tool call. Always `custom_tool_call`. + + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + + - `ID string` + + The unique ID of the custom tool call in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseCustomToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `Namespace string` + + The namespace of the custom tool being called. + + - `type BetaResponseInputItemCompactionTrigger struct{…}` + + Compacts the current context. Must be the final input item. + + - `Type CompactionTrigger` + + The type of the item. Always `compaction_trigger`. + + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + + - `Agent BetaResponseInputItemCompactionTriggerAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemItemReference struct{…}` + + An internal identifier for an item to reference. + + - `ID string` + + The ID of the item to reference. + + - `Agent BetaResponseInputItemItemReferenceAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Type string` + + The type of item to reference. Always `item_reference`. + + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + + - `type BetaResponseInputItemProgram struct{…}` + + - `ID string` + + The unique ID of this program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The item type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseInputItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of this program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output. + + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The item type. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseInputItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Metadata map[string, string]` + + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + + - `Model BetaResponseModel` + + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + + - `type BetaResponseModel string` + + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + + - `const BetaResponseModelO3 BetaResponseModel = "o3"` + + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + + - `const BetaResponseModelO1 BetaResponseModel = "o1"` + + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + + - `string` + + - `Object Response` + + The object type of this resource - always set to `response`. + + - `const ResponseResponse Response = "response"` + + - `Output []BetaResponseOutputItemUnion` + + An array of content items generated by the model. + + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + + - `type BetaResponseOutputMessage struct{…}` + + An output message from the model. + + - `type BetaResponseFileSearchToolCall struct{…}` + + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + + - `type BetaResponseFunctionToolCall struct{…}` + + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + + - `type BetaResponseFunctionToolCallOutputItem 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 BetaResponseFunctionToolCallOutputItemOutputUnion` + + The output from the function call generated by your code. + Can be a string or an list of output content. + + - `string` + + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + + Text, image, or file output of the function call. + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Status BetaResponseFunctionToolCallOutputItemStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + + - `Type FunctionCallOutput` + + The type of the function tool call output. Always `function_call_output`. + + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + + - `Agent BetaResponseFunctionToolCallOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemAgentMessage struct{…}` + + - `ID string` + + The unique ID of the agent message. + + - `Author string` + + The sending agent identity. + + - `Content []BetaResponseOutputItemAgentMessageContentUnion` + + Encrypted content sent between agents. + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + + A text content. + + - `Text string` + + - `Type Text` + + - `const TextText Text = "text"` + + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + + A summary text from the model. + + - `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 BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + + Reasoning text from the model. + + - `Text string` + + The reasoning text from the model. + + - `Type ReasoningText` + + The type of the reasoning text. Always `reasoning_text`. + + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + + - `type BetaResponseOutputRefusal struct{…}` + + A refusal from the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + + A screenshot of a computer. + + - `Detail string` + + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + + - `FileID string` + + The identifier of an uploaded file that contains the screenshot. + + - `ImageURL string` + + The URL of the screenshot image. + + - `Type ComputerScreenshot` + + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + + Opaque encrypted content that Responses API decrypts inside trusted model execution. + + - `EncryptedContent string` + + Opaque encrypted content. + + - `Type EncryptedContent` + + The type of the input item. Always `encrypted_content`. + + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + + - `Recipient string` + + The destination agent identity. + + - `Type AgentMessage` + + The type of the item. Always `agent_message`. + + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + + - `Agent BetaResponseOutputItemAgentMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMultiAgentCall struct{…}` + + - `ID string` + + The unique ID of the multi-agent call item. + + - `Action string` + + The multi-agent action to execute. + + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + + - `Arguments string` + + The JSON string of arguments generated for the action. + + - `CallID string` + + The unique ID linking this call to its output. + + - `Type MultiAgentCall` + + The type of the multi-agent call. Always `multi_agent_call`. + + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + + - `Agent BetaResponseOutputItemMultiAgentCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + + - `ID string` + + The unique ID of the multi-agent call output item. + + - `Action string` + + The multi-agent action that produced this result. + + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + + - `CallID string` + + The unique ID of the multi-agent call. + + - `Output []BetaResponseOutputText` + + Text output returned by the multi-agent action. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `Text string` + + The text output from the model. + + - `Type OutputText` + + The type of the output text. Always `output_text`. + + - `Logprobs []BetaResponseOutputTextLogprob` + + - `Type MultiAgentCallOutput` + + The type of the multi-agent result. Always `multi_agent_call_output`. + + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseFunctionWebSearch struct{…}` + + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + + - `type BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + + - `type BetaResponseComputerToolCallOutputItem 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 BetaResponseComputerToolCallOutputScreenshot` + + A computer screenshot image used with the computer use tool. + + - `Status BetaResponseComputerToolCallOutputItemStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + + - `Type ComputerCallOutput` + + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + + 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. + + - `Agent BetaResponseComputerToolCallOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + + - `type BetaResponseOutputItemProgram struct{…}` + + - `ID string` + + The unique ID of the program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The type of the item. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseOutputItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of the program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output item. + + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The type of the item. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseOutputItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseToolSearchCall 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 BetaResponseToolSearchCallExecution` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + + - `Status BetaResponseToolSearchCallStatus` + + The status of the tool search call item that was recorded. + + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + + - `Type ToolSearchCall` + + The type of the item. Always `tool_search_call`. + + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + + - `Agent BetaResponseToolSearchCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseToolSearchOutputItem 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 BetaResponseToolSearchOutputItemExecution` + + Whether tool search was executed by the server or by the client. + + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + + - `Status BetaResponseToolSearchOutputItemStatus` + + The status of the tool search output item that was recorded. + + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + + - `Tools []BetaToolUnion` + + The loaded tool definitions returned by tool search. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool struct{…}` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `Type ToolSearchOutput` + + The type of the item. Always `tool_search_output`. + + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + + - `Agent BetaResponseToolSearchOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemAdditionalTools struct{…}` + + - `ID string` + + The unique ID of the additional tools item. + + - `Role string` + + The role that provided the additional tools. + + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + + - `Tools []BetaToolUnion` + + The additional tool definitions made available at this item. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool 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"` + + - `Agent BetaResponseOutputItemAdditionalToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseCompactionItem struct{…}` + + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + + - `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"` + + - `Agent BetaResponseCompactionItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemImageGenerationCall 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 BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + + - `Type ImageGenerationCall` + + The type of the image generation call. Always `image_generation_call`. + + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + + - `Agent BetaResponseOutputItemImageGenerationCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseCodeInterpreterToolCall struct{…}` + + A tool call to run code. + + - `type BetaResponseOutputItemLocalShellCall struct{…}` + + A tool call to run a command on the local shell. + + - `ID string` + + The unique ID of the local shell call. + + - `Action BetaResponseOutputItemLocalShellCallAction` + + 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 BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + + - `Type LocalShellCall` + + The type of the local shell call. Always `local_shell_call`. + + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + + - `Agent BetaResponseOutputItemLocalShellCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemLocalShellCallOutput 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"` + + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of the item. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + + - `type BetaResponseFunctionShellToolCall 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 BetaResponseFunctionShellToolCallAction` + + 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 BetaResponseFunctionShellToolCallEnvironmentUnion` + + Represents the use of a local environment to perform shell actions. + + - `type BetaResponseLocalEnvironment struct{…}` + + Represents the use of a local environment to perform shell actions. + + - `Type Local` + + The environment type. Always `local`. + + - `const LocalLocal Local = "local"` + + - `type BetaResponseContainerReference struct{…}` + + Represents a container created with /v1/containers. + + - `ContainerID string` + + - `Type ContainerReference` + + The environment type. Always `container_reference`. + + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + + - `Status BetaResponseFunctionShellToolCallStatus` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + + - `Type ShellCall` + + The type of the item. Always `shell_call`. + + - `const ShellCallShellCall ShellCall = "shell_call"` + + - `Agent BetaResponseFunctionShellToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionShellToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The ID of the entity that created this tool call. + + - `type BetaResponseFunctionShellToolCallOutput 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 []BetaResponseFunctionShellToolCallOutputOutput` + + An array of shell call output contents + + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + + Indicates that the shell call exceeded its configured time limit. + + - `Type Timeout` + + The outcome type. Always `timeout`. + + - `const TimeoutTimeout Timeout = "timeout"` + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit 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 BetaResponseFunctionShellToolCallOutputStatus` + + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + + - `Type ShellCallOutput` + + The type of the shell call output. Always `shell_call_output`. + + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + + - `Agent BetaResponseFunctionShellToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseApplyPatchToolCall 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 BetaResponseApplyPatchToolCallOperationUnion` + + One of the create_file, delete_file, or update_file operations applied via apply_patch. + + - `type BetaResponseApplyPatchToolCallOperationCreateFile 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 BetaResponseApplyPatchToolCallOperationDeleteFile 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 BetaResponseApplyPatchToolCallOperationUpdateFile 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 BetaResponseApplyPatchToolCallStatus` + + The status of the apply patch tool call. One of `in_progress` or `completed`. + + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + + - `Type ApplyPatchCall` + + The type of the item. Always `apply_patch_call`. + + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + + - `Agent BetaResponseApplyPatchToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseApplyPatchToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `CreatedBy string` + + The ID of the entity that created this tool call. + + - `type BetaResponseApplyPatchToolCallOutput 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 BetaResponseApplyPatchToolCallOutputStatus` + + The status of the apply patch tool call output. One of `completed` or `failed`. + + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + + - `Type ApplyPatchCallOutput` + + The type of the item. Always `apply_patch_call_output`. + + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + + - `Agent BetaResponseApplyPatchToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `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 BetaResponseOutputItemMcpCall 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"` + + - `Agent BetaResponseOutputItemMcpCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `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 BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + + - `type BetaResponseOutputItemMcpListTools 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 []BetaResponseOutputItemMcpListToolsTool` + + 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"` + + - `Agent BetaResponseOutputItemMcpListToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Error string` + + Error message if the server could not list tools. + + - `type BetaResponseOutputItemMcpApprovalRequest 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"` + + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMcpApprovalResponse 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"` + + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Reason string` + + Optional reason for the decision. + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. + + - `type BetaResponseCustomToolCallOutputItem 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 BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `ParallelToolCalls bool` + + Whether to allow the model to run tool calls in parallel. + + - `Temperature float64` + + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. + + - `ToolChoice BetaResponseToolChoiceUnion` + + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. + + - `type BetaToolChoiceOptions string` + + Controls which (if any) tool is called by the model. + + `none` means the model will not call any tool and instead generates a message. + + `auto` means the model can pick between generating a message or calling one or + more tools. + + `required` means the model must call one or more tools. + + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + + - `type BetaToolChoiceAllowed struct{…}` + + Constrains the tools available to the model to a pre-defined set. + + - `Mode BetaToolChoiceAllowedMode` + + Constrains the tools available to the model to a pre-defined set. + + `auto` allows the model to pick from among the allowed tools and generate a + message. + + `required` requires the model to call one or more of the allowed tools. + + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + + - `Tools []map[string, any]` + + A list of tool definitions that the model should be allowed to call. + + For the Responses API, the list of tool definitions might look like: + + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` + + - `Type AllowedTools` + + Allowed tool configuration type. Always `allowed_tools`. + + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + + - `type BetaToolChoiceTypes struct{…}` + + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + + - `Type BetaToolChoiceTypesType` + + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + + Allowed values are: + + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` + + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + + - `type BetaToolChoiceFunction struct{…}` + + Use this option to force the model to call a specific function. + + - `Name string` + + The name of the function to call. + + - `Type Function` + + For function calling, the type is always `function`. + + - `const FunctionFunction Function = "function"` + + - `type BetaToolChoiceMcp struct{…}` + + Use this option to force the model to call a specific tool on a remote MCP server. + + - `ServerLabel string` + + The label of the MCP server to use. + + - `Type Mcp` + + For MCP tools, the type is always `mcp`. + + - `const McpMcp Mcp = "mcp"` + + - `Name string` + + The name of the tool to call on the server. + + - `type BetaToolChoiceCustom struct{…}` + + Use this option to force the model to call a specific custom tool. + + - `Name string` + + The name of the custom tool to call. + + - `Type Custom` + + For custom tool calling, the type is always `custom`. + + - `const CustomCustom Custom = "custom"` + + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + + - `Type ProgrammaticToolCalling` + + The tool to call. Always `programmatic_tool_calling`. + + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + + - `type BetaToolChoiceApplyPatch struct{…}` + + Forces the model to call the apply_patch tool when executing a tool call. + + - `Type ApplyPatch` + + The tool to call. Always `apply_patch`. + + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + + - `type BetaToolChoiceShell struct{…}` + + Forces the model to call the shell tool when a tool call is required. + + - `Type Shell` + + The tool to call. Always `shell`. + + - `const ShellShell Shell = "shell"` + + - `Tools []BetaToolUnion` + + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool struct{…}` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `TopP float64` + + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. + + We generally recommend altering this or `temperature` but not both. + + - `Background bool` + + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). + + - `CompletedAt float64` + + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. + + - `Conversation BetaResponseConversation` + + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + + - `ID string` + + The unique ID of the conversation that this response was associated with. + + - `MaxOutputTokens int64` + + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + + - `MaxToolCalls int64` + + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + + - `Moderation BetaResponseModeration` + + Moderation results for the response input and output, if moderated completions were requested. + + - `Input BetaResponseModerationInputUnion` + + Moderation for the response input. + + - `type BetaResponseModerationInputModerationResult struct{…}` + + A moderation result produced for the response input or output. + + - `Categories map[string, bool]` + + A dictionary of moderation categories to booleans, True if the input is flagged under this category. + + - `CategoryAppliedInputTypes map[string, []string]` + + Which modalities of input are reflected by the score for each category. + + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + + - `CategoryScores map[string, float64]` + + A dictionary of moderation categories to scores. + + - `Flagged bool` + + A boolean indicating whether the content was flagged by any category. + + - `Model string` + + The moderation model that produced this result. + + - `Type ModerationResult` + + The object type, which was always `moderation_result` for successful moderation results. + + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + + - `type BetaResponseModerationInputError struct{…}` + + An error produced while attempting moderation for the response input or output. + + - `Code string` + + The error code. + + - `Message string` + + The error message. + + - `Type Error` + + The object type, which was always `error` for moderation failures. + + - `const ErrorError Error = "error"` + + - `Output BetaResponseModerationOutputUnion` + + Moderation for the response output. + + - `type BetaResponseModerationOutputModerationResult struct{…}` + + A moderation result produced for the response input or output. + + - `Categories map[string, bool]` + + A dictionary of moderation categories to booleans, True if the input is flagged under this category. + + - `CategoryAppliedInputTypes map[string, []string]` + + Which modalities of input are reflected by the score for each category. + + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + + - `CategoryScores map[string, float64]` + + A dictionary of moderation categories to scores. + + - `Flagged bool` + + A boolean indicating whether the content was flagged by any category. + + - `Model string` + + The moderation model that produced this result. + + - `Type ModerationResult` + + The object type, which was always `moderation_result` for successful moderation results. + + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + + - `type BetaResponseModerationOutputError struct{…}` + + An error produced while attempting moderation for the response input or output. + + - `Code string` + + The error code. + + - `Message string` + + The error message. + + - `Type Error` + + The object type, which was always `error` for moderation failures. + + - `const ErrorError Error = "error"` + + - `PreviousResponseID string` + + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + + - `Prompt BetaResponsePrompt` + + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + + - `ID string` + + The unique identifier of the prompt template to use. + + - `Variables map[string, BetaResponsePromptVariableUnion]` + + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. + + - `string` + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Version string` + + Optional version of the prompt template. + + - `PromptCacheKey string` + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + + - `PromptCacheOptions BetaResponsePromptCacheOptions` + + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + + - `Mode string` + + Whether implicit prompt-cache breakpoints were enabled. + + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + + - `Ttl string` + + The minimum lifetime applied to each cache breakpoint. + + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + + - `PromptCacheRetention BetaResponsePromptCacheRetention` + + Deprecated. Use `prompt_cache_options.ttl` instead. + + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + + - `Reasoning BetaResponseReasoning` + + **gpt-5 and o-series models only** + + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + + - `Context string` + + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. + + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + + - `Effort string` + + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. + + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + + - `GenerateSummary string` + + **Deprecated:** use `summary` instead. + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + + - `Mode string` + + Controls the reasoning execution mode for the request. + + When returned on a response, this is the effective execution mode. + + - `string` + + - `string` + + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + + - `Summary string` + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + + - `SafetyIdentifier string` + + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + + - `ServiceTier BetaResponseServiceTier` + + Specifies the processing type used for serving the request. + + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. + + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + + - `Status BetaResponseStatus` + + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + + - `Text BetaResponseTextConfig` + + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: + + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + + - `Format BetaResponseFormatTextConfigUnion` + + An object specifying the format that the model must output. + + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + The default format is `{ "type": "text" }` with no additional options. + + **Not recommended for gpt-4o and newer models:** + + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. + + - `type BetaResponseFormatTextConfigText struct{…}` + + Default response format. Used to generate text responses. + + - `Type Text` + + The type of response format being defined. Always `text`. + + - `const TextText Text = "text"` + + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + + - `Name string` + + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. + + - `Schema map[string, any]` + + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). + + - `Type JSONSchema` + + The type of response format being defined. Always `json_schema`. + + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + + - `Description string` + + A description of what the response format is for, used by the model to + determine how to respond in the format. + + - `Strict bool` + + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). + + - `type BetaResponseFormatTextConfigJSONObject struct{…}` + + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. + + - `Type JSONObject` + + The type of response format being defined. Always `json_object`. + + - `const JSONObjectJSONObject JSONObject = "json_object"` + + - `Verbosity BetaResponseTextConfigVerbosity` + + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. + + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + + - `TopLogprobs int64` + + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. + + - `Truncation BetaResponseTruncation` + + The truncation strategy to use for the model response. + + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. + + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + + - `Usage BetaResponseUsage` + + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. + + - `InputTokens int64` + + The number of input tokens. + + - `InputTokensDetails BetaResponseUsageInputTokensDetails` + + A detailed breakdown of the input tokens. + + - `CacheWriteTokens int64` + + The number of input tokens that were written to the cache. + + - `CachedTokens int64` + + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + + - `OutputTokens int64` + + The number of output tokens. + + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + + A detailed breakdown of the output tokens. + + - `ReasoningTokens int64` + + The number of reasoning tokens. + + - `TotalTokens int64` + + The total number of tokens used. + + - `User string` + + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + + - `SequenceNumber int64` + + The sequence number for this event. + + - `Type ResponseCompleted` + + The type of the event. Always `response.completed`. + + - `const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"` + + - `Agent BetaResponseCompletedEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Computer Tool Call + +- `type BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) 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 []BetaResponseComputerToolCallPendingSafetyCheck` + + 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 BetaResponseComputerToolCallStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + + - `Type BetaResponseComputerToolCallType` + + The type of the computer call. Always `computer_call`. + + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + + - `Action BetaComputerActionUnion` + + A click action. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `Button string` + + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "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 BetaComputerActionDoubleClick 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 BetaComputerActionDrag struct{…}` + + A drag action. + + - `Path []BetaComputerActionDragPath` + + 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 BetaComputerActionKeypress 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 BetaComputerActionMove 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 BetaComputerActionScreenshot 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 BetaComputerActionScroll 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 BetaComputerActionType 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 BetaComputerActionWait 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 BetaComputerActionList` + + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `type BetaComputerActionDoubleClick struct{…}` + + A double click action. + + - `type BetaComputerActionDrag struct{…}` + + A drag action. + + - `type BetaComputerActionKeypress struct{…}` + + A collection of keypresses the model would like to perform. + + - `type BetaComputerActionMove struct{…}` + + A mouse move action. + + - `type BetaComputerActionScreenshot struct{…}` + + A screenshot action. + + - `type BetaComputerActionScroll struct{…}` + + A scroll action. + + - `type BetaComputerActionType struct{…}` + + An action to type in text. + + - `type BetaComputerActionWait struct{…}` + + A wait action. + + - `Agent BetaResponseComputerToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Computer Tool Call Output Item + +- `type BetaResponseComputerToolCallOutputItem 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 BetaResponseComputerToolCallOutputScreenshot` + + 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 BetaResponseComputerToolCallOutputItemStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + + - `Type ComputerCallOutput` + + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + + 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. + + - `Agent BetaResponseComputerToolCallOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + +### Beta Response Computer Tool Call Output Screenshot + +- `type BetaResponseComputerToolCallOutputScreenshot struct{…}` + + 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. + +### Beta Response Container Reference + +- `type BetaResponseContainerReference struct{…}` + + Represents a container created with /v1/containers. + + - `ContainerID string` + + - `Type ContainerReference` + + The environment type. Always `container_reference`. + + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + +### Beta Response Content + +- `type BetaResponseContentUnion interface{…}` + + Multi-modal input and output contents. + + - `type BetaResponseInputText 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"` + + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `Detail BetaResponseInputImageDetail` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type InputFile` + + The type of the input item. Always `input_file`. + + - `const InputFileInputFile InputFile = "input_file"` + + - `Detail BetaResponseInputFileDetail` + + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation 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 BetaResponseOutputTextAnnotationFilePath 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 []BetaResponseOutputTextLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `type BetaResponseOutputRefusal 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"` + + - `BetaResponseContentReasoningText` + + - `Text string` + + The reasoning text from the model. + + - `Type ReasoningText` + + The type of the reasoning text. Always `reasoning_text`. + + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + +### Beta Response Content Part Added Event + +- `type BetaResponseContentPartAddedEvent struct{…}` + + Emitted when a new content part is added. + + - `ContentIndex int64` + + The index of the content part that was added. + + - `ItemID string` + + The ID of the output item that the content part was added to. + + - `OutputIndex int64` + + The index of the output item that the content part was added to. + + - `Part BetaResponseContentPartAddedEventPartUnion` + + The content part that was added. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation 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 BetaResponseOutputTextAnnotationFilePath 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 []BetaResponseOutputTextLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `type BetaResponseOutputRefusal 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"` + + - `type BetaResponseContentPartAddedEventPartReasoningText struct{…}` + + Reasoning text from the model. + + - `Text string` + + The reasoning text from the model. + + - `Type ReasoningText` + + The type of the reasoning text. Always `reasoning_text`. + + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + + - `SequenceNumber int64` + + The sequence number of this event. + + - `Type ResponseContentPartAdded` + + The type of the event. Always `response.content_part.added`. + + - `const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"` + + - `Agent BetaResponseContentPartAddedEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Content Part Done Event + +- `type BetaResponseContentPartDoneEvent struct{…}` + + Emitted when a content part is done. + + - `ContentIndex int64` + + The index of the content part that is done. + + - `ItemID string` + + The ID of the output item that the content part was added to. + + - `OutputIndex int64` + + The index of the output item that the content part was added to. + + - `Part BetaResponseContentPartDoneEventPartUnion` + + The content part that is done. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation 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 BetaResponseOutputTextAnnotationFilePath 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 []BetaResponseOutputTextLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `type BetaResponseOutputRefusal 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"` + + - `type BetaResponseContentPartDoneEventPartReasoningText struct{…}` + + Reasoning text from the model. + + - `Text string` + + The reasoning text from the model. + + - `Type ReasoningText` + + The type of the reasoning text. Always `reasoning_text`. + + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + + - `SequenceNumber int64` + + The sequence number of this event. + + - `Type ResponseContentPartDone` + + The type of the event. Always `response.content_part.done`. + + - `const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"` + + - `Agent BetaResponseContentPartDoneEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Conversation Param + +- `type BetaResponseConversationParamResp struct{…}` + + The conversation that this response belongs to. + + - `ID string` + + The unique ID of the conversation. + +### Beta Response Created Event + +- `type BetaResponseCreatedEvent struct{…}` + + An event that is emitted when a response is created. + + - `Response BetaResponse` + + The response that was created. + + - `ID string` + + Unique identifier for this Response. + + - `CreatedAt float64` + + Unix timestamp (in seconds) of when this Response was created. + + - `Error BetaResponseError` + + An error object returned when the model fails to generate a Response. + + - `Code BetaResponseErrorCode` + + The error code for the response. + + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + + - `Message string` + + A human-readable description of the error. + + - `IncompleteDetails BetaResponseIncompleteDetails` + + Details about why the response is incomplete. + + - `Reason string` + + The reason why the response is incomplete. + + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + + - `Instructions BetaResponseInstructionsUnion` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + + - `string` + + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + + A list of one or many input items to the model, containing + different content types. + + - `type BetaEasyInputMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + + - `Content BetaEasyInputMessageContentUnion` + + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. + + - `string` + + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + + A list of one or many input items to the model, containing different content + types. + + - `type BetaResponseInputText 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"` + + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `Detail BetaResponseInputImageDetail` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type InputFile` + + The type of the input item. Always `input_file`. + + - `const InputFileInputFile InputFile = "input_file"` + + - `Detail BetaResponseInputFileDetail` + + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `Role BetaEasyInputMessageRole` + + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. + + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + + - `Phase BetaEasyInputMessagePhase` + + 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 BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + + - `Type BetaEasyInputMessageType` + + The type of the message input. Always `message`. + + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + + - `type BetaResponseInputItemMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + + - `Content BetaResponseInputMessageContentList` + + A list of one or many input items to the model, containing different content + types. + + - `Role string` + + The role of the message input. One of `user`, `system`, or `developer`. + + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + + - `Agent BetaResponseInputItemMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + + - `Type string` + + The type of the message input. Always set to `message`. + + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + + - `type BetaResponseOutputMessage struct{…}` + + An output message from the model. + + - `ID string` + + The unique ID of the output message. + + - `Content []BetaResponseOutputMessageContentUnion` + + The content of the output message. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation 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 BetaResponseOutputTextAnnotationFilePath 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 []BetaResponseOutputTextLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `type BetaResponseOutputRefusal 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 BetaResponseOutputMessageStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + + - `Type Message` + + The type of the output message. Always `message`. + + - `const MessageMessage Message = "message"` + + - `Agent BetaResponseOutputMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Phase BetaResponseOutputMessagePhase` + + 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 BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + + - `type BetaResponseFileSearchToolCall struct{…}` + + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + + - `ID string` + + The unique ID of the file search tool call. + + - `Queries []string` + + The queries used to search for files. + + - `Status BetaResponseFileSearchToolCallStatus` + + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + + - `Type FileSearchCall` + + The type of the file search tool call. Always `file_search_call`. + + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + + - `Agent BetaResponseFileSearchToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Results []BetaResponseFileSearchToolCallResult` + + The results of the file search tool call. + + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + + 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 BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) 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 []BetaResponseComputerToolCallPendingSafetyCheck` + + 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 BetaResponseComputerToolCallStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + + - `Type BetaResponseComputerToolCallType` + + The type of the computer call. Always `computer_call`. + + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + + - `Action BetaComputerActionUnion` + + A click action. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `Button string` + + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "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 BetaComputerActionDoubleClick 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 BetaComputerActionDrag struct{…}` + + A drag action. + + - `Path []BetaComputerActionDragPath` + + 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 BetaComputerActionKeypress 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 BetaComputerActionMove 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 BetaComputerActionScreenshot 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 BetaComputerActionScroll 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 BetaComputerActionType 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 BetaComputerActionWait 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 BetaComputerActionList` + + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `type BetaComputerActionDoubleClick struct{…}` + + A double click action. + + - `type BetaComputerActionDrag struct{…}` - - `type BetaToolProgrammaticToolCalling struct{…}` + A drag action. - - `type BetaToolImageGeneration struct{…}` + - `type BetaComputerActionKeypress struct{…}` - A tool that generates images using the GPT image models. + A collection of keypresses the model would like to perform. - - `type BetaToolLocalShell struct{…}` + - `type BetaComputerActionMove struct{…}` - A tool that allows the model to execute shell commands in a local environment. + A mouse move action. - - `type BetaFunctionShellTool struct{…}` + - `type BetaComputerActionScreenshot struct{…}` - A tool that allows the model to execute shell commands. + A screenshot action. - - `type BetaCustomTool struct{…}` + - `type BetaComputerActionScroll struct{…}` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + A scroll action. - - `type BetaNamespaceTool struct{…}` + - `type BetaComputerActionType struct{…}` - Groups function/custom tools under a shared namespace. + An action to type in text. - - `type BetaToolSearchTool struct{…}` + - `type BetaComputerActionWait struct{…}` - Hosted or BYOT tool search configuration for deferred tools. + A wait action. - - `type BetaWebSearchPreviewTool struct{…}` + - `Agent BetaResponseComputerToolCallAgent` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The agent that produced this item. - - `type BetaApplyPatchTool struct{…}` + - `AgentName string` - Allows the assistant to create, delete, or update files using unified diffs. + The canonical name of the agent that produced this item. - - `TopP float64` + - `type BetaResponseInputItemComputerCallOutput struct{…}` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + The output of a computer tool call. - We generally recommend altering this or `temperature` but not both. + - `CallID string` - - `Background bool` + The ID of the computer tool call that produced the output. - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `CompletedAt float64` + A computer screenshot image used with the computer use tool. - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. + - `Type ComputerScreenshot` - - `Conversation BetaResponseConversation` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `ID string` + - `FileID string` - The unique ID of the conversation that this response was associated with. + The identifier of an uploaded file that contains the screenshot. - - `MaxOutputTokens int64` + - `ImageURL string` - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + The URL of the screenshot image. - - `MaxToolCalls int64` + - `Type ComputerCallOutput` - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + The type of the computer tool call output. Always `computer_call_output`. - - `Moderation BetaResponseModeration` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - Moderation results for the response input and output, if moderated completions were requested. + - `ID string` - - `Input BetaResponseModerationInputUnion` + The ID of the computer tool call output. - Moderation for the response input. + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - - `type BetaResponseModerationInputModerationResult struct{…}` + The safety checks reported by the API that have been acknowledged by the developer. - A moderation result produced for the response input or output. + - `ID string` - - `Categories map[string, bool]` + The ID of the pending safety check. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `Code string` - - `CategoryAppliedInputTypes map[string, []string]` + The type of the pending safety check. - Which modalities of input are reflected by the score for each category. + - `Message string` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + Details about the pending safety check. - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + - `Agent BetaResponseInputItemComputerCallOutputAgent` - - `CategoryScores map[string, float64]` + The agent that produced this item. - A dictionary of moderation categories to scores. + - `AgentName string` - - `Flagged bool` + The canonical name of the agent that produced this item. - A boolean indicating whether the content was flagged by any category. + - `Status string` - - `Model string` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - The moderation model that produced this result. + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `Type ModerationResult` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - The object type, which was always `moderation_result` for successful moderation results. + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + - `type BetaResponseFunctionWebSearch struct{…}` - - `type BetaResponseModerationInputError struct{…}` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - An error produced while attempting moderation for the response input or output. + - `ID string` - - `Code string` + The unique ID of the web search tool call. - The error code. + - `Action BetaResponseFunctionWebSearchActionUnion` - - `Message string` + 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). - The error message. + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - - `Type Error` + Action type "search" - Performs a web search query. - The object type, which was always `error` for moderation failures. + - `Type Search` - - `const ErrorError Error = "error"` + The action type. - - `Output BetaResponseModerationOutputUnion` + - `const SearchSearch Search = "search"` - Moderation for the response output. + - `Queries []string` - - `type BetaResponseModerationOutputModerationResult struct{…}` + The search queries. - A moderation result produced for the response input or output. + - `Query string` - - `Categories map[string, bool]` + The search query. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `CategoryAppliedInputTypes map[string, []string]` + The sources used in the search. - Which modalities of input are reflected by the score for each category. + - `Type URL` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + The type of source. Always `url`. - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + - `const URLURL URL = "url"` - - `CategoryScores map[string, float64]` + - `URL string` - A dictionary of moderation categories to scores. + The URL of the source. - - `Flagged bool` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - A boolean indicating whether the content was flagged by any category. + Action type "open_page" - Opens a specific URL from search results. - - `Model string` + - `Type OpenPage` - The moderation model that produced this result. + The action type. - - `Type ModerationResult` + - `const OpenPageOpenPage OpenPage = "open_page"` - The object type, which was always `moderation_result` for successful moderation results. + - `URL string` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + The URL opened by the model. - - `type BetaResponseModerationOutputError struct{…}` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - An error produced while attempting moderation for the response input or output. + Action type "find_in_page": Searches for a pattern within a loaded page. - - `Code string` + - `Pattern string` - The error code. + The pattern or text to search for within the page. - - `Message string` + - `Type FindInPage` - The error message. + The action type. - - `Type Error` + - `const FindInPageFindInPage FindInPage = "find_in_page"` - The object type, which was always `error` for moderation failures. + - `URL string` - - `const ErrorError Error = "error"` + The URL of the page searched for the pattern. - - `PreviousResponseID string` + - `Status BetaResponseFunctionWebSearchStatus` - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + The status of the web search tool call. - - `Prompt BetaResponsePrompt` + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - `ID string` + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - The unique identifier of the prompt template to use. + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `Variables map[string, BetaResponsePromptVariableUnion]` + - `Type WebSearchCall` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + The type of the web search tool call. Always `web_search_call`. - - `string` + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `type BetaResponseInputText struct{…}` + - `Agent BetaResponseFunctionWebSearchAgent` - A text input to the model. + The agent that produced this item. - - `type BetaResponseInputImage struct{…}` + - `AgentName string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The canonical name of the agent that produced this item. - - `type BetaResponseInputFile struct{…}` + - `type BetaResponseFunctionToolCall struct{…}` - A file input to the model. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `Version string` + - `Arguments string` - Optional version of the prompt template. + A JSON string of the arguments to pass to the function. - - `PromptCacheKey string` + - `CallID string` - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + The unique ID of the function tool call generated by the model. - - `PromptCacheOptions BetaResponsePromptCacheOptions` + - `Name string` - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + The name of the function to run. - - `Mode string` + - `Type FunctionCall` - Whether implicit prompt-cache breakpoints were enabled. + The type of the function tool call. Always `function_call`. - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + - `ID string` - - `Ttl string` + The unique ID of the function tool call. - The minimum lifetime applied to each cache breakpoint. + - `Agent BetaResponseFunctionToolCallAgent` - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + The agent that produced this item. - - `PromptCacheRetention BetaResponsePromptCacheRetention` + - `AgentName string` - Deprecated. Use `prompt_cache_options.ttl` instead. + The canonical name of the agent that produced this item. - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + - `Caller BetaResponseFunctionToolCallCallerUnion` - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + The execution context that produced this tool call. - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `Type Direct` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + - `const DirectDirect Direct = "direct"` - - `Reasoning BetaResponseReasoning` + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - **gpt-5 and o-series models only** + - `CallerID string` - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + The call ID of the program item that produced this tool call. - - `Context string` + - `Type Program` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + - `const ProgramProgram Program = "program"` - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + - `Namespace string` - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + The namespace of the function to run. - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + - `Status BetaResponseFunctionToolCallStatus` - - `Effort string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + The output of a function tool call. - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + - `CallID string` - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + The unique ID of the function tool call generated by the model. - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - - `GenerateSummary string` + Text, image, or file output of the function tool call. - **Deprecated:** use `summary` instead. + - `string` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + An array of content outputs (text, image, file) for the function tool call. - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + - `type BetaResponseInputTextContent struct{…}` - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + A text input to the model. - - `Mode string` + - `Text string` - Controls the reasoning execution mode for the request. + The text input to the model. - When returned on a response, this is the effective execution mode. + - `Type InputText` - - `string` + The type of the input item. Always `input_text`. - - `string` + - `const InputTextInputText InputText = "input_text"` - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Summary string` + - `Mode Explicit` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + The breakpoint mode. Always `explicit`. - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `const ExplicitExplicit Explicit = "explicit"` - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + - `type BetaResponseInputImageContent struct{…}` - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + - `Type InputImage` - - `SafetyIdentifier string` + The type of the input item. Always `input_image`. - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `const InputImageInputImage InputImage = "input_image"` - - `ServiceTier BetaResponseServiceTier` + - `Detail BetaResponseInputImageContentDetail` - Specifies the processing type used for serving the request. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + - `FileID string` - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + The ID of the file to be sent to the model. - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + - `ImageURL string` - - `Status BetaResponseStatus` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `Mode Explicit` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + The breakpoint mode. Always `explicit`. - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + - `const ExplicitExplicit Explicit = "explicit"` - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `type BetaResponseInputFileContent struct{…}` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + A file input to the model. - - `Text BetaResponseTextConfig` + - `Type InputFile` - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + The type of the input item. Always `input_file`. - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `const InputFileInputFile InputFile = "input_file"` - - `Format BetaResponseFormatTextConfigUnion` + - `Detail BetaResponseInputFileContentDetail` - An object specifying the format that the model must output. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - The default format is `{ "type": "text" }` with no additional options. + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - **Not recommended for gpt-4o and newer models:** + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `FileData string` - - `type BetaResponseFormatTextConfigText struct{…}` + The base64-encoded data of the file to be sent to the model. - Default response format. Used to generate text responses. + - `FileID string` - - `Type Text` + The ID of the file to be sent to the model. - The type of response format being defined. Always `text`. + - `FileURL string` - - `const TextText Text = "text"` + The URL of the file to be sent to the model. - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + - `Filename string` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + The name of the file to be sent to the model. - - `Name string` + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Schema map[string, any]` + - `Mode Explicit` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + The breakpoint mode. Always `explicit`. - - `Type JSONSchema` + - `const ExplicitExplicit Explicit = "explicit"` - The type of response format being defined. Always `json_schema`. + - `Type FunctionCallOutput` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The type of the function tool call output. Always `function_call_output`. - - `Description string` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `ID string` - - `Strict bool` + The unique ID of the function tool call output. Populated when this item is returned via API. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Agent BetaResponseInputItemFunctionCallOutputAgent` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + The agent that produced this item. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `AgentName string` - - `Type JSONObject` + The canonical name of the agent that produced this item. - The type of response format being defined. Always `json_object`. + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The execution context that produced this tool call. - - `Verbosity BetaResponseTextConfigVerbosity` + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + - `Type Direct` - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + The caller type. Always `direct`. - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + - `const DirectDirect Direct = "direct"` - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - - `TopLogprobs int64` + - `CallerID string` - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + The call ID of the program item that produced this tool call. - - `Truncation BetaResponseTruncation` + - `Type Program` - The truncation strategy to use for the model response. + The caller type. Always `program`. - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `const ProgramProgram Program = "program"` - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + - `Status string` - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `Usage BetaResponseUsage` + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - - `InputTokens int64` + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - The number of input tokens. + - `type BetaResponseInputItemAgentMessage struct{…}` - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + A message routed between agents. - A detailed breakdown of the input tokens. + - `Author string` - - `CacheWriteTokens int64` + The sending agent identity. - The number of input tokens that were written to the cache. + - `Content []BetaResponseInputItemAgentMessageContentUnion` - - `CachedTokens int64` + Plaintext, image, or encrypted content sent between agents. - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + - `type BetaResponseInputTextContent struct{…}` - - `OutputTokens int64` + A text input to the model. - The number of output tokens. + - `type BetaResponseInputImageContent struct{…}` - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - A detailed breakdown of the output tokens. + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - - `ReasoningTokens int64` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - The number of reasoning tokens. + - `EncryptedContent string` - - `TotalTokens int64` + Opaque encrypted content. - The total number of tokens used. + - `Type EncryptedContent` - - `User string` + The type of the input item. Always `encrypted_content`. - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` -### Example + - `Recipient string` -```go -package main + The destination agent identity. -import ( - "context" - "fmt" + - `Type AgentMessage` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" - "github.com/openai/openai-go/responses" -) + The item type. Always `agent_message`. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - betaResponse, err := client.Beta.Responses.Cancel( - context.TODO(), - "resp_677efb5139a88190b512bc3fef8e535d", - responses.BetaResponseCancelParams{ + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", betaResponse.ID) -} -``` + - `ID string` -#### Response + The unique ID of this agent message item. -```json -{ - "id": "id", - "created_at": 0, - "error": { - "code": "server_error", - "message": "message" - }, - "incomplete_details": { - "reason": "max_output_tokens" - }, - "instructions": "string", - "metadata": { - "foo": "string" - }, - "model": "gpt-5.1", - "object": "response", - "output": [ - { - "id": "id", - "content": [ - { - "annotations": [ - { - "file_id": "file_id", - "filename": "filename", - "index": 0, - "type": "file_citation" - } - ], - "text": "text", - "type": "output_text", - "logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0, - "top_logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0 - } - ] - } - ] - } - ], - "role": "assistant", - "status": "in_progress", - "type": "message", - "agent": { - "agent_name": "agent_name" - }, - "phase": "commentary" - } - ], - "parallel_tool_calls": true, - "temperature": 1, - "tool_choice": "none", - "tools": [ - { - "name": "name", - "parameters": { - "foo": "bar" - }, - "strict": true, - "type": "function", - "allowed_callers": [ - "direct" - ], - "defer_loading": true, - "description": "description", - "output_schema": { - "foo": "bar" - } - } - ], - "top_p": 1, - "background": true, - "completed_at": 0, - "conversation": { - "id": "id" - }, - "max_output_tokens": 0, - "max_tool_calls": 0, - "moderation": { - "input": { - "categories": { - "foo": true - }, - "category_applied_input_types": { - "foo": [ - "text" - ] - }, - "category_scores": { - "foo": 0 - }, - "flagged": true, - "model": "model", - "type": "moderation_result" - }, - "output": { - "categories": { - "foo": true - }, - "category_applied_input_types": { - "foo": [ - "text" - ] - }, - "category_scores": { - "foo": 0 - }, - "flagged": true, - "model": "model", - "type": "moderation_result" - } - }, - "output_text": "output_text", - "previous_response_id": "previous_response_id", - "prompt": { - "id": "id", - "variables": { - "foo": "string" - }, - "version": "version" - }, - "prompt_cache_key": "prompt-cache-key-1234", - "prompt_cache_options": { - "mode": "implicit", - "ttl": "30m" - }, - "prompt_cache_retention": "in_memory", - "reasoning": { - "context": "auto", - "effort": "none", - "generate_summary": "auto", - "mode": "standard", - "summary": "auto" - }, - "safety_identifier": "safety-identifier-1234", - "service_tier": "auto", - "status": "completed", - "text": { - "format": { - "type": "text" - }, - "verbosity": "low" - }, - "top_logprobs": 0, - "truncation": "auto", - "usage": { - "input_tokens": 0, - "input_tokens_details": { - "cache_write_tokens": 0, - "cached_tokens": 0 - }, - "output_tokens": 0, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 0 - }, - "user": "user-1234" -} -``` + - `Agent BetaResponseInputItemAgentMessageAgent` -## Compact a response + The agent that produced this item. -`client.Beta.Responses.Compact(ctx, params) (*BetaCompactedResponse, error)` + - `AgentName string` -**post** `/responses/compact?beta=true` + The canonical name of the agent that produced this item. -Compact a response + - `type BetaResponseInputItemMultiAgentCall struct{…}` -### Parameters + - `Action string` -- `params BetaResponseCompactParams` + The multi-agent action that was executed. - - `Model param.Field[BetaResponseCompactParamsModel]` + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - Body param: Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models. + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `type BetaResponseCompactParamsModel string` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models. + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `const BetaResponseCompactParamsModelGPT5_6Sol BetaResponseCompactParamsModel = "gpt-5.6-sol"` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - - `const BetaResponseCompactParamsModelGPT5_6Terra BetaResponseCompactParamsModel = "gpt-5.6-terra"` + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `const BetaResponseCompactParamsModelGPT5_6Luna BetaResponseCompactParamsModel = "gpt-5.6-luna"` + - `Arguments string` - - `const BetaResponseCompactParamsModelGPT5_4 BetaResponseCompactParamsModel = "gpt-5.4"` + The action arguments as a JSON string. - - `const BetaResponseCompactParamsModelGPT5_4Mini BetaResponseCompactParamsModel = "gpt-5.4-mini"` + - `CallID string` - - `const BetaResponseCompactParamsModelGPT5_4Nano BetaResponseCompactParamsModel = "gpt-5.4-nano"` + The unique ID linking this call to its output. - - `const BetaResponseCompactParamsModelGPT5_4Mini2026_03_17 BetaResponseCompactParamsModel = "gpt-5.4-mini-2026-03-17"` + - `Type MultiAgentCall` - - `const BetaResponseCompactParamsModelGPT5_4Nano2026_03_17 BetaResponseCompactParamsModel = "gpt-5.4-nano-2026-03-17"` + The item type. Always `multi_agent_call`. - - `const BetaResponseCompactParamsModelGPT5_3ChatLatest BetaResponseCompactParamsModel = "gpt-5.3-chat-latest"` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `const BetaResponseCompactParamsModelGPT5_2 BetaResponseCompactParamsModel = "gpt-5.2"` + - `ID string` - - `const BetaResponseCompactParamsModelGPT5_2_2025_12_11 BetaResponseCompactParamsModel = "gpt-5.2-2025-12-11"` + The unique ID of this multi-agent call. - - `const BetaResponseCompactParamsModelGPT5_2ChatLatest BetaResponseCompactParamsModel = "gpt-5.2-chat-latest"` + - `Agent BetaResponseInputItemMultiAgentCallAgent` - - `const BetaResponseCompactParamsModelGPT5_2Pro BetaResponseCompactParamsModel = "gpt-5.2-pro"` + The agent that produced this item. - - `const BetaResponseCompactParamsModelGPT5_2Pro2025_12_11 BetaResponseCompactParamsModel = "gpt-5.2-pro-2025-12-11"` + - `AgentName string` - - `const BetaResponseCompactParamsModelGPT5_1 BetaResponseCompactParamsModel = "gpt-5.1"` + The canonical name of the agent that produced this item. - - `const BetaResponseCompactParamsModelGPT5_1_2025_11_13 BetaResponseCompactParamsModel = "gpt-5.1-2025-11-13"` + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - - `const BetaResponseCompactParamsModelGPT5_1Codex BetaResponseCompactParamsModel = "gpt-5.1-codex"` + - `Action string` - - `const BetaResponseCompactParamsModelGPT5_1Mini BetaResponseCompactParamsModel = "gpt-5.1-mini"` + The multi-agent action that produced this result. - - `const BetaResponseCompactParamsModelGPT5_1ChatLatest BetaResponseCompactParamsModel = "gpt-5.1-chat-latest"` + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaResponseCompactParamsModelGPT5 BetaResponseCompactParamsModel = "gpt-5"` + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `const BetaResponseCompactParamsModelGPT5Mini BetaResponseCompactParamsModel = "gpt-5-mini"` + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - - `const BetaResponseCompactParamsModelGPT5Nano BetaResponseCompactParamsModel = "gpt-5-nano"` + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - - `const BetaResponseCompactParamsModelGPT5_2025_08_07 BetaResponseCompactParamsModel = "gpt-5-2025-08-07"` + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - - `const BetaResponseCompactParamsModelGPT5Mini2025_08_07 BetaResponseCompactParamsModel = "gpt-5-mini-2025-08-07"` + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - - `const BetaResponseCompactParamsModelGPT5Nano2025_08_07 BetaResponseCompactParamsModel = "gpt-5-nano-2025-08-07"` + - `CallID string` - - `const BetaResponseCompactParamsModelGPT5ChatLatest BetaResponseCompactParamsModel = "gpt-5-chat-latest"` + The unique ID of the multi-agent call. - - `const BetaResponseCompactParamsModelGPT4_1 BetaResponseCompactParamsModel = "gpt-4.1"` + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `const BetaResponseCompactParamsModelGPT4_1Mini BetaResponseCompactParamsModel = "gpt-4.1-mini"` + Text output returned by the multi-agent action. - - `const BetaResponseCompactParamsModelGPT4_1Nano BetaResponseCompactParamsModel = "gpt-4.1-nano"` + - `Text string` - - `const BetaResponseCompactParamsModelGPT4_1_2025_04_14 BetaResponseCompactParamsModel = "gpt-4.1-2025-04-14"` + The text content. - - `const BetaResponseCompactParamsModelGPT4_1Mini2025_04_14 BetaResponseCompactParamsModel = "gpt-4.1-mini-2025-04-14"` + - `Type OutputText` - - `const BetaResponseCompactParamsModelGPT4_1Nano2025_04_14 BetaResponseCompactParamsModel = "gpt-4.1-nano-2025-04-14"` + The content type. Always `output_text`. - - `const BetaResponseCompactParamsModelO4Mini BetaResponseCompactParamsModel = "o4-mini"` + - `const OutputTextOutputText OutputText = "output_text"` - - `const BetaResponseCompactParamsModelO4Mini2025_04_16 BetaResponseCompactParamsModel = "o4-mini-2025-04-16"` + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - `const BetaResponseCompactParamsModelO3 BetaResponseCompactParamsModel = "o3"` + Citations associated with the text content. - - `const BetaResponseCompactParamsModelO3_2025_04_16 BetaResponseCompactParamsModel = "o3-2025-04-16"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `const BetaResponseCompactParamsModelO3Mini BetaResponseCompactParamsModel = "o3-mini"` + - `FileID string` - - `const BetaResponseCompactParamsModelO3Mini2025_01_31 BetaResponseCompactParamsModel = "o3-mini-2025-01-31"` + The ID of the file. - - `const BetaResponseCompactParamsModelO1 BetaResponseCompactParamsModel = "o1"` + - `Filename string` - - `const BetaResponseCompactParamsModelO1_2024_12_17 BetaResponseCompactParamsModel = "o1-2024-12-17"` + The filename of the file cited. - - `const BetaResponseCompactParamsModelO1Preview BetaResponseCompactParamsModel = "o1-preview"` + - `Index int64` - - `const BetaResponseCompactParamsModelO1Preview2024_09_12 BetaResponseCompactParamsModel = "o1-preview-2024-09-12"` + The index of the file in the list of files. - - `const BetaResponseCompactParamsModelO1Mini BetaResponseCompactParamsModel = "o1-mini"` + - `Type FileCitation` - - `const BetaResponseCompactParamsModelO1Mini2024_09_12 BetaResponseCompactParamsModel = "o1-mini-2024-09-12"` + The citation type. Always `file_citation`. - - `const BetaResponseCompactParamsModelGPT4o BetaResponseCompactParamsModel = "gpt-4o"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaResponseCompactParamsModelGPT4o2024_11_20 BetaResponseCompactParamsModel = "gpt-4o-2024-11-20"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - - `const BetaResponseCompactParamsModelGPT4o2024_08_06 BetaResponseCompactParamsModel = "gpt-4o-2024-08-06"` + - `EndIndex int64` - - `const BetaResponseCompactParamsModelGPT4o2024_05_13 BetaResponseCompactParamsModel = "gpt-4o-2024-05-13"` + The index of the last character of the citation in the message. - - `const BetaResponseCompactParamsModelGPT4oAudioPreview BetaResponseCompactParamsModel = "gpt-4o-audio-preview"` + - `StartIndex int64` - - `const BetaResponseCompactParamsModelGPT4oAudioPreview2024_10_01 BetaResponseCompactParamsModel = "gpt-4o-audio-preview-2024-10-01"` + The index of the first character of the citation in the message. - - `const BetaResponseCompactParamsModelGPT4oAudioPreview2024_12_17 BetaResponseCompactParamsModel = "gpt-4o-audio-preview-2024-12-17"` + - `Title string` - - `const BetaResponseCompactParamsModelGPT4oAudioPreview2025_06_03 BetaResponseCompactParamsModel = "gpt-4o-audio-preview-2025-06-03"` + The title of the cited resource. - - `const BetaResponseCompactParamsModelGPT4oMiniAudioPreview BetaResponseCompactParamsModel = "gpt-4o-mini-audio-preview"` + - `Type URLCitation` - - `const BetaResponseCompactParamsModelGPT4oMiniAudioPreview2024_12_17 BetaResponseCompactParamsModel = "gpt-4o-mini-audio-preview-2024-12-17"` + The citation type. Always `url_citation`. - - `const BetaResponseCompactParamsModelGPT4oSearchPreview BetaResponseCompactParamsModel = "gpt-4o-search-preview"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `const BetaResponseCompactParamsModelGPT4oMiniSearchPreview BetaResponseCompactParamsModel = "gpt-4o-mini-search-preview"` + - `URL string` - - `const BetaResponseCompactParamsModelGPT4oSearchPreview2025_03_11 BetaResponseCompactParamsModel = "gpt-4o-search-preview-2025-03-11"` + The URL of the cited resource. - - `const BetaResponseCompactParamsModelGPT4oMiniSearchPreview2025_03_11 BetaResponseCompactParamsModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `const BetaResponseCompactParamsModelChatgpt4oLatest BetaResponseCompactParamsModel = "chatgpt-4o-latest"` + - `ContainerID string` - - `const BetaResponseCompactParamsModelCodexMiniLatest BetaResponseCompactParamsModel = "codex-mini-latest"` + The ID of the container. - - `const BetaResponseCompactParamsModelGPT4oMini BetaResponseCompactParamsModel = "gpt-4o-mini"` + - `EndIndex int64` - - `const BetaResponseCompactParamsModelGPT4oMini2024_07_18 BetaResponseCompactParamsModel = "gpt-4o-mini-2024-07-18"` + The index of the last character of the citation in the message. - - `const BetaResponseCompactParamsModelGPT4Turbo BetaResponseCompactParamsModel = "gpt-4-turbo"` + - `FileID string` - - `const BetaResponseCompactParamsModelGPT4Turbo2024_04_09 BetaResponseCompactParamsModel = "gpt-4-turbo-2024-04-09"` + The ID of the container file. - - `const BetaResponseCompactParamsModelGPT4_0125Preview BetaResponseCompactParamsModel = "gpt-4-0125-preview"` + - `Filename string` - - `const BetaResponseCompactParamsModelGPT4TurboPreview BetaResponseCompactParamsModel = "gpt-4-turbo-preview"` + The filename of the container file cited. - - `const BetaResponseCompactParamsModelGPT4_1106Preview BetaResponseCompactParamsModel = "gpt-4-1106-preview"` + - `StartIndex int64` - - `const BetaResponseCompactParamsModelGPT4VisionPreview BetaResponseCompactParamsModel = "gpt-4-vision-preview"` + The index of the first character of the citation in the message. - - `const BetaResponseCompactParamsModelGPT4 BetaResponseCompactParamsModel = "gpt-4"` + - `Type ContainerFileCitation` - - `const BetaResponseCompactParamsModelGPT4_0314 BetaResponseCompactParamsModel = "gpt-4-0314"` + The citation type. Always `container_file_citation`. - - `const BetaResponseCompactParamsModelGPT4_0613 BetaResponseCompactParamsModel = "gpt-4-0613"` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `const BetaResponseCompactParamsModelGPT4_32k BetaResponseCompactParamsModel = "gpt-4-32k"` + - `Type MultiAgentCallOutput` - - `const BetaResponseCompactParamsModelGPT4_32k0314 BetaResponseCompactParamsModel = "gpt-4-32k-0314"` + The item type. Always `multi_agent_call_output`. - - `const BetaResponseCompactParamsModelGPT4_32k0613 BetaResponseCompactParamsModel = "gpt-4-32k-0613"` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `const BetaResponseCompactParamsModelGPT3_5Turbo BetaResponseCompactParamsModel = "gpt-3.5-turbo"` + - `ID string` - - `const BetaResponseCompactParamsModelGPT3_5Turbo16k BetaResponseCompactParamsModel = "gpt-3.5-turbo-16k"` + The unique ID of this multi-agent call output. - - `const BetaResponseCompactParamsModelGPT3_5Turbo0301 BetaResponseCompactParamsModel = "gpt-3.5-turbo-0301"` + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` - - `const BetaResponseCompactParamsModelGPT3_5Turbo0613 BetaResponseCompactParamsModel = "gpt-3.5-turbo-0613"` + The agent that produced this item. - - `const BetaResponseCompactParamsModelGPT3_5Turbo1106 BetaResponseCompactParamsModel = "gpt-3.5-turbo-1106"` + - `AgentName string` - - `const BetaResponseCompactParamsModelGPT3_5Turbo0125 BetaResponseCompactParamsModel = "gpt-3.5-turbo-0125"` + The canonical name of the agent that produced this item. - - `const BetaResponseCompactParamsModelGPT3_5Turbo16k0613 BetaResponseCompactParamsModel = "gpt-3.5-turbo-16k-0613"` + - `type BetaResponseInputItemToolSearchCall struct{…}` - - `const BetaResponseCompactParamsModelO1Pro BetaResponseCompactParamsModel = "o1-pro"` + - `Arguments any` - - `const BetaResponseCompactParamsModelO1Pro2025_03_19 BetaResponseCompactParamsModel = "o1-pro-2025-03-19"` + The arguments supplied to the tool search call. - - `const BetaResponseCompactParamsModelO3Pro BetaResponseCompactParamsModel = "o3-pro"` + - `Type ToolSearchCall` - - `const BetaResponseCompactParamsModelO3Pro2025_06_10 BetaResponseCompactParamsModel = "o3-pro-2025-06-10"` + The item type. Always `tool_search_call`. - - `const BetaResponseCompactParamsModelO3DeepResearch BetaResponseCompactParamsModel = "o3-deep-research"` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `const BetaResponseCompactParamsModelO3DeepResearch2025_06_26 BetaResponseCompactParamsModel = "o3-deep-research-2025-06-26"` + - `ID string` - - `const BetaResponseCompactParamsModelO4MiniDeepResearch BetaResponseCompactParamsModel = "o4-mini-deep-research"` + The unique ID of this tool search call. - - `const BetaResponseCompactParamsModelO4MiniDeepResearch2025_06_26 BetaResponseCompactParamsModel = "o4-mini-deep-research-2025-06-26"` + - `Agent BetaResponseInputItemToolSearchCallAgent` - - `const BetaResponseCompactParamsModelComputerUsePreview BetaResponseCompactParamsModel = "computer-use-preview"` + The agent that produced this item. - - `const BetaResponseCompactParamsModelComputerUsePreview2025_03_11 BetaResponseCompactParamsModel = "computer-use-preview-2025-03-11"` + - `AgentName string` - - `const BetaResponseCompactParamsModelGPT5Codex BetaResponseCompactParamsModel = "gpt-5-codex"` + The canonical name of the agent that produced this item. - - `const BetaResponseCompactParamsModelGPT5Pro BetaResponseCompactParamsModel = "gpt-5-pro"` + - `CallID string` - - `const BetaResponseCompactParamsModelGPT5Pro2025_10_06 BetaResponseCompactParamsModel = "gpt-5-pro-2025-10-06"` + The unique ID of the tool search call generated by the model. - - `const BetaResponseCompactParamsModelGPT5_1CodexMax BetaResponseCompactParamsModel = "gpt-5.1-codex-max"` + - `Execution string` - - `string` + Whether tool search was executed by the server or by the client. - - `Input param.Field[BetaResponseCompactParamsInputUnion]` + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - Body param: Text, image, or file inputs to the model, used to generate a response + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - - `string` + - `Status string` - - `type BetaResponseCompactParamsInputArray []BetaResponseInputItemUnion` + The status of the tool search call. - A list of one or many input items to the model, containing different content types. + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - - `type BetaEasyInputMessage struct{…}` + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - - `Content BetaEasyInputMessageContentUnion` + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `Tools []BetaToolUnion` - - `string` + The loaded tool definitions returned by the tool search output. - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `type BetaFunctionTool struct{…}` - A list of one or many input items to the model, containing different content - types. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `type BetaResponseInputText struct{…}` + - `Name string` - A text input to the model. + The name of the function to call. - - `Text string` + - `Parameters map[string, any]` - The text input to the model. + A JSON schema object describing the parameters of the function. - - `Type InputText` + - `Strict bool` - The type of the input item. Always `input_text`. + Whether strict parameter validation is enforced for this function tool. - - `const InputTextInputText InputText = "input_text"` + - `Type Function` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + The type of the function tool. Always `function`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const FunctionFunction Function = "function"` - - `Mode Explicit` + - `AllowedCallers []string` - The breakpoint mode. Always `explicit`. + The tool invocation context(s). - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `type BetaResponseInputImage struct{…}` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `DeferLoading bool` - - `Detail BetaResponseInputImageDetail` + Whether this function is deferred and loaded via tool search. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Description string` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + A description of the function. Used by the model to determine whether or not to call the function. - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `OutputSchema map[string, any]` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `type BetaFileSearchTool struct{…}` - - `Type InputImage` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The type of the input item. Always `input_image`. + - `Type FileSearch` - - `const InputImageInputImage InputImage = "input_image"` + The type of the file search tool. Always `file_search`. - - `FileID string` + - `const FileSearchFileSearch FileSearch = "file_search"` - The ID of the file to be sent to the model. + - `VectorStoreIDs []string` - - `ImageURL string` + The IDs of the vector stores to search. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `Filters BetaFileSearchToolFiltersUnion` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + A filter to apply. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `Mode Explicit` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - The breakpoint mode. Always `explicit`. + - `Key string` - - `const ExplicitExplicit Explicit = "explicit"` + The key to compare against the value. - - `type BetaResponseInputFile struct{…}` + - `Type string` - A file input to the model. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `Type InputFile` + - `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 - The type of the input item. Always `input_file`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `const InputFileInputFile InputFile = "input_file"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - `Detail BetaResponseInputFileDetail` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `FileData string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - The content of the file to be sent to the model. + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - `FileID string` + The value to compare against the attribute key; supports string, number, or boolean types. - The ID of the file to be sent to the model. + - `string` - - `FileURL string` + - `float64` - The URL of the file to be sent to the model. + - `bool` - - `Filename string` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - The name of the file to be sent to the model. + - `string` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `float64` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `Mode Explicit` + Combine multiple filters using `and` or `or`. - The breakpoint mode. Always `explicit`. + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `const ExplicitExplicit Explicit = "explicit"` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `Role BetaEasyInputMessageRole` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + - `Key string` - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + The key to compare against the value. - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + - `Type string` - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `Phase BetaEasyInputMessagePhase` + - `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 - 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 BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `Type BetaEasyInputMessageType` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - The type of the message input. Always `message`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `type BetaResponseInputItemMessage struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - `Content BetaResponseInputMessageContentList` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - A list of one or many input items to the model, containing different content - types. + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - `Role string` + The value to compare against the attribute key; supports string, number, or boolean types. - The role of the message input. One of `user`, `system`, or `developer`. + - `string` - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + - `float64` - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + - `bool` - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `Agent BetaResponseInputItemMessageAgent` + - `string` - The agent that produced this item. + - `float64` - - `AgentName string` + - `Type string` - The canonical name of the agent that produced this item. + Type of operation: `and` or `or`. - - `Status string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + - `MaxNumResults int64` - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + - `RankingOptions BetaFileSearchToolRankingOptions` - - `Type string` + Ranking options for search. - The type of the message input. Always set to `message`. + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `type BetaResponseOutputMessage struct{…}` + - `EmbeddingWeight float64` - An output message from the model. + The weight of the embedding in the reciprocal ranking fusion. - - `ID string` + - `TextWeight float64` - The unique ID of the output message. + The weight of the text in the reciprocal ranking fusion. - - `Content []BetaResponseOutputMessageContentUnion` + - `Ranker string` - The content of the output message. + The ranker to use for the file search. - - `type BetaResponseOutputText struct{…}` + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - A text output from the model. + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `ScoreThreshold float64` - The annotations of the text output. + 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 BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `type BetaComputerTool struct{…}` - A citation to a file. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `FileID string` + - `Type Computer` - The ID of the file. + The type of the computer tool. Always `computer`. - - `Filename string` + - `const ComputerComputer Computer = "computer"` - The filename of the file cited. + - `type BetaComputerUsePreviewTool struct{…}` - - `Index int64` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The index of the file in the list of files. + - `DisplayHeight int64` - - `Type FileCitation` + The height of the computer display. - The type of the file citation. Always `file_citation`. + - `DisplayWidth int64` - - `const FileCitationFileCitation FileCitation = "file_citation"` + The width of the computer display. - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `Environment BetaComputerUsePreviewToolEnvironment` - A citation for a web resource used to generate a model response. + The type of computer environment to control. - - `EndIndex int64` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - The index of the last character of the URL citation in the message. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `StartIndex int64` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - The index of the first character of the URL citation in the message. + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `Title string` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - The title of the web resource. + - `Type ComputerUsePreview` - - `Type URLCitation` + The type of the computer use tool. Always `computer_use_preview`. - The type of the URL citation. Always `url_citation`. + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `type BetaWebSearchTool struct{…}` - - `URL string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The URL of the web resource. + - `Type BetaWebSearchToolType` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - A citation for a container file used to generate a model response. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `ContainerID string` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - The ID of the container file. + - `Filters BetaWebSearchToolFilters` - - `EndIndex int64` + Filters for the search. - The index of the last character of the container file citation in the message. + - `AllowedDomains []string` - - `FileID string` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - The ID of the file. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `Filename string` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - The filename of the container file cited. + 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. - - `StartIndex int64` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - The index of the first character of the container file citation in the message. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `Type ContainerFileCitation` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - The type of the container file citation. Always `container_file_citation`. + - `UserLocation BetaWebSearchToolUserLocation` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + The approximate location of the user. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `City string` - A path to a file. + Free text input for the city of the user, e.g. `San Francisco`. - - `FileID string` + - `Country string` - The ID of the file. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `Index int64` + - `Region string` - The index of the file in the list of files. + Free text input for the region of the user, e.g. `California`. - - `Type FilePath` + - `Timezone string` - The type of the file path. Always `file_path`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const FilePathFilePath FilePath = "file_path"` + - `Type string` - - `Text string` + The type of location approximation. Always `approximate`. - The text output from the model. + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `Type OutputText` + - `type BetaToolMcp struct{…}` - The type of the output text. Always `output_text`. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const OutputTextOutputText OutputText = "output_text"` + - `ServerLabel string` - - `Logprobs []BetaResponseOutputTextLogprob` + A label for this MCP server, used to identify it in tool calls. - - `Token string` + - `Type Mcp` - - `Bytes []int64` + The type of the MCP tool. Always `mcp`. - - `Logprob float64` + - `const McpMcp Mcp = "mcp"` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `AllowedCallers []string` - - `Token string` + The tool invocation context(s). - - `Bytes []int64` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - - `Logprob float64` + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `type BetaResponseOutputRefusal struct{…}` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - A refusal from the model. + List of allowed tool names or a filter object. - - `Refusal string` + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - The refusal explanation from the model. + A string array of allowed tool names - - `Type Refusal` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - The type of the refusal. Always `refusal`. + A filter object to specify which tools are allowed. - - `const RefusalRefusal Refusal = "refusal"` + - `ReadOnly bool` - - `Role Assistant` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The role of the output message. Always `assistant`. + - `ToolNames []string` - - `const AssistantAssistant Assistant = "assistant"` + List of allowed tool names. - - `Status BetaResponseOutputMessageStatus` + - `Authorization string` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + 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. - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + - `ConnectorID string` - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + Currently supported `connector_id` values are: - - `Type Message` + - 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` - The type of the output message. Always `message`. + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `const MessageMessage Message = "message"` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `Agent BetaResponseOutputMessageAgent` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - The agent that produced this item. + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - - `AgentName string` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - The canonical name of the agent that produced this item. + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `Phase BetaResponseOutputMessagePhase` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - 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 BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `DeferLoading bool` - - `type BetaResponseFileSearchToolCall struct{…}` + Whether this MCP tool is deferred and discovered via tool search. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `Headers map[string, string]` - - `ID string` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - The unique ID of the file search tool call. + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `Queries []string` + Specify which of the MCP server's tools require approval. - The queries used to search for files. + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `Status BetaResponseFileSearchToolCallStatus` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + A filter object to specify which tools are allowed. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `ReadOnly bool` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `ToolNames []string` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + List of allowed tool names. - - `Type FileSearchCall` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - The type of the file search tool call. Always `file_search_call`. + A filter object to specify which tools are allowed. - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `ReadOnly bool` - - `Agent BetaResponseFileSearchToolCallAgent` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The agent that produced this item. + - `ToolNames []string` - - `AgentName string` + List of allowed tool names. - The canonical name of the agent that produced this item. + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `Results []BetaResponseFileSearchToolCallResult` + 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. - The results of the file search tool call. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - 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. + - `ServerDescription string` - - `string` + Optional description of the MCP server, used to provide more context. - - `float64` + - `ServerURL string` - - `bool` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `FileID string` + - `TunnelID string` - The unique ID of the file. + 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. - - `Filename string` + - `type BetaToolCodeInterpreter struct{…}` - The name of the file. + A tool that runs Python code to help generate a response to a prompt. - - `Score float64` + - `Container BetaToolCodeInterpreterContainerUnion` - The relevance score of the file - a value between 0 and 1. + 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. - - `Text string` + - `string` - The text that was retrieved from the file. + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `type BetaResponseComputerToolCall struct{…}` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `Type Auto` - - `ID string` + Always `auto`. - The unique ID of the computer call. + - `const AutoAuto Auto = "auto"` - - `CallID string` + - `FileIDs []string` - An identifier used when responding to the tool call with output. + An optional list of uploaded files to make available to your code. - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + - `MemoryLimit string` - The pending safety checks for the computer call. + The memory limit for the code interpreter container. - - `ID string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - The ID of the pending safety check. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `Code string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - The type of the pending safety check. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `Message string` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - Details about the pending safety check. + Network access policy for the container. - - `Status BetaResponseComputerToolCallStatus` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Type Disabled` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + Disable outbound network access. Always `disabled`. - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `const DisabledDisabled Disabled = "disabled"` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `Type BetaResponseComputerToolCallType` + - `AllowedDomains []string` - The type of the computer call. Always `computer_call`. + A list of allowed domains when type is `allowlist`. - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `Type Allowlist` - - `Action BetaComputerActionUnion` + Allow outbound network access only to specified domains. Always `allowlist`. - A click action. + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `type BetaComputerActionClick struct{…}` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - A click action. + Optional domain-scoped secrets for allowlisted domains. - - `Button string` + - `Domain string` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + The domain associated with the secret. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `Name string` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + The name of the secret to inject for the domain. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `Value string` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + The secret value to inject for the domain. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `Type CodeInterpreter` - - `Type Click` + The type of the code interpreter tool. Always `code_interpreter`. - Specifies the event type. For a click action, this property is always `click`. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `const ClickClick Click = "click"` + - `AllowedCallers []string` - - `X int64` + The tool invocation context(s). - The x-coordinate where the click occurred. + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - - `Y int64` + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - The y-coordinate where the click occurred. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Keys []string` + - `Type ProgrammaticToolCalling` - The keys being held while clicking. + The type of the tool. Always `programmatic_tool_calling`. - - `type BetaComputerActionDoubleClick struct{…}` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - A double click action. + - `type BetaToolImageGeneration struct{…}` - - `Keys []string` + A tool that generates images using the GPT image models. - The keys being held while double-clicking. + - `Type ImageGeneration` - - `Type DoubleClick` + The type of the image generation tool. Always `image_generation`. - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `Action string` - - `X int64` + Whether to generate a new image or edit an existing image. Default: `auto`. - The x-coordinate where the double click occurred. + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - - `Y int64` + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - The y-coordinate where the double click occurred. + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - - `type BetaComputerActionDrag struct{…}` + - `Background string` - A drag action. + 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. - - `Path []BetaComputerActionDragPath` + `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. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `X int64` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - The x-coordinate. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `Y int64` + - `InputFidelity string` - The y-coordinate. + 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`. - - `Type Drag` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - Specifies the event type. For a drag action, this property is always set to `drag`. + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - - `const DragDrag Drag = "drag"` + - `InputImageMask BetaToolImageGenerationInputImageMask` - - `Keys []string` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - The keys being held while dragging the mouse. + - `FileID string` - - `type BetaComputerActionKeypress struct{…}` + File ID for the mask image. - A collection of keypresses the model would like to perform. + - `ImageURL string` - - `Keys []string` + Base64-encoded mask image. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `Model string` - - `Type Keypress` + The image generation model to use. Default: `gpt-image-1`. - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `string` - - `const KeypressKeypress Keypress = "keypress"` + - `string` - - `type BetaComputerActionMove struct{…}` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - A mouse move action. + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `Type Move` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - Specifies the event type. For a move action, this property is always set to `move`. + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `const MoveMove Move = "move"` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - - `X int64` + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - The x-coordinate to move to. + - `Moderation string` - - `Y int64` + Moderation level for the generated image. Default: `auto`. - The y-coordinate to move to. + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `Keys []string` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - The keys being held while moving the mouse. + - `OutputCompression int64` - - `type BetaComputerActionScreenshot struct{…}` + Compression level for the output image. Default: 100. - A screenshot action. + - `OutputFormat string` - - `Type Screenshot` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `type BetaComputerActionScroll struct{…}` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - A scroll action. + - `PartialImages int64` - - `ScrollX int64` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The horizontal scroll distance. + - `Quality string` - - `ScrollY int64` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - The vertical scroll distance. + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `Type Scroll` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `const ScrollScroll Scroll = "scroll"` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - - `X int64` + - `Size string` - The x-coordinate where the scroll occurred. + 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`. - - `Y int64` + - `string` - The y-coordinate where the scroll occurred. + - `string` - - `Keys []string` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - The keys being held while scrolling. + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `type BetaComputerActionType struct{…}` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - An action to type in text. + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - - `Text string` + - `type BetaToolLocalShell struct{…}` - The text to type. + A tool that allows the model to execute shell commands in a local environment. - - `Type Type` + - `Type LocalShell` - Specifies the event type. For a type action, this property is always set to `type`. + The type of the local shell tool. Always `local_shell`. - - `const TypeType Type = "type"` + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `type BetaComputerActionWait struct{…}` + - `type BetaFunctionShellTool struct{…}` - A wait action. + A tool that allows the model to execute shell commands. - - `Type Wait` + - `Type Shell` - Specifies the event type. For a wait action, this property is always set to `wait`. + The type of the shell tool. Always `shell`. - - `const WaitWait Wait = "wait"` + - `const ShellShell Shell = "shell"` - - `Actions BetaComputerActionList` + - `AllowedCallers []string` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + The tool invocation context(s). - - `type BetaComputerActionClick struct{…}` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - A click action. + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - `type BetaComputerActionDoubleClick struct{…}` + - `Environment BetaFunctionShellToolEnvironmentUnion` - A double click action. + - `type BetaContainerAuto struct{…}` - - `type BetaComputerActionDrag struct{…}` + - `Type ContainerAuto` - A drag action. + Automatically creates a container for this request - - `type BetaComputerActionKeypress struct{…}` + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - A collection of keypresses the model would like to perform. + - `FileIDs []string` - - `type BetaComputerActionMove struct{…}` + An optional list of uploaded files to make available to your code. - A mouse move action. + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `type BetaComputerActionScreenshot struct{…}` + The memory limit for the container. - A screenshot action. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `type BetaComputerActionScroll struct{…}` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - A scroll action. + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `type BetaComputerActionType struct{…}` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - An action to type in text. + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - `type BetaComputerActionWait struct{…}` + Network access policy for the container. - A wait action. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `Agent BetaResponseComputerToolCallAgent` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - The agent that produced this item. + - `Skills []BetaContainerAutoSkillUnion` - - `AgentName string` + An optional list of skills referenced by id or inline data. - The canonical name of the agent that produced this item. + - `type BetaSkillReference struct{…}` - - `type BetaResponseInputItemComputerCallOutput struct{…}` + - `SkillID string` - The output of a computer tool call. + The ID of the referenced skill. - - `CallID string` + - `Type SkillReference` - The ID of the computer tool call that produced the output. + References a skill created with the /v1/skills endpoint. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - A computer screenshot image used with the computer use tool. + - `Version string` - - `Type ComputerScreenshot` + Optional skill version. Use a positive integer or 'latest'. Omit for default. - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `type BetaInlineSkill struct{…}` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `Description string` - - `FileID string` + The description of the skill. - The identifier of an uploaded file that contains the screenshot. + - `Name string` - - `ImageURL string` + The name of the skill. - The URL of the screenshot image. + - `Source BetaInlineSkillSource` - - `Type ComputerCallOutput` + Inline skill payload - The type of the computer tool call output. Always `computer_call_output`. + - `Data string` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + Base64-encoded skill zip bundle. - - `ID string` + - `MediaType ApplicationZip` - The ID of the computer tool call output. + The media type of the inline skill payload. Must be `application/zip`. - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - The safety checks reported by the API that have been acknowledged by the developer. + - `Type Base64` - - `ID string` + The type of the inline skill source. Must be `base64`. - The ID of the pending safety check. + - `const Base64Base64 Base64 = "base64"` - - `Code string` + - `Type Inline` - The type of the pending safety check. + Defines an inline skill for this request. - - `Message string` + - `const InlineInline Inline = "inline"` - Details about the pending safety check. + - `type BetaLocalEnvironment struct{…}` - - `Agent BetaResponseInputItemComputerCallOutputAgent` + - `Type Local` - The agent that produced this item. + Use a local computer environment. - - `AgentName string` + - `const LocalLocal Local = "local"` - The canonical name of the agent that produced this item. + - `Skills []BetaLocalSkill` - - `Status string` + An optional list of skills. - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + - `Description string` - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + The description of the skill. - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `Name string` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + The name of the skill. - - `type BetaResponseFunctionWebSearch struct{…}` + - `Path string` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + The path to the directory containing the skill. - - `ID string` + - `type BetaContainerReference struct{…}` - The unique ID of the web search tool call. + - `ContainerID string` - - `Action BetaResponseFunctionWebSearchActionUnion` + The ID of the referenced container. - 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 ContainerReference` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + References a container created with the /v1/containers endpoint - Action type "search" - Performs a web search query. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `Type Search` + - `type BetaCustomTool struct{…}` - The action type. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const SearchSearch Search = "search"` + - `Name string` - - `Queries []string` + The name of the custom tool, used to identify it in tool calls. - The search queries. + - `Type Custom` - - `Query string` + The type of the custom tool. Always `custom`. - The search query. + - `const CustomCustom Custom = "custom"` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + - `AllowedCallers []string` - The sources used in the search. + The tool invocation context(s). - - `Type URL` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - The type of source. Always `url`. + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - - `const URLURL URL = "url"` + - `DeferLoading bool` - - `URL string` + Whether this tool should be deferred and discovered via tool search. - The URL of the source. + - `Description string` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + Optional description of the custom tool, used to provide more context. - Action type "open_page" - Opens a specific URL from search results. + - `Format BetaCustomToolFormatUnion` - - `Type OpenPage` + The input format for the custom tool. Default is unconstrained text. - The action type. + - `type BetaCustomToolFormatText struct{…}` - - `const OpenPageOpenPage OpenPage = "open_page"` + Unconstrained free-form text. - - `URL string` + - `Type Text` - The URL opened by the model. + Unconstrained text format. Always `text`. - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `const TextText Text = "text"` - Action type "find_in_page": Searches for a pattern within a loaded page. + - `type BetaCustomToolFormatGrammar struct{…}` - - `Pattern string` + A grammar defined by the user. - The pattern or text to search for within the page. + - `Definition string` - - `Type FindInPage` + The grammar definition. - The action type. + - `Syntax string` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + The syntax of the grammar definition. One of `lark` or `regex`. - - `URL string` + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - The URL of the page searched for the pattern. + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `Status BetaResponseFunctionWebSearchStatus` + - `Type Grammar` - The status of the web search tool call. + Grammar format. Always `grammar`. - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `const GrammarGrammar Grammar = "grammar"` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + - `type BetaNamespaceTool struct{…}` - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + Groups function/custom tools under a shared namespace. - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `Description string` - - `Type WebSearchCall` + A description of the namespace shown to the model. - The type of the web search tool call. Always `web_search_call`. + - `Name string` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + The namespace name used in tool calls (for example, `crm`). - - `Agent BetaResponseFunctionWebSearchAgent` + - `Tools []BetaNamespaceToolToolUnion` - The agent that produced this item. + The function/custom tools available inside this namespace. - - `AgentName string` + - `type BetaNamespaceToolToolFunction struct{…}` - The canonical name of the agent that produced this item. + - `Name string` - - `type BetaResponseFunctionToolCall struct{…}` + - `Type Function` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const FunctionFunction Function = "function"` - - `Arguments string` + - `AllowedCallers []string` - A JSON string of the arguments to pass to the function. + The tool invocation context(s). - - `CallID string` + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - The unique ID of the function tool call generated by the model. + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `Name string` + - `DeferLoading bool` - The name of the function to run. + Whether this function should be deferred and discovered via tool search. - - `Type FunctionCall` + - `Description string` - The type of the function tool call. Always `function_call`. + - `OutputSchema map[string, any]` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `ID string` + - `Parameters any` - The unique ID of the function tool call. + - `Strict bool` - - `Agent BetaResponseFunctionToolCallAgent` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - The agent that produced this item. + - `type BetaCustomTool struct{…}` - - `AgentName string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The canonical name of the agent that produced this item. + - `Type Namespace` - - `Caller BetaResponseFunctionToolCallCallerUnion` + The type of the tool. Always `namespace`. - The execution context that produced this tool call. + - `const NamespaceNamespace Namespace = "namespace"` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `type BetaToolSearchTool struct{…}` - - `Type Direct` + Hosted or BYOT tool search configuration for deferred tools. - - `const DirectDirect Direct = "direct"` + - `Type ToolSearch` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + The type of the tool. Always `tool_search`. - - `CallerID string` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - The call ID of the program item that produced this tool call. + - `Description string` - - `Type Program` + Description shown to the model for a client-executed tool search tool. - - `const ProgramProgram Program = "program"` + - `Execution BetaToolSearchToolExecution` - - `Namespace string` + Whether tool search is executed by the server or by the client. - The namespace of the function to run. + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `Status BetaResponseFunctionToolCallStatus` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Parameters any` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + Parameter schema for a client-executed tool search tool. - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `Type BetaWebSearchPreviewToolType` - The output of a function tool call. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `CallID string` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - The unique ID of the function tool call generated by the model. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + - `SearchContentTypes []string` - Text, image, or file output of the function tool call. + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `string` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - An array of content outputs (text, image, file) for the function tool call. + 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. - - `type BetaResponseInputTextContent struct{…}` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - A text input to the model. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `Text string` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - The text input to the model. + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `Type InputText` + The user's location. - The type of the input item. Always `input_text`. + - `Type Approximate` - - `const InputTextInputText InputText = "input_text"` + The type of location approximation. Always `approximate`. - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + - `const ApproximateApproximate Approximate = "approximate"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `City string` - - `Mode Explicit` + Free text input for the city of the user, e.g. `San Francisco`. - The breakpoint mode. Always `explicit`. + - `Country string` - - `const ExplicitExplicit Explicit = "explicit"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `type BetaResponseInputImageContent struct{…}` + - `Region string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + Free text input for the region of the user, e.g. `California`. - - `Type InputImage` + - `Timezone string` - The type of the input item. Always `input_image`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const InputImageInputImage InputImage = "input_image"` + - `type BetaApplyPatchTool struct{…}` - - `Detail BetaResponseInputImageContentDetail` + Allows the assistant to create, delete, or update files using unified diffs. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Type ApplyPatch` - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + The type of the tool. Always `apply_patch`. - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + - `AllowedCallers []string` - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + The tool invocation context(s). - - `FileID string` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - The ID of the file to be sent to the model. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `ImageURL string` + - `Type ToolSearchOutput` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + The item type. Always `tool_search_output`. - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `ID string` - - `Mode Explicit` + The unique ID of this tool search output. - The breakpoint mode. Always `explicit`. + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - - `const ExplicitExplicit Explicit = "explicit"` + The agent that produced this item. - - `type BetaResponseInputFileContent struct{…}` + - `AgentName string` - A file input to the model. + The canonical name of the agent that produced this item. - - `Type InputFile` + - `CallID string` - The type of the input item. Always `input_file`. + The unique ID of the tool search call generated by the model. - - `const InputFileInputFile InputFile = "input_file"` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - - `Detail BetaResponseInputFileContentDetail` + Whether tool search was executed by the server or by the client. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + - `Status BetaResponseToolSearchOutputItemParamStatus` - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + The status of the tool search output. - - `FileData string` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - The base64-encoded data of the file to be sent to the model. + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `FileID string` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - The ID of the file to be sent to the model. + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `FileURL string` + - `Role Developer` - The URL of the file to be sent to the model. + The role that provided the additional tools. Only `developer` is supported. - - `Filename string` + - `const DeveloperDeveloper Developer = "developer"` - The name of the file to be sent to the model. + - `Tools []BetaToolUnion` - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + A list of additional tools made available at this item. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaFunctionTool struct{…}` - - `Mode Explicit` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The breakpoint mode. Always `explicit`. + - `type BetaFileSearchTool struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Type FunctionCallOutput` + - `type BetaComputerTool struct{…}` - The type of the function tool call output. Always `function_call_output`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `type BetaComputerUsePreviewTool struct{…}` - - `ID string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The unique ID of the function tool call output. Populated when this item is returned via API. + - `type BetaWebSearchTool struct{…}` - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The agent that produced this item. + - `type BetaToolMcp struct{…}` - - `AgentName string` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The canonical name of the agent that produced this item. + - `type BetaToolCodeInterpreter struct{…}` - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + A tool that runs Python code to help generate a response to a prompt. - The execution context that produced this tool call. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + - `type BetaToolImageGeneration struct{…}` - - `Type Direct` + A tool that generates images using the GPT image models. - The caller type. Always `direct`. + - `type BetaToolLocalShell struct{…}` - - `const DirectDirect Direct = "direct"` + A tool that allows the model to execute shell commands in a local environment. - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + - `type BetaFunctionShellTool struct{…}` - - `CallerID string` + A tool that allows the model to execute shell commands. - The call ID of the program item that produced this tool call. + - `type BetaCustomTool struct{…}` - - `Type Program` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The caller type. Always `program`. + - `type BetaNamespaceTool struct{…}` - - `const ProgramProgram Program = "program"` + Groups function/custom tools under a shared namespace. - - `Status string` + - `type BetaToolSearchTool struct{…}` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + Hosted or BYOT tool search configuration for deferred tools. - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + - `type BetaApplyPatchTool struct{…}` - - `type BetaResponseInputItemAgentMessage struct{…}` + Allows the assistant to create, delete, or update files using unified diffs. - A message routed between agents. + - `Type AdditionalTools` - - `Author string` + The item type. Always `additional_tools`. - The sending agent identity. + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `Content []BetaResponseInputItemAgentMessageContentUnion` + - `ID string` - Plaintext, image, or encrypted content sent between agents. + The unique ID of this additional tools item. - - `type BetaResponseInputTextContent struct{…}` + - `Agent BetaResponseInputItemAdditionalToolsAgent` - A text input to the model. + The agent that produced this item. - - `type BetaResponseInputImageContent struct{…}` + - `AgentName string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + The canonical name of the agent that produced this item. - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + - `type BetaResponseReasoningItem struct{…}` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `EncryptedContent string` + - `ID string` - Opaque encrypted content. + The unique identifier of the reasoning content. - - `Type EncryptedContent` + - `Summary []BetaResponseReasoningItemSummary` - The type of the input item. Always `encrypted_content`. + Reasoning summary content. - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `Text string` - - `Recipient string` + A summary of the reasoning output from the model so far. - The destination agent identity. + - `Type SummaryText` - - `Type AgentMessage` + The type of the object. Always `summary_text`. - The item type. Always `agent_message`. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `Type Reasoning` - - `ID string` + The type of the object. Always `reasoning`. - The unique ID of this agent message item. + - `const ReasoningReasoning Reasoning = "reasoning"` - - `Agent BetaResponseInputItemAgentMessageAgent` + - `Agent BetaResponseReasoningItemAgent` The agent that produced this item. @@ -40091,43 +54908,55 @@ Compact a response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCall struct{…}` + - `Content []BetaResponseReasoningItemContent` - - `Action string` + Reasoning text content. - The multi-agent action that was executed. + - `Text string` - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + The reasoning text from the model. - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + - `Type ReasoningText` - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + The type of the reasoning text. Always `reasoning_text`. - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `EncryptedContent string` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `Arguments string` + - `Status BetaResponseReasoningItemStatus` - The action arguments as a JSON string. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `CallID string` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - The unique ID linking this call to its output. + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `Type MultiAgentCall` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - The item type. Always `multi_agent_call`. + - `type BetaResponseCompactionItemParamResp struct{…}` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + + - `EncryptedContent string` + + The encrypted content of the compaction summary. + + - `Type Compaction` + + The type of the item. Always `compaction`. + + - `const CompactionCompaction Compaction = "compaction"` - `ID string` - The unique ID of this multi-agent call. + The ID of the compaction item. - - `Agent BetaResponseInputItemMultiAgentCallAgent` + - `Agent BetaResponseCompactionItemParamAgentResp` The agent that produced this item. @@ -40135,1414 +54964,1370 @@ Compact a response The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - - `Action string` + An image generation request made by the model. - The multi-agent action that produced this result. + - `ID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + The unique ID of the image generation call. - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `Result string` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + The generated image encoded in base64. - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `Status string` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + The status of the image generation call. - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - - `CallID string` + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - The unique ID of the multi-agent call. + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - Text output returned by the multi-agent action. + - `Type ImageGenerationCall` - - `Text string` + The type of the image generation call. Always `image_generation_call`. - The text content. + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Type OutputText` + - `Agent BetaResponseInputItemImageGenerationCallAgent` - The content type. Always `output_text`. + The agent that produced this item. - - `const OutputTextOutputText OutputText = "output_text"` + - `AgentName string` - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + The canonical name of the agent that produced this item. - Citations associated with the text content. + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + A tool call to run code. - - `FileID string` + - `ID string` - The ID of the file. + The unique ID of the code interpreter tool call. - - `Filename string` + - `Code string` - The filename of the file cited. + The code to run, or null if not available. - - `Index int64` + - `ContainerID string` - The index of the file in the list of files. + The ID of the container used to run the code. - - `Type FileCitation` + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - The citation type. Always `file_citation`. + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + The logs output from the code interpreter. - - `EndIndex int64` + - `Logs string` - The index of the last character of the citation in the message. + The logs output from the code interpreter. - - `StartIndex int64` + - `Type Logs` - The index of the first character of the citation in the message. + The type of the output. Always `logs`. - - `Title string` + - `const LogsLogs Logs = "logs"` - The title of the cited resource. + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `Type URLCitation` + The image output from the code interpreter. - The citation type. Always `url_citation`. + - `Type Image` - - `const URLCitationURLCitation URLCitation = "url_citation"` + The type of the output. Always `image`. - - `URL string` + - `const ImageImage Image = "image"` - The URL of the cited resource. + - `URL string` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + The URL of the image output from the code interpreter. - - `ContainerID string` + - `Status BetaResponseCodeInterpreterToolCallStatus` - The ID of the container. + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `EndIndex int64` + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - The index of the last character of the citation in the message. + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - `FileID string` + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - The ID of the container file. + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `Filename string` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - The filename of the container file cited. + - `Type CodeInterpreterCall` - - `StartIndex int64` + The type of the code interpreter tool call. Always `code_interpreter_call`. - The index of the first character of the citation in the message. + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - `Type ContainerFileCitation` + - `Agent BetaResponseCodeInterpreterToolCallAgent` - The citation type. Always `container_file_citation`. + The agent that produced this item. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `AgentName string` - - `Type MultiAgentCallOutput` + The canonical name of the agent that produced this item. - The item type. Always `multi_agent_call_output`. + - `type BetaResponseInputItemLocalShellCall struct{…}` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + A tool call to run a command on the local shell. - `ID string` - The unique ID of this multi-agent call output. - - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + The unique ID of the local shell call. - The agent that produced this item. + - `Action BetaResponseInputItemLocalShellCallAction` - - `AgentName string` + Execute a shell command on the server. - The canonical name of the agent that produced this item. + - `Command []string` - - `type BetaResponseInputItemToolSearchCall struct{…}` + The command to run. - - `Arguments any` + - `Env map[string, string]` - The arguments supplied to the tool search call. + Environment variables to set for the command. - - `Type ToolSearchCall` + - `Type Exec` - The item type. Always `tool_search_call`. + The type of the local shell action. Always `exec`. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `const ExecExec Exec = "exec"` - - `ID string` + - `TimeoutMs int64` - The unique ID of this tool search call. + Optional timeout in milliseconds for the command. - - `Agent BetaResponseInputItemToolSearchCallAgent` + - `User string` - The agent that produced this item. + Optional user to run the command as. - - `AgentName string` + - `WorkingDirectory string` - The canonical name of the agent that produced this item. + Optional working directory to run the command in. - `CallID string` - The unique ID of the tool search call generated by the model. - - - `Execution string` - - Whether tool search was executed by the server or by the client. + The unique ID of the local shell tool call generated by the model. - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + - `Status string` - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + The status of the local shell call. - - `Status string` + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - The status of the tool search call. + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + - `Type LocalShellCall` - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + The type of the local shell call. Always `local_shell_call`. - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `Tools []BetaToolUnion` + - `Agent BetaResponseInputItemLocalShellCallAgent` - The loaded tool definitions returned by the tool search output. + The agent that produced this item. - - `type BetaFunctionTool struct{…}` + - `AgentName string` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The canonical name of the agent that produced this item. - - `Name string` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - The name of the function to call. + The output of a local shell tool call. - - `Parameters map[string, any]` + - `ID string` - A JSON schema object describing the parameters of the function. + The unique ID of the local shell tool call generated by the model. - - `Strict bool` + - `Output string` - Whether strict parameter validation is enforced for this function tool. + A JSON string of the output of the local shell tool call. - - `Type Function` + - `Type LocalShellCallOutput` - The type of the function tool. Always `function`. + The type of the local shell tool call output. Always `local_shell_call_output`. - - `const FunctionFunction Function = "function"` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `AllowedCallers []string` + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - The tool invocation context(s). + The agent that produced this item. - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `AgentName string` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + The canonical name of the agent that produced this item. - - `DeferLoading bool` + - `Status string` - Whether this function is deferred and loaded via tool search. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `Description string` + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - A description of the function. Used by the model to determine whether or not to call the function. + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - - `OutputSchema map[string, any]` + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - A JSON schema object describing the JSON value encoded in string outputs for this function. + - `type BetaResponseInputItemShellCall struct{…}` - - `type BetaFileSearchTool struct{…}` + A tool representing a request to execute one or more shell commands. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `Action BetaResponseInputItemShellCallAction` - - `Type FileSearch` + The shell commands and limits that describe how to run the tool call. - The type of the file search tool. Always `file_search`. + - `Commands []string` - - `const FileSearchFileSearch FileSearch = "file_search"` + Ordered shell commands for the execution environment to run. - - `VectorStoreIDs []string` + - `MaxOutputLength int64` - The IDs of the vector stores to search. + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - `Filters BetaFileSearchToolFiltersUnion` + - `TimeoutMs int64` - A filter to apply. + Maximum wall-clock time in milliseconds to allow the shell commands to run. - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `CallID string` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + The unique ID of the shell tool call generated by the model. - - `Key string` + - `Type ShellCall` - The key to compare against the value. + The type of the item. Always `shell_call`. - - `Type string` + - `const ShellCallShellCall ShellCall = "shell_call"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `ID string` - - `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 + The unique ID of the shell tool call. Populated when this item is returned via API. - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `Agent BetaResponseInputItemShellCallAgent` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + The agent that produced this item. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + - `AgentName string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + The canonical name of the agent that produced this item. - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + - `Caller BetaResponseInputItemShellCallCallerUnion` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + The execution context that produced this tool call. - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `Type Direct` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + The caller type. Always `direct`. - The value to compare against the attribute key; supports string, number, or boolean types. + - `const DirectDirect Direct = "direct"` - - `string` + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - - `float64` + - `CallerID string` - - `bool` + The call ID of the program item that produced this tool call. - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `Type Program` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + The caller type. Always `program`. - Combine multiple filters using `and` or `or`. + - `const ProgramProgram Program = "program"` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + The environment to execute the shell commands in. - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `type BetaLocalEnvironment struct{…}` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `type BetaContainerReference struct{…}` - - `Key string` + - `Status string` - The key to compare against the value. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `Type string` + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - - `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 BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + The streamed output items emitted by a shell tool call. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `CallID string` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + The unique ID of the shell tool call generated by the model. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `Output []BetaResponseFunctionShellCallOutputContent` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + The exit or timeout outcome associated with this shell call. - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - The value to compare against the attribute key; supports string, number, or boolean types. + Indicates that the shell call exceeded its configured time limit. - - `string` + - `Type Timeout` - - `float64` + The outcome type. Always `timeout`. - - `bool` + - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - `Type string` + Indicates that the shell commands finished and returned an exit code. - Type of operation: `and` or `or`. + - `ExitCode int64` - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + The exit code returned by the shell process. - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + - `Type Exit` - - `MaxNumResults int64` + The outcome type. Always `exit`. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `const ExitExit Exit = "exit"` - - `RankingOptions BetaFileSearchToolRankingOptions` + - `Stderr string` - Ranking options for search. + Captured stderr output for the shell call. - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `Stdout string` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + Captured stdout output for the shell call. - - `EmbeddingWeight float64` + - `Type ShellCallOutput` - The weight of the embedding in the reciprocal ranking fusion. + The type of the item. Always `shell_call_output`. - - `TextWeight float64` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - The weight of the text in the reciprocal ranking fusion. + - `ID string` - - `Ranker string` + The unique ID of the shell tool call output. Populated when this item is returned via API. - The ranker to use for the file search. + - `Agent BetaResponseInputItemShellCallOutputAgent` - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + The agent that produced this item. - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + - `AgentName string` - - `ScoreThreshold float64` + The canonical name of the agent that produced this item. - 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. + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - - `type BetaComputerTool struct{…}` + The execution context that produced this tool call. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - `Type Computer` + - `Type Direct` - The type of the computer tool. Always `computer`. + The caller type. Always `direct`. - - `const ComputerComputer Computer = "computer"` + - `const DirectDirect Direct = "direct"` - - `type BetaComputerUsePreviewTool struct{…}` + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `CallerID string` - - `DisplayHeight int64` + The call ID of the program item that produced this tool call. - The height of the computer display. + - `Type Program` - - `DisplayWidth int64` + The caller type. Always `program`. - The width of the computer display. + - `const ProgramProgram Program = "program"` - - `Environment BetaComputerUsePreviewToolEnvironment` + - `MaxOutputLength int64` - The type of computer environment to control. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `Status string` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + The status of the shell call output. - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - - `Type ComputerUsePreview` + - `type BetaResponseInputItemApplyPatchCall struct{…}` - The type of the computer use tool. Always `computer_use_preview`. + A tool call representing a request to create, delete, or update files using diff patches. - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `CallID string` - - `type BetaWebSearchTool struct{…}` + The unique ID of the apply patch tool call generated by the model. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - - `Type BetaWebSearchToolType` + The specific create, delete, or update instruction for the apply_patch tool call. - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + Instruction for creating a new file via the apply_patch tool. - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `Diff string` - - `Filters BetaWebSearchToolFilters` + Unified diff content to apply when creating the file. - Filters for the search. + - `Path string` - - `AllowedDomains []string` + Path of the file to create relative to the workspace root. - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `Type CreateFile` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + The operation type. Always `create_file`. - - `SearchContextSize BetaWebSearchToolSearchContextSize` + - `const CreateFileCreateFile CreateFile = "create_file"` - 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. + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + Instruction for deleting an existing file via the apply_patch tool. - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `Path string` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + Path of the file to delete relative to the workspace root. - - `UserLocation BetaWebSearchToolUserLocation` + - `Type DeleteFile` - The approximate location of the user. + The operation type. Always `delete_file`. - - `City string` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - Free text input for the city of the user, e.g. `San Francisco`. + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - - `Country string` + Instruction for updating an existing file via the apply_patch tool. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `Diff string` - - `Region string` + Unified diff content to apply to the existing file. - Free text input for the region of the user, e.g. `California`. + - `Path string` - - `Timezone string` + Path of the file to update relative to the workspace root. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `Type UpdateFile` - - `Type string` + The operation type. Always `update_file`. - The type of location approximation. Always `approximate`. + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `Status string` - - `type BetaToolMcp struct{…}` + The status of the apply patch tool call. One of `in_progress` or `completed`. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `ServerLabel string` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - A label for this MCP server, used to identify it in tool calls. + - `Type ApplyPatchCall` - - `Type Mcp` + The type of the item. Always `apply_patch_call`. - The type of the MCP tool. Always `mcp`. + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `const McpMcp Mcp = "mcp"` + - `ID string` - - `AllowedCallers []string` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - The tool invocation context(s). + - `Agent BetaResponseInputItemApplyPatchCallAgent` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + The agent that produced this item. - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + - `AgentName string` - - `AllowedTools BetaToolMcpAllowedToolsUnion` + The canonical name of the agent that produced this item. - List of allowed tool names or a filter object. + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + The execution context that produced this tool call. - A string array of allowed tool names + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `Type Direct` - A filter object to specify which tools are allowed. + The caller type. Always `direct`. - - `ReadOnly bool` + - `const DirectDirect Direct = "direct"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - - `ToolNames []string` + - `CallerID string` - List of allowed tool names. + The call ID of the program item that produced this tool call. - - `Authorization string` + - `Type Program` - 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. + The caller type. Always `program`. - - `ConnectorID string` + - `const ProgramProgram Program = "program"` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - Currently supported `connector_id` values are: + The streamed output emitted by an apply patch tool call. - - 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` + - `CallID string` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + The unique ID of the apply patch tool call generated by the model. - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + - `Status string` - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + The status of the apply patch tool call output. One of `completed` or `failed`. - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + - `Type ApplyPatchCallOutput` - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + The type of the item. Always `apply_patch_call_output`. - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `DeferLoading bool` + - `ID string` - Whether this MCP tool is deferred and discovered via tool search. + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `Headers map[string, string]` + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + The agent that produced this item. - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `AgentName string` - Specify which of the MCP server's tools require approval. + The canonical name of the agent that produced this item. - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + The execution context that produced this tool call. - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - A filter object to specify which tools are allowed. + - `Type Direct` - - `ReadOnly bool` + The caller type. Always `direct`. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `const DirectDirect Direct = "direct"` - - `ToolNames []string` + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - List of allowed tool names. + - `CallerID string` - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + The call ID of the program item that produced this tool call. - A filter object to specify which tools are allowed. + - `Type Program` - - `ReadOnly bool` + The caller type. Always `program`. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `const ProgramProgram Program = "program"` - - `ToolNames []string` + - `Output string` - List of allowed tool names. + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `type BetaResponseInputItemMcpListTools struct{…}` - 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. + A list of tools available on an MCP server. - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `ID string` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + The unique ID of the list. - - `ServerDescription string` + - `ServerLabel string` - Optional description of the MCP server, used to provide more context. + The label of the MCP server. - - `ServerURL string` + - `Tools []BetaResponseInputItemMcpListToolsTool` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + The tools available on the server. - - `TunnelID string` + - `InputSchema any` - 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. + The JSON schema describing the tool's input. - - `type BetaToolCodeInterpreter struct{…}` + - `Name string` - A tool that runs Python code to help generate a response to a prompt. + The name of the tool. - - `Container BetaToolCodeInterpreterContainerUnion` + - `Annotations any` - 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. + Additional annotations about the tool. - - `string` + - `Description string` - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + The description of the tool. - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `Type McpListTools` - - `Type Auto` + The type of the item. Always `mcp_list_tools`. - Always `auto`. + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `const AutoAuto Auto = "auto"` + - `Agent BetaResponseInputItemMcpListToolsAgent` - - `FileIDs []string` + The agent that produced this item. - An optional list of uploaded files to make available to your code. + - `AgentName string` - - `MemoryLimit string` + The canonical name of the agent that produced this item. - The memory limit for the code interpreter container. + - `Error string` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + Error message if the server could not list tools. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + A request for human approval of a tool invocation. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `ID string` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + The unique ID of the approval request. - Network access policy for the container. + - `Arguments string` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + A JSON string of arguments for the tool. - - `Type Disabled` + - `Name string` - Disable outbound network access. Always `disabled`. + The name of the tool to run. - - `const DisabledDisabled Disabled = "disabled"` + - `ServerLabel string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The label of the MCP server making the request. - - `AllowedDomains []string` + - `Type McpApprovalRequest` - A list of allowed domains when type is `allowlist`. + The type of the item. Always `mcp_approval_request`. - - `Type Allowlist` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - Allow outbound network access only to specified domains. Always `allowlist`. + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - - `const AllowlistAllowlist Allowlist = "allowlist"` + The agent that produced this item. - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + - `AgentName string` - Optional domain-scoped secrets for allowlisted domains. + The canonical name of the agent that produced this item. - - `Domain string` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - The domain associated with the secret. + A response to an MCP approval request. - - `Name string` + - `ApprovalRequestID string` - The name of the secret to inject for the domain. + The ID of the approval request being answered. - - `Value string` + - `Approve bool` - The secret value to inject for the domain. + Whether the request was approved. - - `Type CodeInterpreter` + - `Type McpApprovalResponse` - The type of the code interpreter tool. Always `code_interpreter`. + The type of the item. Always `mcp_approval_response`. - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `AllowedCallers []string` + - `ID string` - The tool invocation context(s). + The unique ID of the approval response - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + The agent that produced this item. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `AgentName string` - - `Type ProgrammaticToolCalling` + The canonical name of the agent that produced this item. - The type of the tool. Always `programmatic_tool_calling`. + - `Reason string` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + Optional reason for the decision. - - `type BetaToolImageGeneration struct{…}` + - `type BetaResponseInputItemMcpCall struct{…}` - A tool that generates images using the GPT image models. + An invocation of a tool on an MCP server. - - `Type ImageGeneration` + - `ID string` - The type of the image generation tool. Always `image_generation`. + The unique ID of the tool call. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `Arguments string` - - `Action string` + A JSON string of the arguments passed to the tool. - Whether to generate a new image or edit an existing image. Default: `auto`. + - `Name string` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + The name of the tool that was run. - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `ServerLabel string` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + The label of the MCP server running the tool. - - `Background string` + - `Type McpCall` - 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. + The type of the item. Always `mcp_call`. - `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. + - `const McpCallMcpCall McpCall = "mcp_call"` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + - `Agent BetaResponseInputItemMcpCallAgent` - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + The agent that produced this item. - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + - `AgentName string` - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + The canonical name of the agent that produced this item. - - `InputFidelity string` + - `ApprovalRequestID 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`. + 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. - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + - `Error string` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + The error from the tool call, if any. - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `Output string` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + The output from the tool call. - - `FileID string` + - `Status string` - File ID for the mask image. + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `ImageURL string` + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - Base64-encoded mask image. + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - `Model string` + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - The image generation model to use. Default: `gpt-image-1`. + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - `string` + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `string` + - `type BetaResponseCustomToolCallOutput struct{…}` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + The output of a custom tool call from your code, being sent back to the model. - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `CallID string` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + The call ID, used to map this custom tool call output to a custom tool call. - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `Output BetaResponseCustomToolCallOutputOutputUnion` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `string` - - `Moderation string` + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - Moderation level for the generated image. Default: `auto`. + Text, image, or file output of the custom tool call. - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `type BetaResponseInputText struct{…}` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + A text input to the model. - - `OutputCompression int64` + - `type BetaResponseInputImage struct{…}` - Compression level for the output image. Default: 100. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `OutputFormat string` + - `type BetaResponseInputFile struct{…}` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + A file input to the model. - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + - `Type CustomToolCallOutput` - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + The type of the custom tool call output. Always `custom_tool_call_output`. - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - - `PartialImages int64` + - `ID string` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + The unique ID of the custom tool call output in the OpenAI platform. - - `Quality string` + - `Agent BetaResponseCustomToolCallOutputAgent` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + The agent that produced this item. - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `AgentName string` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + The canonical name of the agent that produced this item. - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The execution context that produced this tool call. - - `Size string` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - 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`. + - `Type Direct` - - `string` + The caller type. Always `direct`. - - `string` + - `const DirectDirect Direct = "direct"` - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + - `CallerID string` - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + The call ID of the program item that produced this tool call. - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + - `Type Program` - - `type BetaToolLocalShell struct{…}` + The caller type. Always `program`. - A tool that allows the model to execute shell commands in a local environment. + - `const ProgramProgram Program = "program"` - - `Type LocalShell` + - `type BetaResponseCustomToolCall struct{…}` - The type of the local shell tool. Always `local_shell`. + A call to a custom tool created by the model. - - `const LocalShellLocalShell LocalShell = "local_shell"` + - `CallID string` - - `type BetaFunctionShellTool struct{…}` + An identifier used to map this custom tool call to a tool call output. - A tool that allows the model to execute shell commands. + - `Input string` - - `Type Shell` + The input for the custom tool call generated by the model. - The type of the shell tool. Always `shell`. + - `Name string` - - `const ShellShell Shell = "shell"` + The name of the custom tool being called. - - `AllowedCallers []string` + - `Type CustomToolCall` - The tool invocation context(s). + The type of the custom tool call. Always `custom_tool_call`. - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `ID string` - - `Environment BetaFunctionShellToolEnvironmentUnion` + The unique ID of the custom tool call in the OpenAI platform. - - `type BetaContainerAuto struct{…}` + - `Agent BetaResponseCustomToolCallAgent` - - `Type ContainerAuto` + The agent that produced this item. - Automatically creates a container for this request + - `AgentName string` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + The canonical name of the agent that produced this item. - - `FileIDs []string` + - `Caller BetaResponseCustomToolCallCallerUnion` - An optional list of uploaded files to make available to your code. + The execution context that produced this tool call. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - The memory limit for the container. + - `Type Direct` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `const DirectDirect Direct = "direct"` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `CallerID string` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + The call ID of the program item that produced this tool call. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `Type Program` - Network access policy for the container. + - `const ProgramProgram Program = "program"` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `Namespace string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The namespace of the custom tool being called. - - `Skills []BetaContainerAutoSkillUnion` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - An optional list of skills referenced by id or inline data. + Compacts the current context. Must be the final input item. - - `type BetaSkillReference struct{…}` + - `Type CompactionTrigger` - - `SkillID string` + The type of the item. Always `compaction_trigger`. - The ID of the referenced skill. + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `Type SkillReference` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - References a skill created with the /v1/skills endpoint. + The agent that produced this item. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `AgentName string` - - `Version string` + The canonical name of the agent that produced this item. - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `type BetaResponseInputItemItemReference struct{…}` - - `type BetaInlineSkill struct{…}` + An internal identifier for an item to reference. - - `Description string` + - `ID string` - The description of the skill. + The ID of the item to reference. - - `Name string` + - `Agent BetaResponseInputItemItemReferenceAgent` - The name of the skill. + The agent that produced this item. - - `Source BetaInlineSkillSource` + - `AgentName string` - Inline skill payload + The canonical name of the agent that produced this item. - - `Data string` + - `Type string` - Base64-encoded skill zip bundle. + The type of item to reference. Always `item_reference`. - - `MediaType ApplicationZip` + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - The media type of the inline skill payload. Must be `application/zip`. + - `type BetaResponseInputItemProgram struct{…}` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `ID string` - - `Type Base64` + The unique ID of this program item. - The type of the inline skill source. Must be `base64`. + - `CallID string` - - `const Base64Base64 Base64 = "base64"` + The stable call ID of the program item. - - `Type Inline` + - `Code string` - Defines an inline skill for this request. + The JavaScript source executed by programmatic tool calling. - - `const InlineInline Inline = "inline"` + - `Fingerprint string` - - `type BetaLocalEnvironment struct{…}` + Opaque program replay fingerprint that must be round-tripped. - - `Type Local` + - `Type Program` - Use a local computer environment. + The item type. Always `program`. - - `const LocalLocal Local = "local"` + - `const ProgramProgram Program = "program"` - - `Skills []BetaLocalSkill` + - `Agent BetaResponseInputItemProgramAgent` - An optional list of skills. + The agent that produced this item. - - `Description string` + - `AgentName string` - The description of the skill. + The canonical name of the agent that produced this item. - - `Name string` + - `type BetaResponseInputItemProgramOutput struct{…}` - The name of the skill. + - `ID string` - - `Path string` + The unique ID of this program output item. - The path to the directory containing the skill. + - `CallID string` - - `type BetaContainerReference struct{…}` + The call ID of the program item. - - `ContainerID string` + - `Result string` - The ID of the referenced container. + The result produced by the program item. - - `Type ContainerReference` + - `Status string` - References a container created with the /v1/containers endpoint + The terminal status of the program output. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `type BetaCustomTool struct{…}` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Type ProgramOutput` - - `Name string` + The item type. Always `program_output`. - The name of the custom tool, used to identify it in tool calls. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `Type Custom` + - `Agent BetaResponseInputItemProgramOutputAgent` - The type of the custom tool. Always `custom`. + The agent that produced this item. - - `const CustomCustom Custom = "custom"` + - `AgentName string` - - `AllowedCallers []string` + The canonical name of the agent that produced this item. - The tool invocation context(s). + - `Metadata map[string, string]` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + 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. - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `DeferLoading bool` + - `Model BetaResponseModel` - Whether this tool should be deferred and discovered via tool search. + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - - `Description string` + - `type BetaResponseModel string` - Optional description of the custom tool, used to provide more context. + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - - `Format BetaCustomToolFormatUnion` + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - The input format for the custom tool. Default is unconstrained text. + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - - `type BetaCustomToolFormatText struct{…}` + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - Unconstrained free-form text. + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - - `Type Text` + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - Unconstrained text format. Always `text`. + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - - `const TextText Text = "text"` + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - - `type BetaCustomToolFormatGrammar struct{…}` + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - A grammar defined by the user. + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - - `Definition string` + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - The grammar definition. + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - - `Syntax string` + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - The syntax of the grammar definition. One of `lark` or `regex`. + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - - `Type Grammar` + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - Grammar format. Always `grammar`. + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - - `const GrammarGrammar Grammar = "grammar"` + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - - `type BetaNamespaceTool struct{…}` + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - Groups function/custom tools under a shared namespace. + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - - `Description string` + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - A description of the namespace shown to the model. + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - - `Name string` + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - The namespace name used in tool calls (for example, `crm`). + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - - `Tools []BetaNamespaceToolToolUnion` + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - The function/custom tools available inside this namespace. + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - - `type BetaNamespaceToolToolFunction struct{…}` + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - - `Name string` + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - - `Type Function` + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - - `const FunctionFunction Function = "function"` + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - - `AllowedCallers []string` + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - The tool invocation context(s). + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - - `DeferLoading bool` + - `const BetaResponseModelO3 BetaResponseModel = "o3"` - Whether this function should be deferred and discovered via tool search. + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - - `Description string` + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - - `OutputSchema map[string, any]` + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `const BetaResponseModelO1 BetaResponseModel = "o1"` - - `Parameters any` + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - - `Strict bool` + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - - `type BetaCustomTool struct{…}` + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - `Type Namespace` + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - The type of the tool. Always `namespace`. + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - - `const NamespaceNamespace Namespace = "namespace"` + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - - `type BetaToolSearchTool struct{…}` + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - Hosted or BYOT tool search configuration for deferred tools. + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - - `Type ToolSearch` + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - The type of the tool. Always `tool_search`. + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - - `Description string` + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - Description shown to the model for a client-executed tool search tool. + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - `Execution BetaToolSearchToolExecution` + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - Whether tool search is executed by the server or by the client. + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `Parameters any` + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - Parameter schema for a client-executed tool search tool. + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` - - `Type BetaWebSearchPreviewToolType` + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - - `SearchContentTypes []string` + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - 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 BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - The user's location. + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - - `Type Approximate` + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - The type of location approximation. Always `approximate`. + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - - `const ApproximateApproximate Approximate = "approximate"` + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - - `City string` + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - Free text input for the city of the user, e.g. `San Francisco`. + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - - `Country string` + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - - `Region string` + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - Free text input for the region of the user, e.g. `California`. + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - - `Timezone string` + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - - `type BetaApplyPatchTool struct{…}` + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - Allows the assistant to create, delete, or update files using unified diffs. + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - - `Type ApplyPatch` + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - The type of the tool. Always `apply_patch`. + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - - `AllowedCallers []string` + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - The tool invocation context(s). + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `string` - - `Type ToolSearchOutput` + - `Object Response` - The item type. Always `tool_search_output`. + The object type of this resource - always set to `response`. - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `const ResponseResponse Response = "response"` - - `ID string` + - `Output []BetaResponseOutputItemUnion` - The unique ID of this tool search output. + An array of content items generated by the model. - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - The agent that produced this item. + - `type BetaResponseOutputMessage struct{…}` - - `AgentName string` + An output message from the model. - The canonical name of the agent that produced this item. + - `type BetaResponseFileSearchToolCall struct{…}` - - `CallID string` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - The unique ID of the tool search call generated by the model. + - `type BetaResponseFunctionToolCall struct{…}` - - `Execution BetaResponseToolSearchOutputItemParamExecution` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - Whether tool search was executed by the server or by the client. + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + - `ID string` - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + The unique ID of the function call tool output. - - `Status BetaResponseToolSearchOutputItemParamStatus` + - `CallID string` - The status of the tool search output. + The unique ID of the function tool call generated by the model. - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + The output from the function call generated by your code. + Can be a string or an list of output content. - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `string` - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - - `Role Developer` + Text, image, or file output of the function call. - The role that provided the additional tools. Only `developer` is supported. + - `type BetaResponseInputText struct{…}` - - `const DeveloperDeveloper Developer = "developer"` + A text input to the model. - - `Tools []BetaToolUnion` + - `type BetaResponseInputImage struct{…}` - A list of additional tools made available at this item. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `type BetaFunctionTool struct{…}` + - `type BetaResponseInputFile struct{…}` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + A file input to the model. - - `type BetaFileSearchTool struct{…}` + - `Status BetaResponseFunctionToolCallOutputItemStatus` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `type BetaComputerTool struct{…}` + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Type FunctionCallOutput` - - `type BetaWebSearchTool struct{…}` + The type of the function tool call output. Always `function_call_output`. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `type BetaToolMcp struct{…}` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The agent that produced this item. - - `type BetaToolCodeInterpreter struct{…}` + - `AgentName string` - A tool that runs Python code to help generate a response to a prompt. + The canonical name of the agent that produced this item. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - `type BetaToolImageGeneration struct{…}` + The execution context that produced this tool call. - A tool that generates images using the GPT image models. + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - `type BetaToolLocalShell struct{…}` + - `Type Direct` - A tool that allows the model to execute shell commands in a local environment. + The caller type. Always `direct`. - - `type BetaFunctionShellTool struct{…}` + - `const DirectDirect Direct = "direct"` - A tool that allows the model to execute shell commands. + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - - `type BetaCustomTool struct{…}` + - `CallerID string` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The call ID of the program item that produced this tool call. - - `type BetaNamespaceTool struct{…}` + - `Type Program` - Groups function/custom tools under a shared namespace. + The caller type. Always `program`. - - `type BetaToolSearchTool struct{…}` + - `const ProgramProgram Program = "program"` - Hosted or BYOT tool search configuration for deferred tools. + - `CreatedBy string` - - `type BetaWebSearchPreviewTool struct{…}` + The identifier of the actor that created the item. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `type BetaResponseOutputItemAgentMessage struct{…}` - - `type BetaApplyPatchTool struct{…}` + - `ID string` - Allows the assistant to create, delete, or update files using unified diffs. + The unique ID of the agent message. - - `Type AdditionalTools` + - `Author string` - The item type. Always `additional_tools`. + The sending agent identity. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - - `ID string` + Encrypted content sent between agents. - The unique ID of this additional tools item. + - `type BetaResponseInputText struct{…}` - - `Agent BetaResponseInputItemAdditionalToolsAgent` + A text input to the model. - The agent that produced this item. + - `type BetaResponseOutputText struct{…}` - - `AgentName string` + A text output from the model. - The canonical name of the agent that produced this item. + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - - `type BetaResponseReasoningItem struct{…}` + A text content. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `Text string` - - `ID string` + - `Type Text` - The unique identifier of the reasoning content. + - `const TextText Text = "text"` - - `Summary []BetaResponseReasoningItemSummary` + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - Reasoning summary content. + A summary text from the model. - `Text string` @@ -41554,23 +56339,9 @@ Compact a response - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `Type Reasoning` - - The type of the object. Always `reasoning`. - - - `const ReasoningReasoning Reasoning = "reasoning"` - - - `Agent BetaResponseReasoningItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Content []BetaResponseReasoningItemContent` + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - Reasoning text content. + Reasoning text from the model. - `Text string` @@ -41582,79 +56353,83 @@ Compact a response - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `EncryptedContent string` + - `type BetaResponseOutputRefusal struct{…}` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + A refusal from the model. - - `Status BetaResponseReasoningItemStatus` + - `type BetaResponseInputImage struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + A screenshot of a computer. - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + - `Detail string` - - `type BetaResponseCompactionItemParamResp struct{…}` + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - - `EncryptedContent string` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - The encrypted content of the compaction summary. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `Type Compaction` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - The type of the item. Always `compaction`. + - `FileID string` - - `const CompactionCompaction Compaction = "compaction"` + The identifier of an uploaded file that contains the screenshot. - - `ID string` + - `ImageURL string` - The ID of the compaction item. + The URL of the screenshot image. - - `Agent BetaResponseCompactionItemParamAgentResp` + - `Type ComputerScreenshot` - The agent that produced this item. + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `AgentName string` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - The canonical name of the agent that produced this item. + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - - `type BetaResponseInputItemImageGenerationCall struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - An image generation request made by the model. + - `Mode Explicit` - - `ID string` + The breakpoint mode. Always `explicit`. - The unique ID of the image generation call. + - `const ExplicitExplicit Explicit = "explicit"` - - `Result string` + - `type BetaResponseInputFile struct{…}` - The generated image encoded in base64. + A file input to the model. - - `Status string` + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - The status of the image generation call. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `EncryptedContent string` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + Opaque encrypted content. - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + - `Type EncryptedContent` - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + The type of the input item. Always `encrypted_content`. - - `Type ImageGenerationCall` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - The type of the image generation call. Always `image_generation_call`. + - `Recipient string` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + The destination agent identity. - - `Agent BetaResponseInputItemImageGenerationCallAgent` + - `Type AgentMessage` + + The type of the item. Always `agent_message`. + + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + + - `Agent BetaResponseOutputItemAgentMessageAgent` The agent that produced this item. @@ -41662,168 +56437,169 @@ Compact a response The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCall struct{…}` - - A tool call to run code. + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - `ID string` - The unique ID of the code interpreter tool call. + The unique ID of the multi-agent call item. - - `Code string` + - `Action string` - The code to run, or null if not available. + The multi-agent action to execute. - - `ContainerID string` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - The ID of the container used to run the code. + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - The logs output from the code interpreter. + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - - `Logs string` + - `Arguments string` - The logs output from the code interpreter. + The JSON string of arguments generated for the action. - - `Type Logs` + - `CallID string` - The type of the output. Always `logs`. + The unique ID linking this call to its output. - - `const LogsLogs Logs = "logs"` + - `Type MultiAgentCall` - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + The type of the multi-agent call. Always `multi_agent_call`. - The image output from the code interpreter. + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `Type Image` + - `Agent BetaResponseOutputItemMultiAgentCallAgent` - The type of the output. Always `image`. + The agent that produced this item. - - `const ImageImage Image = "image"` + - `AgentName string` - - `URL string` + The canonical name of the agent that produced this item. - The URL of the image output from the code interpreter. + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - - `Status BetaResponseCodeInterpreterToolCallStatus` + - `ID string` - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + The unique ID of the multi-agent call output item. - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + - `Action string` - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + The multi-agent action that produced this result. - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `Type CodeInterpreterCall` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - - `Agent BetaResponseCodeInterpreterToolCallAgent` + - `CallID string` - The agent that produced this item. + The unique ID of the multi-agent call. - - `AgentName string` + - `Output []BetaResponseOutputText` - The canonical name of the agent that produced this item. + Text output returned by the multi-agent action. - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - A tool call to run a command on the local shell. + The annotations of the text output. - - `ID string` + - `Text string` - The unique ID of the local shell call. + The text output from the model. - - `Action BetaResponseInputItemLocalShellCallAction` + - `Type OutputText` - Execute a shell command on the server. + The type of the output text. Always `output_text`. - - `Command []string` + - `Logprobs []BetaResponseOutputTextLogprob` - The command to run. + - `Type MultiAgentCallOutput` - - `Env map[string, string]` + The type of the multi-agent result. Always `multi_agent_call_output`. - Environment variables to set for the command. + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `Type Exec` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` - The type of the local shell action. Always `exec`. + The agent that produced this item. - - `const ExecExec Exec = "exec"` + - `AgentName string` - - `TimeoutMs int64` + The canonical name of the agent that produced this item. - Optional timeout in milliseconds for the command. + - `type BetaResponseFunctionWebSearch struct{…}` - - `User string` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - Optional user to run the command as. + - `type BetaResponseComputerToolCall struct{…}` - - `WorkingDirectory string` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - Optional working directory to run the command in. + - `type BetaResponseComputerToolCallOutputItem struct{…}` - - `CallID string` + - `ID string` - The unique ID of the local shell tool call generated by the model. + The unique ID of the computer call tool output. - - `Status string` + - `CallID string` - The status of the local shell call. + The ID of the computer tool call that produced the output. - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + A computer screenshot image used with the computer use tool. - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `Type LocalShellCall` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - The type of the local shell call. Always `local_shell_call`. + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - - `Agent BetaResponseInputItemLocalShellCallAgent` + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - The agent that produced this item. + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - `AgentName string` + - `Type ComputerCallOutput` - The canonical name of the agent that produced this item. + The type of the computer tool call output. Always `computer_call_output`. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - The output of a local shell tool call. + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `ID string` + The safety checks reported by the API that have been acknowledged by the + developer. - The unique ID of the local shell tool call generated by the model. + - `ID string` - - `Output string` + The ID of the pending safety check. - A JSON string of the output of the local shell tool call. + - `Code string` - - `Type LocalShellCallOutput` + The type of the pending safety check. - The type of the local shell tool call output. Always `local_shell_call_output`. + - `Message string` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + Details about the pending safety check. - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + - `Agent BetaResponseComputerToolCallOutputItemAgent` The agent that produced this item. @@ -41831,343 +56607,350 @@ Compact a response The canonical name of the agent that produced this item. - - `Status string` + - `CreatedBy string` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + The identifier of the actor that created the item. - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + - `type BetaResponseReasoningItem struct{…}` - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + 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](https://platform.openai.com/docs/guides/conversation-state). - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `type BetaResponseOutputItemProgram struct{…}` - - `type BetaResponseInputItemShellCall struct{…}` + - `ID string` - A tool representing a request to execute one or more shell commands. + The unique ID of the program item. - - `Action BetaResponseInputItemShellCallAction` + - `CallID string` - The shell commands and limits that describe how to run the tool call. + The stable call ID of the program item. - - `Commands []string` + - `Code string` - Ordered shell commands for the execution environment to run. + The JavaScript source executed by programmatic tool calling. - - `MaxOutputLength int64` + - `Fingerprint string` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + Opaque program replay fingerprint that must be round-tripped. - - `TimeoutMs int64` + - `Type Program` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + The type of the item. Always `program`. - - `CallID string` + - `const ProgramProgram Program = "program"` - The unique ID of the shell tool call generated by the model. + - `Agent BetaResponseOutputItemProgramAgent` - - `Type ShellCall` + The agent that produced this item. - The type of the item. Always `shell_call`. + - `AgentName string` - - `const ShellCallShellCall ShellCall = "shell_call"` + The canonical name of the agent that produced this item. - - `ID string` + - `type BetaResponseOutputItemProgramOutput struct{…}` - The unique ID of the shell tool call. Populated when this item is returned via API. + - `ID string` - - `Agent BetaResponseInputItemShellCallAgent` + The unique ID of the program output item. - The agent that produced this item. + - `CallID string` - - `AgentName string` + The call ID of the program item. - The canonical name of the agent that produced this item. + - `Result string` - - `Caller BetaResponseInputItemShellCallCallerUnion` + The result produced by the program item. - The execution context that produced this tool call. + - `Status string` - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + The terminal status of the program output item. - - `Type Direct` + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - The caller type. Always `direct`. + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - `const DirectDirect Direct = "direct"` + - `Type ProgramOutput` - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + The type of the item. Always `program_output`. - - `CallerID string` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - The call ID of the program item that produced this tool call. + - `Agent BetaResponseOutputItemProgramOutputAgent` - - `Type Program` + The agent that produced this item. - The caller type. Always `program`. + - `AgentName string` - - `const ProgramProgram Program = "program"` + The canonical name of the agent that produced this item. - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + - `type BetaResponseToolSearchCall struct{…}` - The environment to execute the shell commands in. + - `ID string` - - `type BetaLocalEnvironment struct{…}` + The unique ID of the tool search call item. - - `type BetaContainerReference struct{…}` + - `Arguments any` - - `Status string` + Arguments used for the tool search call. - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `CallID string` - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + The unique ID of the tool search call generated by the model. - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + - `Execution BetaResponseToolSearchCallExecution` - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + Whether tool search was executed by the server or by the client. - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - The streamed output items emitted by a shell tool call. + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `CallID string` + - `Status BetaResponseToolSearchCallStatus` - The unique ID of the shell tool call generated by the model. + The status of the tool search call item that was recorded. - - `Output []BetaResponseFunctionShellCallOutputContent` + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - Captured chunks of stdout and stderr output, along with their associated outcomes. + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - The exit or timeout outcome associated with this shell call. + - `Type ToolSearchCall` - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + The type of the item. Always `tool_search_call`. - Indicates that the shell call exceeded its configured time limit. + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `Type Timeout` + - `Agent BetaResponseToolSearchCallAgent` - The outcome type. Always `timeout`. + The agent that produced this item. - - `const TimeoutTimeout Timeout = "timeout"` + - `AgentName string` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + The canonical name of the agent that produced this item. - Indicates that the shell commands finished and returned an exit code. + - `CreatedBy string` - - `ExitCode int64` + The identifier of the actor that created the item. - The exit code returned by the shell process. + - `type BetaResponseToolSearchOutputItem struct{…}` - - `Type Exit` + - `ID string` - The outcome type. Always `exit`. + The unique ID of the tool search output item. - - `const ExitExit Exit = "exit"` + - `CallID string` - - `Stderr string` + The unique ID of the tool search call generated by the model. - Captured stderr output for the shell call. + - `Execution BetaResponseToolSearchOutputItemExecution` - - `Stdout string` + Whether tool search was executed by the server or by the client. - Captured stdout output for the shell call. + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - `Type ShellCallOutput` + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - The type of the item. Always `shell_call_output`. + - `Status BetaResponseToolSearchOutputItemStatus` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + The status of the tool search output item that was recorded. - - `ID string` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - The agent that produced this item. + - `Tools []BetaToolUnion` - - `AgentName string` + The loaded tool definitions returned by tool search. - The canonical name of the agent that produced this item. + - `type BetaFunctionTool struct{…}` - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The execution context that produced this tool call. + - `type BetaFileSearchTool struct{…}` - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Type Direct` + - `type BetaComputerTool struct{…}` - The caller type. Always `direct`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const DirectDirect Direct = "direct"` + - `type BetaComputerUsePreviewTool struct{…}` - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `CallerID string` + - `type BetaWebSearchTool struct{…}` - The call ID of the program item that produced this tool call. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type Program` + - `type BetaToolMcp struct{…}` - The caller type. Always `program`. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const ProgramProgram Program = "program"` + - `type BetaToolCodeInterpreter struct{…}` - - `MaxOutputLength int64` + A tool that runs Python code to help generate a response to a prompt. - The maximum number of UTF-8 characters captured for this shell call's combined output. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Status string` + - `type BetaToolImageGeneration struct{…}` - The status of the shell call output. + A tool that generates images using the GPT image models. - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + - `type BetaToolLocalShell struct{…}` - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + A tool that allows the model to execute shell commands in a local environment. - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + - `type BetaFunctionShellTool struct{…}` - - `type BetaResponseInputItemApplyPatchCall struct{…}` + A tool that allows the model to execute shell commands. - A tool call representing a request to create, delete, or update files using diff patches. + - `type BetaCustomTool struct{…}` - - `CallID string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The unique ID of the apply patch tool call generated by the model. + - `type BetaNamespaceTool struct{…}` - - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + Groups function/custom tools under a shared namespace. - The specific create, delete, or update instruction for the apply_patch tool call. + - `type BetaToolSearchTool struct{…}` - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + Hosted or BYOT tool search configuration for deferred tools. - Instruction for creating a new file via the apply_patch tool. + - `type BetaWebSearchPreviewTool struct{…}` - - `Diff string` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Unified diff content to apply when creating the file. + - `type BetaApplyPatchTool struct{…}` - - `Path string` + Allows the assistant to create, delete, or update files using unified diffs. - Path of the file to create relative to the workspace root. + - `Type ToolSearchOutput` - - `Type CreateFile` + The type of the item. Always `tool_search_output`. - The operation type. Always `create_file`. + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `const CreateFileCreateFile CreateFile = "create_file"` + - `Agent BetaResponseToolSearchOutputItemAgent` - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + The agent that produced this item. - Instruction for deleting an existing file via the apply_patch tool. + - `AgentName string` - - `Path string` + The canonical name of the agent that produced this item. - Path of the file to delete relative to the workspace root. + - `CreatedBy string` - - `Type DeleteFile` + The identifier of the actor that created the item. - The operation type. Always `delete_file`. + - `type BetaResponseOutputItemAdditionalTools struct{…}` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `ID string` - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + The unique ID of the additional tools item. - Instruction for updating an existing file via the apply_patch tool. + - `Role string` - - `Diff string` + The role that provided the additional tools. - Unified diff content to apply to the existing file. + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - - `Path string` + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - Path of the file to update relative to the workspace root. + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - - `Type UpdateFile` + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - The operation type. Always `update_file`. + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - - `Status string` + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + - `Tools []BetaToolUnion` - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + The additional tool definitions made available at this item. - - `Type ApplyPatchCall` + - `type BetaFunctionTool struct{…}` - The type of the item. Always `apply_patch_call`. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `type BetaFileSearchTool struct{…}` - - `ID string` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `type BetaComputerTool struct{…}` - - `Agent BetaResponseInputItemApplyPatchCallAgent` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The agent that produced this item. + - `type BetaComputerUsePreviewTool struct{…}` - - `AgentName string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The canonical name of the agent that produced this item. + - `type BetaWebSearchTool struct{…}` - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The execution context that produced this tool call. + - `type BetaToolMcp struct{…}` - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Type Direct` + - `type BetaToolCodeInterpreter struct{…}` - The caller type. Always `direct`. + A tool that runs Python code to help generate a response to a prompt. - - `const DirectDirect Direct = "direct"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `type BetaToolImageGeneration struct{…}` - - `CallerID string` + A tool that generates images using the GPT image models. - The call ID of the program item that produced this tool call. + - `type BetaToolLocalShell struct{…}` - - `Type Program` + A tool that allows the model to execute shell commands in a local environment. - The caller type. Always `program`. + - `type BetaFunctionShellTool struct{…}` - - `const ProgramProgram Program = "program"` + A tool that allows the model to execute shell commands. - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `type BetaCustomTool struct{…}` - The streamed output emitted by an apply patch tool call. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `CallID string` + - `type BetaNamespaceTool struct{…}` - The unique ID of the apply patch tool call generated by the model. + Groups function/custom tools under a shared namespace. - - `Status string` + - `type BetaToolSearchTool struct{…}` - The status of the apply patch tool call output. One of `completed` or `failed`. + Hosted or BYOT tool search configuration for deferred tools. - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type ApplyPatchCallOutput` + - `type BetaApplyPatchTool struct{…}` - The type of the item. Always `apply_patch_call_output`. + Allows the assistant to create, delete, or update files using unified diffs. - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `Type AdditionalTools` - - `ID string` + The type of the item. Always `additional_tools`. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - `Agent BetaResponseOutputItemAdditionalToolsAgent` The agent that produced this item. @@ -42175,73 +56958,67 @@ Compact a response The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - - - `Type Direct` + - `type BetaResponseCompactionItem struct{…}` - The caller type. Always `direct`. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `const DirectDirect Direct = "direct"` + - `ID string` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + The unique ID of the compaction item. - - `CallerID string` + - `EncryptedContent string` - The call ID of the program item that produced this tool call. + The encrypted content that was produced by compaction. - - `Type Program` + - `Type Compaction` - The caller type. Always `program`. + The type of the item. Always `compaction`. - - `const ProgramProgram Program = "program"` + - `const CompactionCompaction Compaction = "compaction"` - - `Output string` + - `Agent BetaResponseCompactionItemAgent` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + The agent that produced this item. - - `type BetaResponseInputItemMcpListTools struct{…}` + - `AgentName string` - A list of tools available on an MCP server. + The canonical name of the agent that produced this item. - - `ID string` + - `CreatedBy string` - The unique ID of the list. + The identifier of the actor that created the item. - - `ServerLabel string` + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - The label of the MCP server. + An image generation request made by the model. - - `Tools []BetaResponseInputItemMcpListToolsTool` + - `ID string` - The tools available on the server. + The unique ID of the image generation call. - - `InputSchema any` + - `Result string` - The JSON schema describing the tool's input. + The generated image encoded in base64. - - `Name string` + - `Status string` - The name of the tool. + The status of the image generation call. - - `Annotations any` + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - Additional annotations about the tool. + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - `Description string` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - The description of the tool. + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - - `Type McpListTools` + - `Type ImageGenerationCall` - The type of the item. Always `mcp_list_tools`. + The type of the image generation call. Always `image_generation_call`. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseInputItemMcpListToolsAgent` + - `Agent BetaResponseOutputItemImageGenerationCallAgent` The agent that produced this item. @@ -42249,67 +57026,69 @@ Compact a response The canonical name of the agent that produced this item. - - `Error string` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - Error message if the server could not list tools. + A tool call to run code. - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + - `type BetaResponseOutputItemLocalShellCall struct{…}` - A request for human approval of a tool invocation. + A tool call to run a command on the local shell. - `ID string` - The unique ID of the approval request. + The unique ID of the local shell call. - - `Arguments string` + - `Action BetaResponseOutputItemLocalShellCallAction` - A JSON string of arguments for the tool. + Execute a shell command on the server. - - `Name string` + - `Command []string` - The name of the tool to run. + The command to run. - - `ServerLabel string` + - `Env map[string, string]` - The label of the MCP server making the request. + Environment variables to set for the command. - - `Type McpApprovalRequest` + - `Type Exec` - The type of the item. Always `mcp_approval_request`. + The type of the local shell action. Always `exec`. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const ExecExec Exec = "exec"` - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `TimeoutMs int64` - The agent that produced this item. + Optional timeout in milliseconds for the command. - - `AgentName string` + - `User string` - The canonical name of the agent that produced this item. + Optional user to run the command as. - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - `WorkingDirectory string` - A response to an MCP approval request. + Optional working directory to run the command in. - - `ApprovalRequestID string` + - `CallID string` - The ID of the approval request being answered. + The unique ID of the local shell tool call generated by the model. - - `Approve bool` + - `Status string` - Whether the request was approved. + The status of the local shell call. - - `Type McpApprovalResponse` + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - The type of the item. Always `mcp_approval_response`. + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - - `ID string` + - `Type LocalShellCall` - The unique ID of the approval response + The type of the local shell call. Always `local_shell_call`. - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + + - `Agent BetaResponseOutputItemLocalShellCallAgent` The agent that produced this item. @@ -42317,113 +57096,111 @@ Compact a response The canonical name of the agent that produced this item. - - `Reason string` + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - Optional reason for the decision. + The output of a local shell tool call. - - `type BetaResponseInputItemMcpCall struct{…}` + - `ID string` - An invocation of a tool on an MCP server. + The unique ID of the local shell tool call generated by the model. - - `ID string` + - `Output string` - The unique ID of the tool call. + A JSON string of the output of the local shell tool call. - - `Arguments string` + - `Type LocalShellCallOutput` - A JSON string of the arguments passed to the tool. + The type of the local shell tool call output. Always `local_shell_call_output`. - - `Name string` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - The name of the tool that was run. + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` - - `ServerLabel string` + The agent that produced this item. - The label of the MCP server running the tool. + - `AgentName string` - - `Type McpCall` + The canonical name of the agent that produced this item. - The type of the item. Always `mcp_call`. + - `Status string` - - `const McpCallMcpCall McpCall = "mcp_call"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `Agent BetaResponseInputItemMcpCallAgent` + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - The agent that produced this item. + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - - `AgentName string` + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - The canonical name of the agent that produced this item. + - `type BetaResponseFunctionShellToolCall struct{…}` - - `ApprovalRequestID string` + A tool call that executes one or more shell commands in a managed environment. - 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. + - `ID string` - - `Error string` + The unique ID of the shell tool call. Populated when this item is returned via API. - The error from the tool call, if any. + - `Action BetaResponseFunctionShellToolCallAction` - - `Output string` + The shell commands and limits that describe how to run the tool call. - The output from the tool call. + - `Commands []string` - - `Status string` + - `MaxOutputLength int64` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + Optional maximum number of characters to return from each command. - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + - `TimeoutMs int64` - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + Optional timeout in milliseconds for the commands. - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + - `CallID string` - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + The unique ID of the shell tool call generated by the model. - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - - `type BetaResponseCustomToolCallOutput struct{…}` + Represents the use of a local environment to perform shell actions. - The output of a custom tool call from your code, being sent back to the model. + - `type BetaResponseLocalEnvironment struct{…}` - - `CallID string` + Represents the use of a local environment to perform shell actions. - The call ID, used to map this custom tool call output to a custom tool call. + - `Type Local` - - `Output BetaResponseCustomToolCallOutputOutputUnion` + The environment type. Always `local`. - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + - `const LocalLocal Local = "local"` - - `string` + - `type BetaResponseContainerReference struct{…}` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + Represents a container created with /v1/containers. - Text, image, or file output of the custom tool call. + - `ContainerID string` - - `type BetaResponseInputText struct{…}` + - `Type ContainerReference` - A text input to the model. + The environment type. Always `container_reference`. - - `type BetaResponseInputImage struct{…}` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Status BetaResponseFunctionShellToolCallStatus` - - `type BetaResponseInputFile struct{…}` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - A file input to the model. + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - - `Type CustomToolCallOutput` + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - The type of the custom tool call output. Always `custom_tool_call_output`. + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `Type ShellCall` - - `ID string` + The type of the item. Always `shell_call`. - The unique ID of the custom tool call output in the OpenAI platform. + - `const ShellCallShellCall ShellCall = "shell_call"` - - `Agent BetaResponseCustomToolCallOutputAgent` + - `Agent BetaResponseFunctionShellToolCallAgent` The agent that produced this item. @@ -42431,19 +57208,17 @@ Compact a response The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallOutputCallerUnion` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - `CallerID string` @@ -42451,95 +57226,89 @@ Compact a response - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `type BetaResponseCustomToolCall struct{…}` - - A call to a custom tool created by the model. - - - `CallID string` + - `CreatedBy string` - An identifier used to map this custom tool call to a tool call output. + The ID of the entity that created this tool call. - - `Input string` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - The input for the custom tool call generated by the model. + The output of a shell tool call that was emitted. - - `Name string` + - `ID string` - The name of the custom tool being called. + The unique ID of the shell call output. Populated when this item is returned via API. - - `Type CustomToolCall` + - `CallID string` - The type of the custom tool call. Always `custom_tool_call`. + The unique ID of the shell tool call generated by the model. - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `MaxOutputLength int64` - - `ID string` + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - The unique ID of the custom tool call in the OpenAI platform. + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - - `Agent BetaResponseCustomToolCallAgent` + An array of shell call output contents - The agent that produced this item. + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - - `AgentName string` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - The canonical name of the agent that produced this item. + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - - `Caller BetaResponseCustomToolCallCallerUnion` + Indicates that the shell call exceeded its configured time limit. - The execution context that produced this tool call. + - `Type Timeout` - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + The outcome type. Always `timeout`. - - `Type Direct` + - `const TimeoutTimeout Timeout = "timeout"` - - `const DirectDirect Direct = "direct"` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + Indicates that the shell commands finished and returned an exit code. - - `CallerID string` + - `ExitCode int64` - The call ID of the program item that produced this tool call. + Exit code from the shell process. - - `Type Program` + - `Type Exit` - - `const ProgramProgram Program = "program"` + The outcome type. Always `exit`. - - `Namespace string` + - `const ExitExit Exit = "exit"` - The namespace of the custom tool being called. + - `Stderr string` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + The standard error output that was captured. - Compacts the current context. Must be the final input item. + - `Stdout string` - - `Type CompactionTrigger` + The standard output that was captured. - The type of the item. Always `compaction_trigger`. + - `CreatedBy string` - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + The identifier of the actor that created the item. - - `Agent BetaResponseInputItemCompactionTriggerAgent` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - The agent that produced this item. + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - `AgentName string` + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - The canonical name of the agent that produced this item. + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - - `type BetaResponseInputItemItemReference struct{…}` + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - An internal identifier for an item to reference. + - `Type ShellCallOutput` - - `ID string` + The type of the shell call output. Always `shell_call_output`. - The ID of the item to reference. + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `Agent BetaResponseInputItemItemReferenceAgent` + - `Agent BetaResponseFunctionShellToolCallOutputAgent` The agent that produced this item. @@ -42547,339 +57316,342 @@ Compact a response The canonical name of the agent that produced this item. - - `Type string` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - The type of item to reference. Always `item_reference`. + The execution context that produced this tool call. - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `type BetaResponseInputItemProgram struct{…}` + - `Type Direct` - - `ID string` + - `const DirectDirect Direct = "direct"` - The unique ID of this program item. + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - - `CallID string` + - `CallerID string` - The stable call ID of the program item. + The call ID of the program item that produced this tool call. - - `Code string` + - `Type Program` - The JavaScript source executed by programmatic tool calling. + - `const ProgramProgram Program = "program"` - - `Fingerprint string` + - `CreatedBy string` - Opaque program replay fingerprint that must be round-tripped. + The identifier of the actor that created the item. - - `Type Program` + - `type BetaResponseApplyPatchToolCall struct{…}` - The item type. Always `program`. + A tool call that applies file diffs by creating, deleting, or updating files. - - `const ProgramProgram Program = "program"` + - `ID string` - - `Agent BetaResponseInputItemProgramAgent` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - The agent that produced this item. + - `CallID string` - - `AgentName string` + The unique ID of the apply patch tool call generated by the model. - The canonical name of the agent that produced this item. + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - - `type BetaResponseInputItemProgramOutput struct{…}` + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `ID string` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - The unique ID of this program output item. + Instruction describing how to create a file via the apply_patch tool. - - `CallID string` + - `Diff string` - The call ID of the program item. + Diff to apply. - - `Result string` + - `Path string` - The result produced by the program item. + Path of the file to create. - - `Status string` + - `Type CreateFile` - The terminal status of the program output. + Create a new file with the provided diff. - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `const CreateFileCreateFile CreateFile = "create_file"` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - - `Type ProgramOutput` + Instruction describing how to delete a file via the apply_patch tool. - The item type. Always `program_output`. + - `Path string` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + Path of the file to delete. - - `Agent BetaResponseInputItemProgramOutputAgent` + - `Type DeleteFile` - The agent that produced this item. + Delete the specified file. - - `AgentName string` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - The canonical name of the agent that produced this item. + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `Instructions param.Field[string]` + Instruction describing how to update a file via the apply_patch tool. - Body param: A system (or developer) message inserted into the model's context. - When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. + - `Diff string` - - `PreviousResponseID param.Field[string]` + Diff to apply. - Body param: The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + - `Path string` - - `PromptCacheKey param.Field[string]` + Path of the file to update. - Body param: A key to use when reading from or writing to the prompt cache. + - `Type UpdateFile` - - `PromptCacheOptions param.Field[BetaResponseCompactParamsPromptCacheOptions]` + Update an existing file with the provided diff. - Body param: Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details. + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Mode string` + - `Status BetaResponseApplyPatchToolCallStatus` - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaResponseCompactParamsPromptCacheOptionsModeImplicit BetaResponseCompactParamsPromptCacheOptionsMode = "implicit"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `const BetaResponseCompactParamsPromptCacheOptionsModeExplicit BetaResponseCompactParamsPromptCacheOptionsMode = "explicit"` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - `Ttl string` + - `Type ApplyPatchCall` - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. + The type of the item. Always `apply_patch_call`. - - `const BetaResponseCompactParamsPromptCacheOptionsTtl30m BetaResponseCompactParamsPromptCacheOptionsTtl = "30m"` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `PromptCacheRetention param.Field[BetaResponseCompactParamsPromptCacheRetention]` + - `Agent BetaResponseApplyPatchToolCallAgent` - Body param: How long to retain a prompt cache entry created by this request. + The agent that produced this item. - - `const BetaResponseCompactParamsPromptCacheRetentionInMemory BetaResponseCompactParamsPromptCacheRetention = "in_memory"` + - `AgentName string` - - `const BetaResponseCompactParamsPromptCacheRetention24h BetaResponseCompactParamsPromptCacheRetention = "24h"` + The canonical name of the agent that produced this item. - - `ServiceTier param.Field[BetaResponseCompactParamsServiceTier]` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - Body param: The service tier to use for this request. + The execution context that produced this tool call. - - `const BetaResponseCompactParamsServiceTierAuto BetaResponseCompactParamsServiceTier = "auto"` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `const BetaResponseCompactParamsServiceTierDefault BetaResponseCompactParamsServiceTier = "default"` + - `Type Direct` - - `const BetaResponseCompactParamsServiceTierFlex BetaResponseCompactParamsServiceTier = "flex"` + - `const DirectDirect Direct = "direct"` - - `const BetaResponseCompactParamsServiceTierPriority BetaResponseCompactParamsServiceTier = "priority"` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `Betas param.Field[[]string]` + - `CallerID string` - Header param: Optional beta features to enable for this request. + The call ID of the program item that produced this tool call. - - `const BetaResponseCompactParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseCompactParamsOpenAIBeta = "responses_multi_agent=v1"` + - `Type Program` -### Returns + - `const ProgramProgram Program = "program"` -- `type BetaCompactedResponse struct{…}` + - `CreatedBy string` - - `ID string` + The ID of the entity that created this tool call. - The unique identifier for the compacted response. + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `CreatedAt int64` + The output emitted by an apply patch tool call. - Unix timestamp (in seconds) when the compacted conversation was created. + - `ID string` - - `Object ResponseCompaction` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - The object type. Always `response.compaction`. + - `CallID string` - - `const ResponseCompactionResponseCompaction ResponseCompaction = "response.compaction"` + The unique ID of the apply patch tool call generated by the model. - - `Output []BetaResponseOutputItemUnion` + - `Status BetaResponseApplyPatchToolCallOutputStatus` - The compacted list of output items. This is a list of all user messages, followed by a single compaction item. + The status of the apply patch tool call output. One of `completed` or `failed`. - - `type BetaResponseOutputMessage struct{…}` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - An output message from the model. + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - - `ID string` + - `Type ApplyPatchCallOutput` - The unique ID of the output message. + The type of the item. Always `apply_patch_call_output`. - - `Content []BetaResponseOutputMessageContentUnion` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - The content of the output message. + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - `type BetaResponseOutputText struct{…}` + The agent that produced this item. - A text output from the model. + - `AgentName string` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The canonical name of the agent that produced this item. - The annotations of the text output. + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + The execution context that produced this tool call. - A citation to a file. + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - `FileID string` + - `Type Direct` - The ID of the file. + - `const DirectDirect Direct = "direct"` - - `Filename string` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - The filename of the file cited. + - `CallerID string` - - `Index int64` + The call ID of the program item that produced this tool call. - The index of the file in the list of files. + - `Type Program` - - `Type FileCitation` + - `const ProgramProgram Program = "program"` - The type of the file citation. Always `file_citation`. + - `CreatedBy string` - - `const FileCitationFileCitation FileCitation = "file_citation"` + The ID of the entity that created this tool call output. - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `Output string` - A citation for a web resource used to generate a model response. + Optional textual output returned by the apply patch tool. - - `EndIndex int64` + - `type BetaResponseOutputItemMcpCall struct{…}` - The index of the last character of the URL citation in the message. + An invocation of a tool on an MCP server. - - `StartIndex int64` + - `ID string` - The index of the first character of the URL citation in the message. + The unique ID of the tool call. - - `Title string` + - `Arguments string` - The title of the web resource. + A JSON string of the arguments passed to the tool. - - `Type URLCitation` + - `Name string` - The type of the URL citation. Always `url_citation`. + The name of the tool that was run. - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `ServerLabel string` - - `URL string` + The label of the MCP server running the tool. - The URL of the web resource. + - `Type McpCall` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + The type of the item. Always `mcp_call`. - A citation for a container file used to generate a model response. + - `const McpCallMcpCall McpCall = "mcp_call"` - - `ContainerID string` + - `Agent BetaResponseOutputItemMcpCallAgent` - The ID of the container file. + The agent that produced this item. - - `EndIndex int64` + - `AgentName string` - The index of the last character of the container file citation in the message. + The canonical name of the agent that produced this item. - - `FileID string` + - `ApprovalRequestID string` - The ID of the file. + 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. - - `Filename string` + - `Error string` - The filename of the container file cited. + The error from the tool call, if any. - - `StartIndex int64` + - `Output string` - The index of the first character of the container file citation in the message. + The output from the tool call. - - `Type ContainerFileCitation` + - `Status string` - The type of the container file citation. Always `container_file_citation`. + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - A path to a file. + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `FileID string` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - The ID of the file. + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - `Index int64` + - `type BetaResponseOutputItemMcpListTools struct{…}` - The index of the file in the list of files. + A list of tools available on an MCP server. - - `Type FilePath` + - `ID string` - The type of the file path. Always `file_path`. + The unique ID of the list. - - `const FilePathFilePath FilePath = "file_path"` + - `ServerLabel string` - - `Text string` + The label of the MCP server. - The text output from the model. + - `Tools []BetaResponseOutputItemMcpListToolsTool` - - `Type OutputText` + The tools available on the server. - The type of the output text. Always `output_text`. + - `InputSchema any` - - `const OutputTextOutputText OutputText = "output_text"` + The JSON schema describing the tool's input. - - `Logprobs []BetaResponseOutputTextLogprob` + - `Name string` - - `Token string` + The name of the tool. - - `Bytes []int64` + - `Annotations any` - - `Logprob float64` + Additional annotations about the tool. - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `Description string` - - `Token string` + The description of the tool. - - `Bytes []int64` + - `Type McpListTools` - - `Logprob float64` + The type of the item. Always `mcp_list_tools`. - - `type BetaResponseOutputRefusal struct{…}` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - A refusal from the model. + - `Agent BetaResponseOutputItemMcpListToolsAgent` - - `Refusal string` + The agent that produced this item. - The refusal explanation from the model. + - `AgentName string` - - `Type Refusal` + The canonical name of the agent that produced this item. - The type of the refusal. Always `refusal`. + - `Error string` - - `const RefusalRefusal Refusal = "refusal"` + Error message if the server could not list tools. - - `Role Assistant` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - The role of the output message. Always `assistant`. + A request for human approval of a tool invocation. - - `const AssistantAssistant Assistant = "assistant"` + - `ID string` - - `Status BetaResponseOutputMessageStatus` + The unique ID of the approval request. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `Arguments string` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + A JSON string of arguments for the tool. - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `Name string` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + The name of the tool to run. - - `Type Message` + - `ServerLabel string` - The type of the output message. Always `message`. + The label of the MCP server making the request. - - `const MessageMessage Message = "message"` + - `Type McpApprovalRequest` - - `Agent BetaResponseOutputMessageAgent` + The type of the item. Always `mcp_approval_request`. + + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` The agent that produced this item. @@ -42887,1093 +57659,1164 @@ Compact a response The canonical name of the agent that produced this item. - - `Phase BetaResponseOutputMessagePhase` - - 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. + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + A response to an MCP approval request. - - `type BetaResponseFileSearchToolCall struct{…}` + - `ID string` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The unique ID of the approval response - - `ID string` + - `ApprovalRequestID string` - The unique ID of the file search tool call. + The ID of the approval request being answered. - - `Queries []string` + - `Approve bool` - The queries used to search for files. + Whether the request was approved. - - `Status BetaResponseFileSearchToolCallStatus` + - `Type McpApprovalResponse` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + The type of the item. Always `mcp_approval_response`. - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + The agent that produced this item. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `AgentName string` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + The canonical name of the agent that produced this item. - - `Type FileSearchCall` + - `Reason string` - The type of the file search tool call. Always `file_search_call`. + Optional reason for the decision. - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `type BetaResponseCustomToolCall struct{…}` - - `Agent BetaResponseFileSearchToolCallAgent` + A call to a custom tool created by the model. - The agent that produced this item. + - `type BetaResponseCustomToolCallOutputItem struct{…}` - - `AgentName string` + The output of a custom tool call from your code, being sent back to the model. - The canonical name of the agent that produced this item. + - `ID string` - - `Results []BetaResponseFileSearchToolCallResult` + The unique ID of the custom tool call output item. - The results of the file search tool call. + - `Status string` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - 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. + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `string` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - - `float64` + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `bool` + - `CreatedBy string` - - `FileID string` + The identifier of the actor that created the item. - The unique ID of the file. + - `ParallelToolCalls bool` - - `Filename string` + Whether to allow the model to run tool calls in parallel. - The name of the file. + - `Temperature float64` - - `Score float64` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - The relevance score of the file - a value between 0 and 1. + - `ToolChoice BetaResponseToolChoiceUnion` - - `Text string` + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - The text that was retrieved from the file. + - `type BetaToolChoiceOptions string` - - `type BetaResponseFunctionToolCall struct{…}` + Controls which (if any) tool is called by the model. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + `none` means the model will not call any tool and instead generates a message. - - `Arguments string` + `auto` means the model can pick between generating a message or calling one or + more tools. - A JSON string of the arguments to pass to the function. + `required` means the model must call one or more tools. - - `CallID string` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - The unique ID of the function tool call generated by the model. + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - - `Name string` + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - The name of the function to run. + - `type BetaToolChoiceAllowed struct{…}` - - `Type FunctionCall` + Constrains the tools available to the model to a pre-defined set. - The type of the function tool call. Always `function_call`. + - `Mode BetaToolChoiceAllowedMode` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + Constrains the tools available to the model to a pre-defined set. - - `ID string` + `auto` allows the model to pick from among the allowed tools and generate a + message. - The unique ID of the function tool call. + `required` requires the model to call one or more of the allowed tools. - - `Agent BetaResponseFunctionToolCallAgent` + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - The agent that produced this item. + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - - `AgentName string` + - `Tools []map[string, any]` - The canonical name of the agent that produced this item. + A list of tool definitions that the model should be allowed to call. - - `Caller BetaResponseFunctionToolCallCallerUnion` + For the Responses API, the list of tool definitions might look like: - The execution context that produced this tool call. + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `Type AllowedTools` - - `Type Direct` + Allowed tool configuration type. Always `allowed_tools`. - - `const DirectDirect Direct = "direct"` + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `type BetaToolChoiceTypes struct{…}` - - `CallerID string` + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - The call ID of the program item that produced this tool call. + - `Type BetaToolChoiceTypesType` - - `Type Program` + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - - `const ProgramProgram Program = "program"` + Allowed values are: - - `Namespace string` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - The namespace of the function to run. + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - `Status BetaResponseFunctionToolCallStatus` + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - - `ID string` + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - The unique ID of the function call tool output. + - `type BetaToolChoiceFunction struct{…}` - - `CallID string` + Use this option to force the model to call a specific function. - The unique ID of the function tool call generated by the model. + - `Name string` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + The name of the function to call. - The output from the function call generated by your code. - Can be a string or an list of output content. + - `Type Function` - - `string` + For function calling, the type is always `function`. - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `const FunctionFunction Function = "function"` - Text, image, or file output of the function call. + - `type BetaToolChoiceMcp struct{…}` - - `type BetaResponseInputText struct{…}` + Use this option to force the model to call a specific tool on a remote MCP server. - A text input to the model. + - `ServerLabel string` - - `Text string` + The label of the MCP server to use. - The text input to the model. + - `Type Mcp` - - `Type InputText` + For MCP tools, the type is always `mcp`. - The type of the input item. Always `input_text`. + - `const McpMcp Mcp = "mcp"` - - `const InputTextInputText InputText = "input_text"` + - `Name string` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + The name of the tool to call on the server. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaToolChoiceCustom struct{…}` - - `Mode Explicit` + Use this option to force the model to call a specific custom tool. - The breakpoint mode. Always `explicit`. + - `Name string` - - `const ExplicitExplicit Explicit = "explicit"` + The name of the custom tool to call. - - `type BetaResponseInputImage struct{…}` + - `Type Custom` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + For custom tool calling, the type is always `custom`. - - `Detail BetaResponseInputImageDetail` + - `const CustomCustom Custom = "custom"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `Type ProgrammaticToolCalling` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + The tool to call. Always `programmatic_tool_calling`. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `type BetaToolChoiceApplyPatch struct{…}` - - `Type InputImage` + Forces the model to call the apply_patch tool when executing a tool call. - The type of the input item. Always `input_image`. + - `Type ApplyPatch` - - `const InputImageInputImage InputImage = "input_image"` + The tool to call. Always `apply_patch`. - - `FileID string` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - The ID of the file to be sent to the model. + - `type BetaToolChoiceShell struct{…}` - - `ImageURL string` + Forces the model to call the shell tool when a tool call is required. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `Type Shell` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + The tool to call. Always `shell`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const ShellShell Shell = "shell"` - - `Mode Explicit` + - `Tools []BetaToolUnion` - The breakpoint mode. Always `explicit`. + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. - - `const ExplicitExplicit Explicit = "explicit"` + We support the following categories of tools: - - `type BetaResponseInputFile struct{…}` + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. - A file input to the model. + - `type BetaFunctionTool struct{…}` - - `Type InputFile` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The type of the input item. Always `input_file`. + - `type BetaFileSearchTool struct{…}` - - `const InputFileInputFile InputFile = "input_file"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Detail BetaResponseInputFileDetail` + - `type BetaComputerTool struct{…}` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `type BetaWebSearchTool struct{…}` - - `FileData string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The content of the file to be sent to the model. + - `type BetaToolMcp struct{…}` - - `FileID string` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The ID of the file to be sent to the model. + - `type BetaToolCodeInterpreter struct{…}` - - `FileURL string` + A tool that runs Python code to help generate a response to a prompt. - The URL of the file to be sent to the model. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Filename string` + - `type BetaToolImageGeneration struct{…}` - The name of the file to be sent to the model. + A tool that generates images using the GPT image models. - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `type BetaToolLocalShell struct{…}` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + A tool that allows the model to execute shell commands in a local environment. - - `Mode Explicit` + - `type BetaFunctionShellTool struct{…}` - The breakpoint mode. Always `explicit`. + A tool that allows the model to execute shell commands. - - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaCustomTool struct{…}` - - `Status BetaResponseFunctionToolCallOutputItemStatus` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type BetaNamespaceTool struct{…}` - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + Groups function/custom tools under a shared namespace. - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + - `type BetaToolSearchTool struct{…}` - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + Hosted or BYOT tool search configuration for deferred tools. - - `Type FunctionCallOutput` + - `type BetaWebSearchPreviewTool struct{…}` - The type of the function tool call output. Always `function_call_output`. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `type BetaApplyPatchTool struct{…}` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + Allows the assistant to create, delete, or update files using unified diffs. - The agent that produced this item. + - `TopP float64` - - `AgentName string` + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - The canonical name of the agent that produced this item. + We generally recommend altering this or `temperature` but not both. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `Background bool` - The execution context that produced this tool call. + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `CompletedAt float64` - - `Type Direct` + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - The caller type. Always `direct`. + - `Conversation BetaResponseConversation` - - `const DirectDirect Direct = "direct"` + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `ID string` - - `CallerID string` + The unique ID of the conversation that this response was associated with. - The call ID of the program item that produced this tool call. + - `MaxOutputTokens int64` - - `Type Program` + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - The caller type. Always `program`. + - `MaxToolCalls int64` - - `const ProgramProgram Program = "program"` + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `CreatedBy string` + - `Moderation BetaResponseModeration` - The identifier of the actor that created the item. + Moderation results for the response input and output, if moderated completions were requested. - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `Input BetaResponseModerationInputUnion` - - `ID string` + Moderation for the response input. - The unique ID of the agent message. + - `type BetaResponseModerationInputModerationResult struct{…}` - - `Author string` + A moderation result produced for the response input or output. - The sending agent identity. + - `Categories map[string, bool]` - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - Encrypted content sent between agents. + - `CategoryAppliedInputTypes map[string, []string]` - - `type BetaResponseInputText struct{…}` + Which modalities of input are reflected by the score for each category. - A text input to the model. + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` - - `type BetaResponseOutputText struct{…}` + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` - A text output from the model. + - `CategoryScores map[string, float64]` - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + A dictionary of moderation categories to scores. - A text content. + - `Flagged bool` - - `Text string` + A boolean indicating whether the content was flagged by any category. - - `Type Text` + - `Model string` - - `const TextText Text = "text"` + The moderation model that produced this result. - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + - `Type ModerationResult` - A summary text from the model. + The object type, which was always `moderation_result` for successful moderation results. - - `Text string` + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - A summary of the reasoning output from the model so far. + - `type BetaResponseModerationInputError struct{…}` - - `Type SummaryText` + An error produced while attempting moderation for the response input or output. - The type of the object. Always `summary_text`. + - `Code string` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + The error code. - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `Message string` - Reasoning text from the model. + The error message. - - `Text string` + - `Type Error` - The reasoning text from the model. + The object type, which was always `error` for moderation failures. - - `Type ReasoningText` + - `const ErrorError Error = "error"` - The type of the reasoning text. Always `reasoning_text`. + - `Output BetaResponseModerationOutputUnion` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + Moderation for the response output. - - `type BetaResponseOutputRefusal struct{…}` + - `type BetaResponseModerationOutputModerationResult struct{…}` - A refusal from the model. + A moderation result produced for the response input or output. - - `type BetaResponseInputImage struct{…}` + - `Categories map[string, bool]` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + - `CategoryAppliedInputTypes map[string, []string]` - A screenshot of a computer. + Which modalities of input are reflected by the score for each category. - - `Detail string` + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `CategoryScores map[string, float64]` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + A dictionary of moderation categories to scores. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `Flagged bool` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + A boolean indicating whether the content was flagged by any category. - - `FileID string` + - `Model string` - The identifier of an uploaded file that contains the screenshot. + The moderation model that produced this result. - - `ImageURL string` + - `Type ModerationResult` - The URL of the screenshot image. + The object type, which was always `moderation_result` for successful moderation results. - - `Type ComputerScreenshot` + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `type BetaResponseModerationOutputError struct{…}` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + An error produced while attempting moderation for the response input or output. - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `Code string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The error code. - - `Mode Explicit` + - `Message string` - The breakpoint mode. Always `explicit`. + The error message. - - `const ExplicitExplicit Explicit = "explicit"` + - `Type Error` - - `type BetaResponseInputFile struct{…}` + The object type, which was always `error` for moderation failures. - A file input to the model. + - `const ErrorError Error = "error"` - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + - `PreviousResponseID string` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - - `EncryptedContent string` + - `Prompt BetaResponsePrompt` - Opaque encrypted content. + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - - `Type EncryptedContent` + - `ID string` - The type of the input item. Always `encrypted_content`. + The unique identifier of the prompt template to use. - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `Variables map[string, BetaResponsePromptVariableUnion]` - - `Recipient string` + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - The destination agent identity. + - `string` - - `Type AgentMessage` + - `type BetaResponseInputText struct{…}` - The type of the item. Always `agent_message`. + A text input to the model. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `type BetaResponseInputImage struct{…}` - - `Agent BetaResponseOutputItemAgentMessageAgent` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The agent that produced this item. + - `type BetaResponseInputFile struct{…}` - - `AgentName string` + A file input to the model. - The canonical name of the agent that produced this item. + - `Version string` - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + Optional version of the prompt template. - - `ID string` + - `PromptCacheKey string` - The unique ID of the multi-agent call item. + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - - `Action string` + - `PromptCacheOptions BetaResponsePromptCacheOptions` - The multi-agent action to execute. + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + - `Mode string` - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + Whether implicit prompt-cache breakpoints were enabled. - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + - `Ttl string` - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + The minimum lifetime applied to each cache breakpoint. - - `Arguments string` + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` - The JSON string of arguments generated for the action. + - `PromptCacheRetention BetaResponsePromptCacheRetention` - - `CallID string` + Deprecated. Use `prompt_cache_options.ttl` instead. - The unique ID linking this call to its output. + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - `Type MultiAgentCall` + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - The type of the multi-agent call. Always `multi_agent_call`. + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` - The agent that produced this item. + - `Reasoning BetaResponseReasoning` - - `AgentName string` + **gpt-5 and o-series models only** - The canonical name of the agent that produced this item. + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + - `Context string` - - `ID string` + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - The unique ID of the multi-agent call output item. + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` - - `Action string` + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` - The multi-agent action that produced this result. + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + - `Effort string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` - - `CallID string` + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` - The unique ID of the multi-agent call. + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` - - `Output []BetaResponseOutputText` + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` - Text output returned by the multi-agent action. + - `GenerateSummary string` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + **Deprecated:** use `summary` instead. - The annotations of the text output. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `Text string` + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` - The text output from the model. + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` - - `Type OutputText` + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` - The type of the output text. Always `output_text`. + - `Mode string` - - `Logprobs []BetaResponseOutputTextLogprob` + Controls the reasoning execution mode for the request. - - `Type MultiAgentCallOutput` + When returned on a response, this is the effective execution mode. - The type of the multi-agent result. Always `multi_agent_call_output`. + - `string` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `string` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` - The agent that produced this item. + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` - - `AgentName string` + - `Summary string` - The canonical name of the agent that produced this item. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `type BetaResponseFunctionWebSearch struct{…}` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` - - `ID string` + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` - The unique ID of the web search tool call. + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` - - `Action BetaResponseFunctionWebSearchActionUnion` + - `SafetyIdentifier string` - 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). + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `ServiceTier BetaResponseServiceTier` - Action type "search" - Performs a web search query. + Specifies the processing type used for serving the request. - - `Type Search` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - The action type. + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - `const SearchSearch Search = "search"` + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` - - `Queries []string` + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` - The search queries. + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` - - `Query string` + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` - The search query. + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + - `Status BetaResponseStatus` - The sources used in the search. + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. - - `Type URL` + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` - The type of source. Always `url`. + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` - - `const URLURL URL = "url"` + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` - - `URL string` + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` - The URL of the source. + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` - Action type "open_page" - Opens a specific URL from search results. + - `Text BetaResponseTextConfig` - - `Type OpenPage` + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - The action type. + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - - `const OpenPageOpenPage OpenPage = "open_page"` + - `Format BetaResponseFormatTextConfigUnion` - - `URL string` + An object specifying the format that the model must output. - The URL opened by the model. + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + The default format is `{ "type": "text" }` with no additional options. - Action type "find_in_page": Searches for a pattern within a loaded page. + **Not recommended for gpt-4o and newer models:** - - `Pattern string` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - The pattern or text to search for within the page. + - `type BetaResponseFormatTextConfigText struct{…}` - - `Type FindInPage` + Default response format. Used to generate text responses. - The action type. + - `Type Text` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + The type of response format being defined. Always `text`. - - `URL string` + - `const TextText Text = "text"` - The URL of the page searched for the pattern. + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - - `Status BetaResponseFunctionWebSearchStatus` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The status of the web search tool call. + - `Name string` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + - `Schema map[string, any]` - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `Type JSONSchema` - - `Type WebSearchCall` + The type of response format being defined. Always `json_schema`. - The type of the web search tool call. Always `web_search_call`. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `Description string` - - `Agent BetaResponseFunctionWebSearchAgent` + A description of what the response format is for, used by the model to + determine how to respond in the format. - The agent that produced this item. + - `Strict bool` - - `AgentName string` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The canonical name of the agent that produced this item. + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - - `type BetaResponseComputerToolCall struct{…}` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `Type JSONObject` - - `ID string` + The type of response format being defined. Always `json_object`. - The unique ID of the computer call. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `CallID string` + - `Verbosity BetaResponseTextConfigVerbosity` - An identifier used when responding to the tool call with output. + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - The pending safety checks for the computer call. + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - - `ID string` + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - The ID of the pending safety check. + - `TopLogprobs int64` - - `Code string` + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - The type of the pending safety check. + - `Truncation BetaResponseTruncation` - - `Message string` + The truncation strategy to use for the model response. - Details about the pending safety check. + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `Status BetaResponseComputerToolCallStatus` + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `Usage BetaResponseUsage` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `InputTokens int64` - - `Type BetaResponseComputerToolCallType` + The number of input tokens. - The type of the computer call. Always `computer_call`. + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + A detailed breakdown of the input tokens. - - `Action BetaComputerActionUnion` + - `CacheWriteTokens int64` - A click action. + The number of input tokens that were written to the cache. - - `type BetaComputerActionClick struct{…}` + - `CachedTokens int64` - A click action. + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - - `Button string` + - `OutputTokens int64` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + The number of output tokens. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + A detailed breakdown of the output tokens. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `ReasoningTokens int64` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + The number of reasoning tokens. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `TotalTokens int64` - - `Type Click` + The total number of tokens used. - Specifies the event type. For a click action, this property is always `click`. + - `User string` - - `const ClickClick Click = "click"` + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `X int64` + - `SequenceNumber int64` - The x-coordinate where the click occurred. + The sequence number for this event. - - `Y int64` + - `Type ResponseCreated` - The y-coordinate where the click occurred. + The type of the event. Always `response.created`. - - `Keys []string` + - `const ResponseCreatedResponseCreated ResponseCreated = "response.created"` - The keys being held while clicking. + - `Agent BetaResponseCreatedEventAgent` - - `type BetaComputerActionDoubleClick struct{…}` + The agent that owns this multi-agent streaming event. - A double click action. + - `AgentName string` - - `Keys []string` + The canonical name of the agent that produced this item. - The keys being held while double-clicking. +### Beta Response Custom Tool Call - - `Type DoubleClick` +- `type BetaResponseCustomToolCall struct{…}` - Specifies the event type. For a double click action, this property is always set to `double_click`. + A call to a custom tool created by the model. - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `CallID string` - - `X int64` + An identifier used to map this custom tool call to a tool call output. - The x-coordinate where the double click occurred. + - `Input string` - - `Y int64` + The input for the custom tool call generated by the model. - The y-coordinate where the double click occurred. + - `Name string` - - `type BetaComputerActionDrag struct{…}` + The name of the custom tool being called. - A drag action. + - `Type CustomToolCall` - - `Path []BetaComputerActionDragPath` + The type of the custom tool call. Always `custom_tool_call`. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `ID string` - - `X int64` + The unique ID of the custom tool call in the OpenAI platform. - The x-coordinate. + - `Agent BetaResponseCustomToolCallAgent` - - `Y int64` + The agent that produced this item. - The y-coordinate. + - `AgentName string` - - `Type Drag` + The canonical name of the agent that produced this item. - Specifies the event type. For a drag action, this property is always set to `drag`. + - `Caller BetaResponseCustomToolCallCallerUnion` - - `const DragDrag Drag = "drag"` + The execution context that produced this tool call. - - `Keys []string` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - The keys being held while dragging the mouse. + - `Type Direct` - - `type BetaComputerActionKeypress struct{…}` + - `const DirectDirect Direct = "direct"` - A collection of keypresses the model would like to perform. + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `Keys []string` + - `CallerID string` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + The call ID of the program item that produced this tool call. - - `Type Keypress` + - `Type Program` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `const ProgramProgram Program = "program"` - - `const KeypressKeypress Keypress = "keypress"` + - `Namespace string` - - `type BetaComputerActionMove struct{…}` + The namespace of the custom tool being called. - A mouse move action. +### Beta Response Custom Tool Call Input Delta Event - - `Type Move` +- `type BetaResponseCustomToolCallInputDeltaEvent struct{…}` - Specifies the event type. For a move action, this property is always set to `move`. + Event representing a delta (partial update) to the input of a custom tool call. - - `const MoveMove Move = "move"` + - `Delta string` - - `X int64` + The incremental input data (delta) for the custom tool call. - The x-coordinate to move to. + - `ItemID string` - - `Y int64` + Unique identifier for the API item associated with this event. - The y-coordinate to move to. + - `OutputIndex int64` - - `Keys []string` + The index of the output this delta applies to. - The keys being held while moving the mouse. + - `SequenceNumber int64` - - `type BetaComputerActionScreenshot struct{…}` + The sequence number of this event. - A screenshot action. + - `Type ResponseCustomToolCallInputDelta` - - `Type Screenshot` + The event type identifier. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `Agent BetaResponseCustomToolCallInputDeltaEventAgent` - - `type BetaComputerActionScroll struct{…}` + The agent that owns this multi-agent streaming event. - A scroll action. + - `AgentName string` - - `ScrollX int64` + The canonical name of the agent that produced this item. - The horizontal scroll distance. +### Beta Response Custom Tool Call Input Done Event - - `ScrollY int64` +- `type BetaResponseCustomToolCallInputDoneEvent struct{…}` - The vertical scroll distance. + Event indicating that input for a custom tool call is complete. - - `Type Scroll` + - `Input string` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + The complete input data for the custom tool call. - - `const ScrollScroll Scroll = "scroll"` + - `ItemID string` - - `X int64` + Unique identifier for the API item associated with this event. - The x-coordinate where the scroll occurred. + - `OutputIndex int64` - - `Y int64` + The index of the output this event applies to. - The y-coordinate where the scroll occurred. + - `SequenceNumber int64` - - `Keys []string` + The sequence number of this event. - The keys being held while scrolling. + - `Type ResponseCustomToolCallInputDone` - - `type BetaComputerActionType struct{…}` + The event type identifier. - An action to type in text. + - `const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"` - - `Text string` + - `Agent BetaResponseCustomToolCallInputDoneEventAgent` - The text to type. + The agent that owns this multi-agent streaming event. - - `Type Type` + - `AgentName string` - Specifies the event type. For a type action, this property is always set to `type`. + The canonical name of the agent that produced this item. - - `const TypeType Type = "type"` +### Beta Response Custom Tool Call Item - - `type BetaComputerActionWait struct{…}` +- `type BetaResponseCustomToolCallItem struct{…}` - A wait action. + A call to a custom tool created by the model. - - `Type Wait` + - `ID string` - Specifies the event type. For a wait action, this property is always set to `wait`. + The unique ID of the custom tool call item. - - `const WaitWait Wait = "wait"` + - `Status string` - - `Actions BetaComputerActionList` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `const BetaResponseCustomToolCallItemStatusInProgress BetaResponseCustomToolCallItemStatus = "in_progress"` - - `type BetaComputerActionClick struct{…}` + - `const BetaResponseCustomToolCallItemStatusCompleted BetaResponseCustomToolCallItemStatus = "completed"` - A click action. + - `const BetaResponseCustomToolCallItemStatusIncomplete BetaResponseCustomToolCallItemStatus = "incomplete"` - - `type BetaComputerActionDoubleClick struct{…}` + - `CreatedBy string` - A double click action. + The identifier of the actor that created the item. - - `type BetaComputerActionDrag struct{…}` +### Beta Response Custom Tool Call Output - A drag action. +- `type BetaResponseCustomToolCallOutput struct{…}` - - `type BetaComputerActionKeypress struct{…}` + The output of a custom tool call from your code, being sent back to the model. - A collection of keypresses the model would like to perform. + - `CallID string` - - `type BetaComputerActionMove struct{…}` + The call ID, used to map this custom tool call output to a custom tool call. - A mouse move action. + - `Output BetaResponseCustomToolCallOutputOutputUnion` - - `type BetaComputerActionScreenshot struct{…}` + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - A screenshot action. + - `string` - - `type BetaComputerActionScroll struct{…}` + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - A scroll action. + Text, image, or file output of the custom tool call. - - `type BetaComputerActionType struct{…}` + - `type BetaResponseInputText struct{…}` - An action to type in text. + A text input to the model. - - `type BetaComputerActionWait struct{…}` + - `Text string` - A wait action. + The text input to the model. - - `Agent BetaResponseComputerToolCallAgent` + - `Type InputText` - The agent that produced this item. + The type of the input item. Always `input_text`. - - `AgentName string` + - `const InputTextInputText InputText = "input_text"` - The canonical name of the agent that produced this item. + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `ID string` + - `Mode Explicit` - The unique ID of the computer call tool output. + The breakpoint mode. Always `explicit`. - - `CallID string` + - `const ExplicitExplicit Explicit = "explicit"` - The ID of the computer tool call that produced the output. + - `type BetaResponseInputImage struct{…}` - - `Output BetaResponseComputerToolCallOutputScreenshot` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - A computer screenshot image used with the computer use tool. + - `Detail BetaResponseInputImageDetail` - - `Type ComputerScreenshot` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `FileID string` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - The identifier of an uploaded file that contains the screenshot. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `ImageURL string` + - `Type InputImage` - The URL of the screenshot image. + The type of the input item. Always `input_image`. - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `const InputImageInputImage InputImage = "input_image"` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `FileID string` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + The ID of the file to be sent to the model. - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `ImageURL string` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `Type ComputerCallOutput` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The type of the computer tool call output. Always `computer_call_output`. + - `Mode Explicit` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + The breakpoint mode. Always `explicit`. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `const ExplicitExplicit Explicit = "explicit"` - The safety checks reported by the API that have been acknowledged by the - developer. + - `type BetaResponseInputFile struct{…}` - - `ID string` + A file input to the model. - The ID of the pending safety check. + - `Type InputFile` - - `Code string` + The type of the input item. Always `input_file`. - The type of the pending safety check. + - `const InputFileInputFile InputFile = "input_file"` - - `Message string` + - `Detail BetaResponseInputFileDetail` - Details about the pending safety check. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - The agent that produced this item. + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `AgentName string` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - The canonical name of the agent that produced this item. + - `FileData string` - - `CreatedBy string` + The content of the file to be sent to the model. - The identifier of the actor that created the item. + - `FileID string` - - `type BetaResponseReasoningItem struct{…}` + The ID of the file to be sent to the model. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `FileURL string` - - `ID string` + The URL of the file to be sent to the model. - The unique identifier of the reasoning content. + - `Filename string` - - `Summary []BetaResponseReasoningItemSummary` + The name of the file to be sent to the model. - Reasoning summary content. + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `Text string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A summary of the reasoning output from the model so far. + - `Mode Explicit` - - `Type SummaryText` + The breakpoint mode. Always `explicit`. - The type of the object. Always `summary_text`. + - `const ExplicitExplicit Explicit = "explicit"` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `Type CustomToolCallOutput` - - `Type Reasoning` + The type of the custom tool call output. Always `custom_tool_call_output`. - The type of the object. Always `reasoning`. + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - - `const ReasoningReasoning Reasoning = "reasoning"` + - `ID string` - - `Agent BetaResponseReasoningItemAgent` + The unique ID of the custom tool call output in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallOutputAgent` The agent that produced this item. @@ -43981,1409 +58824,1390 @@ Compact a response The canonical name of the agent that produced this item. - - `Content []BetaResponseReasoningItemContent` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - Reasoning text content. + The execution context that produced this tool call. - - `Text string` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - The reasoning text from the model. + - `Type Direct` - - `Type ReasoningText` + The caller type. Always `direct`. - The type of the reasoning text. Always `reasoning_text`. + - `const DirectDirect Direct = "direct"` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - - `EncryptedContent string` + - `CallerID string` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + The call ID of the program item that produced this tool call. - - `Status BetaResponseReasoningItemStatus` + - `Type Program` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The caller type. Always `program`. - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` +### Beta Response Custom Tool Call Output Item - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` +- `type BetaResponseCustomToolCallOutputItem struct{…}` - - `type BetaResponseOutputItemProgram struct{…}` + The output of a custom tool call from your code, being sent back to the model. - `ID string` - The unique ID of the program item. - - - `CallID string` - - The stable call ID of the program item. - - - `Code string` + The unique ID of the custom tool call output item. - The JavaScript source executed by programmatic tool calling. + - `Status string` - - `Fingerprint string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Opaque program replay fingerprint that must be round-tripped. + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `Type Program` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - The type of the item. Always `program`. + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `const ProgramProgram Program = "program"` + - `CreatedBy string` - - `Agent BetaResponseOutputItemProgramAgent` + The identifier of the actor that created the item. - The agent that produced this item. +### Beta Response Error - - `AgentName string` +- `type BetaResponseError struct{…}` - The canonical name of the agent that produced this item. + An error object returned when the model fails to generate a Response. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `Code BetaResponseErrorCode` - - `ID string` + The error code for the response. - The unique ID of the program output item. + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` - - `CallID string` + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` - The call ID of the program item. + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` - - `Result string` + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` - The result produced by the program item. + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` - - `Status string` + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` - The terminal status of the program output item. + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` - - `Type ProgramOutput` + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` - The type of the item. Always `program_output`. + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` - The agent that produced this item. + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` - - `AgentName string` + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` - The canonical name of the agent that produced this item. + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` - - `type BetaResponseToolSearchCall struct{…}` + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` - - `ID string` + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` - The unique ID of the tool search call item. + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` - - `Arguments any` + - `Message string` - Arguments used for the tool search call. + A human-readable description of the error. - - `CallID string` +### Beta Response Error Event - The unique ID of the tool search call generated by the model. +- `type BetaResponseErrorEvent struct{…}` - - `Execution BetaResponseToolSearchCallExecution` + Emitted when an error occurs. - Whether tool search was executed by the server or by the client. + - `Code string` - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + The error code. - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `Message string` - - `Status BetaResponseToolSearchCallStatus` + The error message. - The status of the tool search call item that was recorded. + - `Param string` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + The error parameter. - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `SequenceNumber int64` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + The sequence number of this event. - - `Type ToolSearchCall` + - `Type Error` - The type of the item. Always `tool_search_call`. + The type of the event. Always `error`. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `const ErrorError Error = "error"` - - `Agent BetaResponseToolSearchCallAgent` + - `Agent BetaResponseErrorEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `CreatedBy string` +### Beta Response Failed Event - The identifier of the actor that created the item. +- `type BetaResponseFailedEvent struct{…}` - - `type BetaResponseToolSearchOutputItem struct{…}` + An event that is emitted when a response fails. + + - `Response BetaResponse` + + The response that failed. - `ID string` - The unique ID of the tool search output item. + Unique identifier for this Response. - - `CallID string` + - `CreatedAt float64` - The unique ID of the tool search call generated by the model. + Unix timestamp (in seconds) of when this Response was created. - - `Execution BetaResponseToolSearchOutputItemExecution` + - `Error BetaResponseError` - Whether tool search was executed by the server or by the client. + An error object returned when the model fails to generate a Response. - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + - `Code BetaResponseErrorCode` - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + The error code for the response. - - `Status BetaResponseToolSearchOutputItemStatus` + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` - The status of the tool search output item that was recorded. + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` - - `Tools []BetaToolUnion` + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` - The loaded tool definitions returned by tool search. + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` - - `type BetaFunctionTool struct{…}` + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` - - `Name string` + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` - The name of the function to call. + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` - - `Parameters map[string, any]` + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` - A JSON schema object describing the parameters of the function. + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` - - `Strict bool` + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` - Whether strict parameter validation is enforced for this function tool. + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` - - `Type Function` + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` - The type of the function tool. Always `function`. + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` - - `const FunctionFunction Function = "function"` + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` - - `AllowedCallers []string` + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` - The tool invocation context(s). + - `Message string` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + A human-readable description of the error. - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `IncompleteDetails BetaResponseIncompleteDetails` - - `DeferLoading bool` + Details about why the response is incomplete. - Whether this function is deferred and loaded via tool search. + - `Reason string` - - `Description string` + The reason why the response is incomplete. - A description of the function. Used by the model to determine whether or not to call the function. + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` - - `OutputSchema map[string, any]` + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` - A JSON schema object describing the JSON value encoded in string outputs for this function. + - `Instructions BetaResponseInstructionsUnion` - - `type BetaFileSearchTool struct{…}` + A system (or developer) message inserted into the model's context. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. - - `Type FileSearch` + - `string` - The type of the file search tool. Always `file_search`. + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` - - `const FileSearchFileSearch FileSearch = "file_search"` + A list of one or many input items to the model, containing + different content types. - - `VectorStoreIDs []string` + - `type BetaEasyInputMessage struct{…}` - The IDs of the vector stores to search. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `Filters BetaFileSearchToolFiltersUnion` + - `Content BetaEasyInputMessageContentUnion` - A filter to apply. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `string` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - `Key string` + A list of one or many input items to the model, containing different content + types. - The key to compare against the value. + - `type BetaResponseInputText struct{…}` - - `Type string` + A text input to the model. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `Text string` - - `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 + The text input to the model. - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `Type InputText` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + The type of the input item. Always `input_text`. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + - `const InputTextInputText InputText = "input_text"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + - `Mode Explicit` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + The breakpoint mode. Always `explicit`. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `const ExplicitExplicit Explicit = "explicit"` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + - `type BetaResponseInputImage struct{…}` - The value to compare against the attribute key; supports string, number, or boolean types. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `string` + - `Detail BetaResponseInputImageDetail` - - `float64` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `bool` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - Combine multiple filters using `and` or `or`. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + - `Type InputImage` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + The type of the input item. Always `input_image`. - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `const InputImageInputImage InputImage = "input_image"` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `FileID string` - - `Key string` + The ID of the file to be sent to the model. - The key to compare against the value. + - `ImageURL string` - - `Type string` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `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 + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `Mode Explicit` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + The breakpoint mode. Always `explicit`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `const ExplicitExplicit Explicit = "explicit"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + - `type BetaResponseInputFile struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + A file input to the model. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + - `Type InputFile` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + The type of the input item. Always `input_file`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `const InputFileInputFile InputFile = "input_file"` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + - `Detail BetaResponseInputFileDetail` - The value to compare against the attribute key; supports string, number, or boolean types. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `string` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `float64` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `bool` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `FileData string` - - `Type string` + The content of the file to be sent to the model. - Type of operation: `and` or `or`. + - `FileID string` - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + The ID of the file to be sent to the model. - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + - `FileURL string` - - `MaxNumResults int64` + The URL of the file to be sent to the model. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `Filename string` - - `RankingOptions BetaFileSearchToolRankingOptions` + The name of the file to be sent to the model. - Ranking options for search. + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + - `Mode Explicit` - - `EmbeddingWeight float64` + The breakpoint mode. Always `explicit`. - The weight of the embedding in the reciprocal ranking fusion. + - `const ExplicitExplicit Explicit = "explicit"` - - `TextWeight float64` + - `Role BetaEasyInputMessageRole` - The weight of the text in the reciprocal ranking fusion. + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - - `Ranker string` + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - The ranker to use for the file search. + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - - `ScoreThreshold float64` + - `Phase BetaEasyInputMessagePhase` - 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. + 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. - - `type BetaComputerTool struct{…}` + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - - `Type Computer` + - `Type BetaEasyInputMessageType` - The type of the computer tool. Always `computer`. + The type of the message input. Always `message`. - - `const ComputerComputer Computer = "computer"` + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - - `type BetaComputerUsePreviewTool struct{…}` + - `type BetaResponseInputItemMessage struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - - `DisplayHeight int64` + - `Content BetaResponseInputMessageContentList` - The height of the computer display. + A list of one or many input items to the model, containing different content + types. - - `DisplayWidth int64` + - `Role string` - The width of the computer display. + The role of the message input. One of `user`, `system`, or `developer`. - - `Environment BetaComputerUsePreviewToolEnvironment` + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` - The type of computer environment to control. + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `Agent BetaResponseInputItemMessageAgent` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + The agent that produced this item. - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `AgentName string` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + The canonical name of the agent that produced this item. - - `Type ComputerUsePreview` + - `Status string` - The type of the computer use tool. Always `computer_use_preview`. + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - - `type BetaWebSearchTool struct{…}` + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - - `Type BetaWebSearchToolType` + - `Type string` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + The type of the message input. Always set to `message`. - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `type BetaResponseOutputMessage struct{…}` - - `Filters BetaWebSearchToolFilters` + An output message from the model. - Filters for the search. + - `ID string` - - `AllowedDomains []string` + The unique ID of the output message. - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `Content []BetaResponseOutputMessageContentUnion` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + The content of the output message. - - `SearchContextSize BetaWebSearchToolSearchContextSize` + - `type BetaResponseOutputText struct{…}` - 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. + A text output from the model. - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + The annotations of the text output. - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `UserLocation BetaWebSearchToolUserLocation` + A citation to a file. - The approximate location of the user. + - `FileID string` - - `City string` + The ID of the file. - Free text input for the city of the user, e.g. `San Francisco`. + - `Filename string` - - `Country string` + The filename of the file cited. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `Index int64` - - `Region string` + The index of the file in the list of files. - Free text input for the region of the user, e.g. `California`. + - `Type FileCitation` - - `Timezone string` + The type of the file citation. Always `file_citation`. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `Type string` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - The type of location approximation. Always `approximate`. + A citation for a web resource used to generate a model response. - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `EndIndex int64` - - `type BetaToolMcp struct{…}` + The index of the last character of the URL citation in the message. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `StartIndex int64` - - `ServerLabel string` + The index of the first character of the URL citation in the message. - A label for this MCP server, used to identify it in tool calls. + - `Title string` - - `Type Mcp` + The title of the web resource. - The type of the MCP tool. Always `mcp`. + - `Type URLCitation` - - `const McpMcp Mcp = "mcp"` + The type of the URL citation. Always `url_citation`. - - `AllowedCallers []string` + - `const URLCitationURLCitation URLCitation = "url_citation"` - The tool invocation context(s). + - `URL string` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + The URL of the web resource. - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `AllowedTools BetaToolMcpAllowedToolsUnion` + A citation for a container file used to generate a model response. - List of allowed tool names or a filter object. + - `ContainerID string` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + The ID of the container file. - A string array of allowed tool names + - `EndIndex int64` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + The index of the last character of the container file citation in the message. - A filter object to specify which tools are allowed. + - `FileID string` - - `ReadOnly bool` + The ID of the file. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Filename string` - - `ToolNames []string` + The filename of the container file cited. - List of allowed tool names. + - `StartIndex int64` - - `Authorization string` + The index of the first character of the container file citation in the message. - 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. + - `Type ContainerFileCitation` - - `ConnectorID string` + The type of the container file citation. Always `container_file_citation`. - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - Currently supported `connector_id` values are: + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - - 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` + A path to a file. - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + - `FileID string` - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + The ID of the file. - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `Index int64` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + The index of the file in the list of files. - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `Type FilePath` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + The type of the file path. Always `file_path`. - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `const FilePathFilePath FilePath = "file_path"` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + - `Text string` - - `DeferLoading bool` + The text output from the model. - Whether this MCP tool is deferred and discovered via tool search. + - `Type OutputText` - - `Headers map[string, string]` + The type of the output text. Always `output_text`. - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `const OutputTextOutputText OutputText = "output_text"` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `Logprobs []BetaResponseOutputTextLogprob` - Specify which of the MCP server's tools require approval. + - `Token string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + - `Bytes []int64` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `Logprob float64` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - A filter object to specify which tools are allowed. + - `Token string` - - `ReadOnly bool` + - `Bytes []int64` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Logprob float64` - - `ToolNames []string` + - `type BetaResponseOutputRefusal struct{…}` - List of allowed tool names. + A refusal from the model. - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `Refusal string` - A filter object to specify which tools are allowed. + The refusal explanation from the model. - - `ReadOnly bool` + - `Type Refusal` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The type of the refusal. Always `refusal`. - - `ToolNames []string` + - `const RefusalRefusal Refusal = "refusal"` - List of allowed tool names. + - `Role Assistant` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + The role of the output message. Always `assistant`. - 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 AssistantAssistant Assistant = "assistant"` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `Status BetaResponseOutputMessageStatus` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `ServerDescription string` + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - Optional description of the MCP server, used to provide more context. + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - - `ServerURL string` + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `Type Message` - - `TunnelID string` + The type of the output message. Always `message`. - 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. + - `const MessageMessage Message = "message"` - - `type BetaToolCodeInterpreter struct{…}` + - `Agent BetaResponseOutputMessageAgent` - A tool that runs Python code to help generate a response to a prompt. + The agent that produced this item. - - `Container BetaToolCodeInterpreterContainerUnion` + - `AgentName string` - 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. + The canonical name of the agent that produced this item. - - `string` + - `Phase BetaResponseOutputMessagePhase` - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + 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. - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `Type Auto` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - Always `auto`. + - `type BetaResponseFileSearchToolCall struct{…}` - - `const AutoAuto Auto = "auto"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `FileIDs []string` + - `ID string` - An optional list of uploaded files to make available to your code. + The unique ID of the file search tool call. - - `MemoryLimit string` + - `Queries []string` - The memory limit for the code interpreter container. + The queries used to search for files. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + - `Status BetaResponseFileSearchToolCallStatus` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - Network access policy for the container. + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - - `Type Disabled` + - `Type FileSearchCall` - Disable outbound network access. Always `disabled`. + The type of the file search tool call. Always `file_search_call`. - - `const DisabledDisabled Disabled = "disabled"` + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `Agent BetaResponseFileSearchToolCallAgent` - - `AllowedDomains []string` + The agent that produced this item. - A list of allowed domains when type is `allowlist`. + - `AgentName string` - - `Type Allowlist` + The canonical name of the agent that produced this item. - Allow outbound network access only to specified domains. Always `allowlist`. + - `Results []BetaResponseFileSearchToolCallResult` - - `const AllowlistAllowlist Allowlist = "allowlist"` + The results of the file search tool call. - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - Optional domain-scoped secrets for allowlisted domains. + 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. - - `Domain string` + - `string` - The domain associated with the secret. + - `float64` - - `Name string` + - `bool` - The name of the secret to inject for the domain. + - `FileID string` - - `Value string` + The unique ID of the file. - The secret value to inject for the domain. + - `Filename string` - - `Type CodeInterpreter` + The name of the file. - The type of the code interpreter tool. Always `code_interpreter`. + - `Score float64` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + The relevance score of the file - a value between 0 and 1. - - `AllowedCallers []string` + - `Text string` - The tool invocation context(s). + The text that was retrieved from the file. - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `type BetaResponseComputerToolCall struct{…}` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `ID string` - - `Type ProgrammaticToolCalling` + The unique ID of the computer call. - The type of the tool. Always `programmatic_tool_calling`. + - `CallID string` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + An identifier used when responding to the tool call with output. - - `type BetaToolImageGeneration struct{…}` + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - A tool that generates images using the GPT image models. + The pending safety checks for the computer call. - - `Type ImageGeneration` + - `ID string` - The type of the image generation tool. Always `image_generation`. + The ID of the pending safety check. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `Code string` - - `Action string` + The type of the pending safety check. - Whether to generate a new image or edit an existing image. Default: `auto`. + - `Message string` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + Details about the pending safety check. - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `Status BetaResponseComputerToolCallStatus` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Background string` + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - 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. + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - `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. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + - `Type BetaResponseComputerToolCallType` - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + The type of the computer call. Always `computer_call`. - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `Action BetaComputerActionUnion` - - `InputFidelity string` + A click action. - 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`. + - `type BetaComputerActionClick struct{…}` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + A click action. - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + - `Button string` - - `InputImageMask BetaToolImageGenerationInputImageMask` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `FileID string` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - File ID for the mask image. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `ImageURL string` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - Base64-encoded mask image. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `Model string` + - `Type Click` - The image generation model to use. Default: `gpt-image-1`. + Specifies the event type. For a click action, this property is always `click`. - - `string` + - `const ClickClick Click = "click"` - - `string` + - `X int64` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + The x-coordinate where the click occurred. - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `Y int64` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + The y-coordinate where the click occurred. - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `Keys []string` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + The keys being held while clicking. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `type BetaComputerActionDoubleClick struct{…}` - - `Moderation string` + A double click action. - Moderation level for the generated image. Default: `auto`. + - `Keys []string` - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + The keys being held while double-clicking. - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `Type DoubleClick` - - `OutputCompression int64` + Specifies the event type. For a double click action, this property is always set to `double_click`. - Compression level for the output image. Default: 100. + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `OutputFormat string` + - `X int64` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + The x-coordinate where the double click occurred. - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + - `Y int64` - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + The y-coordinate where the double click occurred. - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + - `type BetaComputerActionDrag struct{…}` - - `PartialImages int64` + A drag action. - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `Path []BetaComputerActionDragPath` - - `Quality string` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `X int64` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + The x-coordinate. - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `Y int64` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The y-coordinate. - - `Size string` + - `Type Drag` - 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`. + Specifies the event type. For a drag action, this property is always set to `drag`. - - `string` + - `const DragDrag Drag = "drag"` - - `string` + - `Keys []string` - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + The keys being held while dragging the mouse. - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + - `type BetaComputerActionKeypress struct{…}` - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + A collection of keypresses the model would like to perform. - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + - `Keys []string` - - `type BetaToolLocalShell struct{…}` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - A tool that allows the model to execute shell commands in a local environment. + - `Type Keypress` - - `Type LocalShell` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - The type of the local shell tool. Always `local_shell`. + - `const KeypressKeypress Keypress = "keypress"` - - `const LocalShellLocalShell LocalShell = "local_shell"` + - `type BetaComputerActionMove struct{…}` - - `type BetaFunctionShellTool struct{…}` + A mouse move action. - A tool that allows the model to execute shell commands. + - `Type Move` - - `Type Shell` + Specifies the event type. For a move action, this property is always set to `move`. - The type of the shell tool. Always `shell`. + - `const MoveMove Move = "move"` - - `const ShellShell Shell = "shell"` + - `X int64` - - `AllowedCallers []string` + The x-coordinate to move to. - The tool invocation context(s). + - `Y int64` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + The y-coordinate to move to. - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `Keys []string` - - `Environment BetaFunctionShellToolEnvironmentUnion` + The keys being held while moving the mouse. - - `type BetaContainerAuto struct{…}` + - `type BetaComputerActionScreenshot struct{…}` - - `Type ContainerAuto` + A screenshot action. - Automatically creates a container for this request + - `Type Screenshot` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `FileIDs []string` + - `type BetaComputerActionScroll struct{…}` - An optional list of uploaded files to make available to your code. + A scroll action. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `ScrollX int64` - The memory limit for the container. + The horizontal scroll distance. - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `ScrollY int64` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The vertical scroll distance. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `Type Scroll` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `const ScrollScroll Scroll = "scroll"` - Network access policy for the container. + - `X int64` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + The x-coordinate where the scroll occurred. - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `Y int64` - - `Skills []BetaContainerAutoSkillUnion` + The y-coordinate where the scroll occurred. - An optional list of skills referenced by id or inline data. + - `Keys []string` - - `type BetaSkillReference struct{…}` + The keys being held while scrolling. - - `SkillID string` + - `type BetaComputerActionType struct{…}` - The ID of the referenced skill. + An action to type in text. - - `Type SkillReference` + - `Text string` - References a skill created with the /v1/skills endpoint. + The text to type. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `Type Type` - - `Version string` + Specifies the event type. For a type action, this property is always set to `type`. - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `const TypeType Type = "type"` - - `type BetaInlineSkill struct{…}` + - `type BetaComputerActionWait struct{…}` - - `Description string` + A wait action. - The description of the skill. + - `Type Wait` - - `Name string` + Specifies the event type. For a wait action, this property is always set to `wait`. - The name of the skill. + - `const WaitWait Wait = "wait"` - - `Source BetaInlineSkillSource` + - `Actions BetaComputerActionList` - Inline skill payload + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `Data string` + - `type BetaComputerActionClick struct{…}` - Base64-encoded skill zip bundle. + A click action. - - `MediaType ApplicationZip` + - `type BetaComputerActionDoubleClick struct{…}` - The media type of the inline skill payload. Must be `application/zip`. + A double click action. - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `type BetaComputerActionDrag struct{…}` - - `Type Base64` + A drag action. - The type of the inline skill source. Must be `base64`. + - `type BetaComputerActionKeypress struct{…}` - - `const Base64Base64 Base64 = "base64"` + A collection of keypresses the model would like to perform. - - `Type Inline` + - `type BetaComputerActionMove struct{…}` - Defines an inline skill for this request. + A mouse move action. - - `const InlineInline Inline = "inline"` + - `type BetaComputerActionScreenshot struct{…}` - - `type BetaLocalEnvironment struct{…}` + A screenshot action. - - `Type Local` + - `type BetaComputerActionScroll struct{…}` - Use a local computer environment. + A scroll action. - - `const LocalLocal Local = "local"` + - `type BetaComputerActionType struct{…}` - - `Skills []BetaLocalSkill` + An action to type in text. - An optional list of skills. + - `type BetaComputerActionWait struct{…}` - - `Description string` + A wait action. - The description of the skill. + - `Agent BetaResponseComputerToolCallAgent` - - `Name string` + The agent that produced this item. - The name of the skill. + - `AgentName string` - - `Path string` + The canonical name of the agent that produced this item. - The path to the directory containing the skill. + - `type BetaResponseInputItemComputerCallOutput struct{…}` - - `type BetaContainerReference struct{…}` + The output of a computer tool call. - - `ContainerID string` + - `CallID string` - The ID of the referenced container. + The ID of the computer tool call that produced the output. - - `Type ContainerReference` + - `Output BetaResponseComputerToolCallOutputScreenshot` - References a container created with the /v1/containers endpoint + A computer screenshot image used with the computer use tool. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `Type ComputerScreenshot` - - `type BetaCustomTool struct{…}` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `Name string` + - `FileID string` - The name of the custom tool, used to identify it in tool calls. + The identifier of an uploaded file that contains the screenshot. - - `Type Custom` + - `ImageURL string` - The type of the custom tool. Always `custom`. + The URL of the screenshot image. - - `const CustomCustom Custom = "custom"` + - `Type ComputerCallOutput` - - `AllowedCallers []string` + The type of the computer tool call output. Always `computer_call_output`. - The tool invocation context(s). + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `ID string` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + The ID of the computer tool call output. - - `DeferLoading bool` + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - Whether this tool should be deferred and discovered via tool search. + The safety checks reported by the API that have been acknowledged by the developer. - - `Description string` + - `ID string` - Optional description of the custom tool, used to provide more context. + The ID of the pending safety check. - - `Format BetaCustomToolFormatUnion` + - `Code string` - The input format for the custom tool. Default is unconstrained text. + The type of the pending safety check. - - `type BetaCustomToolFormatText struct{…}` + - `Message string` - Unconstrained free-form text. + Details about the pending safety check. - - `Type Text` + - `Agent BetaResponseInputItemComputerCallOutputAgent` - Unconstrained text format. Always `text`. + The agent that produced this item. - - `const TextText Text = "text"` + - `AgentName string` - - `type BetaCustomToolFormatGrammar struct{…}` + The canonical name of the agent that produced this item. - A grammar defined by the user. + - `Status string` - - `Definition string` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - The grammar definition. + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `Syntax string` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - The syntax of the grammar definition. One of `lark` or `regex`. + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `type BetaResponseFunctionWebSearch struct{…}` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `Type Grammar` + - `ID string` - Grammar format. Always `grammar`. + The unique ID of the web search tool call. - - `const GrammarGrammar Grammar = "grammar"` + - `Action BetaResponseFunctionWebSearchActionUnion` - - `type BetaNamespaceTool struct{…}` + 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). - Groups function/custom tools under a shared namespace. + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - - `Description string` + Action type "search" - Performs a web search query. - A description of the namespace shown to the model. + - `Type Search` - - `Name string` + The action type. - The namespace name used in tool calls (for example, `crm`). + - `const SearchSearch Search = "search"` - - `Tools []BetaNamespaceToolToolUnion` + - `Queries []string` - The function/custom tools available inside this namespace. + The search queries. - - `type BetaNamespaceToolToolFunction struct{…}` + - `Query string` - - `Name string` + The search query. - - `Type Function` + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `const FunctionFunction Function = "function"` + The sources used in the search. - - `AllowedCallers []string` + - `Type URL` - The tool invocation context(s). + The type of source. Always `url`. - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `const URLURL URL = "url"` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `URL string` - - `DeferLoading bool` + The URL of the source. - Whether this function should be deferred and discovered via tool search. + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `Description string` + Action type "open_page" - Opens a specific URL from search results. - - `OutputSchema map[string, any]` + - `Type OpenPage` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + The action type. - - `Parameters any` + - `const OpenPageOpenPage OpenPage = "open_page"` - - `Strict bool` + - `URL string` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + The URL opened by the model. - - `type BetaCustomTool struct{…}` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + Action type "find_in_page": Searches for a pattern within a loaded page. - - `Type Namespace` + - `Pattern string` - The type of the tool. Always `namespace`. + The pattern or text to search for within the page. - - `const NamespaceNamespace Namespace = "namespace"` + - `Type FindInPage` - - `type BetaToolSearchTool struct{…}` + The action type. - Hosted or BYOT tool search configuration for deferred tools. + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `Type ToolSearch` + - `URL string` - The type of the tool. Always `tool_search`. + The URL of the page searched for the pattern. - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `Status BetaResponseFunctionWebSearchStatus` - - `Description string` + The status of the web search tool call. - Description shown to the model for a client-executed tool search tool. + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - - `Execution BetaToolSearchToolExecution` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - Whether tool search is executed by the server or by the client. + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `Type WebSearchCall` - - `Parameters any` + The type of the web search tool call. Always `web_search_call`. - Parameter schema for a client-executed tool search tool. + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `type BetaWebSearchPreviewTool struct{…}` + - `Agent BetaResponseFunctionWebSearchAgent` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The agent that produced this item. - - `Type BetaWebSearchPreviewToolType` + - `AgentName string` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + The canonical name of the agent that produced this item. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `type BetaResponseFunctionToolCall struct{…}` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `SearchContentTypes []string` + - `Arguments string` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + A JSON string of the arguments to pass to the function. - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + - `CallID string` - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + The unique ID of the function tool call generated by the model. - 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. + - `Name string` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + The name of the function to run. - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `Type FunctionCall` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + The type of the function tool call. Always `function_call`. - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - The user's location. + - `ID string` - - `Type Approximate` + The unique ID of the function tool call. - The type of location approximation. Always `approximate`. + - `Agent BetaResponseFunctionToolCallAgent` - - `const ApproximateApproximate Approximate = "approximate"` + The agent that produced this item. - - `City string` + - `AgentName string` - Free text input for the city of the user, e.g. `San Francisco`. + The canonical name of the agent that produced this item. - - `Country string` + - `Caller BetaResponseFunctionToolCallCallerUnion` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + The execution context that produced this tool call. - - `Region string` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - Free text input for the region of the user, e.g. `California`. + - `Type Direct` - - `Timezone string` + - `const DirectDirect Direct = "direct"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - `type BetaApplyPatchTool struct{…}` + - `CallerID string` - Allows the assistant to create, delete, or update files using unified diffs. + The call ID of the program item that produced this tool call. - - `Type ApplyPatch` + - `Type Program` - The type of the tool. Always `apply_patch`. + - `const ProgramProgram Program = "program"` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `Namespace string` - - `AllowedCallers []string` + The namespace of the function to run. - The tool invocation context(s). + - `Status BetaResponseFunctionToolCallStatus` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `Type ToolSearchOutput` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - The type of the item. Always `tool_search_output`. + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `Agent BetaResponseToolSearchOutputItemAgent` + The output of a function tool call. - The agent that produced this item. + - `CallID string` - - `AgentName string` + The unique ID of the function tool call generated by the model. - The canonical name of the agent that produced this item. + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - - `CreatedBy string` + Text, image, or file output of the function tool call. - The identifier of the actor that created the item. + - `string` - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `ID string` + An array of content outputs (text, image, file) for the function tool call. - The unique ID of the additional tools item. + - `type BetaResponseInputTextContent struct{…}` - - `Role string` + A text input to the model. - The role that provided the additional tools. + - `Text string` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + The text input to the model. - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + - `Type InputText` - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + The type of the input item. Always `input_text`. - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `const InputTextInputText InputText = "input_text"` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + - `Mode Explicit` - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + The breakpoint mode. Always `explicit`. - - `Tools []BetaToolUnion` + - `const ExplicitExplicit Explicit = "explicit"` - The additional tool definitions made available at this item. + - `type BetaResponseInputImageContent struct{…}` - - `type BetaFunctionTool struct{…}` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Type InputImage` - - `type BetaFileSearchTool struct{…}` + The type of the input item. Always `input_image`. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const InputImageInputImage InputImage = "input_image"` - - `type BetaComputerTool struct{…}` + - `Detail BetaResponseInputImageContentDetail` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - - `type BetaWebSearchTool struct{…}` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - - `type BetaToolMcp struct{…}` + - `FileID string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The ID of the file to be sent to the model. - - `type BetaToolCodeInterpreter struct{…}` + - `ImageURL string` - A tool that runs Python code to help generate a response to a prompt. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `type BetaToolImageGeneration struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A tool that generates images using the GPT image models. + - `Mode Explicit` - - `type BetaToolLocalShell struct{…}` + The breakpoint mode. Always `explicit`. - A tool that allows the model to execute shell commands in a local environment. + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaFunctionShellTool struct{…}` + - `type BetaResponseInputFileContent struct{…}` - A tool that allows the model to execute shell commands. + A file input to the model. - - `type BetaCustomTool struct{…}` + - `Type InputFile` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The type of the input item. Always `input_file`. - - `type BetaNamespaceTool struct{…}` + - `const InputFileInputFile InputFile = "input_file"` - Groups function/custom tools under a shared namespace. + - `Detail BetaResponseInputFileContentDetail` - - `type BetaToolSearchTool struct{…}` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - Hosted or BYOT tool search configuration for deferred tools. + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `type BetaApplyPatchTool struct{…}` + - `FileData string` - Allows the assistant to create, delete, or update files using unified diffs. + The base64-encoded data of the file to be sent to the model. - - `Type AdditionalTools` + - `FileID string` - The type of the item. Always `additional_tools`. + The ID of the file to be sent to the model. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `FileURL string` - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + The URL of the file to be sent to the model. - The agent that produced this item. + - `Filename string` - - `AgentName string` + The name of the file to be sent to the model. - The canonical name of the agent that produced this item. + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - - `type BetaResponseCompactionItem struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `Mode Explicit` - - `ID string` + The breakpoint mode. Always `explicit`. - The unique ID of the compaction item. + - `const ExplicitExplicit Explicit = "explicit"` - - `EncryptedContent string` + - `Type FunctionCallOutput` - The encrypted content that was produced by compaction. + The type of the function tool call output. Always `function_call_output`. - - `Type Compaction` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - The type of the item. Always `compaction`. + - `ID string` - - `const CompactionCompaction Compaction = "compaction"` + The unique ID of the function tool call output. Populated when this item is returned via API. - - `Agent BetaResponseCompactionItemAgent` + - `Agent BetaResponseInputItemFunctionCallOutputAgent` The agent that produced this item. @@ -45391,296 +60215,287 @@ Compact a response The canonical name of the agent that produced this item. - - `CreatedBy string` + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - The identifier of the actor that created the item. + The execution context that produced this tool call. - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - An image generation request made by the model. + - `Type Direct` - - `ID string` + The caller type. Always `direct`. - The unique ID of the image generation call. + - `const DirectDirect Direct = "direct"` - - `Result string` + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - The generated image encoded in base64. + - `CallerID string` - - `Status string` + The call ID of the program item that produced this tool call. - The status of the image generation call. + - `Type Program` - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + The caller type. Always `program`. - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `Status string` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `Type ImageGenerationCall` + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - The type of the image generation call. Always `image_generation_call`. + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `type BetaResponseInputItemAgentMessage struct{…}` - The agent that produced this item. + A message routed between agents. - - `AgentName string` + - `Author string` - The canonical name of the agent that produced this item. + The sending agent identity. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `Content []BetaResponseInputItemAgentMessageContentUnion` - A tool call to run code. + Plaintext, image, or encrypted content sent between agents. - - `ID string` + - `type BetaResponseInputTextContent struct{…}` - The unique ID of the code interpreter tool call. + A text input to the model. - - `Code string` + - `type BetaResponseInputImageContent struct{…}` - The code to run, or null if not available. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `ContainerID string` + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - The ID of the container used to run the code. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + - `EncryptedContent string` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + Opaque encrypted content. - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `Type EncryptedContent` - The logs output from the code interpreter. + The type of the input item. Always `encrypted_content`. - - `Logs string` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - The logs output from the code interpreter. + - `Recipient string` - - `Type Logs` + The destination agent identity. - The type of the output. Always `logs`. + - `Type AgentMessage` - - `const LogsLogs Logs = "logs"` + The item type. Always `agent_message`. - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - The image output from the code interpreter. + - `ID string` - - `Type Image` + The unique ID of this agent message item. - The type of the output. Always `image`. + - `Agent BetaResponseInputItemAgentMessageAgent` - - `const ImageImage Image = "image"` + The agent that produced this item. - - `URL string` + - `AgentName string` - The URL of the image output from the code interpreter. + The canonical name of the agent that produced this item. - - `Status BetaResponseCodeInterpreterToolCallStatus` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `Action string` - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + The multi-agent action that was executed. - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `Type CodeInterpreterCall` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + - `Arguments string` - - `Agent BetaResponseCodeInterpreterToolCallAgent` + The action arguments as a JSON string. - The agent that produced this item. + - `CallID string` - - `AgentName string` + The unique ID linking this call to its output. - The canonical name of the agent that produced this item. + - `Type MultiAgentCall` - - `type BetaResponseOutputItemLocalShellCall struct{…}` + The item type. Always `multi_agent_call`. - A tool call to run a command on the local shell. + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - `ID string` - The unique ID of the local shell call. - - - `Action BetaResponseOutputItemLocalShellCallAction` - - Execute a shell command on the server. + The unique ID of this multi-agent call. - - `Command []string` + - `Agent BetaResponseInputItemMultiAgentCallAgent` - The command to run. + The agent that produced this item. - - `Env map[string, string]` + - `AgentName string` - Environment variables to set for the command. + The canonical name of the agent that produced this item. - - `Type Exec` + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - The type of the local shell action. Always `exec`. + - `Action string` - - `const ExecExec Exec = "exec"` + The multi-agent action that produced this result. - - `TimeoutMs int64` + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - Optional timeout in milliseconds for the command. + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `User string` + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - Optional user to run the command as. + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - - `WorkingDirectory string` + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - Optional working directory to run the command in. + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - `CallID string` - The unique ID of the local shell tool call generated by the model. - - - `Status string` - - The status of the local shell call. + The unique ID of the multi-agent call. - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + Text output returned by the multi-agent action. - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `Text string` - - `Type LocalShellCall` + The text content. - The type of the local shell call. Always `local_shell_call`. + - `Type OutputText` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + The content type. Always `output_text`. - - `Agent BetaResponseOutputItemLocalShellCallAgent` + - `const OutputTextOutputText OutputText = "output_text"` - The agent that produced this item. + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - `AgentName string` + Citations associated with the text content. - The canonical name of the agent that produced this item. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + - `FileID string` - The output of a local shell tool call. + The ID of the file. - - `ID string` + - `Filename string` - The unique ID of the local shell tool call generated by the model. + The filename of the file cited. - - `Output string` + - `Index int64` - A JSON string of the output of the local shell tool call. + The index of the file in the list of files. - - `Type LocalShellCallOutput` + - `Type FileCitation` - The type of the local shell tool call output. Always `local_shell_call_output`. + The citation type. Always `file_citation`. - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - The agent that produced this item. + - `EndIndex int64` - - `AgentName string` + The index of the last character of the citation in the message. - The canonical name of the agent that produced this item. + - `StartIndex int64` - - `Status string` + The index of the first character of the citation in the message. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `Title string` - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + The title of the cited resource. - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + - `Type URLCitation` - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + The citation type. Always `url_citation`. - - `type BetaResponseFunctionShellToolCall struct{…}` + - `const URLCitationURLCitation URLCitation = "url_citation"` - A tool call that executes one or more shell commands in a managed environment. + - `URL string` - - `ID string` + The URL of the cited resource. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `Action BetaResponseFunctionShellToolCallAction` + - `ContainerID string` - The shell commands and limits that describe how to run the tool call. + The ID of the container. - - `Commands []string` + - `EndIndex int64` - - `MaxOutputLength int64` + The index of the last character of the citation in the message. - Optional maximum number of characters to return from each command. + - `FileID string` - - `TimeoutMs int64` + The ID of the container file. - Optional timeout in milliseconds for the commands. + - `Filename string` - - `CallID string` + The filename of the container file cited. - The unique ID of the shell tool call generated by the model. + - `StartIndex int64` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + The index of the first character of the citation in the message. - Represents the use of a local environment to perform shell actions. + - `Type ContainerFileCitation` - - `type BetaResponseLocalEnvironment struct{…}` + The citation type. Always `container_file_citation`. - Represents the use of a local environment to perform shell actions. + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `Type Local` + - `Type MultiAgentCallOutput` - The environment type. Always `local`. + The item type. Always `multi_agent_call_output`. - - `const LocalLocal Local = "local"` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `type BetaResponseContainerReference struct{…}` + - `ID string` - Represents a container created with /v1/containers. + The unique ID of this multi-agent call output. - - `ContainerID string` + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` - - `Type ContainerReference` + The agent that produced this item. - The environment type. Always `container_reference`. + - `AgentName string` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + The canonical name of the agent that produced this item. - - `Status BetaResponseFunctionShellToolCallStatus` + - `type BetaResponseInputItemToolSearchCall struct{…}` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `Arguments any` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + The arguments supplied to the tool search call. - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `Type ToolSearchCall` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + The item type. Always `tool_search_call`. - - `Type ShellCall` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - The type of the item. Always `shell_call`. + - `ID string` - - `const ShellCallShellCall ShellCall = "shell_call"` + The unique ID of this tool search call. - - `Agent BetaResponseFunctionShellToolCallAgent` + - `Agent BetaResponseInputItemToolSearchCallAgent` The agent that produced this item. @@ -45688,1307 +60503,1268 @@ Compact a response The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` - - The execution context that produced this tool call. + - `CallID string` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + The unique ID of the tool search call generated by the model. - - `Type Direct` + - `Execution string` - - `const DirectDirect Direct = "direct"` + Whether tool search was executed by the server or by the client. - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - - `CallerID string` + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - The call ID of the program item that produced this tool call. + - `Status string` - - `Type Program` + The status of the tool search call. - - `const ProgramProgram Program = "program"` + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - - `CreatedBy string` + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - The ID of the entity that created this tool call. + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - The output of a shell tool call that was emitted. + - `Tools []BetaToolUnion` - - `ID string` + The loaded tool definitions returned by the tool search output. - The unique ID of the shell call output. Populated when this item is returned via API. + - `type BetaFunctionTool struct{…}` - - `CallID string` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The unique ID of the shell tool call generated by the model. + - `Name string` - - `MaxOutputLength int64` + The name of the function to call. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `Parameters map[string, any]` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + A JSON schema object describing the parameters of the function. - An array of shell call output contents + - `Strict bool` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + Whether strict parameter validation is enforced for this function tool. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Type Function` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + The type of the function tool. Always `function`. - Indicates that the shell call exceeded its configured time limit. + - `const FunctionFunction Function = "function"` - - `Type Timeout` + - `AllowedCallers []string` - The outcome type. Always `timeout`. + The tool invocation context(s). - - `const TimeoutTimeout Timeout = "timeout"` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - Indicates that the shell commands finished and returned an exit code. + - `DeferLoading bool` - - `ExitCode int64` + Whether this function is deferred and loaded via tool search. - Exit code from the shell process. + - `Description string` - - `Type Exit` + A description of the function. Used by the model to determine whether or not to call the function. - The outcome type. Always `exit`. + - `OutputSchema map[string, any]` - - `const ExitExit Exit = "exit"` + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `Stderr string` + - `type BetaFileSearchTool struct{…}` - The standard error output that was captured. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Stdout string` + - `Type FileSearch` - The standard output that was captured. + The type of the file search tool. Always `file_search`. - - `CreatedBy string` + - `const FileSearchFileSearch FileSearch = "file_search"` - The identifier of the actor that created the item. + - `VectorStoreIDs []string` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + The IDs of the vector stores to search. - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `Filters BetaFileSearchToolFiltersUnion` - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + A filter to apply. - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `Type ShellCallOutput` + - `Key string` - The type of the shell call output. Always `shell_call_output`. + The key to compare against the value. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `Type string` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - The agent that produced this item. + - `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 - - `AgentName string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - The canonical name of the agent that produced this item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - The execution context that produced this tool call. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Type Direct` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - - `const DirectDirect Direct = "direct"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `CallerID string` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - The call ID of the program item that produced this tool call. + The value to compare against the attribute key; supports string, number, or boolean types. - - `Type Program` + - `string` - - `const ProgramProgram Program = "program"` + - `float64` - - `CreatedBy string` + - `bool` - The identifier of the actor that created the item. + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `type BetaResponseApplyPatchToolCall struct{…}` + - `string` - A tool call that applies file diffs by creating, deleting, or updating files. + - `float64` - - `ID string` + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + Combine multiple filters using `and` or `or`. - - `CallID string` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - The unique ID of the apply patch tool call generated by the model. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `Key string` - Instruction describing how to create a file via the apply_patch tool. + The key to compare against the value. - - `Diff string` + - `Type string` - Diff to apply. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `Path string` + - `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 - Path of the file to create. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `Type CreateFile` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - Create a new file with the provided diff. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `const CreateFileCreateFile CreateFile = "create_file"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - Instruction describing how to delete a file via the apply_patch tool. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `Path string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - Path of the file to delete. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `Type DeleteFile` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - Delete the specified file. + The value to compare against the attribute key; supports string, number, or boolean types. - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `string` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `float64` - Instruction describing how to update a file via the apply_patch tool. + - `bool` - - `Diff string` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - Diff to apply. + - `string` - - `Path string` + - `float64` - Path of the file to update. + - `Type string` - - `Type UpdateFile` + Type of operation: `and` or `or`. - Update an existing file with the provided diff. + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - `Status BetaResponseApplyPatchToolCallStatus` + - `MaxNumResults int64` - The status of the apply patch tool call. One of `in_progress` or `completed`. + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `RankingOptions BetaFileSearchToolRankingOptions` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + Ranking options for search. - - `Type ApplyPatchCall` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - The type of the item. Always `apply_patch_call`. + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `EmbeddingWeight float64` - - `Agent BetaResponseApplyPatchToolCallAgent` + The weight of the embedding in the reciprocal ranking fusion. - The agent that produced this item. + - `TextWeight float64` - - `AgentName string` + The weight of the text in the reciprocal ranking fusion. - The canonical name of the agent that produced this item. + - `Ranker string` - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + The ranker to use for the file search. - The execution context that produced this tool call. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - - `Type Direct` + - `ScoreThreshold float64` - - `const DirectDirect Direct = "direct"` + 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 BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `type BetaComputerTool struct{…}` - - `CallerID string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The call ID of the program item that produced this tool call. + - `Type Computer` - - `Type Program` + The type of the computer tool. Always `computer`. - - `const ProgramProgram Program = "program"` + - `const ComputerComputer Computer = "computer"` - - `CreatedBy string` + - `type BetaComputerUsePreviewTool struct{…}` - The ID of the entity that created this tool call. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + - `DisplayHeight int64` - The output emitted by an apply patch tool call. + The height of the computer display. - - `ID string` + - `DisplayWidth int64` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The width of the computer display. - - `CallID string` + - `Environment BetaComputerUsePreviewToolEnvironment` - The unique ID of the apply patch tool call generated by the model. + The type of computer environment to control. - - `Status BetaResponseApplyPatchToolCallOutputStatus` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `Type ApplyPatchCallOutput` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - The type of the item. Always `apply_patch_call_output`. + - `Type ComputerUsePreview` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + The type of the computer use tool. Always `computer_use_preview`. - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - The agent that produced this item. + - `type BetaWebSearchTool struct{…}` - - `AgentName string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The canonical name of the agent that produced this item. + - `Type BetaWebSearchToolType` - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - The execution context that produced this tool call. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - - `Type Direct` + - `Filters BetaWebSearchToolFilters` - - `const DirectDirect Direct = "direct"` + Filters for the search. - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + - `AllowedDomains []string` - - `CallerID string` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - The call ID of the program item that produced this tool call. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `Type Program` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - - `const ProgramProgram Program = "program"` + 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. - - `CreatedBy string` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - The ID of the entity that created this tool call output. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `Output string` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - Optional textual output returned by the apply patch tool. + - `UserLocation BetaWebSearchToolUserLocation` - - `type BetaResponseOutputItemMcpCall struct{…}` + The approximate location of the user. - An invocation of a tool on an MCP server. + - `City string` - - `ID string` + Free text input for the city of the user, e.g. `San Francisco`. - The unique ID of the tool call. + - `Country string` - - `Arguments string` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - A JSON string of the arguments passed to the tool. + - `Region string` - - `Name string` + Free text input for the region of the user, e.g. `California`. - The name of the tool that was run. + - `Timezone string` - - `ServerLabel string` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The label of the MCP server running the tool. + - `Type string` - - `Type McpCall` + The type of location approximation. Always `approximate`. - The type of the item. Always `mcp_call`. + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `const McpCallMcpCall McpCall = "mcp_call"` + - `type BetaToolMcp struct{…}` - - `Agent BetaResponseOutputItemMcpCallAgent` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The agent that produced this item. + - `ServerLabel string` - - `AgentName string` + A label for this MCP server, used to identify it in tool calls. - The canonical name of the agent that produced this item. + - `Type Mcp` - - `ApprovalRequestID string` + The type of the MCP tool. Always `mcp`. - 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. + - `const McpMcp Mcp = "mcp"` - - `Error string` + - `AllowedCallers []string` - The error from the tool call, if any. + The tool invocation context(s). - - `Output string` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - The output from the tool call. + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `Status string` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + List of allowed tool names or a filter object. - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + A string array of allowed tool names - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + A filter object to specify which tools are allowed. - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + - `ReadOnly bool` - - `type BetaResponseOutputItemMcpListTools struct{…}` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - A list of tools available on an MCP server. + - `ToolNames []string` - - `ID string` + List of allowed tool names. - The unique ID of the list. + - `Authorization string` - - `ServerLabel 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. - The label of the MCP server. + - `ConnectorID string` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - The tools available on the server. + Currently supported `connector_id` values are: - - `InputSchema any` + - 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` - The JSON schema describing the tool's input. + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `Name string` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - The name of the tool. + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `Annotations any` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - Additional annotations about the tool. + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - - `Description string` + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - The description of the tool. + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - - `Type McpListTools` + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - The type of the item. Always `mcp_list_tools`. + - `DeferLoading bool` - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + Whether this MCP tool is deferred and discovered via tool search. - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `Headers map[string, string]` - The agent that produced this item. + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `AgentName string` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - The canonical name of the agent that produced this item. + Specify which of the MCP server's tools require approval. - - `Error string` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - Error message if the server could not list tools. + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - A request for human approval of a tool invocation. + A filter object to specify which tools are allowed. - - `ID string` + - `ReadOnly bool` - The unique ID of the approval request. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Arguments string` + - `ToolNames []string` - A JSON string of arguments for the tool. + List of allowed tool names. - - `Name string` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - The name of the tool to run. + A filter object to specify which tools are allowed. - - `ServerLabel string` + - `ReadOnly bool` - The label of the MCP server making the request. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Type McpApprovalRequest` + - `ToolNames []string` - The type of the item. Always `mcp_approval_request`. + List of allowed tool names. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + 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. - The agent that produced this item. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - - `AgentName string` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - The canonical name of the agent that produced this item. + - `ServerDescription string` - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + Optional description of the MCP server, used to provide more context. - A response to an MCP approval request. + - `ServerURL string` - - `ID string` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - The unique ID of the approval response + - `TunnelID string` - - `ApprovalRequestID 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. - The ID of the approval request being answered. + - `type BetaToolCodeInterpreter struct{…}` - - `Approve bool` + A tool that runs Python code to help generate a response to a prompt. - Whether the request was approved. + - `Container BetaToolCodeInterpreterContainerUnion` - - `Type McpApprovalResponse` + 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. - The type of the item. Always `mcp_approval_response`. + - `string` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - The agent that produced this item. + - `Type Auto` - - `AgentName string` + Always `auto`. - The canonical name of the agent that produced this item. + - `const AutoAuto Auto = "auto"` - - `Reason string` + - `FileIDs []string` - Optional reason for the decision. + An optional list of uploaded files to make available to your code. - - `type BetaResponseCustomToolCall struct{…}` + - `MemoryLimit string` - A call to a custom tool created by the model. + The memory limit for the code interpreter container. - - `CallID string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - An identifier used to map this custom tool call to a tool call output. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `Input string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - The input for the custom tool call generated by the model. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `Name string` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - The name of the custom tool being called. + Network access policy for the container. - - `Type CustomToolCall` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The type of the custom tool call. Always `custom_tool_call`. + - `Type Disabled` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + Disable outbound network access. Always `disabled`. - - `ID string` + - `const DisabledDisabled Disabled = "disabled"` - The unique ID of the custom tool call in the OpenAI platform. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `Agent BetaResponseCustomToolCallAgent` + - `AllowedDomains []string` - The agent that produced this item. + A list of allowed domains when type is `allowlist`. - - `AgentName string` + - `Type Allowlist` - The canonical name of the agent that produced this item. + Allow outbound network access only to specified domains. Always `allowlist`. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `const AllowlistAllowlist Allowlist = "allowlist"` - The execution context that produced this tool call. + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + Optional domain-scoped secrets for allowlisted domains. - - `Type Direct` + - `Domain string` - - `const DirectDirect Direct = "direct"` + The domain associated with the secret. - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `Name string` - - `CallerID string` + The name of the secret to inject for the domain. - The call ID of the program item that produced this tool call. + - `Value string` - - `Type Program` + The secret value to inject for the domain. - - `const ProgramProgram Program = "program"` + - `Type CodeInterpreter` - - `Namespace string` + The type of the code interpreter tool. Always `code_interpreter`. - The namespace of the custom tool being called. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `AllowedCallers []string` - The output of a custom tool call from your code, being sent back to the model. + The tool invocation context(s). - - `ID string` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - The unique ID of the custom tool call output item. + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `Status string` + - `type BetaToolProgrammaticToolCalling struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Type ProgrammaticToolCalling` - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + The type of the tool. Always `programmatic_tool_calling`. - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `type BetaToolImageGeneration struct{…}` - - `CreatedBy string` + A tool that generates images using the GPT image models. - The identifier of the actor that created the item. + - `Type ImageGeneration` - - `Usage BetaResponseUsage` + The type of the image generation tool. Always `image_generation`. - Token accounting for the compaction pass, including cached, reasoning, and total tokens. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `InputTokens int64` + - `Action string` - The number of input tokens. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - A detailed breakdown of the input tokens. + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `CacheWriteTokens int64` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - The number of input tokens that were written to the cache. + - `Background string` - - `CachedTokens int64` + 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. - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + `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. - - `OutputTokens int64` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - The number of output tokens. + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - A detailed breakdown of the output tokens. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `ReasoningTokens int64` + - `InputFidelity string` - The number of reasoning tokens. + 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`. - - `TotalTokens int64` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - The total number of tokens used. + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` -### Example + - `InputImageMask BetaToolImageGenerationInputImageMask` -```go -package main + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). -import ( - "context" - "fmt" + - `FileID string` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" - "github.com/openai/openai-go/responses" -) + File ID for the mask image. -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - betaCompactedResponse, err := client.Beta.Responses.Compact(context.TODO(), responses.BetaResponseCompactParams{ - Model: responses.BetaResponseCompactParamsModelGPT5_6Sol, - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", betaCompactedResponse.ID) -} -``` + - `ImageURL string` -#### Response + Base64-encoded mask image. -```json -{ - "id": "id", - "created_at": 0, - "object": "response.compaction", - "output": [ - { - "id": "id", - "content": [ - { - "annotations": [ - { - "file_id": "file_id", - "filename": "filename", - "index": 0, - "type": "file_citation" - } - ], - "text": "text", - "type": "output_text", - "logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0, - "top_logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0 - } - ] - } - ] - } - ], - "role": "assistant", - "status": "in_progress", - "type": "message", - "agent": { - "agent_name": "agent_name" - }, - "phase": "commentary" - } - ], - "usage": { - "input_tokens": 0, - "input_tokens_details": { - "cache_write_tokens": 0, - "cached_tokens": 0 - }, - "output_tokens": 0, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 0 - } -} -``` + - `Model string` -## Domain Types + The image generation model to use. Default: `gpt-image-1`. -### Beta Apply Patch Tool + - `string` -- `type BetaApplyPatchTool struct{…}` + - `string` - Allows the assistant to create, delete, or update files using unified diffs. + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - - `Type ApplyPatch` + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - The type of the tool. Always `apply_patch`. + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `AllowedCallers []string` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - The tool invocation context(s). + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `Moderation string` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + Moderation level for the generated image. Default: `auto`. -### Beta Compacted Response + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` -- `type BetaCompactedResponse struct{…}` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - - `ID string` + - `OutputCompression int64` - The unique identifier for the compacted response. + Compression level for the output image. Default: 100. - - `CreatedAt int64` + - `OutputFormat string` - Unix timestamp (in seconds) when the compacted conversation was created. + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `Object ResponseCompaction` + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - The object type. Always `response.compaction`. + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `const ResponseCompactionResponseCompaction ResponseCompaction = "response.compaction"` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - - `Output []BetaResponseOutputItemUnion` + - `PartialImages int64` - The compacted list of output items. This is a list of all user messages, followed by a single compaction item. + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `type BetaResponseOutputMessage struct{…}` + - `Quality string` - An output message from the model. + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `ID string` + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - The unique ID of the output message. + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - - `Content []BetaResponseOutputMessageContentUnion` + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - The content of the output message. + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - - `type BetaResponseOutputText struct{…}` + - `Size string` - A text output from the model. + 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`. - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `string` - The annotations of the text output. + - `string` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - A citation to a file. + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `FileID string` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - The ID of the file. + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - - `Filename string` + - `type BetaToolLocalShell struct{…}` - The filename of the file cited. + A tool that allows the model to execute shell commands in a local environment. - - `Index int64` + - `Type LocalShell` - The index of the file in the list of files. + The type of the local shell tool. Always `local_shell`. - - `Type FileCitation` + - `const LocalShellLocalShell LocalShell = "local_shell"` - The type of the file citation. Always `file_citation`. + - `type BetaFunctionShellTool struct{…}` - - `const FileCitationFileCitation FileCitation = "file_citation"` + A tool that allows the model to execute shell commands. - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `Type Shell` - A citation for a web resource used to generate a model response. + The type of the shell tool. Always `shell`. - - `EndIndex int64` + - `const ShellShell Shell = "shell"` - The index of the last character of the URL citation in the message. + - `AllowedCallers []string` - - `StartIndex int64` + The tool invocation context(s). - The index of the first character of the URL citation in the message. + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - `Title string` + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - The title of the web resource. + - `Environment BetaFunctionShellToolEnvironmentUnion` - - `Type URLCitation` + - `type BetaContainerAuto struct{…}` - The type of the URL citation. Always `url_citation`. + - `Type ContainerAuto` - - `const URLCitationURLCitation URLCitation = "url_citation"` + Automatically creates a container for this request - - `URL string` + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - The URL of the web resource. + - `FileIDs []string` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + An optional list of uploaded files to make available to your code. - A citation for a container file used to generate a model response. + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `ContainerID string` + The memory limit for the container. - The ID of the container file. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `EndIndex int64` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - The index of the last character of the container file citation in the message. + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `FileID string` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - The ID of the file. + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - `Filename string` + Network access policy for the container. - The filename of the container file cited. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `StartIndex int64` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - The index of the first character of the container file citation in the message. + - `Skills []BetaContainerAutoSkillUnion` - - `Type ContainerFileCitation` + An optional list of skills referenced by id or inline data. - The type of the container file citation. Always `container_file_citation`. + - `type BetaSkillReference struct{…}` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `SkillID string` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + The ID of the referenced skill. - A path to a file. + - `Type SkillReference` - - `FileID string` + References a skill created with the /v1/skills endpoint. - The ID of the file. + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `Index int64` + - `Version string` - The index of the file in the list of files. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `Type FilePath` + - `type BetaInlineSkill struct{…}` - The type of the file path. Always `file_path`. + - `Description string` - - `const FilePathFilePath FilePath = "file_path"` + The description of the skill. - - `Text string` + - `Name string` - The text output from the model. + The name of the skill. - - `Type OutputText` + - `Source BetaInlineSkillSource` - The type of the output text. Always `output_text`. + Inline skill payload - - `const OutputTextOutputText OutputText = "output_text"` + - `Data string` - - `Logprobs []BetaResponseOutputTextLogprob` + Base64-encoded skill zip bundle. - - `Token string` + - `MediaType ApplicationZip` - - `Bytes []int64` + The media type of the inline skill payload. Must be `application/zip`. - - `Logprob float64` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `Type Base64` - - `Token string` + The type of the inline skill source. Must be `base64`. - - `Bytes []int64` + - `const Base64Base64 Base64 = "base64"` - - `Logprob float64` + - `Type Inline` - - `type BetaResponseOutputRefusal struct{…}` + Defines an inline skill for this request. - A refusal from the model. + - `const InlineInline Inline = "inline"` - - `Refusal string` + - `type BetaLocalEnvironment struct{…}` - The refusal explanation from the model. + - `Type Local` - - `Type Refusal` + Use a local computer environment. - The type of the refusal. Always `refusal`. + - `const LocalLocal Local = "local"` - - `const RefusalRefusal Refusal = "refusal"` + - `Skills []BetaLocalSkill` - - `Role Assistant` + An optional list of skills. - The role of the output message. Always `assistant`. + - `Description string` - - `const AssistantAssistant Assistant = "assistant"` + The description of the skill. - - `Status BetaResponseOutputMessageStatus` + - `Name string` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + The name of the skill. - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + - `Path string` - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + The path to the directory containing the skill. - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + - `type BetaContainerReference struct{…}` - - `Type Message` + - `ContainerID string` - The type of the output message. Always `message`. + The ID of the referenced container. - - `const MessageMessage Message = "message"` + - `Type ContainerReference` - - `Agent BetaResponseOutputMessageAgent` + References a container created with the /v1/containers endpoint - The agent that produced this item. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `AgentName string` + - `type BetaCustomTool struct{…}` - The canonical name of the agent that produced this item. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Phase BetaResponseOutputMessagePhase` + - `Name string` - 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. + The name of the custom tool, used to identify it in tool calls. - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `Type Custom` - - `type BetaResponseFileSearchToolCall struct{…}` + The type of the custom tool. Always `custom`. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `const CustomCustom Custom = "custom"` - - `ID string` + - `AllowedCallers []string` - The unique ID of the file search tool call. + The tool invocation context(s). - - `Queries []string` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - The queries used to search for files. + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - - `Status BetaResponseFileSearchToolCallStatus` + - `DeferLoading bool` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + Whether this tool should be deferred and discovered via tool search. - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + - `Description string` - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + Optional description of the custom tool, used to provide more context. - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + - `Format BetaCustomToolFormatUnion` - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + The input format for the custom tool. Default is unconstrained text. - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + - `type BetaCustomToolFormatText struct{…}` - - `Type FileSearchCall` + Unconstrained free-form text. - The type of the file search tool call. Always `file_search_call`. + - `Type Text` - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + Unconstrained text format. Always `text`. - - `Agent BetaResponseFileSearchToolCallAgent` + - `const TextText Text = "text"` - The agent that produced this item. + - `type BetaCustomToolFormatGrammar struct{…}` - - `AgentName string` + A grammar defined by the user. - The canonical name of the agent that produced this item. + - `Definition string` - - `Results []BetaResponseFileSearchToolCallResult` + The grammar definition. - The results of the file search tool call. + - `Syntax string` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + The syntax of the grammar definition. One of `lark` or `regex`. - 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. + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `string` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `float64` + - `Type Grammar` - - `bool` + Grammar format. Always `grammar`. - - `FileID string` + - `const GrammarGrammar Grammar = "grammar"` - The unique ID of the file. + - `type BetaNamespaceTool struct{…}` - - `Filename string` + Groups function/custom tools under a shared namespace. - The name of the file. + - `Description string` - - `Score float64` + A description of the namespace shown to the model. - The relevance score of the file - a value between 0 and 1. + - `Name string` - - `Text string` + The namespace name used in tool calls (for example, `crm`). - The text that was retrieved from the file. + - `Tools []BetaNamespaceToolToolUnion` - - `type BetaResponseFunctionToolCall struct{…}` + The function/custom tools available inside this namespace. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `type BetaNamespaceToolToolFunction struct{…}` - - `Arguments string` + - `Name string` - A JSON string of the arguments to pass to the function. + - `Type Function` - - `CallID string` + - `const FunctionFunction Function = "function"` - The unique ID of the function tool call generated by the model. + - `AllowedCallers []string` - - `Name string` + The tool invocation context(s). - The name of the function to run. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `Type FunctionCall` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - The type of the function tool call. Always `function_call`. + - `DeferLoading bool` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + Whether this function should be deferred and discovered via tool search. - - `ID string` + - `Description string` - The unique ID of the function tool call. + - `OutputSchema map[string, any]` - - `Agent BetaResponseFunctionToolCallAgent` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - The agent that produced this item. + - `Parameters any` - - `AgentName string` + - `Strict bool` - The canonical name of the agent that produced this item. + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `type BetaCustomTool struct{…}` - The execution context that produced this tool call. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `Type Namespace` - - `Type Direct` + The type of the tool. Always `namespace`. - - `const DirectDirect Direct = "direct"` + - `const NamespaceNamespace Namespace = "namespace"` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `type BetaToolSearchTool struct{…}` - - `CallerID string` + Hosted or BYOT tool search configuration for deferred tools. - The call ID of the program item that produced this tool call. + - `Type ToolSearch` - - `Type Program` + The type of the tool. Always `tool_search`. - - `const ProgramProgram Program = "program"` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `Namespace string` + - `Description string` - The namespace of the function to run. + Description shown to the model for a client-executed tool search tool. - - `Status BetaResponseFunctionToolCallStatus` + - `Execution BetaToolSearchToolExecution` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Whether tool search is executed by the server or by the client. - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `Parameters any` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + Parameter schema for a client-executed tool search tool. - - `ID string` + - `type BetaWebSearchPreviewTool struct{…}` - The unique ID of the function call tool output. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `CallID string` + - `Type BetaWebSearchPreviewToolType` - The unique ID of the function tool call generated by the model. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - The output from the function call generated by your code. - Can be a string or an list of output content. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `string` + - `SearchContentTypes []string` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - Text, image, or file output of the function call. + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `type BetaResponseInputText struct{…}` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - A text input to the model. + 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. - - `Text string` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - The text input to the model. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `Type InputText` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - The type of the input item. Always `input_text`. + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `const InputTextInputText InputText = "input_text"` + The user's location. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `Type Approximate` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The type of location approximation. Always `approximate`. - - `Mode Explicit` + - `const ApproximateApproximate Approximate = "approximate"` - The breakpoint mode. Always `explicit`. + - `City string` - - `const ExplicitExplicit Explicit = "explicit"` + Free text input for the city of the user, e.g. `San Francisco`. - - `type BetaResponseInputImage struct{…}` + - `Country string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `Detail BetaResponseInputImageDetail` + - `Region string` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + Free text input for the region of the user, e.g. `California`. - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `Timezone string` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `type BetaApplyPatchTool struct{…}` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + Allows the assistant to create, delete, or update files using unified diffs. - - `Type InputImage` + - `Type ApplyPatch` - The type of the input item. Always `input_image`. + The type of the tool. Always `apply_patch`. - - `const InputImageInputImage InputImage = "input_image"` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `FileID string` + - `AllowedCallers []string` - The ID of the file to be sent to the model. + The tool invocation context(s). - - `ImageURL string` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `Type ToolSearchOutput` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The item type. Always `tool_search_output`. - - `Mode Explicit` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - The breakpoint mode. Always `explicit`. + - `ID string` - - `const ExplicitExplicit Explicit = "explicit"` + The unique ID of this tool search output. - - `type BetaResponseInputFile struct{…}` + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - A file input to the model. + The agent that produced this item. - - `Type InputFile` + - `AgentName string` - The type of the input item. Always `input_file`. + The canonical name of the agent that produced this item. - - `const InputFileInputFile InputFile = "input_file"` + - `CallID string` - - `Detail BetaResponseInputFileDetail` + The unique ID of the tool search call generated by the model. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Execution BetaResponseToolSearchOutputItemParamExecution` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + Whether tool search was executed by the server or by the client. - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - `FileData string` + - `Status BetaResponseToolSearchOutputItemParamStatus` - The content of the file to be sent to the model. + The status of the tool search output. - - `FileID string` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - The ID of the file to be sent to the model. + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `FileURL string` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - The URL of the file to be sent to the model. + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `Filename string` + - `Role Developer` - The name of the file to be sent to the model. + The role that provided the additional tools. Only `developer` is supported. - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `const DeveloperDeveloper Developer = "developer"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Tools []BetaToolUnion` - - `Mode Explicit` + A list of additional tools made available at this item. - The breakpoint mode. Always `explicit`. + - `type BetaFunctionTool struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Status BetaResponseFunctionToolCallOutputItemStatus` + - `type BetaFileSearchTool struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + - `type BetaComputerTool struct{…}` - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `type BetaComputerUsePreviewTool struct{…}` - - `Type FunctionCallOutput` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The type of the function tool call output. Always `function_call_output`. + - `type BetaWebSearchTool struct{…}` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `type BetaToolMcp struct{…}` - The agent that produced this item. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `AgentName string` + - `type BetaToolCodeInterpreter struct{…}` - The canonical name of the agent that produced this item. + A tool that runs Python code to help generate a response to a prompt. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `type BetaToolProgrammaticToolCalling struct{…}` - The execution context that produced this tool call. + - `type BetaToolImageGeneration struct{…}` - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + A tool that generates images using the GPT image models. - - `Type Direct` + - `type BetaToolLocalShell struct{…}` - The caller type. Always `direct`. + A tool that allows the model to execute shell commands in a local environment. - - `const DirectDirect Direct = "direct"` + - `type BetaFunctionShellTool struct{…}` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + A tool that allows the model to execute shell commands. - - `CallerID string` + - `type BetaCustomTool struct{…}` - The call ID of the program item that produced this tool call. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Type Program` + - `type BetaNamespaceTool struct{…}` - The caller type. Always `program`. + Groups function/custom tools under a shared namespace. - - `const ProgramProgram Program = "program"` + - `type BetaToolSearchTool struct{…}` - - `CreatedBy string` + Hosted or BYOT tool search configuration for deferred tools. - The identifier of the actor that created the item. + - `type BetaWebSearchPreviewTool struct{…}` - - `type BetaResponseOutputItemAgentMessage struct{…}` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `ID string` + - `type BetaApplyPatchTool struct{…}` - The unique ID of the agent message. + Allows the assistant to create, delete, or update files using unified diffs. - - `Author string` + - `Type AdditionalTools` - The sending agent identity. + The item type. Always `additional_tools`. - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - Encrypted content sent between agents. + - `ID string` - - `type BetaResponseInputText struct{…}` + The unique ID of this additional tools item. - A text input to the model. + - `Agent BetaResponseInputItemAdditionalToolsAgent` - - `type BetaResponseOutputText struct{…}` + The agent that produced this item. - A text output from the model. + - `AgentName string` - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + The canonical name of the agent that produced this item. - A text content. + - `type BetaResponseReasoningItem struct{…}` - - `Text string` + 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](https://platform.openai.com/docs/guides/conversation-state). - - `Type Text` + - `ID string` - - `const TextText Text = "text"` + The unique identifier of the reasoning content. - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + - `Summary []BetaResponseReasoningItemSummary` - A summary text from the model. + Reasoning summary content. - `Text string` @@ -47000,9 +61776,23 @@ func main() { - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `Type Reasoning` - Reasoning text from the model. + The type of the object. Always `reasoning`. + + - `const ReasoningReasoning Reasoning = "reasoning"` + + - `Agent BetaResponseReasoningItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Content []BetaResponseReasoningItemContent` + + Reasoning text content. - `Text string` @@ -47014,83 +61804,79 @@ func main() { - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `type BetaResponseOutputRefusal struct{…}` - - A refusal from the model. - - - `type BetaResponseInputImage struct{…}` - - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `EncryptedContent string` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - A screenshot of a computer. + - `Status BetaResponseReasoningItemStatus` - - `Detail string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `type BetaResponseCompactionItemParamResp struct{…}` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `FileID string` + - `EncryptedContent string` - The identifier of an uploaded file that contains the screenshot. + The encrypted content of the compaction summary. - - `ImageURL string` + - `Type Compaction` - The URL of the screenshot image. + The type of the item. Always `compaction`. - - `Type ComputerScreenshot` + - `const CompactionCompaction Compaction = "compaction"` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `ID string` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + The ID of the compaction item. - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `Agent BetaResponseCompactionItemParamAgentResp` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The agent that produced this item. - - `Mode Explicit` + - `AgentName string` - The breakpoint mode. Always `explicit`. + The canonical name of the agent that produced this item. - - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - - `type BetaResponseInputFile struct{…}` + An image generation request made by the model. - A file input to the model. + - `ID string` - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + The unique ID of the image generation call. - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `Result string` - - `EncryptedContent string` + The generated image encoded in base64. - Opaque encrypted content. + - `Status string` - - `Type EncryptedContent` + The status of the image generation call. - The type of the input item. Always `encrypted_content`. + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - `Recipient string` + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - The destination agent identity. + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - - `Type AgentMessage` + - `Type ImageGenerationCall` - The type of the item. Always `agent_message`. + The type of the image generation call. Always `image_generation_call`. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseOutputItemAgentMessageAgent` + - `Agent BetaResponseInputItemImageGenerationCallAgent` The agent that produced this item. @@ -47098,611 +61884,586 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `ID string` + A tool call to run code. - The unique ID of the multi-agent call item. + - `ID string` - - `Action string` + The unique ID of the code interpreter tool call. - The multi-agent action to execute. + - `Code string` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + The code to run, or null if not available. - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + - `ContainerID string` - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + The ID of the container used to run the code. - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `Arguments string` + The logs output from the code interpreter. - The JSON string of arguments generated for the action. + - `Logs string` - - `CallID string` + The logs output from the code interpreter. - The unique ID linking this call to its output. + - `Type Logs` - - `Type MultiAgentCall` + The type of the output. Always `logs`. - The type of the multi-agent call. Always `multi_agent_call`. + - `const LogsLogs Logs = "logs"` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + The image output from the code interpreter. - The agent that produced this item. + - `Type Image` - - `AgentName string` + The type of the output. Always `image`. - The canonical name of the agent that produced this item. + - `const ImageImage Image = "image"` - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + - `URL string` - - `ID string` + The URL of the image output from the code interpreter. - The unique ID of the multi-agent call output item. + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `Action string` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - The multi-agent action that produced this result. + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + - `Type CodeInterpreterCall` - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `CallID string` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - The unique ID of the multi-agent call. + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `Output []BetaResponseOutputText` + The agent that produced this item. - Text output returned by the multi-agent action. + - `AgentName string` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The canonical name of the agent that produced this item. - The annotations of the text output. + - `type BetaResponseInputItemLocalShellCall struct{…}` - - `Text string` + A tool call to run a command on the local shell. - The text output from the model. + - `ID string` - - `Type OutputText` + The unique ID of the local shell call. - The type of the output text. Always `output_text`. + - `Action BetaResponseInputItemLocalShellCallAction` - - `Logprobs []BetaResponseOutputTextLogprob` + Execute a shell command on the server. - - `Type MultiAgentCallOutput` + - `Command []string` - The type of the multi-agent result. Always `multi_agent_call_output`. + The command to run. - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `Env map[string, string]` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + Environment variables to set for the command. - The agent that produced this item. + - `Type Exec` - - `AgentName string` + The type of the local shell action. Always `exec`. - The canonical name of the agent that produced this item. + - `const ExecExec Exec = "exec"` - - `type BetaResponseFunctionWebSearch struct{…}` + - `TimeoutMs int64` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + Optional timeout in milliseconds for the command. - - `ID string` + - `User string` - The unique ID of the web search tool call. + Optional user to run the command as. - - `Action BetaResponseFunctionWebSearchActionUnion` + - `WorkingDirectory string` - 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). + Optional working directory to run the command in. - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `CallID string` - Action type "search" - Performs a web search query. + The unique ID of the local shell tool call generated by the model. - - `Type Search` + - `Status string` - The action type. + The status of the local shell call. - - `const SearchSearch Search = "search"` + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - - `Queries []string` + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - The search queries. + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - - `Query string` + - `Type LocalShellCall` - The search query. + The type of the local shell call. Always `local_shell_call`. - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - The sources used in the search. + - `Agent BetaResponseInputItemLocalShellCallAgent` - - `Type URL` + The agent that produced this item. - The type of source. Always `url`. + - `AgentName string` - - `const URLURL URL = "url"` + The canonical name of the agent that produced this item. - - `URL string` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - The URL of the source. + The output of a local shell tool call. - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + - `ID string` - Action type "open_page" - Opens a specific URL from search results. + The unique ID of the local shell tool call generated by the model. - - `Type OpenPage` + - `Output string` - The action type. + A JSON string of the output of the local shell tool call. - - `const OpenPageOpenPage OpenPage = "open_page"` + - `Type LocalShellCallOutput` - - `URL string` + The type of the local shell tool call output. Always `local_shell_call_output`. - The URL opened by the model. + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - Action type "find_in_page": Searches for a pattern within a loaded page. + The agent that produced this item. - - `Pattern string` + - `AgentName string` - The pattern or text to search for within the page. + The canonical name of the agent that produced this item. - - `Type FindInPage` + - `Status string` - The action type. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const FindInPageFindInPage FindInPage = "find_in_page"` + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - - `URL string` + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - The URL of the page searched for the pattern. + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - - `Status BetaResponseFunctionWebSearchStatus` + - `type BetaResponseInputItemShellCall struct{…}` - The status of the web search tool call. + A tool representing a request to execute one or more shell commands. - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `Action BetaResponseInputItemShellCallAction` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + The shell commands and limits that describe how to run the tool call. - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `Commands []string` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + Ordered shell commands for the execution environment to run. - - `Type WebSearchCall` + - `MaxOutputLength int64` - The type of the web search tool call. Always `web_search_call`. + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `TimeoutMs int64` - - `Agent BetaResponseFunctionWebSearchAgent` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - The agent that produced this item. + - `CallID string` - - `AgentName string` + The unique ID of the shell tool call generated by the model. - The canonical name of the agent that produced this item. + - `Type ShellCall` - - `type BetaResponseComputerToolCall struct{…}` + The type of the item. Always `shell_call`. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `const ShellCallShellCall ShellCall = "shell_call"` - `ID string` - The unique ID of the computer call. - - - `CallID string` - - An identifier used when responding to the tool call with output. - - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - The pending safety checks for the computer call. - - - `ID string` + The unique ID of the shell tool call. Populated when this item is returned via API. - The ID of the pending safety check. + - `Agent BetaResponseInputItemShellCallAgent` - - `Code string` + The agent that produced this item. - The type of the pending safety check. + - `AgentName string` - - `Message string` + The canonical name of the agent that produced this item. - Details about the pending safety check. + - `Caller BetaResponseInputItemShellCallCallerUnion` - - `Status BetaResponseComputerToolCallStatus` + The execution context that produced this tool call. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `Type Direct` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + The caller type. Always `direct`. - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `const DirectDirect Direct = "direct"` - - `Type BetaResponseComputerToolCallType` + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - The type of the computer call. Always `computer_call`. + - `CallerID string` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + The call ID of the program item that produced this tool call. - - `Action BetaComputerActionUnion` + - `Type Program` - A click action. + The caller type. Always `program`. - - `type BetaComputerActionClick struct{…}` + - `const ProgramProgram Program = "program"` - A click action. + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - `Button string` + The environment to execute the shell commands in. - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `type BetaLocalEnvironment struct{…}` - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `type BetaContainerReference struct{…}` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `Status string` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - - `Type Click` + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - Specifies the event type. For a click action, this property is always `click`. + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `const ClickClick Click = "click"` + The streamed output items emitted by a shell tool call. - - `X int64` + - `CallID string` - The x-coordinate where the click occurred. + The unique ID of the shell tool call generated by the model. - - `Y int64` + - `Output []BetaResponseFunctionShellCallOutputContent` - The y-coordinate where the click occurred. + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `Keys []string` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - The keys being held while clicking. + The exit or timeout outcome associated with this shell call. - - `type BetaComputerActionDoubleClick struct{…}` + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - A double click action. + Indicates that the shell call exceeded its configured time limit. - - `Keys []string` + - `Type Timeout` - The keys being held while double-clicking. + The outcome type. Always `timeout`. - - `Type DoubleClick` + - `const TimeoutTimeout Timeout = "timeout"` - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + Indicates that the shell commands finished and returned an exit code. - - `X int64` + - `ExitCode int64` - The x-coordinate where the double click occurred. + The exit code returned by the shell process. - - `Y int64` + - `Type Exit` - The y-coordinate where the double click occurred. + The outcome type. Always `exit`. - - `type BetaComputerActionDrag struct{…}` + - `const ExitExit Exit = "exit"` - A drag action. + - `Stderr string` - - `Path []BetaComputerActionDragPath` + Captured stderr output for the shell call. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `Stdout string` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + Captured stdout output for the shell call. - - `X int64` + - `Type ShellCallOutput` - The x-coordinate. + The type of the item. Always `shell_call_output`. - - `Y int64` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - The y-coordinate. + - `ID string` - - `Type Drag` + The unique ID of the shell tool call output. Populated when this item is returned via API. - Specifies the event type. For a drag action, this property is always set to `drag`. + - `Agent BetaResponseInputItemShellCallOutputAgent` - - `const DragDrag Drag = "drag"` + The agent that produced this item. - - `Keys []string` + - `AgentName string` - The keys being held while dragging the mouse. + The canonical name of the agent that produced this item. - - `type BetaComputerActionKeypress struct{…}` + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - A collection of keypresses the model would like to perform. + The execution context that produced this tool call. - - `Keys []string` + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `Type Direct` - - `Type Keypress` + The caller type. Always `direct`. - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `const DirectDirect Direct = "direct"` - - `const KeypressKeypress Keypress = "keypress"` + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - `type BetaComputerActionMove struct{…}` + - `CallerID string` - A mouse move action. + The call ID of the program item that produced this tool call. - - `Type Move` + - `Type Program` - Specifies the event type. For a move action, this property is always set to `move`. + The caller type. Always `program`. - - `const MoveMove Move = "move"` + - `const ProgramProgram Program = "program"` - - `X int64` + - `MaxOutputLength int64` - The x-coordinate to move to. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `Y int64` + - `Status string` - The y-coordinate to move to. + The status of the shell call output. - - `Keys []string` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - The keys being held while moving the mouse. + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - - `type BetaComputerActionScreenshot struct{…}` + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - A screenshot action. + - `type BetaResponseInputItemApplyPatchCall struct{…}` - - `Type Screenshot` + A tool call representing a request to create, delete, or update files using diff patches. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `CallID string` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + The unique ID of the apply patch tool call generated by the model. - - `type BetaComputerActionScroll struct{…}` + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - A scroll action. + The specific create, delete, or update instruction for the apply_patch tool call. - - `ScrollX int64` + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - The horizontal scroll distance. + Instruction for creating a new file via the apply_patch tool. - - `ScrollY int64` + - `Diff string` - The vertical scroll distance. + Unified diff content to apply when creating the file. - - `Type Scroll` + - `Path string` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + Path of the file to create relative to the workspace root. - - `const ScrollScroll Scroll = "scroll"` + - `Type CreateFile` - - `X int64` + The operation type. Always `create_file`. - The x-coordinate where the scroll occurred. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `Y int64` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - The y-coordinate where the scroll occurred. + Instruction for deleting an existing file via the apply_patch tool. - - `Keys []string` + - `Path string` - The keys being held while scrolling. + Path of the file to delete relative to the workspace root. - - `type BetaComputerActionType struct{…}` + - `Type DeleteFile` - An action to type in text. + The operation type. Always `delete_file`. - - `Text string` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - The text to type. + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - - `Type Type` + Instruction for updating an existing file via the apply_patch tool. - Specifies the event type. For a type action, this property is always set to `type`. + - `Diff string` - - `const TypeType Type = "type"` + Unified diff content to apply to the existing file. - - `type BetaComputerActionWait struct{…}` + - `Path string` - A wait action. + Path of the file to update relative to the workspace root. - - `Type Wait` + - `Type UpdateFile` - Specifies the event type. For a wait action, this property is always set to `wait`. + The operation type. Always `update_file`. - - `const WaitWait Wait = "wait"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Actions BetaComputerActionList` + - `Status string` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `type BetaComputerActionClick struct{…}` + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - A click action. + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - - `type BetaComputerActionDoubleClick struct{…}` + - `Type ApplyPatchCall` - A double click action. + The type of the item. Always `apply_patch_call`. - - `type BetaComputerActionDrag struct{…}` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - A drag action. + - `ID string` - - `type BetaComputerActionKeypress struct{…}` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - A collection of keypresses the model would like to perform. + - `Agent BetaResponseInputItemApplyPatchCallAgent` - - `type BetaComputerActionMove struct{…}` + The agent that produced this item. - A mouse move action. + - `AgentName string` - - `type BetaComputerActionScreenshot struct{…}` + The canonical name of the agent that produced this item. - A screenshot action. + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - - `type BetaComputerActionScroll struct{…}` + The execution context that produced this tool call. - A scroll action. + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - - `type BetaComputerActionType struct{…}` + - `Type Direct` - An action to type in text. + The caller type. Always `direct`. - - `type BetaComputerActionWait struct{…}` + - `const DirectDirect Direct = "direct"` - A wait action. + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - - `Agent BetaResponseComputerToolCallAgent` + - `CallerID string` - The agent that produced this item. + The call ID of the program item that produced this tool call. - - `AgentName string` + - `Type Program` - The canonical name of the agent that produced this item. + The caller type. Always `program`. - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `const ProgramProgram Program = "program"` - - `ID string` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - The unique ID of the computer call tool output. + The streamed output emitted by an apply patch tool call. - `CallID string` - The ID of the computer tool call that produced the output. + The unique ID of the apply patch tool call generated by the model. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Status string` - A computer screenshot image used with the computer use tool. + The status of the apply patch tool call output. One of `completed` or `failed`. - - `Type ComputerScreenshot` + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `Type ApplyPatchCallOutput` - - `FileID string` + The type of the item. Always `apply_patch_call_output`. - The identifier of an uploaded file that contains the screenshot. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `ImageURL string` + - `ID string` - The URL of the screenshot image. + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + The agent that produced this item. - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `AgentName string` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + The canonical name of the agent that produced this item. - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + The execution context that produced this tool call. - - `Type ComputerCallOutput` + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - The type of the computer tool call output. Always `computer_call_output`. + - `Type Direct` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + The caller type. Always `direct`. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `const DirectDirect Direct = "direct"` - The safety checks reported by the API that have been acknowledged by the - developer. + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - - `ID string` + - `CallerID string` - The ID of the pending safety check. + The call ID of the program item that produced this tool call. - - `Code string` + - `Type Program` - The type of the pending safety check. + The caller type. Always `program`. - - `Message string` + - `const ProgramProgram Program = "program"` - Details about the pending safety check. + - `Output string` - - `Agent BetaResponseComputerToolCallOutputItemAgent` + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - The agent that produced this item. + - `type BetaResponseInputItemMcpListTools struct{…}` - - `AgentName string` + A list of tools available on an MCP server. - The canonical name of the agent that produced this item. + - `ID string` - - `CreatedBy string` + The unique ID of the list. - The identifier of the actor that created the item. + - `ServerLabel string` - - `type BetaResponseReasoningItem struct{…}` + The label of the MCP server. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `Tools []BetaResponseInputItemMcpListToolsTool` - - `ID string` + The tools available on the server. - The unique identifier of the reasoning content. + - `InputSchema any` - - `Summary []BetaResponseReasoningItemSummary` + The JSON schema describing the tool's input. - Reasoning summary content. + - `Name string` - - `Text string` + The name of the tool. - A summary of the reasoning output from the model so far. + - `Annotations any` - - `Type SummaryText` + Additional annotations about the tool. - The type of the object. Always `summary_text`. + - `Description string` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + The description of the tool. - - `Type Reasoning` + - `Type McpListTools` - The type of the object. Always `reasoning`. + The type of the item. Always `mcp_list_tools`. - - `const ReasoningReasoning Reasoning = "reasoning"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Agent BetaResponseReasoningItemAgent` + - `Agent BetaResponseInputItemMcpListToolsAgent` The agent that produced this item. @@ -47710,61 +62471,67 @@ func main() { The canonical name of the agent that produced this item. - - `Content []BetaResponseReasoningItemContent` + - `Error string` - Reasoning text content. + Error message if the server could not list tools. - - `Text string` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - The reasoning text from the model. + A request for human approval of a tool invocation. - - `Type ReasoningText` + - `ID string` - The type of the reasoning text. Always `reasoning_text`. + The unique ID of the approval request. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Arguments string` - - `EncryptedContent string` + A JSON string of arguments for the tool. - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `Name string` - - `Status BetaResponseReasoningItemStatus` + The name of the tool to run. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `ServerLabel string` - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + The label of the MCP server making the request. - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + - `Type McpApprovalRequest` - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + The type of the item. Always `mcp_approval_request`. - - `type BetaResponseOutputItemProgram struct{…}` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `ID string` + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - The unique ID of the program item. + The agent that produced this item. - - `CallID string` + - `AgentName string` - The stable call ID of the program item. + The canonical name of the agent that produced this item. - - `Code string` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - The JavaScript source executed by programmatic tool calling. + A response to an MCP approval request. - - `Fingerprint string` + - `ApprovalRequestID string` - Opaque program replay fingerprint that must be round-tripped. + The ID of the approval request being answered. - - `Type Program` + - `Approve bool` - The type of the item. Always `program`. + Whether the request was approved. - - `const ProgramProgram Program = "program"` + - `Type McpApprovalResponse` - - `Agent BetaResponseOutputItemProgramAgent` + The type of the item. Always `mcp_approval_response`. + + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + + - `ID string` + + The unique ID of the approval response + + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` The agent that produced this item. @@ -47772,35 +62539,37 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `Reason string` - - `ID string` + Optional reason for the decision. - The unique ID of the program output item. + - `type BetaResponseInputItemMcpCall struct{…}` - - `CallID string` + An invocation of a tool on an MCP server. - The call ID of the program item. + - `ID string` - - `Result string` + The unique ID of the tool call. - The result produced by the program item. + - `Arguments string` - - `Status string` + A JSON string of the arguments passed to the tool. - The terminal status of the program output item. + - `Name string` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + The name of the tool that was run. - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + - `ServerLabel string` - - `Type ProgramOutput` + The label of the MCP server running the tool. - The type of the item. Always `program_output`. + - `Type McpCall` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + The type of the item. Always `mcp_call`. - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `const McpCallMcpCall McpCall = "mcp_call"` + + - `Agent BetaResponseInputItemMcpCallAgent` The agent that produced this item. @@ -47808,1165 +62577,1142 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseToolSearchCall struct{…}` + - `ApprovalRequestID string` - - `ID 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. - The unique ID of the tool search call item. + - `Error string` - - `Arguments any` + The error from the tool call, if any. - Arguments used for the tool search call. + - `Output string` - - `CallID string` + The output from the tool call. - The unique ID of the tool search call generated by the model. + - `Status string` - - `Execution BetaResponseToolSearchCallExecution` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - Whether tool search was executed by the server or by the client. + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - - `Status BetaResponseToolSearchCallStatus` + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - The status of the tool search call item that was recorded. + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + - `type BetaResponseCustomToolCallOutput struct{…}` - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + The output of a custom tool call from your code, being sent back to the model. - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + - `CallID string` - - `Type ToolSearchCall` + The call ID, used to map this custom tool call output to a custom tool call. - The type of the item. Always `tool_search_call`. + - `Output BetaResponseCustomToolCallOutputOutputUnion` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `Agent BetaResponseToolSearchCallAgent` + - `string` - The agent that produced this item. + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - - `AgentName string` + Text, image, or file output of the custom tool call. - The canonical name of the agent that produced this item. + - `type BetaResponseInputText struct{…}` - - `CreatedBy string` + A text input to the model. - The identifier of the actor that created the item. + - `type BetaResponseInputImage struct{…}` - - `type BetaResponseToolSearchOutputItem struct{…}` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `ID string` + - `type BetaResponseInputFile struct{…}` - The unique ID of the tool search output item. + A file input to the model. - - `CallID string` + - `Type CustomToolCallOutput` - The unique ID of the tool search call generated by the model. + The type of the custom tool call output. Always `custom_tool_call_output`. - - `Execution BetaResponseToolSearchOutputItemExecution` + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - Whether tool search was executed by the server or by the client. + - `ID string` - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + The unique ID of the custom tool call output in the OpenAI platform. - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `Agent BetaResponseCustomToolCallOutputAgent` - - `Status BetaResponseToolSearchOutputItemStatus` + The agent that produced this item. - The status of the tool search output item that was recorded. + - `AgentName string` - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + The canonical name of the agent that produced this item. - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + The execution context that produced this tool call. - - `Tools []BetaToolUnion` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - The loaded tool definitions returned by tool search. + - `Type Direct` - - `type BetaFunctionTool struct{…}` + The caller type. Always `direct`. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const DirectDirect Direct = "direct"` - - `Name string` + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - The name of the function to call. + - `CallerID string` - - `Parameters map[string, any]` + The call ID of the program item that produced this tool call. - A JSON schema object describing the parameters of the function. + - `Type Program` - - `Strict bool` + The caller type. Always `program`. - Whether strict parameter validation is enforced for this function tool. + - `const ProgramProgram Program = "program"` - - `Type Function` + - `type BetaResponseCustomToolCall struct{…}` - The type of the function tool. Always `function`. + A call to a custom tool created by the model. - - `const FunctionFunction Function = "function"` + - `CallID string` - - `AllowedCallers []string` + An identifier used to map this custom tool call to a tool call output. - The tool invocation context(s). + - `Input string` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + The input for the custom tool call generated by the model. - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `Name string` - - `DeferLoading bool` + The name of the custom tool being called. - Whether this function is deferred and loaded via tool search. + - `Type CustomToolCall` - - `Description string` + The type of the custom tool call. Always `custom_tool_call`. - A description of the function. Used by the model to determine whether or not to call the function. + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `OutputSchema map[string, any]` + - `ID string` - A JSON schema object describing the JSON value encoded in string outputs for this function. + The unique ID of the custom tool call in the OpenAI platform. - - `type BetaFileSearchTool struct{…}` + - `Agent BetaResponseCustomToolCallAgent` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The agent that produced this item. - - `Type FileSearch` + - `AgentName string` - The type of the file search tool. Always `file_search`. + The canonical name of the agent that produced this item. - - `const FileSearchFileSearch FileSearch = "file_search"` + - `Caller BetaResponseCustomToolCallCallerUnion` - - `VectorStoreIDs []string` + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - The IDs of the vector stores to search. + - `Type Direct` - - `Filters BetaFileSearchToolFiltersUnion` + - `const DirectDirect Direct = "direct"` - A filter to apply. + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `CallerID string` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + The call ID of the program item that produced this tool call. - - `Key string` + - `Type Program` - The key to compare against the value. + - `const ProgramProgram Program = "program"` - - `Type string` + - `Namespace string` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The namespace of the custom tool being called. - - `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 + - `type BetaResponseInputItemCompactionTrigger struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + Compacts the current context. Must be the final input item. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `Type CompactionTrigger` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + The type of the item. Always `compaction_trigger`. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + The agent that produced this item. - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + - `AgentName string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + The canonical name of the agent that produced this item. - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + - `type BetaResponseInputItemItemReference struct{…}` - The value to compare against the attribute key; supports string, number, or boolean types. + An internal identifier for an item to reference. - - `string` + - `ID string` - - `float64` + The ID of the item to reference. - - `bool` + - `Agent BetaResponseInputItemItemReferenceAgent` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + The agent that produced this item. - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + - `AgentName string` - Combine multiple filters using `and` or `or`. + The canonical name of the agent that produced this item. - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + - `Type string` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + The type of item to reference. Always `item_reference`. - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `type BetaResponseInputItemProgram struct{…}` - - `Key string` + - `ID string` - The key to compare against the value. + The unique ID of this program item. - - `Type string` + - `CallID string` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The stable call ID of the program item. - - `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 + - `Code string` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + The JavaScript source executed by programmatic tool calling. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + - `Fingerprint string` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + Opaque program replay fingerprint that must be round-tripped. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + - `Type Program` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + The item type. Always `program`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + - `const ProgramProgram Program = "program"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `Agent BetaResponseInputItemProgramAgent` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + The agent that produced this item. - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + - `AgentName string` - The value to compare against the attribute key; supports string, number, or boolean types. + The canonical name of the agent that produced this item. - - `string` + - `type BetaResponseInputItemProgramOutput struct{…}` - - `float64` + - `ID string` - - `bool` + The unique ID of this program output item. - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `CallID string` - - `Type string` + The call ID of the program item. - Type of operation: `and` or `or`. + - `Result string` - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + The result produced by the program item. - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + - `Status string` - - `MaxNumResults int64` + The terminal status of the program output. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `RankingOptions BetaFileSearchToolRankingOptions` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - Ranking options for search. + - `Type ProgramOutput` - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + The item type. Always `program_output`. - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `EmbeddingWeight float64` + - `Agent BetaResponseInputItemProgramOutputAgent` - The weight of the embedding in the reciprocal ranking fusion. + The agent that produced this item. - - `TextWeight float64` + - `AgentName string` - The weight of the text in the reciprocal ranking fusion. + The canonical name of the agent that produced this item. - - `Ranker string` + - `Metadata map[string, string]` - The ranker to use for the file search. + 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. - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + - `Model BetaResponseModel` - - `ScoreThreshold float64` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - 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 BetaResponseModel string` - - `type BetaComputerTool struct{…}` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - - `Type Computer` + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - The type of the computer tool. Always `computer`. + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - - `const ComputerComputer Computer = "computer"` + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - - `DisplayHeight int64` + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - The height of the computer display. + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - - `DisplayWidth int64` + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - The width of the computer display. + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - - `Environment BetaComputerUsePreviewToolEnvironment` + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - The type of computer environment to control. + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - - `Type ComputerUsePreview` + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - The type of the computer use tool. Always `computer_use_preview`. + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - - `type BetaWebSearchTool struct{…}` + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - - `Type BetaWebSearchToolType` + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - - `Filters BetaWebSearchToolFilters` + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - Filters for the search. + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - - `AllowedDomains []string` + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - 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 BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `const BetaResponseModelO3 BetaResponseModel = "o3"` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - - `UserLocation BetaWebSearchToolUserLocation` + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - The approximate location of the user. + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - - `City string` + - `const BetaResponseModelO1 BetaResponseModel = "o1"` - Free text input for the city of the user, e.g. `San Francisco`. + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - - `Country string` + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - - `Region string` + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - Free text input for the region of the user, e.g. `California`. + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - `Timezone string` + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - - `Type string` + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - The type of location approximation. Always `approximate`. + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - - `type BetaToolMcp struct{…}` + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - - `ServerLabel string` + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - A label for this MCP server, used to identify it in tool calls. + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - - `Type Mcp` + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - The type of the MCP tool. Always `mcp`. + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - - `const McpMcp Mcp = "mcp"` + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - - `AllowedCallers []string` + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - The tool invocation context(s). + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` - List of allowed tool names or a filter object. + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - A string array of allowed tool names + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - A filter object to specify which tools are allowed. + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - - `ReadOnly bool` + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - - `ToolNames []string` + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - List of allowed tool names. + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - - `Authorization string` + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - 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. + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - - `ConnectorID string` + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - Currently supported `connector_id` values are: + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - - 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 BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - - `DeferLoading bool` + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - Whether this MCP tool is deferred and discovered via tool search. + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - - `Headers map[string, string]` + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - Specify which of the MCP server's tools require approval. + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - A filter object to specify which tools are allowed. + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - - `ReadOnly bool` + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `string` - - `ToolNames []string` + - `Object Response` - List of allowed tool names. + The object type of this resource - always set to `response`. - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `const ResponseResponse Response = "response"` - A filter object to specify which tools are allowed. + - `Output []BetaResponseOutputItemUnion` - - `ReadOnly bool` + An array of content items generated by the model. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - - `ToolNames []string` + - `type BetaResponseOutputMessage struct{…}` - List of allowed tool names. + An output message from the model. - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `type BetaResponseFileSearchToolCall struct{…}` - 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. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `type BetaResponseFunctionToolCall struct{…}` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `ServerDescription string` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - Optional description of the MCP server, used to provide more context. + - `ID string` - - `ServerURL string` + The unique ID of the function call tool output. - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `CallID string` - - `TunnelID string` + The unique ID of the function tool call generated by the model. - 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. + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - - `type BetaToolCodeInterpreter struct{…}` + The output from the function call generated by your code. + Can be a string or an list of output content. - A tool that runs Python code to help generate a response to a prompt. + - `string` - - `Container BetaToolCodeInterpreterContainerUnion` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - 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. + Text, image, or file output of the function call. - - `string` + - `type BetaResponseInputText struct{…}` - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + A text input to the model. - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `type BetaResponseInputImage struct{…}` - - `Type Auto` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - Always `auto`. + - `type BetaResponseInputFile struct{…}` - - `const AutoAuto Auto = "auto"` + A file input to the model. - - `FileIDs []string` + - `Status BetaResponseFunctionToolCallOutputItemStatus` - An optional list of uploaded files to make available to your code. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `MemoryLimit string` + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - The memory limit for the code interpreter container. + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `Type FunctionCallOutput` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + The type of the function tool call output. Always `function_call_output`. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - Network access policy for the container. + The agent that produced this item. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `AgentName string` - - `Type Disabled` + The canonical name of the agent that produced this item. - Disable outbound network access. Always `disabled`. + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - `const DisabledDisabled Disabled = "disabled"` + The execution context that produced this tool call. - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - `AllowedDomains []string` + - `Type Direct` - A list of allowed domains when type is `allowlist`. + The caller type. Always `direct`. - - `Type Allowlist` + - `const DirectDirect Direct = "direct"` - Allow outbound network access only to specified domains. Always `allowlist`. + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `CallerID string` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + The call ID of the program item that produced this tool call. - Optional domain-scoped secrets for allowlisted domains. + - `Type Program` - - `Domain string` + The caller type. Always `program`. - The domain associated with the secret. + - `const ProgramProgram Program = "program"` - - `Name string` + - `CreatedBy string` - The name of the secret to inject for the domain. + The identifier of the actor that created the item. - - `Value string` + - `type BetaResponseOutputItemAgentMessage struct{…}` - The secret value to inject for the domain. + - `ID string` - - `Type CodeInterpreter` + The unique ID of the agent message. - The type of the code interpreter tool. Always `code_interpreter`. + - `Author string` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + The sending agent identity. - - `AllowedCallers []string` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - The tool invocation context(s). + Encrypted content sent between agents. - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `type BetaResponseInputText struct{…}` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + A text input to the model. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `type BetaResponseOutputText struct{…}` - - `Type ProgrammaticToolCalling` + A text output from the model. - The type of the tool. Always `programmatic_tool_calling`. + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + A text content. - - `type BetaToolImageGeneration struct{…}` + - `Text string` - A tool that generates images using the GPT image models. + - `Type Text` - - `Type ImageGeneration` + - `const TextText Text = "text"` - The type of the image generation tool. Always `image_generation`. + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + A summary text from the model. - - `Action string` + - `Text string` - Whether to generate a new image or edit an existing image. Default: `auto`. + A summary of the reasoning output from the model so far. - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + - `Type SummaryText` - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + The type of the object. Always `summary_text`. - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `Background string` + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - 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. + Reasoning text from the model. - `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. + - `Text string` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + The reasoning text from the model. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `Type ReasoningText` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + The type of the reasoning text. Always `reasoning_text`. - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `InputFidelity string` + - `type BetaResponseOutputRefusal struct{…}` - 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`. + A refusal from the model. - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + - `type BetaResponseInputImage struct{…}` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + A screenshot of a computer. - - `FileID string` + - `Detail string` - File ID for the mask image. + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `ImageURL string` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - Base64-encoded mask image. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - - `Model string` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - The image generation model to use. Default: `gpt-image-1`. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - - `string` + - `FileID string` - - `string` + The identifier of an uploaded file that contains the screenshot. - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + - `ImageURL string` - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + The URL of the screenshot image. - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + - `Type ComputerScreenshot` - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - - `Moderation string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Moderation level for the generated image. Default: `auto`. + - `Mode Explicit` - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + The breakpoint mode. Always `explicit`. - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `const ExplicitExplicit Explicit = "explicit"` - - `OutputCompression int64` + - `type BetaResponseInputFile struct{…}` - Compression level for the output image. Default: 100. + A file input to the model. - - `OutputFormat string` + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + - `EncryptedContent string` - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + Opaque encrypted content. - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + - `Type EncryptedContent` - - `PartialImages int64` + The type of the input item. Always `encrypted_content`. - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `Quality string` + - `Recipient string` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + The destination agent identity. - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `Type AgentMessage` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + The type of the item. Always `agent_message`. - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + - `Agent BetaResponseOutputItemAgentMessageAgent` - - `Size string` + The agent that produced this item. - 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`. + - `AgentName string` - - `string` + The canonical name of the agent that produced this item. - - `string` + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `ID string` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + The unique ID of the multi-agent call item. - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `Action string` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + The multi-agent action to execute. - - `type BetaToolLocalShell struct{…}` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - A tool that allows the model to execute shell commands in a local environment. + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - `Type LocalShell` + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - The type of the local shell tool. Always `local_shell`. + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `const LocalShellLocalShell LocalShell = "local_shell"` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - - `type BetaFunctionShellTool struct{…}` + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - A tool that allows the model to execute shell commands. + - `Arguments string` - - `Type Shell` + The JSON string of arguments generated for the action. - The type of the shell tool. Always `shell`. + - `CallID string` - - `const ShellShell Shell = "shell"` + The unique ID linking this call to its output. - - `AllowedCallers []string` + - `Type MultiAgentCall` - The tool invocation context(s). + The type of the multi-agent call. Always `multi_agent_call`. - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `Agent BetaResponseOutputItemMultiAgentCallAgent` - - `Environment BetaFunctionShellToolEnvironmentUnion` + The agent that produced this item. - - `type BetaContainerAuto struct{…}` + - `AgentName string` - - `Type ContainerAuto` + The canonical name of the agent that produced this item. - Automatically creates a container for this request + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + - `ID string` - - `FileIDs []string` + The unique ID of the multi-agent call output item. - An optional list of uploaded files to make available to your code. + - `Action string` - - `MemoryLimit BetaContainerAutoMemoryLimit` + The multi-agent action that produced this result. - The memory limit for the container. + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - Network access policy for the container. + - `CallID string` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + The unique ID of the multi-agent call. - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `Output []BetaResponseOutputText` - - `Skills []BetaContainerAutoSkillUnion` + Text output returned by the multi-agent action. - An optional list of skills referenced by id or inline data. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `type BetaSkillReference struct{…}` + The annotations of the text output. - - `SkillID string` + - `Text string` - The ID of the referenced skill. + The text output from the model. - - `Type SkillReference` + - `Type OutputText` - References a skill created with the /v1/skills endpoint. + The type of the output text. Always `output_text`. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `Logprobs []BetaResponseOutputTextLogprob` - - `Version string` + - `Type MultiAgentCallOutput` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + The type of the multi-agent result. Always `multi_agent_call_output`. - - `type BetaInlineSkill struct{…}` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `Description string` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` - The description of the skill. + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the skill. + The canonical name of the agent that produced this item. - - `Source BetaInlineSkillSource` + - `type BetaResponseFunctionWebSearch struct{…}` - Inline skill payload + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `Data string` + - `type BetaResponseComputerToolCall struct{…}` - Base64-encoded skill zip bundle. + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `MediaType ApplicationZip` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - The media type of the inline skill payload. Must be `application/zip`. + - `ID string` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + The unique ID of the computer call tool output. - - `Type Base64` + - `CallID string` - The type of the inline skill source. Must be `base64`. + The ID of the computer tool call that produced the output. - - `const Base64Base64 Base64 = "base64"` + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `Type Inline` + A computer screenshot image used with the computer use tool. - Defines an inline skill for this request. + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `const InlineInline Inline = "inline"` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `type BetaLocalEnvironment struct{…}` + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - - `Type Local` + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - Use a local computer environment. + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - - `const LocalLocal Local = "local"` + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - `Skills []BetaLocalSkill` + - `Type ComputerCallOutput` - An optional list of skills. + The type of the computer tool call output. Always `computer_call_output`. - - `Description string` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - The description of the skill. + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `Name string` + The safety checks reported by the API that have been acknowledged by the + developer. - The name of the skill. + - `ID string` - - `Path string` + The ID of the pending safety check. - The path to the directory containing the skill. + - `Code string` - - `type BetaContainerReference struct{…}` + The type of the pending safety check. - - `ContainerID string` + - `Message string` - The ID of the referenced container. + Details about the pending safety check. - - `Type ContainerReference` + - `Agent BetaResponseComputerToolCallOutputItemAgent` - References a container created with the /v1/containers endpoint + The agent that produced this item. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `AgentName string` - - `type BetaCustomTool struct{…}` + The canonical name of the agent that produced this item. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `CreatedBy string` - - `Name string` + The identifier of the actor that created the item. - The name of the custom tool, used to identify it in tool calls. + - `type BetaResponseReasoningItem struct{…}` - - `Type Custom` + 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](https://platform.openai.com/docs/guides/conversation-state). - The type of the custom tool. Always `custom`. + - `type BetaResponseOutputItemProgram struct{…}` - - `const CustomCustom Custom = "custom"` + - `ID string` - - `AllowedCallers []string` + The unique ID of the program item. - The tool invocation context(s). + - `CallID string` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + The stable call ID of the program item. - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + - `Code string` - - `DeferLoading bool` + The JavaScript source executed by programmatic tool calling. - Whether this tool should be deferred and discovered via tool search. + - `Fingerprint string` - - `Description string` + Opaque program replay fingerprint that must be round-tripped. - Optional description of the custom tool, used to provide more context. + - `Type Program` - - `Format BetaCustomToolFormatUnion` + The type of the item. Always `program`. - The input format for the custom tool. Default is unconstrained text. + - `const ProgramProgram Program = "program"` - - `type BetaCustomToolFormatText struct{…}` + - `Agent BetaResponseOutputItemProgramAgent` - Unconstrained free-form text. + The agent that produced this item. - - `Type Text` + - `AgentName string` - Unconstrained text format. Always `text`. + The canonical name of the agent that produced this item. - - `const TextText Text = "text"` + - `type BetaResponseOutputItemProgramOutput struct{…}` - - `type BetaCustomToolFormatGrammar struct{…}` + - `ID string` - A grammar defined by the user. + The unique ID of the program output item. - - `Definition string` + - `CallID string` - The grammar definition. + The call ID of the program item. - - `Syntax string` + - `Result string` - The syntax of the grammar definition. One of `lark` or `regex`. + The result produced by the program item. - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `Status string` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + The terminal status of the program output item. - - `Type Grammar` + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - Grammar format. Always `grammar`. + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - `const GrammarGrammar Grammar = "grammar"` + - `Type ProgramOutput` - - `type BetaNamespaceTool struct{…}` + The type of the item. Always `program_output`. - Groups function/custom tools under a shared namespace. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `Description string` + - `Agent BetaResponseOutputItemProgramOutputAgent` - A description of the namespace shown to the model. + The agent that produced this item. - - `Name string` + - `AgentName string` - The namespace name used in tool calls (for example, `crm`). + The canonical name of the agent that produced this item. - - `Tools []BetaNamespaceToolToolUnion` + - `type BetaResponseToolSearchCall struct{…}` - The function/custom tools available inside this namespace. + - `ID string` - - `type BetaNamespaceToolToolFunction struct{…}` + The unique ID of the tool search call item. - - `Name string` + - `Arguments any` - - `Type Function` + Arguments used for the tool search call. - - `const FunctionFunction Function = "function"` + - `CallID string` - - `AllowedCallers []string` + The unique ID of the tool search call generated by the model. - The tool invocation context(s). + - `Execution BetaResponseToolSearchCallExecution` - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + Whether tool search was executed by the server or by the client. - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - `DeferLoading bool` + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - Whether this function should be deferred and discovered via tool search. + - `Status BetaResponseToolSearchCallStatus` - - `Description string` + The status of the tool search call item that was recorded. - - `OutputSchema map[string, any]` + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - `Parameters any` + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - - `Strict bool` + - `Type ToolSearchCall` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + The type of the item. Always `tool_search_call`. - - `type BetaCustomTool struct{…}` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Agent BetaResponseToolSearchCallAgent` - - `Type Namespace` + The agent that produced this item. - The type of the tool. Always `namespace`. + - `AgentName string` - - `const NamespaceNamespace Namespace = "namespace"` + The canonical name of the agent that produced this item. - - `type BetaToolSearchTool struct{…}` + - `CreatedBy string` - Hosted or BYOT tool search configuration for deferred tools. + The identifier of the actor that created the item. - - `Type ToolSearch` + - `type BetaResponseToolSearchOutputItem struct{…}` - The type of the tool. Always `tool_search`. + - `ID string` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + The unique ID of the tool search output item. - - `Description string` + - `CallID string` - Description shown to the model for a client-executed tool search tool. + The unique ID of the tool search call generated by the model. - - `Execution BetaToolSearchToolExecution` + - `Execution BetaResponseToolSearchOutputItemExecution` - Whether tool search is executed by the server or by the client. + Whether tool search was executed by the server or by the client. - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - - `Parameters any` + - `Status BetaResponseToolSearchOutputItemStatus` - Parameter schema for a client-executed tool search tool. + The status of the tool search output item that was recorded. - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - `Type BetaWebSearchPreviewToolType` + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `Tools []BetaToolUnion` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + The loaded tool definitions returned by tool search. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + - `type BetaFunctionTool struct{…}` - - `SearchContentTypes []string` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `type BetaFileSearchTool struct{…}` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `type BetaComputerTool struct{…}` - 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. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `type BetaWebSearchTool struct{…}` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The user's location. + - `type BetaToolMcp struct{…}` - - `Type Approximate` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The type of location approximation. Always `approximate`. + - `type BetaToolCodeInterpreter struct{…}` - - `const ApproximateApproximate Approximate = "approximate"` + A tool that runs Python code to help generate a response to a prompt. - - `City string` + - `type BetaToolProgrammaticToolCalling struct{…}` - Free text input for the city of the user, e.g. `San Francisco`. + - `type BetaToolImageGeneration struct{…}` - - `Country string` + A tool that generates images using the GPT image models. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `type BetaToolLocalShell struct{…}` - - `Region string` + A tool that allows the model to execute shell commands in a local environment. - Free text input for the region of the user, e.g. `California`. + - `type BetaFunctionShellTool struct{…}` - - `Timezone string` + A tool that allows the model to execute shell commands. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `type BetaCustomTool struct{…}` - - `type BetaApplyPatchTool struct{…}` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - Allows the assistant to create, delete, or update files using unified diffs. + - `type BetaNamespaceTool struct{…}` - - `Type ApplyPatch` + Groups function/custom tools under a shared namespace. - The type of the tool. Always `apply_patch`. + - `type BetaToolSearchTool struct{…}` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + Hosted or BYOT tool search configuration for deferred tools. - - `AllowedCallers []string` + - `type BetaWebSearchPreviewTool struct{…}` - The tool invocation context(s). + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `type BetaApplyPatchTool struct{…}` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + Allows the assistant to create, delete, or update files using unified diffs. - `Type ToolSearchOutput` @@ -49166,79 +63912,6 @@ func main() { 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 []BetaResponseCodeInterpreterToolCallOutputUnion` - - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. - - - `type BetaResponseCodeInterpreterToolCallOutputLogs 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 BetaResponseCodeInterpreterToolCallOutputImage 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 BetaResponseCodeInterpreterToolCallStatus` - - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - - `Type CodeInterpreterCall` - - The type of the code interpreter tool call. Always `code_interpreter_call`. - - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - - `Agent BetaResponseCodeInterpreterToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemLocalShellCall struct{…}` A tool call to run a command on the local shell. @@ -49749,186 +64422,1117 @@ func main() { - `const McpCallMcpCall McpCall = "mcp_call"` - - `Agent BetaResponseOutputItemMcpCallAgent` + - `Agent BetaResponseOutputItemMcpCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `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 BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + + - `type BetaResponseOutputItemMcpListTools 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 []BetaResponseOutputItemMcpListToolsTool` + + 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"` + + - `Agent BetaResponseOutputItemMcpListToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Error string` + + Error message if the server could not list tools. + + - `type BetaResponseOutputItemMcpApprovalRequest 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"` + + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMcpApprovalResponse 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"` + + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Reason string` + + Optional reason for the decision. + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. + + - `type BetaResponseCustomToolCallOutputItem 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 BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `ParallelToolCalls bool` + + Whether to allow the model to run tool calls in parallel. + + - `Temperature float64` + + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. + + - `ToolChoice BetaResponseToolChoiceUnion` + + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. + + - `type BetaToolChoiceOptions string` + + Controls which (if any) tool is called by the model. + + `none` means the model will not call any tool and instead generates a message. + + `auto` means the model can pick between generating a message or calling one or + more tools. + + `required` means the model must call one or more tools. + + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + + - `type BetaToolChoiceAllowed struct{…}` + + Constrains the tools available to the model to a pre-defined set. + + - `Mode BetaToolChoiceAllowedMode` + + Constrains the tools available to the model to a pre-defined set. + + `auto` allows the model to pick from among the allowed tools and generate a + message. + + `required` requires the model to call one or more of the allowed tools. + + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + + - `Tools []map[string, any]` + + A list of tool definitions that the model should be allowed to call. + + For the Responses API, the list of tool definitions might look like: + + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` + + - `Type AllowedTools` + + Allowed tool configuration type. Always `allowed_tools`. + + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + + - `type BetaToolChoiceTypes struct{…}` + + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + + - `Type BetaToolChoiceTypesType` + + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + + Allowed values are: + + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` + + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + + - `type BetaToolChoiceFunction struct{…}` + + Use this option to force the model to call a specific function. + + - `Name string` + + The name of the function to call. + + - `Type Function` + + For function calling, the type is always `function`. + + - `const FunctionFunction Function = "function"` + + - `type BetaToolChoiceMcp struct{…}` + + Use this option to force the model to call a specific tool on a remote MCP server. + + - `ServerLabel string` + + The label of the MCP server to use. + + - `Type Mcp` + + For MCP tools, the type is always `mcp`. + + - `const McpMcp Mcp = "mcp"` + + - `Name string` + + The name of the tool to call on the server. + + - `type BetaToolChoiceCustom struct{…}` + + Use this option to force the model to call a specific custom tool. + + - `Name string` + + The name of the custom tool to call. + + - `Type Custom` + + For custom tool calling, the type is always `custom`. + + - `const CustomCustom Custom = "custom"` + + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + + - `Type ProgrammaticToolCalling` + + The tool to call. Always `programmatic_tool_calling`. + + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + + - `type BetaToolChoiceApplyPatch struct{…}` + + Forces the model to call the apply_patch tool when executing a tool call. + + - `Type ApplyPatch` + + The tool to call. Always `apply_patch`. + + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + + - `type BetaToolChoiceShell struct{…}` + + Forces the model to call the shell tool when a tool call is required. + + - `Type Shell` + + The tool to call. Always `shell`. + + - `const ShellShell Shell = "shell"` + + - `Tools []BetaToolUnion` + + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `type BetaFileSearchTool struct{…}` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type BetaComputerTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaComputerUsePreviewTool struct{…}` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaToolMcp struct{…}` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `type BetaToolCodeInterpreter struct{…}` + + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool struct{…}` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `TopP float64` + + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. + + We generally recommend altering this or `temperature` but not both. + + - `Background bool` + + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). + + - `CompletedAt float64` + + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. + + - `Conversation BetaResponseConversation` + + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + + - `ID string` + + The unique ID of the conversation that this response was associated with. + + - `MaxOutputTokens int64` + + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + + - `MaxToolCalls int64` + + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + + - `Moderation BetaResponseModeration` + + Moderation results for the response input and output, if moderated completions were requested. + + - `Input BetaResponseModerationInputUnion` + + Moderation for the response input. + + - `type BetaResponseModerationInputModerationResult struct{…}` + + A moderation result produced for the response input or output. + + - `Categories map[string, bool]` + + A dictionary of moderation categories to booleans, True if the input is flagged under this category. + + - `CategoryAppliedInputTypes map[string, []string]` + + Which modalities of input are reflected by the score for each category. + + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + + - `CategoryScores map[string, float64]` + + A dictionary of moderation categories to scores. + + - `Flagged bool` + + A boolean indicating whether the content was flagged by any category. + + - `Model string` + + The moderation model that produced this result. + + - `Type ModerationResult` + + The object type, which was always `moderation_result` for successful moderation results. + + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + + - `type BetaResponseModerationInputError struct{…}` + + An error produced while attempting moderation for the response input or output. + + - `Code string` + + The error code. + + - `Message string` + + The error message. + + - `Type Error` + + The object type, which was always `error` for moderation failures. + + - `const ErrorError Error = "error"` + + - `Output BetaResponseModerationOutputUnion` + + Moderation for the response output. + + - `type BetaResponseModerationOutputModerationResult struct{…}` + + A moderation result produced for the response input or output. + + - `Categories map[string, bool]` + + A dictionary of moderation categories to booleans, True if the input is flagged under this category. + + - `CategoryAppliedInputTypes map[string, []string]` + + Which modalities of input are reflected by the score for each category. + + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + + - `CategoryScores map[string, float64]` + + A dictionary of moderation categories to scores. + + - `Flagged bool` + + A boolean indicating whether the content was flagged by any category. + + - `Model string` + + The moderation model that produced this result. + + - `Type ModerationResult` + + The object type, which was always `moderation_result` for successful moderation results. + + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + + - `type BetaResponseModerationOutputError struct{…}` + + An error produced while attempting moderation for the response input or output. + + - `Code string` + + The error code. + + - `Message string` + + The error message. + + - `Type Error` + + The object type, which was always `error` for moderation failures. + + - `const ErrorError Error = "error"` + + - `PreviousResponseID string` + + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + + - `Prompt BetaResponsePrompt` + + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + + - `ID string` + + The unique identifier of the prompt template to use. + + - `Variables map[string, BetaResponsePromptVariableUnion]` + + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. + + - `string` + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Version string` + + Optional version of the prompt template. + + - `PromptCacheKey string` + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + + - `PromptCacheOptions BetaResponsePromptCacheOptions` + + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + + - `Mode string` + + Whether implicit prompt-cache breakpoints were enabled. + + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + + - `Ttl string` + + The minimum lifetime applied to each cache breakpoint. + + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + + - `PromptCacheRetention BetaResponsePromptCacheRetention` + + Deprecated. Use `prompt_cache_options.ttl` instead. + + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + + - `Reasoning BetaResponseReasoning` + + **gpt-5 and o-series models only** + + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + + - `Context string` + + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. + + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + + - `Effort string` + + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. + + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + + - `GenerateSummary string` + + **Deprecated:** use `summary` instead. + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + + - `Mode string` + + Controls the reasoning execution mode for the request. + + When returned on a response, this is the effective execution mode. + + - `string` + + - `string` + + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + + - `Summary string` + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + + - `SafetyIdentifier string` + + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + + - `ServiceTier BetaResponseServiceTier` + + Specifies the processing type used for serving the request. + + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. + + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + + - `Status BetaResponseStatus` + + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + + - `Text BetaResponseTextConfig` + + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: + + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + + - `Format BetaResponseFormatTextConfigUnion` + + An object specifying the format that the model must output. + + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + The default format is `{ "type": "text" }` with no additional options. + + **Not recommended for gpt-4o and newer models:** + + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. + + - `type BetaResponseFormatTextConfigText struct{…}` + + Default response format. Used to generate text responses. + + - `Type Text` + + The type of response format being defined. Always `text`. + + - `const TextText Text = "text"` + + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + + - `Name string` + + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. + + - `Schema map[string, any]` + + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). + + - `Type JSONSchema` + + The type of response format being defined. Always `json_schema`. + + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + + - `Description string` + + A description of what the response format is for, used by the model to + determine how to respond in the format. + + - `Strict bool` + + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). + + - `type BetaResponseFormatTextConfigJSONObject struct{…}` + + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. + + - `Type JSONObject` + + The type of response format being defined. Always `json_object`. + + - `const JSONObjectJSONObject JSONObject = "json_object"` + + - `Verbosity BetaResponseTextConfigVerbosity` + + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. + + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + + - `TopLogprobs int64` + + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. + + - `Truncation BetaResponseTruncation` + + The truncation strategy to use for the model response. + + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. + + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + + - `Usage BetaResponseUsage` + + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. + + - `InputTokens int64` + + The number of input tokens. + + - `InputTokensDetails BetaResponseUsageInputTokensDetails` + + A detailed breakdown of the input tokens. - The agent that produced this item. + - `CacheWriteTokens int64` - - `AgentName string` + The number of input tokens that were written to the cache. - The canonical name of the agent that produced this item. + - `CachedTokens int64` - - `ApprovalRequestID string` + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - 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. + - `OutputTokens int64` - - `Error string` + The number of output tokens. - The error from the tool call, if any. + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - - `Output string` + A detailed breakdown of the output tokens. - The output from the tool call. + - `ReasoningTokens int64` - - `Status string` + The number of reasoning tokens. - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `TotalTokens int64` - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + The total number of tokens used. - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + - `User string` - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + - `SequenceNumber int64` - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + The sequence number of this event. - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `Type ResponseFailed` - A list of tools available on an MCP server. + The type of the event. Always `response.failed`. - - `ID string` + - `const ResponseFailedResponseFailed ResponseFailed = "response.failed"` - The unique ID of the list. + - `Agent BetaResponseFailedEventAgent` - - `ServerLabel string` + The agent that owns this multi-agent streaming event. - The label of the MCP server. + - `AgentName string` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + The canonical name of the agent that produced this item. - The tools available on the server. +### Beta Response File Search Call Completed Event - - `InputSchema any` +- `type BetaResponseFileSearchCallCompletedEvent struct{…}` - The JSON schema describing the tool's input. + Emitted when a file search call is completed (results found). - - `Name string` + - `ItemID string` - The name of the tool. + The ID of the output item that the file search call is initiated. - - `Annotations any` + - `OutputIndex int64` - Additional annotations about the tool. + The index of the output item that the file search call is initiated. - - `Description string` + - `SequenceNumber int64` - The description of the tool. + The sequence number of this event. - - `Type McpListTools` + - `Type ResponseFileSearchCallCompleted` - The type of the item. Always `mcp_list_tools`. + The type of the event. Always `response.file_search_call.completed`. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `const ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `Agent BetaResponseFileSearchCallCompletedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Error string` - - Error message if the server could not list tools. - - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - A request for human approval of a tool invocation. +### Beta Response File Search Call In Progress Event - - `ID string` +- `type BetaResponseFileSearchCallInProgressEvent struct{…}` - The unique ID of the approval request. + Emitted when a file search call is initiated. - - `Arguments string` + - `ItemID string` - A JSON string of arguments for the tool. + The ID of the output item that the file search call is initiated. - - `Name string` + - `OutputIndex int64` - The name of the tool to run. + The index of the output item that the file search call is initiated. - - `ServerLabel string` + - `SequenceNumber int64` - The label of the MCP server making the request. + The sequence number of this event. - - `Type McpApprovalRequest` + - `Type ResponseFileSearchCallInProgress` - The type of the item. Always `mcp_approval_request`. + The type of the event. Always `response.file_search_call.in_progress`. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `Agent BetaResponseFileSearchCallInProgressEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` +### Beta Response File Search Call Searching Event - A response to an MCP approval request. +- `type BetaResponseFileSearchCallSearchingEvent struct{…}` - - `ID string` + Emitted when a file search is currently searching. - The unique ID of the approval response + - `ItemID string` - - `ApprovalRequestID string` + The ID of the output item that the file search call is initiated. - The ID of the approval request being answered. + - `OutputIndex int64` - - `Approve bool` + The index of the output item that the file search call is searching. - Whether the request was approved. + - `SequenceNumber int64` - - `Type McpApprovalResponse` + The sequence number of this event. - The type of the item. Always `mcp_approval_response`. + - `Type ResponseFileSearchCallSearching` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + The type of the event. Always `response.file_search_call.searching`. - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + - `const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"` - The agent that produced this item. + - `Agent BetaResponseFileSearchCallSearchingEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Reason string` +### Beta Response File Search Tool Call - Optional reason for the decision. +- `type BetaResponseFileSearchToolCall struct{…}` - - `type BetaResponseCustomToolCall struct{…}` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - A call to a custom tool created by the model. + - `ID string` - - `CallID string` + The unique ID of the file search tool call. - An identifier used to map this custom tool call to a tool call output. + - `Queries []string` - - `Input string` + The queries used to search for files. - The input for the custom tool call generated by the model. + - `Status BetaResponseFileSearchToolCallStatus` - - `Name string` + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - The name of the custom tool being called. + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - - `Type CustomToolCall` + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - The type of the custom tool call. Always `custom_tool_call`. + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `ID string` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - The unique ID of the custom tool call in the OpenAI platform. + - `Type FileSearchCall` - - `Agent BetaResponseCustomToolCallAgent` + The type of the file search tool call. Always `file_search_call`. + + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + + - `Agent BetaResponseFileSearchToolCallAgent` The agent that produced this item. @@ -49936,812 +65540,831 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `Results []BetaResponseFileSearchToolCallResult` - The execution context that produced this tool call. + The results of the file search tool call. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - - `Type Direct` + 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. - - `const DirectDirect Direct = "direct"` + - `string` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `float64` - - `CallerID string` + - `bool` - The call ID of the program item that produced this tool call. + - `FileID string` - - `Type Program` + The unique ID of the file. - - `const ProgramProgram Program = "program"` + - `Filename string` - - `Namespace string` + The name of the file. - The namespace of the custom tool being called. + - `Score float64` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + The relevance score of the file - a value between 0 and 1. - The output of a custom tool call from your code, being sent back to the model. + - `Text string` - - `ID string` + The text that was retrieved from the file. - The unique ID of the custom tool call output item. +### Beta Response Format Text Config - - `Status string` +- `type BetaResponseFormatTextConfigUnion interface{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + An object specifying the format that the model must output. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + The default format is `{ "type": "text" }` with no additional options. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + **Not recommended for gpt-4o and newer models:** - - `CreatedBy string` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - The identifier of the actor that created the item. + - `type BetaResponseFormatTextConfigText struct{…}` - - `Usage BetaResponseUsage` + Default response format. Used to generate text responses. - Token accounting for the compaction pass, including cached, reasoning, and total tokens. + - `Type Text` - - `InputTokens int64` + The type of response format being defined. Always `text`. - The number of input tokens. + - `const TextText Text = "text"` - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - A detailed breakdown of the input tokens. + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `CacheWriteTokens int64` + - `Name string` - The number of input tokens that were written to the cache. + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `CachedTokens int64` + - `Schema map[string, any]` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `OutputTokens int64` + - `Type JSONSchema` - The number of output tokens. + The type of response format being defined. Always `json_schema`. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - A detailed breakdown of the output tokens. + - `Description string` - - `ReasoningTokens int64` + A description of what the response format is for, used by the model to + determine how to respond in the format. - The number of reasoning tokens. + - `Strict bool` - - `TotalTokens int64` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The total number of tokens used. + - `type BetaResponseFormatTextConfigJSONObject struct{…}` -### Beta Computer Action + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. -- `type BetaComputerActionUnion interface{…}` + - `Type JSONObject` - A click action. + The type of response format being defined. Always `json_object`. - - `type BetaComputerActionClick struct{…}` + - `const JSONObjectJSONObject JSONObject = "json_object"` - A click action. +### Beta Response Format Text JSON Schema Config - - `Button string` +- `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `Name string` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `Schema map[string, any]` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `Type JSONSchema` - - `Type Click` + The type of response format being defined. Always `json_schema`. - Specifies the event type. For a click action, this property is always `click`. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `const ClickClick Click = "click"` + - `Description string` - - `X int64` + A description of what the response format is for, used by the model to + determine how to respond in the format. - The x-coordinate where the click occurred. + - `Strict bool` - - `Y int64` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The y-coordinate where the click occurred. +### Beta Response Function Call Arguments Delta Event - - `Keys []string` +- `type BetaResponseFunctionCallArgumentsDeltaEvent struct{…}` - The keys being held while clicking. + Emitted when there is a partial function-call arguments delta. - - `type BetaComputerActionDoubleClick struct{…}` + - `Delta string` - A double click action. + The function-call arguments delta that is added. - - `Keys []string` + - `ItemID string` - The keys being held while double-clicking. + The ID of the output item that the function-call arguments delta is added to. - - `Type DoubleClick` + - `OutputIndex int64` - Specifies the event type. For a double click action, this property is always set to `double_click`. + The index of the output item that the function-call arguments delta is added to. - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `SequenceNumber int64` - - `X int64` + The sequence number of this event. - The x-coordinate where the double click occurred. + - `Type ResponseFunctionCallArgumentsDelta` - - `Y int64` + The type of the event. Always `response.function_call_arguments.delta`. - The y-coordinate where the double click occurred. + - `const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"` - - `type BetaComputerActionDrag struct{…}` + - `Agent BetaResponseFunctionCallArgumentsDeltaEventAgent` - A drag action. + The agent that owns this multi-agent streaming event. - - `Path []BetaComputerActionDragPath` + - `AgentName string` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + The canonical name of the agent that produced this item. - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` +### Beta Response Function Call Arguments Done Event - - `X int64` +- `type BetaResponseFunctionCallArgumentsDoneEvent struct{…}` - The x-coordinate. + Emitted when function-call arguments are finalized. - - `Y int64` + - `Arguments string` - The y-coordinate. + The function-call arguments. - - `Type Drag` + - `ItemID string` - Specifies the event type. For a drag action, this property is always set to `drag`. + The ID of the item. - - `const DragDrag Drag = "drag"` + - `Name string` - - `Keys []string` + The name of the function that was called. - The keys being held while dragging the mouse. + - `OutputIndex int64` - - `type BetaComputerActionKeypress struct{…}` + The index of the output item. - A collection of keypresses the model would like to perform. + - `SequenceNumber int64` - - `Keys []string` + The sequence number of this event. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `Type ResponseFunctionCallArgumentsDone` - - `Type Keypress` + - `const ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `Agent BetaResponseFunctionCallArgumentsDoneEventAgent` - - `const KeypressKeypress Keypress = "keypress"` + The agent that owns this multi-agent streaming event. - - `type BetaComputerActionMove struct{…}` + - `AgentName string` - A mouse move action. + The canonical name of the agent that produced this item. - - `Type Move` +### Beta Response Function Call Output Item - Specifies the event type. For a move action, this property is always set to `move`. +- `type BetaResponseFunctionCallOutputItemUnion interface{…}` - - `const MoveMove Move = "move"` + A piece of message content, such as text, an image, or a file. - - `X int64` + - `type BetaResponseInputTextContent struct{…}` - The x-coordinate to move to. + A text input to the model. - - `Y int64` + - `Text string` - The y-coordinate to move to. + The text input to the model. - - `Keys []string` + - `Type InputText` - The keys being held while moving the mouse. + The type of the input item. Always `input_text`. - - `type BetaComputerActionScreenshot struct{…}` + - `const InputTextInputText InputText = "input_text"` - A screenshot action. + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `Type Screenshot` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `Mode Explicit` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + The breakpoint mode. Always `explicit`. - - `type BetaComputerActionScroll struct{…}` + - `const ExplicitExplicit Explicit = "explicit"` - A scroll action. + - `type BetaResponseInputImageContent struct{…}` - - `ScrollX int64` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - The horizontal scroll distance. + - `Type InputImage` - - `ScrollY int64` + The type of the input item. Always `input_image`. - The vertical scroll distance. + - `const InputImageInputImage InputImage = "input_image"` - - `Type Scroll` + - `Detail BetaResponseInputImageContentDetail` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const ScrollScroll Scroll = "scroll"` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - - `X int64` + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - The x-coordinate where the scroll occurred. + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - - `Y int64` + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - The y-coordinate where the scroll occurred. + - `FileID string` - - `Keys []string` + The ID of the file to be sent to the model. - The keys being held while scrolling. + - `ImageURL string` - - `type BetaComputerActionType struct{…}` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - An action to type in text. + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `Text string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The text to type. + - `Mode Explicit` - - `Type Type` + The breakpoint mode. Always `explicit`. - Specifies the event type. For a type action, this property is always set to `type`. + - `const ExplicitExplicit Explicit = "explicit"` - - `const TypeType Type = "type"` + - `type BetaResponseInputFileContent struct{…}` - - `type BetaComputerActionWait struct{…}` + A file input to the model. - A wait action. + - `Type InputFile` - - `Type Wait` + The type of the input item. Always `input_file`. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `const InputFileInputFile InputFile = "input_file"` - - `const WaitWait Wait = "wait"` + - `Detail BetaResponseInputFileContentDetail` -### Beta Computer Action List + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. -- `type BetaComputerActionList []BetaComputerActionUnion` + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - - `type BetaComputerActionClick struct{…}` + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - A click action. + - `FileData string` - - `Button string` + The base64-encoded data of the file to be sent to the model. - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `FileID string` - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + The ID of the file to be sent to the model. - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `FileURL string` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + The URL of the file to be sent to the model. - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `Filename string` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + The name of the file to be sent to the model. - - `Type Click` + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - Specifies the event type. For a click action, this property is always `click`. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const ClickClick Click = "click"` + - `Mode Explicit` - - `X int64` + The breakpoint mode. Always `explicit`. - The x-coordinate where the click occurred. + - `const ExplicitExplicit Explicit = "explicit"` - - `Y int64` +### Beta Response Function Call Output Item List - The y-coordinate where the click occurred. +- `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `Keys []string` + An array of content outputs (text, image, file) for the function tool call. - The keys being held while clicking. + - `type BetaResponseInputTextContent struct{…}` - - `type BetaComputerActionDoubleClick struct{…}` + A text input to the model. - A double click action. + - `Text string` - - `Keys []string` + The text input to the model. - The keys being held while double-clicking. + - `Type InputText` - - `Type DoubleClick` + The type of the input item. Always `input_text`. - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `const InputTextInputText InputText = "input_text"` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `X int64` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The x-coordinate where the double click occurred. + - `Mode Explicit` - - `Y int64` + The breakpoint mode. Always `explicit`. - The y-coordinate where the double click occurred. + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaComputerActionDrag struct{…}` + - `type BetaResponseInputImageContent struct{…}` - A drag action. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `Path []BetaComputerActionDragPath` + - `Type InputImage` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + The type of the input item. Always `input_image`. - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `const InputImageInputImage InputImage = "input_image"` - - `X int64` + - `Detail BetaResponseInputImageContentDetail` - The x-coordinate. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `Y int64` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - The y-coordinate. + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - - `Type Drag` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - Specifies the event type. For a drag action, this property is always set to `drag`. + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - - `const DragDrag Drag = "drag"` + - `FileID string` - - `Keys []string` + The ID of the file to be sent to the model. - The keys being held while dragging the mouse. + - `ImageURL string` - - `type BetaComputerActionKeypress struct{…}` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - A collection of keypresses the model would like to perform. + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `Keys []string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `Mode Explicit` - - `Type Keypress` + The breakpoint mode. Always `explicit`. - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `const ExplicitExplicit Explicit = "explicit"` - - `const KeypressKeypress Keypress = "keypress"` + - `type BetaResponseInputFileContent struct{…}` - - `type BetaComputerActionMove struct{…}` + A file input to the model. - A mouse move action. + - `Type InputFile` - - `Type Move` + The type of the input item. Always `input_file`. - Specifies the event type. For a move action, this property is always set to `move`. + - `const InputFileInputFile InputFile = "input_file"` - - `const MoveMove Move = "move"` + - `Detail BetaResponseInputFileContentDetail` - - `X int64` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - The x-coordinate to move to. + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `Y int64` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - The y-coordinate to move to. + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `Keys []string` + - `FileData string` - The keys being held while moving the mouse. + The base64-encoded data of the file to be sent to the model. - - `type BetaComputerActionScreenshot struct{…}` + - `FileID string` - A screenshot action. + The ID of the file to be sent to the model. - - `Type Screenshot` + - `FileURL string` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + The URL of the file to be sent to the model. - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `Filename string` - - `type BetaComputerActionScroll struct{…}` + The name of the file to be sent to the model. - A scroll action. + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - - `ScrollX int64` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The horizontal scroll distance. + - `Mode Explicit` - - `ScrollY int64` + The breakpoint mode. Always `explicit`. - The vertical scroll distance. + - `const ExplicitExplicit Explicit = "explicit"` - - `Type Scroll` +### Beta Response Function Shell Call Output Content - Specifies the event type. For a scroll action, this property is always set to `scroll`. +- `type BetaResponseFunctionShellCallOutputContent struct{…}` - - `const ScrollScroll Scroll = "scroll"` + Captured stdout and stderr for a portion of a shell tool call output. - - `X int64` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - The x-coordinate where the scroll occurred. + The exit or timeout outcome associated with this shell call. - - `Y int64` + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - The y-coordinate where the scroll occurred. + Indicates that the shell call exceeded its configured time limit. - - `Keys []string` + - `Type Timeout` - The keys being held while scrolling. + The outcome type. Always `timeout`. - - `type BetaComputerActionType struct{…}` + - `const TimeoutTimeout Timeout = "timeout"` - An action to type in text. + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - `Text string` + Indicates that the shell commands finished and returned an exit code. - The text to type. + - `ExitCode int64` - - `Type Type` + The exit code returned by the shell process. - Specifies the event type. For a type action, this property is always set to `type`. + - `Type Exit` - - `const TypeType Type = "type"` + The outcome type. Always `exit`. - - `type BetaComputerActionWait struct{…}` + - `const ExitExit Exit = "exit"` - A wait action. + - `Stderr string` - - `Type Wait` + Captured stderr output for the shell call. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `Stdout string` - - `const WaitWait Wait = "wait"` + Captured stdout output for the shell call. -### Beta Computer Tool +### Beta Response Function Shell Tool Call -- `type BetaComputerTool struct{…}` +- `type BetaResponseFunctionShellToolCall struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + A tool call that executes one or more shell commands in a managed environment. - - `Type Computer` + - `ID string` - The type of the computer tool. Always `computer`. + The unique ID of the shell tool call. Populated when this item is returned via API. - - `const ComputerComputer Computer = "computer"` + - `Action BetaResponseFunctionShellToolCallAction` -### Beta Computer Use Preview Tool + The shell commands and limits that describe how to run the tool call. -- `type BetaComputerUsePreviewTool struct{…}` + - `Commands []string` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `MaxOutputLength int64` - - `DisplayHeight int64` + Optional maximum number of characters to return from each command. - The height of the computer display. + - `TimeoutMs int64` - - `DisplayWidth int64` + Optional timeout in milliseconds for the commands. - The width of the computer display. + - `CallID string` - - `Environment BetaComputerUsePreviewToolEnvironment` + The unique ID of the shell tool call generated by the model. - The type of computer environment to control. + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + Represents the use of a local environment to perform shell actions. - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `type BetaResponseLocalEnvironment struct{…}` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + Represents the use of a local environment to perform shell actions. - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `Type Local` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + The environment type. Always `local`. - - `Type ComputerUsePreview` + - `const LocalLocal Local = "local"` - The type of the computer use tool. Always `computer_use_preview`. + - `type BetaResponseContainerReference struct{…}` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + Represents a container created with /v1/containers. -### Beta Container Auto + - `ContainerID string` -- `type BetaContainerAuto struct{…}` + - `Type ContainerReference` - - `Type ContainerAuto` + The environment type. Always `container_reference`. - Automatically creates a container for this request + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + - `Status BetaResponseFunctionShellToolCallStatus` - - `FileIDs []string` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - An optional list of uploaded files to make available to your code. + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - The memory limit for the container. + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `Type ShellCall` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The type of the item. Always `shell_call`. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `const ShellCallShellCall ShellCall = "shell_call"` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + - `Agent BetaResponseFunctionShellToolCallAgent` - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + The agent that produced this item. - Network access policy for the container. + - `AgentName string` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + The canonical name of the agent that produced this item. - - `Type Disabled` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - Disable outbound network access. Always `disabled`. + The execution context that produced this tool call. - - `const DisabledDisabled Disabled = "disabled"` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `Type Direct` - - `AllowedDomains []string` + - `const DirectDirect Direct = "direct"` - A list of allowed domains when type is `allowlist`. + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - - `Type Allowlist` + - `CallerID string` - Allow outbound network access only to specified domains. Always `allowlist`. + The call ID of the program item that produced this tool call. - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `Type Program` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + - `const ProgramProgram Program = "program"` - Optional domain-scoped secrets for allowlisted domains. + - `CreatedBy string` - - `Domain string` + The ID of the entity that created this tool call. - The domain associated with the secret. +### Beta Response Function Shell Tool Call Output - - `Name string` +- `type BetaResponseFunctionShellToolCallOutput struct{…}` - The name of the secret to inject for the domain. + The output of a shell tool call that was emitted. - - `Value string` + - `ID string` - The secret value to inject for the domain. + The unique ID of the shell call output. Populated when this item is returned via API. - - `Skills []BetaContainerAutoSkillUnion` + - `CallID string` - An optional list of skills referenced by id or inline data. + The unique ID of the shell tool call generated by the model. - - `type BetaSkillReference struct{…}` + - `MaxOutputLength int64` - - `SkillID string` + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - The ID of the referenced skill. + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - - `Type SkillReference` + An array of shell call output contents - References a skill created with the /v1/skills endpoint. + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - - `Version string` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + Indicates that the shell call exceeded its configured time limit. - - `type BetaInlineSkill struct{…}` + - `Type Timeout` - - `Description string` + The outcome type. Always `timeout`. - The description of the skill. + - `const TimeoutTimeout Timeout = "timeout"` - - `Name string` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - The name of the skill. + Indicates that the shell commands finished and returned an exit code. - - `Source BetaInlineSkillSource` + - `ExitCode int64` - Inline skill payload + Exit code from the shell process. - - `Data string` + - `Type Exit` - Base64-encoded skill zip bundle. + The outcome type. Always `exit`. - - `MediaType ApplicationZip` + - `const ExitExit Exit = "exit"` - The media type of the inline skill payload. Must be `application/zip`. + - `Stderr string` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + The standard error output that was captured. - - `Type Base64` + - `Stdout string` - The type of the inline skill source. Must be `base64`. + The standard output that was captured. - - `const Base64Base64 Base64 = "base64"` + - `CreatedBy string` - - `Type Inline` + The identifier of the actor that created the item. - Defines an inline skill for this request. + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `const InlineInline Inline = "inline"` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. -### Beta Container Network Policy Allowlist + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` -- `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - - `AllowedDomains []string` + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - A list of allowed domains when type is `allowlist`. + - `Type ShellCallOutput` - - `Type Allowlist` + The type of the shell call output. Always `shell_call_output`. - Allow outbound network access only to specified domains. Always `allowlist`. + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + The agent that produced this item. - Optional domain-scoped secrets for allowlisted domains. + - `AgentName string` - - `Domain string` + The canonical name of the agent that produced this item. - The domain associated with the secret. + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - - `Name string` + The execution context that produced this tool call. - The name of the secret to inject for the domain. + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `Value string` + - `Type Direct` - The secret value to inject for the domain. + - `const DirectDirect Direct = "direct"` -### Beta Container Network Policy Disabled + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` -- `type BetaContainerNetworkPolicyDisabled struct{…}` + - `CallerID string` - - `Type Disabled` + The call ID of the program item that produced this tool call. - Disable outbound network access. Always `disabled`. + - `Type Program` - - `const DisabledDisabled Disabled = "disabled"` + - `const ProgramProgram Program = "program"` -### Beta Container Network Policy Domain Secret + - `CreatedBy string` -- `type BetaContainerNetworkPolicyDomainSecret struct{…}` + The identifier of the actor that created the item. - - `Domain string` +### Beta Response Function Tool Call - The domain associated with the secret. +- `type BetaResponseFunctionToolCall struct{…}` - - `Name string` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - The name of the secret to inject for the domain. + - `Arguments string` - - `Value string` + A JSON string of the arguments to pass to the function. - The secret value to inject for the domain. + - `CallID string` -### Beta Container Reference + The unique ID of the function tool call generated by the model. -- `type BetaContainerReference struct{…}` + - `Name string` - - `ContainerID string` + The name of the function to run. - The ID of the referenced container. + - `Type FunctionCall` - - `Type ContainerReference` + The type of the function tool call. Always `function_call`. - References a container created with the /v1/containers endpoint + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `ID string` -### Beta Custom Tool + The unique ID of the function tool call. -- `type BetaCustomTool struct{…}` + - `Agent BetaResponseFunctionToolCallAgent` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the custom tool, used to identify it in tool calls. + The canonical name of the agent that produced this item. - - `Type Custom` + - `Caller BetaResponseFunctionToolCallCallerUnion` - The type of the custom tool. Always `custom`. + The execution context that produced this tool call. - - `const CustomCustom Custom = "custom"` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `AllowedCallers []string` + - `Type Direct` - The tool invocation context(s). + - `const DirectDirect Direct = "direct"` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + - `CallerID string` - - `DeferLoading bool` + The call ID of the program item that produced this tool call. - Whether this tool should be deferred and discovered via tool search. + - `Type Program` - - `Description string` + - `const ProgramProgram Program = "program"` - Optional description of the custom tool, used to provide more context. + - `Namespace string` - - `Format BetaCustomToolFormatUnion` + The namespace of the function to run. - The input format for the custom tool. Default is unconstrained text. + - `Status BetaResponseFunctionToolCallStatus` - - `type BetaCustomToolFormatText struct{…}` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Unconstrained free-form text. + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `Type Text` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - Unconstrained text format. Always `text`. + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `const TextText Text = "text"` +### Beta Response Function Tool Call Item - - `type BetaCustomToolFormatGrammar struct{…}` +- `type BetaResponseFunctionToolCallItem struct{…}` - A grammar defined by the user. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `Definition string` + - `ID string` - The grammar definition. + The unique ID of the function tool call. - - `Syntax string` + - `Status string` - The syntax of the grammar definition. One of `lark` or `regex`. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `const BetaResponseFunctionToolCallItemStatusInProgress BetaResponseFunctionToolCallItemStatus = "in_progress"` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `const BetaResponseFunctionToolCallItemStatusCompleted BetaResponseFunctionToolCallItemStatus = "completed"` - - `Type Grammar` + - `const BetaResponseFunctionToolCallItemStatusIncomplete BetaResponseFunctionToolCallItemStatus = "incomplete"` - Grammar format. Always `grammar`. + - `CreatedBy string` - - `const GrammarGrammar Grammar = "grammar"` + The identifier of the actor that created the item. -### Beta Easy Input Message +### Beta Response Function Tool Call Output Item -- `type BetaEasyInputMessage struct{…}` +- `type BetaResponseFunctionToolCallOutputItem struct{…}` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `ID string` - - `Content BetaEasyInputMessageContentUnion` + The unique ID of the function call tool output. - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `CallID string` + + The unique ID of the function tool call generated by the model. + + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + + The output from the function call generated by your code. + Can be a string or an list of output content. - `string` - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - A list of one or many input items to the model, containing different content - types. + Text, image, or file output of the function call. - `type BetaResponseInputText struct{…}` @@ -50853,648 +66476,310 @@ func main() { - `const ExplicitExplicit Explicit = "explicit"` - - `Role BetaEasyInputMessageRole` - - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. - - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - - - `Phase BetaEasyInputMessagePhase` - - 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 BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - - - `Type BetaEasyInputMessageType` - - The type of the message input. Always `message`. - - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - -### Beta File Search Tool - -- `type BetaFileSearchTool struct{…}` - - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - - `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 BetaFileSearchToolFiltersUnion` - - A filter to apply. - - - `type BetaFileSearchToolFiltersComparisonFilter 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 string` - - 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 BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - The value to compare against the attribute key; supports string, number, or boolean types. - - - `string` - - - `float64` - - - `bool` - - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` - - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - Combine multiple filters using `and` or `or`. - - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - - `type BetaFileSearchToolFiltersCompoundFilterFilter 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 string` - - 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 BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - The value to compare against the attribute key; supports string, number, or boolean types. - - - `string` - - - `float64` - - - `bool` - - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` - - - `Type string` - - Type of operation: `and` or `or`. - - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - - `MaxNumResults int64` - - The maximum number of results to return. This number should be between 1 and 50 inclusive. - - - `RankingOptions BetaFileSearchToolRankingOptions` - - Ranking options for search. - - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - 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 BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "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. - -### Beta Function Shell Tool - -- `type BetaFunctionShellTool 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"` - - - `AllowedCallers []string` - - The tool invocation context(s). - - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - - `Environment BetaFunctionShellToolEnvironmentUnion` - - - `type BetaContainerAuto 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 BetaContainerAutoMemoryLimit` - - The memory limit for the container. - - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - Network access policy for the container. - - - `type BetaContainerNetworkPolicyDisabled struct{…}` - - - `Type Disabled` - - Disable outbound network access. Always `disabled`. - - - `const DisabledDisabled Disabled = "disabled"` - - - `type BetaContainerNetworkPolicyAllowlist 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 []BetaContainerNetworkPolicyDomainSecret` - - 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. - - - `Skills []BetaContainerAutoSkillUnion` - - An optional list of skills referenced by id or inline data. - - - `type BetaSkillReference 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 BetaInlineSkill struct{…}` - - - `Description string` - - The description of the skill. - - - `Name string` - - The name of the skill. - - - `Source BetaInlineSkillSource` - - 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 BetaLocalEnvironment struct{…}` - - - `Type Local` - - Use a local computer environment. - - - `const LocalLocal Local = "local"` + - `Status BetaResponseFunctionToolCallOutputItemStatus` - - `Skills []BetaLocalSkill` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - An optional list of skills. + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `Description string` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - The description of the skill. + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `Name string` + - `Type FunctionCallOutput` - The name of the skill. + The type of the function tool call output. Always `function_call_output`. - - `Path string` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - The path to the directory containing the skill. + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - - `type BetaContainerReference struct{…}` + The agent that produced this item. - - `ContainerID string` + - `AgentName string` - The ID of the referenced container. + The canonical name of the agent that produced this item. - - `Type ContainerReference` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - References a container created with the /v1/containers endpoint + The execution context that produced this tool call. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` -### Beta Function Tool + - `Type Direct` -- `type BetaFunctionTool struct{…}` + The caller type. Always `direct`. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const DirectDirect Direct = "direct"` - - `Name string` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - The name of the function to call. + - `CallerID string` - - `Parameters map[string, any]` + The call ID of the program item that produced this tool call. - A JSON schema object describing the parameters of the function. + - `Type Program` - - `Strict bool` + The caller type. Always `program`. - Whether strict parameter validation is enforced for this function tool. + - `const ProgramProgram Program = "program"` - - `Type Function` + - `CreatedBy string` - The type of the function tool. Always `function`. + The identifier of the actor that created the item. - - `const FunctionFunction Function = "function"` +### Beta Response Function Web Search - - `AllowedCallers []string` +- `type BetaResponseFunctionWebSearch struct{…}` - The tool invocation context(s). + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `ID string` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + The unique ID of the web search tool call. - - `DeferLoading bool` + - `Action BetaResponseFunctionWebSearchActionUnion` - Whether this function is deferred and loaded via tool search. + 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). - - `Description string` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - A description of the function. Used by the model to determine whether or not to call the function. + Action type "search" - Performs a web search query. - - `OutputSchema map[string, any]` + - `Type Search` - A JSON schema object describing the JSON value encoded in string outputs for this function. + The action type. -### Beta Inline Skill + - `const SearchSearch Search = "search"` -- `type BetaInlineSkill struct{…}` + - `Queries []string` - - `Description string` + The search queries. - The description of the skill. + - `Query string` - - `Name string` + The search query. - The name of the skill. + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `Source BetaInlineSkillSource` + The sources used in the search. - Inline skill payload + - `Type URL` - - `Data string` + The type of source. Always `url`. - Base64-encoded skill zip bundle. + - `const URLURL URL = "url"` - - `MediaType ApplicationZip` + - `URL string` - The media type of the inline skill payload. Must be `application/zip`. + The URL of the source. - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `Type Base64` + Action type "open_page" - Opens a specific URL from search results. - The type of the inline skill source. Must be `base64`. + - `Type OpenPage` - - `const Base64Base64 Base64 = "base64"` + The action type. - - `Type Inline` + - `const OpenPageOpenPage OpenPage = "open_page"` - Defines an inline skill for this request. + - `URL string` - - `const InlineInline Inline = "inline"` + The URL opened by the model. -### Beta Inline Skill Source + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` -- `type BetaInlineSkillSource struct{…}` + Action type "find_in_page": Searches for a pattern within a loaded page. - Inline skill payload + - `Pattern string` - - `Data string` + The pattern or text to search for within the page. - Base64-encoded skill zip bundle. + - `Type FindInPage` - - `MediaType ApplicationZip` + The action type. - The media type of the inline skill payload. Must be `application/zip`. + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `URL string` - - `Type Base64` + The URL of the page searched for the pattern. - The type of the inline skill source. Must be `base64`. + - `Status BetaResponseFunctionWebSearchStatus` - - `const Base64Base64 Base64 = "base64"` + The status of the web search tool call. -### Beta Local Environment + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` -- `type BetaLocalEnvironment struct{…}` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - `Type Local` + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - Use a local computer environment. + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `const LocalLocal Local = "local"` + - `Type WebSearchCall` - - `Skills []BetaLocalSkill` + The type of the web search tool call. Always `web_search_call`. - An optional list of skills. + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `Description string` + - `Agent BetaResponseFunctionWebSearchAgent` - The description of the skill. + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the skill. + The canonical name of the agent that produced this item. - - `Path string` +### Beta Response Image Gen Call Completed Event - The path to the directory containing the skill. +- `type BetaResponseImageGenCallCompletedEvent struct{…}` -### Beta Local Skill + Emitted when an image generation tool call has completed and the final image is available. -- `type BetaLocalSkill struct{…}` + - `ItemID string` - - `Description string` + The unique identifier of the image generation item being processed. - The description of the skill. + - `OutputIndex int64` - - `Name string` + The index of the output item in the response's output array. - The name of the skill. + - `SequenceNumber int64` - - `Path string` + The sequence number of this event. - The path to the directory containing the skill. + - `Type ResponseImageGenerationCallCompleted` -### Beta Namespace Tool + The type of the event. Always 'response.image_generation_call.completed'. -- `type BetaNamespaceTool struct{…}` + - `const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"` - Groups function/custom tools under a shared namespace. + - `Agent BetaResponseImageGenCallCompletedEventAgent` - - `Description string` + The agent that owns this multi-agent streaming event. - A description of the namespace shown to the model. + - `AgentName string` - - `Name string` + The canonical name of the agent that produced this item. - The namespace name used in tool calls (for example, `crm`). +### Beta Response Image Gen Call Generating Event - - `Tools []BetaNamespaceToolToolUnion` +- `type BetaResponseImageGenCallGeneratingEvent struct{…}` - The function/custom tools available inside this namespace. + Emitted when an image generation tool call is actively generating an image (intermediate state). - - `type BetaNamespaceToolToolFunction struct{…}` + - `ItemID string` - - `Name string` + The unique identifier of the image generation item being processed. - - `Type Function` + - `OutputIndex int64` - - `const FunctionFunction Function = "function"` + The index of the output item in the response's output array. - - `AllowedCallers []string` + - `SequenceNumber int64` - The tool invocation context(s). + The sequence number of the image generation item being processed. - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `Type ResponseImageGenerationCallGenerating` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + The type of the event. Always 'response.image_generation_call.generating'. - - `DeferLoading bool` + - `const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"` - Whether this function should be deferred and discovered via tool search. + - `Agent BetaResponseImageGenCallGeneratingEventAgent` - - `Description string` + The agent that owns this multi-agent streaming event. - - `OutputSchema map[string, any]` + - `AgentName string` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + The canonical name of the agent that produced this item. - - `Parameters any` +### Beta Response Image Gen Call In Progress Event - - `Strict bool` +- `type BetaResponseImageGenCallInProgressEvent struct{…}` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + Emitted when an image generation tool call is in progress. - - `type BetaCustomTool struct{…}` + - `ItemID string` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The unique identifier of the image generation item being processed. - - `Name string` + - `OutputIndex int64` - The name of the custom tool, used to identify it in tool calls. + The index of the output item in the response's output array. - - `Type Custom` + - `SequenceNumber int64` - The type of the custom tool. Always `custom`. + The sequence number of the image generation item being processed. - - `const CustomCustom Custom = "custom"` + - `Type ResponseImageGenerationCallInProgress` - - `AllowedCallers []string` + The type of the event. Always 'response.image_generation_call.in_progress'. - The tool invocation context(s). + - `const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `Agent BetaResponseImageGenCallInProgressEventAgent` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + The agent that owns this multi-agent streaming event. - - `DeferLoading bool` + - `AgentName string` - Whether this tool should be deferred and discovered via tool search. + The canonical name of the agent that produced this item. - - `Description string` +### Beta Response Image Gen Call Partial Image Event - Optional description of the custom tool, used to provide more context. +- `type BetaResponseImageGenCallPartialImageEvent struct{…}` - - `Format BetaCustomToolFormatUnion` + Emitted when a partial image is available during image generation streaming. - The input format for the custom tool. Default is unconstrained text. + - `ItemID string` - - `type BetaCustomToolFormatText struct{…}` + The unique identifier of the image generation item being processed. - Unconstrained free-form text. + - `OutputIndex int64` - - `Type Text` + The index of the output item in the response's output array. - Unconstrained text format. Always `text`. + - `PartialImageB64 string` - - `const TextText Text = "text"` + Base64-encoded partial image data, suitable for rendering as an image. - - `type BetaCustomToolFormatGrammar struct{…}` + - `PartialImageIndex int64` - A grammar defined by the user. + 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). - - `Definition string` + - `SequenceNumber int64` - The grammar definition. + The sequence number of the image generation item being processed. - - `Syntax string` + - `Type ResponseImageGenerationCallPartialImage` - The syntax of the grammar definition. One of `lark` or `regex`. + The type of the event. Always 'response.image_generation_call.partial_image'. - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `Agent BetaResponseImageGenCallPartialImageEventAgent` - - `Type Grammar` + The agent that owns this multi-agent streaming event. - Grammar format. Always `grammar`. + - `AgentName string` - - `const GrammarGrammar Grammar = "grammar"` + The canonical name of the agent that produced this item. - - `Type Namespace` +### Beta Response In Progress Event - The type of the tool. Always `namespace`. +- `type BetaResponseInProgressEvent struct{…}` - - `const NamespaceNamespace Namespace = "namespace"` + Emitted when the response is in progress. -### Beta Response + - `Response BetaResponse` -- `type BetaResponse struct{…}` + The response that is in progress. - `ID string` @@ -51732,6 +67017,8 @@ func main() { - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + - `Type BetaEasyInputMessageType` The type of the message input. Always `message`. @@ -51979,6 +67266,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -53159,7 +68448,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -53216,7 +68509,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -57895,449 +73192,17 @@ func main() { A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). -### Beta Response Apply Patch Tool Call - -- `type BetaResponseApplyPatchToolCall 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 BetaResponseApplyPatchToolCallOperationUnion` - - One of the create_file, delete_file, or update_file operations applied via apply_patch. - - - `type BetaResponseApplyPatchToolCallOperationCreateFile 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 BetaResponseApplyPatchToolCallOperationDeleteFile 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 BetaResponseApplyPatchToolCallOperationUpdateFile 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 BetaResponseApplyPatchToolCallStatus` - - The status of the apply patch tool call. One of `in_progress` or `completed`. - - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - - `Type ApplyPatchCall` - - The type of the item. Always `apply_patch_call`. - - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - - `Agent BetaResponseApplyPatchToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - - `Type Direct` - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - - `const ProgramProgram Program = "program"` - - - `CreatedBy string` - - The ID of the entity that created this tool call. - -### Beta Response Apply Patch Tool Call Output - -- `type BetaResponseApplyPatchToolCallOutput 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 BetaResponseApplyPatchToolCallOutputStatus` - - The status of the apply patch tool call output. One of `completed` or `failed`. - - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - - - `Type ApplyPatchCallOutput` - - The type of the item. Always `apply_patch_call_output`. - - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - - `Type Direct` - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - - `const ProgramProgram Program = "program"` - - - `CreatedBy string` - - The ID of the entity that created this tool call output. - - - `Output string` - - Optional textual output returned by the apply patch tool. - -### Beta Response Audio Delta Event - -- `type BetaResponseAudioDeltaEvent struct{…}` - - Emitted when there is a partial audio response. - - - `Delta string` - - A chunk of Base64 encoded response audio bytes. - - - `SequenceNumber int64` - - A sequence number for this chunk of the stream response. - - - `Type ResponseAudioDelta` - - The type of the event. Always `response.audio.delta`. - - - `const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"` - - - `Agent BetaResponseAudioDeltaEventAgent` - - The agent that owns this multi-agent streaming event. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Audio Done Event - -- `type BetaResponseAudioDoneEvent struct{…}` - - Emitted when the audio response is complete. - - - `SequenceNumber int64` - - The sequence number of the delta. - - - `Type ResponseAudioDone` - - The type of the event. Always `response.audio.done`. - - - `const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"` - - - `Agent BetaResponseAudioDoneEventAgent` - - The agent that owns this multi-agent streaming event. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Audio Transcript Delta Event - -- `type BetaResponseAudioTranscriptDeltaEvent struct{…}` - - Emitted when there is a partial transcript of audio. - - - `Delta string` - - The partial transcript of the audio response. - - - `SequenceNumber int64` - - The sequence number of this event. - - - `Type ResponseAudioTranscriptDelta` - - The type of the event. Always `response.audio.transcript.delta`. - - - `const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"` - - - `Agent BetaResponseAudioTranscriptDeltaEventAgent` - - The agent that owns this multi-agent streaming event. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Audio Transcript Done Event - -- `type BetaResponseAudioTranscriptDoneEvent struct{…}` - - Emitted when the full audio transcript is completed. - - `SequenceNumber int64` The sequence number of this event. - - `Type ResponseAudioTranscriptDone` - - The type of the event. Always `response.audio.transcript.done`. - - - `const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"` - - - `Agent BetaResponseAudioTranscriptDoneEventAgent` - - The agent that owns this multi-agent streaming event. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Code Interpreter Call Code Delta Event - -- `type BetaResponseCodeInterpreterCallCodeDeltaEvent struct{…}` - - Emitted when a partial code snippet is streamed by the code interpreter. - - - `Delta string` - - The partial code snippet being streamed by the code interpreter. - - - `ItemID string` - - The unique identifier of the code interpreter tool call item. - - - `OutputIndex int64` - - The index of the output item in the response for which the code is being streamed. - - - `SequenceNumber int64` - - The sequence number of this event, used to order streaming events. - - - `Type ResponseCodeInterpreterCallCodeDelta` - - The type of the event. Always `response.code_interpreter_call_code.delta`. - - - `const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"` - - - `Agent BetaResponseCodeInterpreterCallCodeDeltaEventAgent` - - The agent that owns this multi-agent streaming event. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Code Interpreter Call Code Done Event - -- `type BetaResponseCodeInterpreterCallCodeDoneEvent struct{…}` - - Emitted when the code snippet is finalized by the code interpreter. - - - `Code string` - - The final code snippet output by the code interpreter. - - - `ItemID string` - - The unique identifier of the code interpreter tool call item. - - - `OutputIndex int64` - - The index of the output item in the response for which the code is finalized. - - - `SequenceNumber int64` - - The sequence number of this event, used to order streaming events. - - - `Type ResponseCodeInterpreterCallCodeDone` - - The type of the event. Always `response.code_interpreter_call_code.done`. - - - `const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"` - - - `Agent BetaResponseCodeInterpreterCallCodeDoneEventAgent` - - The agent that owns this multi-agent streaming event. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Code Interpreter Call Completed Event - -- `type BetaResponseCodeInterpreterCallCompletedEvent struct{…}` - - Emitted when the code interpreter call is completed. - - - `ItemID string` - - The unique identifier of the code interpreter tool call item. - - - `OutputIndex int64` - - The index of the output item in the response for which the code interpreter call is completed. - - - `SequenceNumber int64` - - The sequence number of this event, used to order streaming events. - - - `Type ResponseCodeInterpreterCallCompleted` - - The type of the event. Always `response.code_interpreter_call.completed`. - - - `const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"` - - - `Agent BetaResponseCodeInterpreterCallCompletedEventAgent` - - The agent that owns this multi-agent streaming event. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Code Interpreter Call In Progress Event - -- `type BetaResponseCodeInterpreterCallInProgressEvent struct{…}` - - Emitted when a code interpreter call is in progress. - - - `ItemID string` - - The unique identifier of the code interpreter tool call item. - - - `OutputIndex int64` - - The index of the output item in the response for which the code interpreter call is in progress. - - - `SequenceNumber int64` - - The sequence number of this event, used to order streaming events. - - - `Type ResponseCodeInterpreterCallInProgress` - - The type of the event. Always `response.code_interpreter_call.in_progress`. - - - `const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"` - - - `Agent BetaResponseCodeInterpreterCallInProgressEventAgent` - - The agent that owns this multi-agent streaming event. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Code Interpreter Call Interpreting Event - -- `type BetaResponseCodeInterpreterCallInterpretingEvent struct{…}` - - Emitted when the code interpreter is actively interpreting the code snippet. - - - `ItemID string` - - The unique identifier of the code interpreter tool call item. - - - `OutputIndex int64` - - The index of the output item in the response for which the code interpreter is interpreting code. - - - `SequenceNumber int64` - - The sequence number of this event, used to order streaming events. - - - `Type ResponseCodeInterpreterCallInterpreting` + - `Type ResponseInProgress` - The type of the event. Always `response.code_interpreter_call.interpreting`. + The type of the event. Always `response.in_progress`. - - `const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"` + - `const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"` - - `Agent BetaResponseCodeInterpreterCallInterpretingEventAgent` + - `Agent BetaResponseInProgressEventAgent` The agent that owns this multi-agent streaming event. @@ -58345,154 +73210,46 @@ func main() { The canonical name of the agent that produced this item. -### Beta Response Code Interpreter Tool Call - -- `type BetaResponseCodeInterpreterToolCall 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 []BetaResponseCodeInterpreterToolCallOutputUnion` - - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. - - - `type BetaResponseCodeInterpreterToolCallOutputLogs 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 BetaResponseCodeInterpreterToolCallOutputImage 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 BetaResponseCodeInterpreterToolCallStatus` - - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - - `Type CodeInterpreterCall` - - The type of the code interpreter tool call. Always `code_interpreter_call`. - - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - - `Agent BetaResponseCodeInterpreterToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Compaction Item - -- `type BetaResponseCompactionItem struct{…}` - - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - - `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"` - - - `Agent BetaResponseCompactionItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `CreatedBy string` - - The identifier of the actor that created the item. - -### Beta Response Compaction Item Param - -- `type BetaResponseCompactionItemParamResp struct{…}` - - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). +### Beta Response Includable - - `EncryptedContent string` +- `type BetaResponseIncludable string` - The encrypted content of the compaction summary. + Specify additional output data to include in the model response. Currently supported values are: - - `Type Compaction` + - `web_search_call.results`: Include the search results of the web search tool call. + - `web_search_call.action.sources`: Include the sources of the web search tool call. + - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. + - `computer_call_output.output.image_url`: Include image urls from the computer call output. + - `file_search_call.results`: Include the search results of the file search tool call. + - `message.input_image.image_url`: Include image urls from the input message. + - `message.output_text.logprobs`: Include logprobs with assistant messages. + - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). - The type of the item. Always `compaction`. + - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` - - `const CompactionCompaction Compaction = "compaction"` + - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` - - `ID string` + - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` - The ID of the compaction item. + - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` - - `Agent BetaResponseCompactionItemParamAgentResp` + - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` - The agent that produced this item. + - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` - - `AgentName string` + - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` - The canonical name of the agent that produced this item. + - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` -### Beta Response Completed Event +### Beta Response Incomplete Event -- `type BetaResponseCompletedEvent struct{…}` +- `type BetaResponseIncompleteEvent struct{…}` - Emitted when the model response is complete. + An event that is emitted when a response finishes as incomplete. - `Response BetaResponse` - Properties of the completed response. + The response that was incomplete. - `ID string` @@ -58730,6 +73487,8 @@ func main() { - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + - `Type BetaEasyInputMessageType` The type of the message input. Always `message`. @@ -58977,6 +73736,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -60157,7 +74918,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -60214,7 +74979,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -60930,1233 +75699,215 @@ func main() { - `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 BetaCustomToolFormatUnion` - - The input format for the custom tool. Default is unconstrained text. - - - `type BetaCustomToolFormatText struct{…}` - - Unconstrained free-form text. - - - `Type Text` - - Unconstrained text format. Always `text`. - - - `const TextText Text = "text"` - - - `type BetaCustomToolFormatGrammar 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 BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - - `Type Grammar` - - Grammar format. Always `grammar`. - - - `const GrammarGrammar Grammar = "grammar"` - - - `type BetaNamespaceTool 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 []BetaNamespaceToolToolUnion` - - The function/custom tools available inside this namespace. - - - `type BetaNamespaceToolToolFunction struct{…}` - - - `Name string` - - - `Type Function` - - - `const FunctionFunction Function = "function"` - - - `AllowedCallers []string` - - The tool invocation context(s). - - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - - `DeferLoading bool` - - Whether this function should be deferred and discovered via tool search. - - - `Description string` - - - `OutputSchema map[string, any]` - - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - - `Parameters any` - - - `Strict bool` - - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - - `type BetaCustomTool struct{…}` - - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - - `Type Namespace` - - The type of the tool. Always `namespace`. - - - `const NamespaceNamespace Namespace = "namespace"` - - - `type BetaToolSearchTool 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 BetaToolSearchToolExecution` - - Whether tool search is executed by the server or by the client. - - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - - `Parameters any` - - Parameter schema for a client-executed tool search tool. - - - `type BetaWebSearchPreviewTool struct{…}` - - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `Type BetaWebSearchPreviewToolType` - - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - - `SearchContentTypes []string` - - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - 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 BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - - `UserLocation BetaWebSearchPreviewToolUserLocation` - - 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](https://en.wikipedia.org/wiki/ISO_3166-1) 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](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - - `type BetaApplyPatchTool 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"` - - - `AllowedCallers []string` - - The tool invocation context(s). - - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - - `Type ToolSearchOutput` - - The item type. Always `tool_search_output`. - - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - - `ID string` - - The unique ID of this tool search output. - - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `CallID string` - - The unique ID of the tool search call generated by the model. - - - `Execution BetaResponseToolSearchOutputItemParamExecution` - - Whether tool search was executed by the server or by the client. - - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - - `Status BetaResponseToolSearchOutputItemParamStatus` - - The status of the tool search output. - - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - - - `type BetaResponseInputItemAdditionalTools struct{…}` - - - `Role Developer` - - The role that provided the additional tools. Only `developer` is supported. - - - `const DeveloperDeveloper Developer = "developer"` - - - `Tools []BetaToolUnion` - - A list of additional tools made available at this item. - - - `type BetaFunctionTool struct{…}` - - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - - `type BetaFileSearchTool struct{…}` - - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - - `type BetaComputerTool struct{…}` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type BetaComputerUsePreviewTool struct{…}` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type BetaWebSearchTool struct{…}` - - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `type BetaToolMcp struct{…}` - - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - - `type BetaToolCodeInterpreter struct{…}` - - A tool that runs Python code to help generate a response to a prompt. - - - `type BetaToolProgrammaticToolCalling struct{…}` - - - `type BetaToolImageGeneration struct{…}` - - A tool that generates images using the GPT image models. - - - `type BetaToolLocalShell struct{…}` - - A tool that allows the model to execute shell commands in a local environment. - - - `type BetaFunctionShellTool struct{…}` - - A tool that allows the model to execute shell commands. - - - `type BetaCustomTool struct{…}` - - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - - `type BetaNamespaceTool struct{…}` - - Groups function/custom tools under a shared namespace. - - - `type BetaToolSearchTool struct{…}` - - Hosted or BYOT tool search configuration for deferred tools. - - - `type BetaWebSearchPreviewTool struct{…}` - - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `type BetaApplyPatchTool struct{…}` - - Allows the assistant to create, delete, or update files using unified diffs. - - - `Type AdditionalTools` - - The item type. Always `additional_tools`. - - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - - `ID string` - - The unique ID of this additional tools item. - - - `Agent BetaResponseInputItemAdditionalToolsAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). - - - `ID string` - - The unique identifier of the reasoning content. - - - `Summary []BetaResponseReasoningItemSummary` - - 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"` - - - `Agent BetaResponseReasoningItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Content []BetaResponseReasoningItemContent` - - 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 BetaResponseReasoningItemStatus` - - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - - `type BetaResponseCompactionItemParamResp struct{…}` - - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - - `EncryptedContent string` - - The encrypted content of the compaction summary. - - - `Type Compaction` - - The type of the item. Always `compaction`. - - - `const CompactionCompaction Compaction = "compaction"` - - - `ID string` - - The ID of the compaction item. - - - `Agent BetaResponseCompactionItemParamAgentResp` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseInputItemImageGenerationCall 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 BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - - - `Type ImageGenerationCall` - - The type of the image generation call. Always `image_generation_call`. - - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - - `Agent BetaResponseInputItemImageGenerationCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseCodeInterpreterToolCall 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 []BetaResponseCodeInterpreterToolCallOutputUnion` - - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. - - - `type BetaResponseCodeInterpreterToolCallOutputLogs 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 BetaResponseCodeInterpreterToolCallOutputImage 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 BetaResponseCodeInterpreterToolCallStatus` - - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - - `Type CodeInterpreterCall` - - The type of the code interpreter tool call. Always `code_interpreter_call`. - - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - - `Agent BetaResponseCodeInterpreterToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseInputItemLocalShellCall struct{…}` - - A tool call to run a command on the local shell. - - - `ID string` - - The unique ID of the local shell call. - - - `Action BetaResponseInputItemLocalShellCallAction` - - 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 BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - - - `Type LocalShellCall` - - The type of the local shell call. Always `local_shell_call`. - - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - - `Agent BetaResponseInputItemLocalShellCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseInputItemLocalShellCallOutput 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"` - - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Status string` - - The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - - - `type BetaResponseInputItemShellCall struct{…}` - - A tool representing a request to execute one or more shell commands. - - - `Action BetaResponseInputItemShellCallAction` - - The shell commands and limits that describe how to run the tool call. - - - `Commands []string` - - Ordered shell commands for the execution environment to run. - - - `MaxOutputLength int64` - - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - - `TimeoutMs int64` - - Maximum wall-clock time in milliseconds to allow the shell commands to run. - - - `CallID string` - - The unique ID of the shell tool call generated by the model. - - - `Type ShellCall` - - The type of the item. Always `shell_call`. - - - `const ShellCallShellCall ShellCall = "shell_call"` - - - `ID string` - - The unique ID of the shell tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemShellCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseInputItemShellCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - The caller type. Always `program`. - - - `const ProgramProgram Program = "program"` - - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - The environment to execute the shell commands in. - - - `type BetaLocalEnvironment struct{…}` - - - `type BetaContainerReference struct{…}` - - - `Status string` - - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - - - `type BetaResponseInputItemShellCallOutput struct{…}` - - The streamed output items emitted by a shell tool call. - - - `CallID string` - - The unique ID of the shell tool call generated by the model. - - - `Output []BetaResponseFunctionShellCallOutputContent` - - Captured chunks of stdout and stderr output, along with their associated outcomes. - - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - The exit or timeout outcome associated with this shell call. - - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - - Indicates that the shell call exceeded its configured time limit. - - - `Type Timeout` - - The outcome type. Always `timeout`. - - - `const TimeoutTimeout Timeout = "timeout"` - - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - Indicates that the shell commands finished and returned an exit code. - - - `ExitCode int64` - - The exit code returned by the shell process. - - - `Type Exit` - - The outcome type. Always `exit`. - - - `const ExitExit Exit = "exit"` - - - `Stderr string` - - Captured stderr output for the shell call. - - - `Stdout string` - - Captured stdout output for the shell call. - - - `Type ShellCallOutput` - - The type of the item. Always `shell_call_output`. - - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - - `ID string` - - The unique ID of the shell tool call output. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemShellCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - The caller type. Always `program`. - - - `const ProgramProgram Program = "program"` - - - `MaxOutputLength int64` - - The maximum number of UTF-8 characters captured for this shell call's combined output. - - - `Status string` - - The status of the shell call output. - - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - - - `type BetaResponseInputItemApplyPatchCall struct{…}` - - A tool call representing a request to create, delete, or update files using diff patches. - - - `CallID string` - - The unique ID of the apply patch tool call generated by the model. - - - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - - The specific create, delete, or update instruction for the apply_patch tool call. - - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - - Instruction for creating a new file via the apply_patch tool. - - - `Diff string` - - Unified diff content to apply when creating the file. - - - `Path string` - - Path of the file to create relative to the workspace root. - - - `Type CreateFile` - - The operation type. Always `create_file`. - - - `const CreateFileCreateFile CreateFile = "create_file"` - - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - - Instruction for deleting an existing file via the apply_patch tool. - - - `Path string` - - Path of the file to delete relative to the workspace root. - - - `Type DeleteFile` - - The operation type. Always `delete_file`. - - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - - Instruction for updating an existing file via the apply_patch tool. - - - `Diff string` - - Unified diff content to apply to the existing file. - - - `Path string` - - Path of the file to update relative to the workspace root. - - - `Type UpdateFile` - - The operation type. Always `update_file`. - - - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - - `Status string` - - The status of the apply patch tool call. One of `in_progress` or `completed`. - - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - - - `Type ApplyPatchCall` - - The type of the item. Always `apply_patch_call`. - - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - - `ID string` - - The unique ID of the apply patch tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemApplyPatchCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - The caller type. Always `program`. - - - `const ProgramProgram Program = "program"` - - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - - The streamed output emitted by an apply patch tool call. - - - `CallID string` - - The unique ID of the apply patch tool call generated by the model. - - - `Status string` - - The status of the apply patch tool call output. One of `completed` or `failed`. - - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - - - `Type ApplyPatchCallOutput` - - The type of the item. Always `apply_patch_call_output`. - - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - - `ID string` - - The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - The caller type. Always `program`. - - - `const ProgramProgram Program = "program"` - - - `Output string` - - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - - `type BetaResponseInputItemMcpListTools 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 []BetaResponseInputItemMcpListToolsTool` + Whether this tool should be deferred and discovered via tool search. - The tools available on the server. + - `Description string` - - `InputSchema any` + Optional description of the custom tool, used to provide more context. - The JSON schema describing the tool's input. + - `Format BetaCustomToolFormatUnion` - - `Name string` + The input format for the custom tool. Default is unconstrained text. - The name of the tool. + - `type BetaCustomToolFormatText struct{…}` - - `Annotations any` + Unconstrained free-form text. - Additional annotations about the tool. + - `Type Text` - - `Description string` + Unconstrained text format. Always `text`. - The description of the tool. + - `const TextText Text = "text"` - - `Type McpListTools` + - `type BetaCustomToolFormatGrammar struct{…}` - The type of the item. Always `mcp_list_tools`. + A grammar defined by the user. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `Definition string` - - `Agent BetaResponseInputItemMcpListToolsAgent` + The grammar definition. - The agent that produced this item. + - `Syntax string` - - `AgentName string` + The syntax of the grammar definition. One of `lark` or `regex`. - The canonical name of the agent that produced this item. + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `Error string` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - Error message if the server could not list tools. + - `Type Grammar` - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + Grammar format. Always `grammar`. - A request for human approval of a tool invocation. + - `const GrammarGrammar Grammar = "grammar"` - - `ID string` + - `type BetaNamespaceTool struct{…}` - The unique ID of the approval request. + Groups function/custom tools under a shared namespace. - - `Arguments string` + - `Description string` - A JSON string of arguments for the tool. + A description of the namespace shown to the model. - `Name string` - The name of the tool to run. + The namespace name used in tool calls (for example, `crm`). - - `ServerLabel string` + - `Tools []BetaNamespaceToolToolUnion` - The label of the MCP server making the request. + The function/custom tools available inside this namespace. - - `Type McpApprovalRequest` + - `type BetaNamespaceToolToolFunction struct{…}` - The type of the item. Always `mcp_approval_request`. + - `Name string` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `Type Function` - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `const FunctionFunction Function = "function"` - The agent that produced this item. + - `AllowedCallers []string` - - `AgentName string` + The tool invocation context(s). - The canonical name of the agent that produced this item. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - A response to an MCP approval request. + - `DeferLoading bool` - - `ApprovalRequestID string` + Whether this function should be deferred and discovered via tool search. - The ID of the approval request being answered. + - `Description string` - - `Approve bool` + - `OutputSchema map[string, any]` - Whether the request was approved. + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `Type McpApprovalResponse` + - `Parameters any` - The type of the item. Always `mcp_approval_response`. + - `Strict bool` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `ID string` + - `type BetaCustomTool struct{…}` - The unique ID of the approval response + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `Type Namespace` - The agent that produced this item. + The type of the tool. Always `namespace`. - - `AgentName string` + - `const NamespaceNamespace Namespace = "namespace"` - The canonical name of the agent that produced this item. + - `type BetaToolSearchTool struct{…}` - - `Reason string` + Hosted or BYOT tool search configuration for deferred tools. - Optional reason for the decision. + - `Type ToolSearch` - - `type BetaResponseInputItemMcpCall struct{…}` + The type of the tool. Always `tool_search`. - An invocation of a tool on an MCP server. + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `ID string` + - `Description string` - The unique ID of the tool call. + Description shown to the model for a client-executed tool search tool. - - `Arguments string` + - `Execution BetaToolSearchToolExecution` - A JSON string of the arguments passed to the tool. + Whether tool search is executed by the server or by the client. - - `Name string` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - The name of the tool that was run. + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `ServerLabel string` + - `Parameters any` - The label of the MCP server running the tool. + Parameter schema for a client-executed tool search tool. - - `Type McpCall` + - `type BetaWebSearchPreviewTool struct{…}` - The type of the item. Always `mcp_call`. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const McpCallMcpCall McpCall = "mcp_call"` + - `Type BetaWebSearchPreviewToolType` - - `Agent BetaResponseInputItemMcpCallAgent` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The agent that produced this item. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `AgentName string` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - The canonical name of the agent that produced this item. + - `SearchContentTypes []string` - - `ApprovalRequestID string` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - 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. + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `Error string` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - The error from the tool call, if any. + 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. - - `Output string` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - The output from the tool call. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `Status string` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + The user's location. - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + - `Type Approximate` - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + The type of location approximation. Always `approximate`. - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + - `const ApproximateApproximate Approximate = "approximate"` - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + - `City string` - - `type BetaResponseCustomToolCallOutput struct{…}` + Free text input for the city of the user, e.g. `San Francisco`. - The output of a custom tool call from your code, being sent back to the model. + - `Country string` - - `CallID string` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The call ID, used to map this custom tool call output to a custom tool call. + - `Region string` - - `Output BetaResponseCustomToolCallOutputOutputUnion` + Free text input for the region of the user, e.g. `California`. - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + - `Timezone string` - - `string` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + - `type BetaApplyPatchTool struct{…}` - Text, image, or file output of the custom tool call. + Allows the assistant to create, delete, or update files using unified diffs. - - `type BetaResponseInputText struct{…}` + - `Type ApplyPatch` - A text input to the model. + The type of the tool. Always `apply_patch`. - - `type BetaResponseInputImage struct{…}` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `AllowedCallers []string` - - `type BetaResponseInputFile struct{…}` + The tool invocation context(s). - A file input to the model. + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - - `Type CustomToolCallOutput` + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - The type of the custom tool call output. Always `custom_tool_call_output`. + - `Type ToolSearchOutput` - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + The item type. Always `tool_search_output`. + + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - `ID string` - The unique ID of the custom tool call output in the OpenAI platform. + The unique ID of this tool search output. - - `Agent BetaResponseCustomToolCallOutputAgent` + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` The agent that produced this item. @@ -62164,115 +75915,115 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - The execution context that produced this tool call. + - `CallID string` - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + The unique ID of the tool search call generated by the model. - - `Type Direct` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - The caller type. Always `direct`. + Whether tool search was executed by the server or by the client. - - `const DirectDirect Direct = "direct"` + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - `CallerID string` + - `Status BetaResponseToolSearchOutputItemParamStatus` - The call ID of the program item that produced this tool call. + The status of the tool search output. - - `Type Program` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - The caller type. Always `program`. + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - - `type BetaResponseCustomToolCall struct{…}` + - `type BetaResponseInputItemAdditionalTools struct{…}` - A call to a custom tool created by the model. + - `Role Developer` - - `CallID string` + The role that provided the additional tools. Only `developer` is supported. - An identifier used to map this custom tool call to a tool call output. + - `const DeveloperDeveloper Developer = "developer"` - - `Input string` + - `Tools []BetaToolUnion` - The input for the custom tool call generated by the model. + A list of additional tools made available at this item. - - `Name string` + - `type BetaFunctionTool struct{…}` - The name of the custom tool being called. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Type CustomToolCall` + - `type BetaFileSearchTool struct{…}` - The type of the custom tool call. Always `custom_tool_call`. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `type BetaComputerTool struct{…}` - - `ID string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The unique ID of the custom tool call in the OpenAI platform. + - `type BetaComputerUsePreviewTool struct{…}` - - `Agent BetaResponseCustomToolCallAgent` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The agent that produced this item. + - `type BetaWebSearchTool struct{…}` - - `AgentName string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The canonical name of the agent that produced this item. + - `type BetaToolMcp struct{…}` - - `Caller BetaResponseCustomToolCallCallerUnion` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The execution context that produced this tool call. + - `type BetaToolCodeInterpreter struct{…}` - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + A tool that runs Python code to help generate a response to a prompt. - - `Type Direct` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `const DirectDirect Direct = "direct"` + - `type BetaToolImageGeneration struct{…}` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + A tool that generates images using the GPT image models. - - `CallerID string` + - `type BetaToolLocalShell struct{…}` - The call ID of the program item that produced this tool call. + A tool that allows the model to execute shell commands in a local environment. - - `Type Program` + - `type BetaFunctionShellTool struct{…}` - - `const ProgramProgram Program = "program"` + A tool that allows the model to execute shell commands. - - `Namespace string` + - `type BetaCustomTool struct{…}` - The namespace of the custom tool being called. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `type BetaResponseInputItemCompactionTrigger struct{…}` + - `type BetaNamespaceTool struct{…}` - Compacts the current context. Must be the final input item. + Groups function/custom tools under a shared namespace. - - `Type CompactionTrigger` + - `type BetaToolSearchTool struct{…}` - The type of the item. Always `compaction_trigger`. + Hosted or BYOT tool search configuration for deferred tools. - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `type BetaWebSearchPreviewTool struct{…}` - - `Agent BetaResponseInputItemCompactionTriggerAgent` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The agent that produced this item. + - `type BetaApplyPatchTool struct{…}` - - `AgentName string` + Allows the assistant to create, delete, or update files using unified diffs. - The canonical name of the agent that produced this item. + - `Type AdditionalTools` - - `type BetaResponseInputItemItemReference struct{…}` + The item type. Always `additional_tools`. - An internal identifier for an item to reference. + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - `ID string` - The ID of the item to reference. + The unique ID of this additional tools item. - - `Agent BetaResponseInputItemItemReferenceAgent` + - `Agent BetaResponseInputItemAdditionalToolsAgent` The agent that produced this item. @@ -62280,37 +76031,38 @@ func main() { The canonical name of the agent that produced this item. - - `Type string` - - The type of item to reference. Always `item_reference`. - - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + - `type BetaResponseReasoningItem struct{…}` - - `type BetaResponseInputItemProgram 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](https://platform.openai.com/docs/guides/conversation-state). - `ID string` - The unique ID of this program item. + The unique identifier of the reasoning content. - - `CallID string` + - `Summary []BetaResponseReasoningItemSummary` - The stable call ID of the program item. + Reasoning summary content. - - `Code string` + - `Text string` - The JavaScript source executed by programmatic tool calling. + A summary of the reasoning output from the model so far. - - `Fingerprint string` + - `Type SummaryText` - Opaque program replay fingerprint that must be round-tripped. + The type of the object. Always `summary_text`. - - `Type Program` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - The item type. Always `program`. + - `Type Reasoning` - - `const ProgramProgram Program = "program"` + The type of the object. Always `reasoning`. - - `Agent BetaResponseInputItemProgramAgent` + - `const ReasoningReasoning Reasoning = "reasoning"` + + - `Agent BetaResponseReasoningItemAgent` The agent that produced this item. @@ -62318,339 +76070,314 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemProgramOutput struct{…}` - - - `ID string` - - The unique ID of this program output item. - - - `CallID string` - - The call ID of the program item. - - - `Result string` + - `Content []BetaResponseReasoningItemContent` - The result produced by the program item. + Reasoning text content. - - `Status string` + - `Text string` - The terminal status of the program output. + The reasoning text from the model. - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `Type ReasoningText` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + The type of the reasoning text. Always `reasoning_text`. - - `Type ProgramOutput` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - The item type. Always `program_output`. + - `EncryptedContent string` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `Agent BetaResponseInputItemProgramOutputAgent` + - `Status BetaResponseReasoningItemStatus` - The agent that produced this item. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `AgentName string` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - The canonical name of the agent that produced this item. + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `Metadata map[string, string]` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - 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. + - `type BetaResponseCompactionItemParamResp struct{…}` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `Model BetaResponseModel` + - `EncryptedContent string` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + The encrypted content of the compaction summary. - - `type BetaResponseModel string` + - `Type Compaction` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + The type of the item. Always `compaction`. - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + - `const CompactionCompaction Compaction = "compaction"` - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + - `ID string` - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + The ID of the compaction item. - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + - `Agent BetaResponseCompactionItemParamAgentResp` - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + The agent that produced this item. - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + - `AgentName string` - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + An image generation request made by the model. - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + - `ID string` - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + The unique ID of the image generation call. - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + - `Result string` - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + The generated image encoded in base64. - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + - `Status string` - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + The status of the image generation call. - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + - `Type ImageGenerationCall` - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + The type of the image generation call. Always `image_generation_call`. - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + - `Agent BetaResponseInputItemImageGenerationCallAgent` - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + The agent that produced this item. - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + - `AgentName string` - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + A tool call to run code. - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + - `ID string` - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + The unique ID of the code interpreter tool call. - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + - `Code string` - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + The code to run, or null if not available. - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + - `ContainerID string` - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + The ID of the container used to run the code. - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + The logs output from the code interpreter. - - `const BetaResponseModelO1 BetaResponseModel = "o1"` + - `Logs string` - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + The logs output from the code interpreter. - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + - `Type Logs` - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + The type of the output. Always `logs`. - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + - `const LogsLogs Logs = "logs"` - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + The image output from the code interpreter. - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + - `Type Image` - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + The type of the output. Always `image`. - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + - `const ImageImage Image = "image"` - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + - `URL string` - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + The URL of the image output from the code interpreter. - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `Type CodeInterpreterCall` - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + The agent that produced this item. - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + - `AgentName string` - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + - `type BetaResponseInputItemLocalShellCall struct{…}` - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + A tool call to run a command on the local shell. - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + - `ID string` - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + The unique ID of the local shell call. - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + - `Action BetaResponseInputItemLocalShellCallAction` - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + Execute a shell command on the server. - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + - `Command []string` - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + The command to run. - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + - `Env map[string, string]` - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + Environment variables to set for the command. - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + - `Type Exec` - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + The type of the local shell action. Always `exec`. - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + - `const ExecExec Exec = "exec"` - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + - `TimeoutMs int64` - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + Optional timeout in milliseconds for the command. - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + - `User string` - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + Optional user to run the command as. - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + - `WorkingDirectory string` - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + Optional working directory to run the command in. - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + - `CallID string` - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + The unique ID of the local shell tool call generated by the model. - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + - `Status string` - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + The status of the local shell call. - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + - `Type LocalShellCall` - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + The type of the local shell call. Always `local_shell_call`. - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + - `Agent BetaResponseInputItemLocalShellCallAgent` - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + The agent that produced this item. - - `string` + - `AgentName string` - - `Object Response` + The canonical name of the agent that produced this item. - The object type of this resource - always set to `response`. + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `const ResponseResponse Response = "response"` + The output of a local shell tool call. - - `Output []BetaResponseOutputItemUnion` + - `ID string` - An array of content items generated by the model. + The unique ID of the local shell tool call generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + - `Output string` - - `type BetaResponseOutputMessage struct{…}` + A JSON string of the output of the local shell tool call. - An output message from the model. + - `Type LocalShellCallOutput` - - `type BetaResponseFileSearchToolCall struct{…}` + The type of the local shell tool call output. Always `local_shell_call_output`. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `type BetaResponseFunctionToolCall struct{…}` + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + The agent that produced this item. - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - The unique ID of the function call tool output. + - `Status string` - - `CallID string` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - The unique ID of the function tool call generated by the model. + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - The output from the function call generated by your code. - Can be a string or an list of output content. + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - - `string` + - `type BetaResponseInputItemShellCall struct{…}` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + A tool representing a request to execute one or more shell commands. - Text, image, or file output of the function call. + - `Action BetaResponseInputItemShellCallAction` - - `type BetaResponseInputText struct{…}` + The shell commands and limits that describe how to run the tool call. - A text input to the model. + - `Commands []string` - - `type BetaResponseInputImage struct{…}` + Ordered shell commands for the execution environment to run. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `MaxOutputLength int64` - - `type BetaResponseInputFile struct{…}` + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - A file input to the model. + - `TimeoutMs int64` - - `Status BetaResponseFunctionToolCallOutputItemStatus` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `CallID string` - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + The unique ID of the shell tool call generated by the model. - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + - `Type ShellCall` - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + The type of the item. Always `shell_call`. - - `Type FunctionCallOutput` + - `const ShellCallShellCall ShellCall = "shell_call"` - The type of the function tool call output. Always `function_call_output`. + - `ID string` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + The unique ID of the shell tool call. Populated when this item is returned via API. - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `Agent BetaResponseInputItemShellCallAgent` The agent that produced this item. @@ -62658,11 +76385,11 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `Caller BetaResponseInputItemShellCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - `Type Direct` @@ -62670,7 +76397,7 @@ func main() { - `const DirectDirect Direct = "direct"` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - `CallerID string` @@ -62682,360 +76409,341 @@ func main() { - `const ProgramProgram Program = "program"` - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - `ID string` + The environment to execute the shell commands in. - The unique ID of the agent message. + - `type BetaLocalEnvironment struct{…}` - - `Author string` + - `type BetaContainerReference struct{…}` - The sending agent identity. + - `Status string` - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - Encrypted content sent between agents. + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - - `type BetaResponseInputText struct{…}` + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - A text input to the model. + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - - `type BetaResponseOutputText struct{…}` + - `type BetaResponseInputItemShellCallOutput struct{…}` - A text output from the model. + The streamed output items emitted by a shell tool call. - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + - `CallID string` - A text content. + The unique ID of the shell tool call generated by the model. - - `Text string` + - `Output []BetaResponseFunctionShellCallOutputContent` - - `Type Text` + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `const TextText Text = "text"` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + The exit or timeout outcome associated with this shell call. - A summary text from the model. + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - - `Text string` + Indicates that the shell call exceeded its configured time limit. - A summary of the reasoning output from the model so far. + - `Type Timeout` - - `Type SummaryText` + The outcome type. Always `timeout`. - The type of the object. Always `summary_text`. + - `const TimeoutTimeout Timeout = "timeout"` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + Indicates that the shell commands finished and returned an exit code. - Reasoning text from the model. + - `ExitCode int64` - - `Text string` + The exit code returned by the shell process. - The reasoning text from the model. + - `Type Exit` - - `Type ReasoningText` + The outcome type. Always `exit`. - The type of the reasoning text. Always `reasoning_text`. + - `const ExitExit Exit = "exit"` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Stderr string` - - `type BetaResponseOutputRefusal struct{…}` + Captured stderr output for the shell call. - A refusal from the model. + - `Stdout string` - - `type BetaResponseInputImage struct{…}` + Captured stdout output for the shell call. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Type ShellCallOutput` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + The type of the item. Always `shell_call_output`. - A screenshot of a computer. + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `Detail string` + - `ID string` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `Agent BetaResponseInputItemShellCallOutputAgent` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + The agent that produced this item. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `AgentName string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + The canonical name of the agent that produced this item. - - `FileID string` + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - The identifier of an uploaded file that contains the screenshot. + The execution context that produced this tool call. - - `ImageURL string` + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - The URL of the screenshot image. + - `Type Direct` - - `Type ComputerScreenshot` + The caller type. Always `direct`. - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `const DirectDirect Direct = "direct"` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `CallerID string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The call ID of the program item that produced this tool call. - - `Mode Explicit` + - `Type Program` - The breakpoint mode. Always `explicit`. + The caller type. Always `program`. - - `const ExplicitExplicit Explicit = "explicit"` + - `const ProgramProgram Program = "program"` - - `type BetaResponseInputFile struct{…}` + - `MaxOutputLength int64` - A file input to the model. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + - `Status string` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The status of the shell call output. - - `EncryptedContent string` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - Opaque encrypted content. + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - - `Type EncryptedContent` + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - The type of the input item. Always `encrypted_content`. + - `type BetaResponseInputItemApplyPatchCall struct{…}` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + A tool call representing a request to create, delete, or update files using diff patches. - - `Recipient string` + - `CallID string` - The destination agent identity. + The unique ID of the apply patch tool call generated by the model. - - `Type AgentMessage` + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - The type of the item. Always `agent_message`. + The specific create, delete, or update instruction for the apply_patch tool call. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - - `Agent BetaResponseOutputItemAgentMessageAgent` + Instruction for creating a new file via the apply_patch tool. - The agent that produced this item. + - `Diff string` - - `AgentName string` + Unified diff content to apply when creating the file. - The canonical name of the agent that produced this item. + - `Path string` - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + Path of the file to create relative to the workspace root. - - `ID string` + - `Type CreateFile` - The unique ID of the multi-agent call item. + The operation type. Always `create_file`. - - `Action string` + - `const CreateFileCreateFile CreateFile = "create_file"` - The multi-agent action to execute. + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + Instruction for deleting an existing file via the apply_patch tool. - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + - `Path string` - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + Path of the file to delete relative to the workspace root. - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + - `Type DeleteFile` - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + The operation type. Always `delete_file`. - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `Arguments string` + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - The JSON string of arguments generated for the action. + Instruction for updating an existing file via the apply_patch tool. - - `CallID string` + - `Diff string` - The unique ID linking this call to its output. + Unified diff content to apply to the existing file. - - `Type MultiAgentCall` + - `Path string` - The type of the multi-agent call. Always `multi_agent_call`. + Path of the file to update relative to the workspace root. - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `Type UpdateFile` - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + The operation type. Always `update_file`. - The agent that produced this item. + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `AgentName string` + - `Status string` - The canonical name of the agent that produced this item. + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `ID string` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - The unique ID of the multi-agent call output item. + - `Type ApplyPatchCall` - - `Action string` + The type of the item. Always `apply_patch_call`. - The multi-agent action that produced this result. + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + - `ID string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + - `Agent BetaResponseInputItemApplyPatchCallAgent` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + The agent that produced this item. - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + - `AgentName string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + The canonical name of the agent that produced this item. - - `CallID string` + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - The unique ID of the multi-agent call. + The execution context that produced this tool call. - - `Output []BetaResponseOutputText` + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - Text output returned by the multi-agent action. + - `Type Direct` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The caller type. Always `direct`. - The annotations of the text output. + - `const DirectDirect Direct = "direct"` - - `Text string` + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - The text output from the model. + - `CallerID string` - - `Type OutputText` + The call ID of the program item that produced this tool call. - The type of the output text. Always `output_text`. + - `Type Program` - - `Logprobs []BetaResponseOutputTextLogprob` + The caller type. Always `program`. - - `Type MultiAgentCallOutput` + - `const ProgramProgram Program = "program"` - The type of the multi-agent result. Always `multi_agent_call_output`. + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + The streamed output emitted by an apply patch tool call. - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `CallID string` - The agent that produced this item. + The unique ID of the apply patch tool call generated by the model. - - `AgentName string` + - `Status string` - The canonical name of the agent that produced this item. + The status of the apply patch tool call output. One of `completed` or `failed`. - - `type BetaResponseFunctionWebSearch struct{…}` + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - - `type BetaResponseComputerToolCall struct{…}` + - `Type ApplyPatchCallOutput` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + The type of the item. Always `apply_patch_call_output`. - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - `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 BetaResponseComputerToolCallOutputScreenshot` - - A computer screenshot image used with the computer use tool. + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + The agent that produced this item. - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `AgentName string` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + The canonical name of the agent that produced this item. - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + The execution context that produced this tool call. - - `Type ComputerCallOutput` + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - The type of the computer tool call output. Always `computer_call_output`. + - `Type Direct` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + The caller type. Always `direct`. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `const DirectDirect Direct = "direct"` - The safety checks reported by the API that have been acknowledged by the - developer. + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - - `ID string` + - `CallerID string` - The ID of the pending safety check. + The call ID of the program item that produced this tool call. - - `Code string` + - `Type Program` - The type of the pending safety check. + The caller type. Always `program`. - - `Message string` + - `const ProgramProgram Program = "program"` - Details about the pending safety check. + - `Output string` - - `Agent BetaResponseComputerToolCallOutputItemAgent` + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - The agent that produced this item. + - `type BetaResponseInputItemMcpListTools struct{…}` - - `AgentName string` + A list of tools available on an MCP server. - The canonical name of the agent that produced this item. + - `ID string` - - `CreatedBy string` + The unique ID of the list. - The identifier of the actor that created the item. + - `ServerLabel string` - - `type BetaResponseReasoningItem struct{…}` + The label of the MCP server. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `Tools []BetaResponseInputItemMcpListToolsTool` - - `type BetaResponseOutputItemProgram struct{…}` + The tools available on the server. - - `ID string` + - `InputSchema any` - The unique ID of the program item. + The JSON schema describing the tool's input. - - `CallID string` + - `Name string` - The stable call ID of the program item. + The name of the tool. - - `Code string` + - `Annotations any` - The JavaScript source executed by programmatic tool calling. + Additional annotations about the tool. - - `Fingerprint string` + - `Description string` - Opaque program replay fingerprint that must be round-tripped. + The description of the tool. - - `Type Program` + - `Type McpListTools` - The type of the item. Always `program`. + The type of the item. Always `mcp_list_tools`. - - `const ProgramProgram Program = "program"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Agent BetaResponseOutputItemProgramAgent` + - `Agent BetaResponseInputItemMcpListToolsAgent` The agent that produced this item. @@ -63043,35 +76751,37 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `Error string` - - `ID string` + Error message if the server could not list tools. - The unique ID of the program output item. + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - - `CallID string` + A request for human approval of a tool invocation. - The call ID of the program item. + - `ID string` - - `Result string` + The unique ID of the approval request. - The result produced by the program item. + - `Arguments string` - - `Status string` + A JSON string of arguments for the tool. - The terminal status of the program output item. + - `Name string` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + The name of the tool to run. - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + - `ServerLabel string` - - `Type ProgramOutput` + The label of the MCP server making the request. - The type of the item. Always `program_output`. + - `Type McpApprovalRequest` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + The type of the item. Always `mcp_approval_request`. - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` The agent that produced this item. @@ -63079,45 +76789,29 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseToolSearchCall 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 BetaResponseToolSearchCallExecution` - - Whether tool search was executed by the server or by the client. + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + A response to an MCP approval request. - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `ApprovalRequestID string` - - `Status BetaResponseToolSearchCallStatus` + The ID of the approval request being answered. - The status of the tool search call item that was recorded. + - `Approve bool` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + Whether the request was approved. - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `Type McpApprovalResponse` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + The type of the item. Always `mcp_approval_response`. - - `Type ToolSearchCall` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - The type of the item. Always `tool_search_call`. + - `ID string` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + The unique ID of the approval response - - `Agent BetaResponseToolSearchCallAgent` + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` The agent that produced this item. @@ -63125,113 +76819,113 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` + - `Reason string` - The identifier of the actor that created the item. + Optional reason for the decision. - - `type BetaResponseToolSearchOutputItem struct{…}` + - `type BetaResponseInputItemMcpCall struct{…}` - - `ID string` + An invocation of a tool on an MCP server. - The unique ID of the tool search output item. + - `ID string` - - `CallID string` + The unique ID of the tool call. - The unique ID of the tool search call generated by the model. + - `Arguments string` - - `Execution BetaResponseToolSearchOutputItemExecution` + A JSON string of the arguments passed to the tool. - Whether tool search was executed by the server or by the client. + - `Name string` - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + The name of the tool that was run. - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `ServerLabel string` - - `Status BetaResponseToolSearchOutputItemStatus` + The label of the MCP server running the tool. - The status of the tool search output item that was recorded. + - `Type McpCall` - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + The type of the item. Always `mcp_call`. - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `const McpCallMcpCall McpCall = "mcp_call"` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + - `Agent BetaResponseInputItemMcpCallAgent` - - `Tools []BetaToolUnion` + The agent that produced this item. - The loaded tool definitions returned by tool search. + - `AgentName string` - - `type BetaFunctionTool struct{…}` + The canonical name of the agent that produced this item. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `ApprovalRequestID string` - - `type BetaFileSearchTool struct{…}` + 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. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `Error string` - - `type BetaComputerTool struct{…}` + The error from the tool call, if any. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Output string` - - `type BetaComputerUsePreviewTool struct{…}` + The output from the tool call. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Status string` - - `type BetaWebSearchTool struct{…}` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - `type BetaToolMcp struct{…}` + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - - `type BetaToolCodeInterpreter struct{…}` + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - A tool that runs Python code to help generate a response to a prompt. + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `type BetaResponseCustomToolCallOutput struct{…}` - - `type BetaToolImageGeneration struct{…}` + The output of a custom tool call from your code, being sent back to the model. - A tool that generates images using the GPT image models. + - `CallID string` - - `type BetaToolLocalShell struct{…}` + The call ID, used to map this custom tool call output to a custom tool call. - A tool that allows the model to execute shell commands in a local environment. + - `Output BetaResponseCustomToolCallOutputOutputUnion` - - `type BetaFunctionShellTool struct{…}` + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - A tool that allows the model to execute shell commands. + - `string` - - `type BetaCustomTool struct{…}` + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + Text, image, or file output of the custom tool call. - - `type BetaNamespaceTool struct{…}` + - `type BetaResponseInputText struct{…}` - Groups function/custom tools under a shared namespace. + A text input to the model. - - `type BetaToolSearchTool struct{…}` + - `type BetaResponseInputImage struct{…}` - Hosted or BYOT tool search configuration for deferred tools. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `type BetaWebSearchPreviewTool struct{…}` + - `type BetaResponseInputFile struct{…}` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + A file input to the model. - - `type BetaApplyPatchTool struct{…}` + - `Type CustomToolCallOutput` - Allows the assistant to create, delete, or update files using unified diffs. + The type of the custom tool call output. Always `custom_tool_call_output`. - - `Type ToolSearchOutput` + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - The type of the item. Always `tool_search_output`. + - `ID string` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + The unique ID of the custom tool call output in the OpenAI platform. - - `Agent BetaResponseToolSearchOutputItemAgent` + - `Agent BetaResponseCustomToolCallOutputAgent` The agent that produced this item. @@ -63239,111 +76933,115 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - The identifier of the actor that created the item. + The execution context that produced this tool call. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - - `ID string` + - `Type Direct` - The unique ID of the additional tools item. + The caller type. Always `direct`. - - `Role string` + - `const DirectDirect Direct = "direct"` - The role that provided the additional tools. + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + - `CallerID string` - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + The call ID of the program item that produced this tool call. - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + - `Type Program` - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + The caller type. Always `program`. - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + - `type BetaResponseCustomToolCall struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + A call to a custom tool created by the model. - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + - `CallID string` - - `Tools []BetaToolUnion` + An identifier used to map this custom tool call to a tool call output. - The additional tool definitions made available at this item. + - `Input string` - - `type BetaFunctionTool struct{…}` + The input for the custom tool call generated by the model. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Name string` - - `type BetaFileSearchTool struct{…}` + The name of the custom tool being called. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `Type CustomToolCall` - - `type BetaComputerTool struct{…}` + The type of the custom tool call. Always `custom_tool_call`. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `type BetaComputerUsePreviewTool struct{…}` + - `ID string` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The unique ID of the custom tool call in the OpenAI platform. - - `type BetaWebSearchTool struct{…}` + - `Agent BetaResponseCustomToolCallAgent` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The agent that produced this item. - - `type BetaToolMcp struct{…}` + - `AgentName string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The canonical name of the agent that produced this item. - - `type BetaToolCodeInterpreter struct{…}` + - `Caller BetaResponseCustomToolCallCallerUnion` - A tool that runs Python code to help generate a response to a prompt. + The execution context that produced this tool call. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - `type BetaToolImageGeneration struct{…}` + - `Type Direct` - A tool that generates images using the GPT image models. + - `const DirectDirect Direct = "direct"` - - `type BetaToolLocalShell struct{…}` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - A tool that allows the model to execute shell commands in a local environment. + - `CallerID string` - - `type BetaFunctionShellTool struct{…}` + The call ID of the program item that produced this tool call. - A tool that allows the model to execute shell commands. + - `Type Program` - - `type BetaCustomTool struct{…}` + - `const ProgramProgram Program = "program"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Namespace string` - - `type BetaNamespaceTool struct{…}` + The namespace of the custom tool being called. - Groups function/custom tools under a shared namespace. + - `type BetaResponseInputItemCompactionTrigger struct{…}` - - `type BetaToolSearchTool struct{…}` + Compacts the current context. Must be the final input item. - Hosted or BYOT tool search configuration for deferred tools. + - `Type CompactionTrigger` - - `type BetaWebSearchPreviewTool struct{…}` + The type of the item. Always `compaction_trigger`. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `type BetaApplyPatchTool struct{…}` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - Allows the assistant to create, delete, or update files using unified diffs. + The agent that produced this item. - - `Type AdditionalTools` + - `AgentName string` - The type of the item. Always `additional_tools`. + The canonical name of the agent that produced this item. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `type BetaResponseInputItemItemReference struct{…}` - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + An internal identifier for an item to reference. + + - `ID string` + + The ID of the item to reference. + + - `Agent BetaResponseInputItemItemReferenceAgent` The agent that produced this item. @@ -63351,25 +77049,37 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseCompactionItem struct{…}` + - `Type string` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The type of item to reference. Always `item_reference`. + + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + + - `type BetaResponseInputItemProgram struct{…}` - `ID string` - The unique ID of the compaction item. + The unique ID of this program item. - - `EncryptedContent string` + - `CallID string` - The encrypted content that was produced by compaction. + The stable call ID of the program item. - - `Type Compaction` + - `Code string` - The type of the item. Always `compaction`. + The JavaScript source executed by programmatic tool calling. - - `const CompactionCompaction Compaction = "compaction"` + - `Fingerprint string` - - `Agent BetaResponseCompactionItemAgent` + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The item type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseInputItemProgramAgent` The agent that produced this item. @@ -63377,41 +77087,35 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` - - The identifier of the actor that created the item. + - `type BetaResponseInputItemProgramOutput struct{…}` - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `ID string` - An image generation request made by the model. + The unique ID of this program output item. - - `ID string` + - `CallID string` - The unique ID of the image generation call. + The call ID of the program item. - `Result string` - The generated image encoded in base64. + The result produced by the program item. - `Status string` - The status of the image generation call. - - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + The terminal status of the program output. - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - - `Type ImageGenerationCall` + - `Type ProgramOutput` - The type of the image generation call. Always `image_generation_call`. + The item type. Always `program_output`. - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `Agent BetaResponseInputItemProgramOutputAgent` The agent that produced this item. @@ -63419,289 +77123,303 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCall struct{…}` - - A tool call to run code. - - - `type BetaResponseOutputItemLocalShellCall struct{…}` + - `Metadata map[string, string]` - A tool call to run a command on the local shell. + 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. - - `ID string` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - The unique ID of the local shell call. + - `Model BetaResponseModel` - - `Action BetaResponseOutputItemLocalShellCallAction` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - Execute a shell command on the server. + - `type BetaResponseModel string` - - `Command []string` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - The command to run. + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - - `Env map[string, string]` + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - Environment variables to set for the command. + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - - `Type Exec` + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - The type of the local shell action. Always `exec`. + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - - `const ExecExec Exec = "exec"` + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - - `TimeoutMs int64` + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - Optional timeout in milliseconds for the command. + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - - `User string` + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - Optional user to run the command as. + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - - `WorkingDirectory string` + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - Optional working directory to run the command in. + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - - `CallID string` + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - The unique ID of the local shell tool call generated by the model. + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - - `Status string` + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - The status of the local shell call. + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - - `Type LocalShellCall` + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - The type of the local shell call. Always `local_shell_call`. + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - The agent that produced this item. + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - - `AgentName string` + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - The output of a local shell tool call. + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - - `ID string` + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - The unique ID of the local shell tool call generated by the model. + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - - `Output string` + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - A JSON string of the output of the local shell tool call. + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - - `Type LocalShellCallOutput` + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - The type of the local shell tool call output. Always `local_shell_call_output`. + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `const BetaResponseModelO3 BetaResponseModel = "o3"` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - The agent that produced this item. + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - - `AgentName string` + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelO1 BetaResponseModel = "o1"` - - `Status string` + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - `type BetaResponseFunctionShellToolCall struct{…}` + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - A tool call that executes one or more shell commands in a managed environment. + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - - `ID string` + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - The unique ID of the shell tool call. Populated when this item is returned via API. + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - - `Action BetaResponseFunctionShellToolCallAction` + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - The shell commands and limits that describe how to run the tool call. + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - - `Commands []string` + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - - `MaxOutputLength int64` + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - Optional maximum number of characters to return from each command. + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - - `TimeoutMs int64` + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - Optional timeout in milliseconds for the commands. + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - - `CallID string` + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - The unique ID of the shell tool call generated by the model. + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - Represents the use of a local environment to perform shell actions. + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - - `type BetaResponseLocalEnvironment struct{…}` + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - Represents the use of a local environment to perform shell actions. + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` - - `Type Local` + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` - The environment type. Always `local`. + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - - `const LocalLocal Local = "local"` + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - - `type BetaResponseContainerReference struct{…}` + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - Represents a container created with /v1/containers. + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - - `ContainerID string` + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - - `Type ContainerReference` + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - The environment type. Always `container_reference`. + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - - `Status BetaResponseFunctionShellToolCallStatus` + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - - `Type ShellCall` + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - The type of the item. Always `shell_call`. + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - - `const ShellCallShellCall ShellCall = "shell_call"` + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - - `Agent BetaResponseFunctionShellToolCallAgent` + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - The agent that produced this item. + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - - `AgentName string` + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - The execution context that produced this tool call. + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - - `Type Direct` + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - - `const DirectDirect Direct = "direct"` + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - - `CallerID string` + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - The call ID of the program item that produced this tool call. + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - - `Type Program` + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - - `CreatedBy string` + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - The ID of the entity that created this tool call. + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - The output of a shell tool call that was emitted. + - `string` - - `ID string` + - `Object Response` - The unique ID of the shell call output. Populated when this item is returned via API. + The object type of this resource - always set to `response`. - - `CallID string` + - `const ResponseResponse Response = "response"` - The unique ID of the shell tool call generated by the model. + - `Output []BetaResponseOutputItemUnion` - - `MaxOutputLength int64` + An array of content items generated by the model. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + - `type BetaResponseOutputMessage struct{…}` - An array of shell call output contents + An output message from the model. - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + - `type BetaResponseFileSearchToolCall struct{…}` - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + - `type BetaResponseFunctionToolCall struct{…}` - Indicates that the shell call exceeded its configured time limit. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `Type Timeout` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - The outcome type. Always `timeout`. + - `ID string` - - `const TimeoutTimeout Timeout = "timeout"` + The unique ID of the function call tool output. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `CallID string` - Indicates that the shell commands finished and returned an exit code. + The unique ID of the function tool call generated by the model. - - `ExitCode int64` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - Exit code from the shell process. + The output from the function call generated by your code. + Can be a string or an list of output content. - - `Type Exit` + - `string` - The outcome type. Always `exit`. + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - - `const ExitExit Exit = "exit"` + Text, image, or file output of the function call. - - `Stderr string` + - `type BetaResponseInputText struct{…}` - The standard error output that was captured. + A text input to the model. - - `Stdout string` + - `type BetaResponseInputImage struct{…}` - The standard output that was captured. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `CreatedBy string` + - `type BetaResponseInputFile struct{…}` - The identifier of the actor that created the item. + A file input to the model. - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `Status BetaResponseFunctionToolCallOutputItemStatus` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `Type ShellCallOutput` + - `Type FunctionCallOutput` - The type of the shell call output. Always `shell_call_output`. + The type of the function tool call output. Always `function_call_output`. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` The agent that produced this item. @@ -63709,17 +77427,19 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` The execution context that produced this tool call. - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - `Type Direct` + The caller type. Always `direct`. + - `const DirectDirect Direct = "direct"` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - `CallerID string` @@ -63727,151 +77447,151 @@ func main() { - `Type Program` + The caller type. Always `program`. + - `const ProgramProgram Program = "program"` - `CreatedBy string` The identifier of the actor that created the item. - - `type BetaResponseApplyPatchToolCall struct{…}` - - A tool call that applies file diffs by creating, deleting, or updating files. + - `type BetaResponseOutputItemAgentMessage struct{…}` - `ID string` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + The unique ID of the agent message. - - `CallID string` + - `Author string` - The unique ID of the apply patch tool call generated by the model. + The sending agent identity. - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + Encrypted content sent between agents. - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `type BetaResponseInputText struct{…}` - Instruction describing how to create a file via the apply_patch tool. + A text input to the model. - - `Diff string` + - `type BetaResponseOutputText struct{…}` - Diff to apply. + A text output from the model. - - `Path string` + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - Path of the file to create. + A text content. - - `Type CreateFile` + - `Text string` - Create a new file with the provided diff. + - `Type Text` - - `const CreateFileCreateFile CreateFile = "create_file"` + - `const TextText Text = "text"` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - Instruction describing how to delete a file via the apply_patch tool. + A summary text from the model. - - `Path string` + - `Text string` - Path of the file to delete. + A summary of the reasoning output from the model so far. - - `Type DeleteFile` + - `Type SummaryText` - Delete the specified file. + The type of the object. Always `summary_text`. - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - Instruction describing how to update a file via the apply_patch tool. + Reasoning text from the model. - - `Diff string` + - `Text string` - Diff to apply. + The reasoning text from the model. - - `Path string` + - `Type ReasoningText` - Path of the file to update. + The type of the reasoning text. Always `reasoning_text`. - - `Type UpdateFile` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - Update an existing file with the provided diff. + - `type BetaResponseOutputRefusal struct{…}` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + A refusal from the model. - - `Status BetaResponseApplyPatchToolCallStatus` + - `type BetaResponseInputImage struct{…}` - The status of the apply patch tool call. One of `in_progress` or `completed`. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + A screenshot of a computer. - - `Type ApplyPatchCall` + - `Detail string` - The type of the item. Always `apply_patch_call`. + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - - `Agent BetaResponseApplyPatchToolCallAgent` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - The agent that produced this item. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `AgentName string` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - The canonical name of the agent that produced this item. + - `FileID string` - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + The identifier of an uploaded file that contains the screenshot. - The execution context that produced this tool call. + - `ImageURL string` - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + The URL of the screenshot image. - - `Type Direct` + - `Type ComputerScreenshot` - - `const DirectDirect Direct = "direct"` + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `CallerID string` + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - The call ID of the program item that produced this tool call. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Type Program` + - `Mode Explicit` - - `const ProgramProgram Program = "program"` + The breakpoint mode. Always `explicit`. - - `CreatedBy string` + - `const ExplicitExplicit Explicit = "explicit"` - The ID of the entity that created this tool call. + - `type BetaResponseInputFile struct{…}` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + A file input to the model. - The output emitted by an apply patch tool call. + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - - `ID string` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `EncryptedContent string` - - `CallID string` + Opaque encrypted content. - The unique ID of the apply patch tool call generated by the model. + - `Type EncryptedContent` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + The type of the input item. Always `encrypted_content`. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `Recipient string` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + The destination agent identity. - - `Type ApplyPatchCallOutput` + - `Type AgentMessage` - The type of the item. Always `apply_patch_call_output`. + The type of the item. Always `agent_message`. - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `Agent BetaResponseOutputItemAgentMessageAgent` The agent that produced this item. @@ -63879,61 +77599,43 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - - `Type Direct` - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - `Type Program` + - `ID string` - - `const ProgramProgram Program = "program"` + The unique ID of the multi-agent call item. - - `CreatedBy string` + - `Action string` - The ID of the entity that created this tool call output. + The multi-agent action to execute. - - `Output string` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - Optional textual output returned by the apply patch tool. + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - `type BetaResponseOutputItemMcpCall struct{…}` + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - An invocation of a tool on an MCP server. + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `ID string` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - The unique ID of the tool call. + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - `Arguments string` - A JSON string of the arguments passed to the tool. - - - `Name string` - - The name of the tool that was run. + The JSON string of arguments generated for the action. - - `ServerLabel string` + - `CallID string` - The label of the MCP server running the tool. + The unique ID linking this call to its output. - - `Type McpCall` + - `Type MultiAgentCall` - The type of the item. Always `mcp_call`. + The type of the multi-agent call. Always `multi_agent_call`. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `Agent BetaResponseOutputItemMcpCallAgent` + - `Agent BetaResponseOutputItemMultiAgentCallAgent` The agent that produced this item. @@ -63941,110 +77643,57 @@ func main() { The canonical name of the agent that produced this item. - - `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 BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - - `type BetaResponseOutputItemMcpListTools struct{…}` - - A list of tools available on an MCP server. + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - `ID string` - The unique ID of the list. - - - `ServerLabel string` - - The label of the MCP server. - - - `Tools []BetaResponseOutputItemMcpListToolsTool` - - 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. + The unique ID of the multi-agent call output item. - - `Type McpListTools` + - `Action string` - The type of the item. Always `mcp_list_tools`. + The multi-agent action that produced this result. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - The agent that produced this item. + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `AgentName string` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - The canonical name of the agent that produced this item. + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - `Error string` + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - Error message if the server could not list tools. + - `CallID string` - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + The unique ID of the multi-agent call. - A request for human approval of a tool invocation. + - `Output []BetaResponseOutputText` - - `ID string` + Text output returned by the multi-agent action. - The unique ID of the approval request. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `Arguments string` + The annotations of the text output. - A JSON string of arguments for the tool. + - `Text string` - - `Name string` + The text output from the model. - The name of the tool to run. + - `Type OutputText` - - `ServerLabel string` + The type of the output text. Always `output_text`. - The label of the MCP server making the request. + - `Logprobs []BetaResponseOutputTextLogprob` - - `Type McpApprovalRequest` + - `Type MultiAgentCallOutput` - The type of the item. Always `mcp_approval_request`. + The type of the multi-agent result. Always `multi_agent_call_output`. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` The agent that produced this item. @@ -64052,265 +77701,234 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - - A response to an MCP approval request. - - - `ID string` - - The unique ID of the approval response + - `type BetaResponseFunctionWebSearch struct{…}` - - `ApprovalRequestID string` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - The ID of the approval request being answered. + - `type BetaResponseComputerToolCall struct{…}` - - `Approve bool` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - Whether the request was approved. + - `type BetaResponseComputerToolCallOutputItem struct{…}` - - `Type McpApprovalResponse` + - `ID string` - The type of the item. Always `mcp_approval_response`. + The unique ID of the computer call tool output. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `CallID string` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + The ID of the computer tool call that produced the output. - The agent that produced this item. + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `AgentName string` + A computer screenshot image used with the computer use tool. - The canonical name of the agent that produced this item. + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `Reason string` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - Optional reason for the decision. + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - - `type BetaResponseCustomToolCall struct{…}` + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - A call to a custom tool created by the model. + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - The output of a custom tool call from your code, being sent back to the model. + - `Type ComputerCallOutput` - - `ID string` + The type of the computer tool call output. Always `computer_call_output`. - The unique ID of the custom tool call output item. + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `Status string` + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The safety checks reported by the API that have been acknowledged by the + developer. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `ID string` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + The ID of the pending safety check. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `Code string` - - `CreatedBy string` + The type of the pending safety check. - The identifier of the actor that created the item. + - `Message string` - - `ParallelToolCalls bool` + Details about the pending safety check. - Whether to allow the model to run tool calls in parallel. + - `Agent BetaResponseComputerToolCallOutputItemAgent` - - `Temperature float64` + The agent that produced this item. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `AgentName string` - - `ToolChoice BetaResponseToolChoiceUnion` + The canonical name of the agent that produced this item. - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `CreatedBy string` - - `type BetaToolChoiceOptions string` + The identifier of the actor that created the item. - Controls which (if any) tool is called by the model. + - `type BetaResponseReasoningItem struct{…}` - `none` means the model will not call any tool and instead generates a message. + 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](https://platform.openai.com/docs/guides/conversation-state). - `auto` means the model can pick between generating a message or calling one or - more tools. + - `type BetaResponseOutputItemProgram struct{…}` - `required` means the model must call one or more tools. + - `ID string` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + The unique ID of the program item. - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + - `CallID string` - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + The stable call ID of the program item. - - `type BetaToolChoiceAllowed struct{…}` + - `Code string` - Constrains the tools available to the model to a pre-defined set. + The JavaScript source executed by programmatic tool calling. - - `Mode BetaToolChoiceAllowedMode` + - `Fingerprint string` - Constrains the tools available to the model to a pre-defined set. + Opaque program replay fingerprint that must be round-tripped. - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `Type Program` - `required` requires the model to call one or more of the allowed tools. + The type of the item. Always `program`. - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + - `const ProgramProgram Program = "program"` - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + - `Agent BetaResponseOutputItemProgramAgent` - - `Tools []map[string, any]` + The agent that produced this item. - A list of tool definitions that the model should be allowed to call. + - `AgentName string` - For the Responses API, the list of tool definitions might look like: + The canonical name of the agent that produced this item. - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `type BetaResponseOutputItemProgramOutput struct{…}` - - `Type AllowedTools` + - `ID string` - Allowed tool configuration type. Always `allowed_tools`. + The unique ID of the program output item. - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `CallID string` - - `type BetaToolChoiceTypes struct{…}` + The call ID of the program item. - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `Result string` - - `Type BetaToolChoiceTypesType` + The result produced by the program item. - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `Status string` - Allowed values are: + The terminal status of the program output item. - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + - `Type ProgramOutput` - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + The type of the item. Always `program_output`. - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + - `Agent BetaResponseOutputItemProgramOutputAgent` - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + The agent that produced this item. - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + - `AgentName string` - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + The canonical name of the agent that produced this item. - - `type BetaToolChoiceFunction struct{…}` + - `type BetaResponseToolSearchCall struct{…}` - Use this option to force the model to call a specific function. + - `ID string` - - `Name string` + The unique ID of the tool search call item. - The name of the function to call. + - `Arguments any` - - `Type Function` + Arguments used for the tool search call. - For function calling, the type is always `function`. + - `CallID string` - - `const FunctionFunction Function = "function"` + The unique ID of the tool search call generated by the model. - - `type BetaToolChoiceMcp struct{…}` + - `Execution BetaResponseToolSearchCallExecution` - Use this option to force the model to call a specific tool on a remote MCP server. + Whether tool search was executed by the server or by the client. - - `ServerLabel string` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - The label of the MCP server to use. + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `Type Mcp` + - `Status BetaResponseToolSearchCallStatus` - For MCP tools, the type is always `mcp`. + The status of the tool search call item that was recorded. - - `const McpMcp Mcp = "mcp"` + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - - `Name string` + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - The name of the tool to call on the server. + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - - `type BetaToolChoiceCustom struct{…}` + - `Type ToolSearchCall` - Use this option to force the model to call a specific custom tool. + The type of the item. Always `tool_search_call`. - - `Name string` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - The name of the custom tool to call. + - `Agent BetaResponseToolSearchCallAgent` - - `Type Custom` + The agent that produced this item. - For custom tool calling, the type is always `custom`. + - `AgentName string` - - `const CustomCustom Custom = "custom"` + The canonical name of the agent that produced this item. - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `CreatedBy string` - - `Type ProgrammaticToolCalling` + The identifier of the actor that created the item. - The tool to call. Always `programmatic_tool_calling`. + - `type BetaResponseToolSearchOutputItem struct{…}` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `ID string` - - `type BetaToolChoiceApplyPatch struct{…}` + The unique ID of the tool search output item. - Forces the model to call the apply_patch tool when executing a tool call. + - `CallID string` - - `Type ApplyPatch` + The unique ID of the tool search call generated by the model. - The tool to call. Always `apply_patch`. + - `Execution BetaResponseToolSearchOutputItemExecution` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + Whether tool search was executed by the server or by the client. - - `type BetaToolChoiceShell struct{…}` + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - Forces the model to call the shell tool when a tool call is required. + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - - `Type Shell` + - `Status BetaResponseToolSearchOutputItemStatus` - The tool to call. Always `shell`. + The status of the tool search output item that was recorded. - - `const ShellShell Shell = "shell"` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - - `Tools []BetaToolUnion` + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - We support the following categories of tools: + - `Tools []BetaToolUnion` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + The loaded tool definitions returned by tool search. - `type BetaFunctionTool struct{…}` @@ -64376,1719 +77994,1729 @@ func main() { Allows the assistant to create, delete, or update files using unified diffs. - - `TopP float64` - - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. - - We generally recommend altering this or `temperature` but not both. - - - `Background bool` - - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). - - - `CompletedAt float64` - - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. - - - `Conversation BetaResponseConversation` - - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + - `Type ToolSearchOutput` - - `ID string` + The type of the item. Always `tool_search_output`. - The unique ID of the conversation that this response was associated with. + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `MaxOutputTokens int64` + - `Agent BetaResponseToolSearchOutputItemAgent` - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + The agent that produced this item. - - `MaxToolCalls int64` + - `AgentName string` - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + The canonical name of the agent that produced this item. - - `Moderation BetaResponseModeration` + - `CreatedBy string` - Moderation results for the response input and output, if moderated completions were requested. + The identifier of the actor that created the item. - - `Input BetaResponseModerationInputUnion` + - `type BetaResponseOutputItemAdditionalTools struct{…}` - Moderation for the response input. + - `ID string` - - `type BetaResponseModerationInputModerationResult struct{…}` + The unique ID of the additional tools item. - A moderation result produced for the response input or output. + - `Role string` - - `Categories map[string, bool]` + The role that provided the additional tools. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - - `CategoryAppliedInputTypes map[string, []string]` + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - Which modalities of input are reflected by the score for each category. + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - `CategoryScores map[string, float64]` + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - A dictionary of moderation categories to scores. + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - - `Flagged bool` + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - A boolean indicating whether the content was flagged by any category. + - `Tools []BetaToolUnion` - - `Model string` + The additional tool definitions made available at this item. - The moderation model that produced this result. + - `type BetaFunctionTool struct{…}` - - `Type ModerationResult` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The object type, which was always `moderation_result` for successful moderation results. + - `type BetaFileSearchTool struct{…}` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `type BetaResponseModerationInputError struct{…}` + - `type BetaComputerTool struct{…}` - An error produced while attempting moderation for the response input or output. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Code string` + - `type BetaComputerUsePreviewTool struct{…}` - The error code. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Message string` + - `type BetaWebSearchTool struct{…}` - The error message. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type Error` + - `type BetaToolMcp struct{…}` - The object type, which was always `error` for moderation failures. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const ErrorError Error = "error"` + - `type BetaToolCodeInterpreter struct{…}` - - `Output BetaResponseModerationOutputUnion` + A tool that runs Python code to help generate a response to a prompt. - Moderation for the response output. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type BetaResponseModerationOutputModerationResult struct{…}` + - `type BetaToolImageGeneration struct{…}` - A moderation result produced for the response input or output. + A tool that generates images using the GPT image models. - - `Categories map[string, bool]` + - `type BetaToolLocalShell struct{…}` - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + A tool that allows the model to execute shell commands in a local environment. - - `CategoryAppliedInputTypes map[string, []string]` + - `type BetaFunctionShellTool struct{…}` - Which modalities of input are reflected by the score for each category. + A tool that allows the model to execute shell commands. - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + - `type BetaCustomTool struct{…}` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `CategoryScores map[string, float64]` + - `type BetaNamespaceTool struct{…}` - A dictionary of moderation categories to scores. + Groups function/custom tools under a shared namespace. - - `Flagged bool` + - `type BetaToolSearchTool struct{…}` - A boolean indicating whether the content was flagged by any category. + Hosted or BYOT tool search configuration for deferred tools. - - `Model string` + - `type BetaWebSearchPreviewTool struct{…}` - The moderation model that produced this result. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type ModerationResult` + - `type BetaApplyPatchTool struct{…}` - The object type, which was always `moderation_result` for successful moderation results. + Allows the assistant to create, delete, or update files using unified diffs. - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + - `Type AdditionalTools` - - `type BetaResponseModerationOutputError struct{…}` + The type of the item. Always `additional_tools`. - An error produced while attempting moderation for the response input or output. + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `Code string` + - `Agent BetaResponseOutputItemAdditionalToolsAgent` - The error code. + The agent that produced this item. - - `Message string` + - `AgentName string` - The error message. + The canonical name of the agent that produced this item. - - `Type Error` + - `type BetaResponseCompactionItem struct{…}` - The object type, which was always `error` for moderation failures. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `const ErrorError Error = "error"` + - `ID string` - - `PreviousResponseID string` + The unique ID of the compaction item. - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + - `EncryptedContent string` - - `Prompt BetaResponsePrompt` + The encrypted content that was produced by compaction. - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + - `Type Compaction` - - `ID string` + The type of the item. Always `compaction`. - The unique identifier of the prompt template to use. + - `const CompactionCompaction Compaction = "compaction"` - - `Variables map[string, BetaResponsePromptVariableUnion]` + - `Agent BetaResponseCompactionItemAgent` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + The agent that produced this item. - - `string` + - `AgentName string` - - `type BetaResponseInputText struct{…}` + The canonical name of the agent that produced this item. - A text input to the model. + - `CreatedBy string` - - `type BetaResponseInputImage struct{…}` + The identifier of the actor that created the item. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - - `type BetaResponseInputFile struct{…}` + An image generation request made by the model. - A file input to the model. + - `ID string` - - `Version string` + The unique ID of the image generation call. - Optional version of the prompt template. + - `Result string` - - `PromptCacheKey string` + The generated image encoded in base64. - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + - `Status string` - - `PromptCacheOptions BetaResponsePromptCacheOptions` + The status of the image generation call. - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - - `Mode string` + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - Whether implicit prompt-cache breakpoints were enabled. + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + - `Type ImageGenerationCall` - - `Ttl string` + The type of the image generation call. Always `image_generation_call`. - The minimum lifetime applied to each cache breakpoint. + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + - `Agent BetaResponseOutputItemImageGenerationCallAgent` - - `PromptCacheRetention BetaResponsePromptCacheRetention` + The agent that produced this item. - Deprecated. Use `prompt_cache_options.ttl` instead. + - `AgentName string` - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + The canonical name of the agent that produced this item. - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + A tool call to run code. - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `type BetaResponseOutputItemLocalShellCall struct{…}` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + A tool call to run a command on the local shell. - - `Reasoning BetaResponseReasoning` + - `ID string` - **gpt-5 and o-series models only** + The unique ID of the local shell call. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `Action BetaResponseOutputItemLocalShellCallAction` - - `Context string` + Execute a shell command on the server. - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + - `Command []string` - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + The command to run. - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + - `Env map[string, string]` - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + Environment variables to set for the command. - - `Effort string` + - `Type Exec` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + The type of the local shell action. Always `exec`. - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + - `const ExecExec Exec = "exec"` - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `TimeoutMs int64` - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + Optional timeout in milliseconds for the command. - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + - `User string` - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + Optional user to run the command as. - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + - `WorkingDirectory string` - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + Optional working directory to run the command in. - - `GenerateSummary string` + - `CallID string` - **Deprecated:** use `summary` instead. + The unique ID of the local shell tool call generated by the model. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `Status string` - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + The status of the local shell call. - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - - `Mode string` + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - Controls the reasoning execution mode for the request. + - `Type LocalShellCall` - When returned on a response, this is the effective execution mode. + The type of the local shell call. Always `local_shell_call`. - - `string` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `string` + - `Agent BetaResponseOutputItemLocalShellCallAgent` - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + The agent that produced this item. - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + - `AgentName string` - - `Summary string` + The canonical name of the agent that produced this item. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + The output of a local shell tool call. - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + - `ID string` - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + The unique ID of the local shell tool call generated by the model. - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + - `Output string` - - `SafetyIdentifier string` + A JSON string of the output of the local shell tool call. - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `Type LocalShellCallOutput` - - `ServiceTier BetaResponseServiceTier` + The type of the local shell tool call output. Always `local_shell_call_output`. - Specifies the processing type used for serving the request. + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + The agent that produced this item. - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `AgentName string` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + The canonical name of the agent that produced this item. - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + - `Status string` - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - - `Status BetaResponseStatus` + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + - `type BetaResponseFunctionShellToolCall struct{…}` - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + A tool call that executes one or more shell commands in a managed environment. - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + - `ID string` - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + The unique ID of the shell tool call. Populated when this item is returned via API. - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `Action BetaResponseFunctionShellToolCallAction` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + The shell commands and limits that describe how to run the tool call. - - `Text BetaResponseTextConfig` + - `Commands []string` - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `MaxOutputLength int64` - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + Optional maximum number of characters to return from each command. - - `Format BetaResponseFormatTextConfigUnion` + - `TimeoutMs int64` - An object specifying the format that the model must output. + Optional timeout in milliseconds for the commands. - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `CallID string` - The default format is `{ "type": "text" }` with no additional options. + The unique ID of the shell tool call generated by the model. - **Not recommended for gpt-4o and newer models:** + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + Represents the use of a local environment to perform shell actions. - - `type BetaResponseFormatTextConfigText struct{…}` + - `type BetaResponseLocalEnvironment struct{…}` - Default response format. Used to generate text responses. + Represents the use of a local environment to perform shell actions. - - `Type Text` + - `Type Local` - The type of response format being defined. Always `text`. + The environment type. Always `local`. - - `const TextText Text = "text"` + - `const LocalLocal Local = "local"` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + - `type BetaResponseContainerReference struct{…}` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + Represents a container created with /v1/containers. - - `Name string` + - `ContainerID string` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `Type ContainerReference` - - `Schema map[string, any]` + The environment type. Always `container_reference`. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `Type JSONSchema` + - `Status BetaResponseFunctionShellToolCallStatus` - The type of response format being defined. Always `json_schema`. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - - `Description string` + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `Strict bool` + - `Type ShellCall` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + The type of the item. Always `shell_call`. - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + - `const ShellCallShellCall ShellCall = "shell_call"` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `Agent BetaResponseFunctionShellToolCallAgent` - - `Type JSONObject` + The agent that produced this item. - The type of response format being defined. Always `json_object`. + - `AgentName string` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The canonical name of the agent that produced this item. - - `Verbosity BetaResponseTextConfigVerbosity` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + The execution context that produced this tool call. - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + - `Type Direct` - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + - `const DirectDirect Direct = "direct"` - - `TopLogprobs int64` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + - `CallerID string` - - `Truncation BetaResponseTruncation` + The call ID of the program item that produced this tool call. - The truncation strategy to use for the model response. + - `Type Program` - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `const ProgramProgram Program = "program"` - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + - `CreatedBy string` - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + The ID of the entity that created this tool call. - - `Usage BetaResponseUsage` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + The output of a shell tool call that was emitted. - - `InputTokens int64` + - `ID string` - The number of input tokens. + The unique ID of the shell call output. Populated when this item is returned via API. - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + - `CallID string` - A detailed breakdown of the input tokens. + The unique ID of the shell tool call generated by the model. - - `CacheWriteTokens int64` + - `MaxOutputLength int64` - The number of input tokens that were written to the cache. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `CachedTokens int64` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + An array of shell call output contents - - `OutputTokens int64` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - The number of output tokens. + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - A detailed breakdown of the output tokens. + Indicates that the shell call exceeded its configured time limit. - - `ReasoningTokens int64` + - `Type Timeout` - The number of reasoning tokens. + The outcome type. Always `timeout`. - - `TotalTokens int64` + - `const TimeoutTimeout Timeout = "timeout"` - The total number of tokens used. + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - - `User string` + Indicates that the shell commands finished and returned an exit code. - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `ExitCode int64` - - `SequenceNumber int64` + Exit code from the shell process. - The sequence number for this event. + - `Type Exit` - - `Type ResponseCompleted` + The outcome type. Always `exit`. - The type of the event. Always `response.completed`. + - `const ExitExit Exit = "exit"` - - `const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"` + - `Stderr string` - - `Agent BetaResponseCompletedEventAgent` + The standard error output that was captured. - The agent that owns this multi-agent streaming event. + - `Stdout string` - - `AgentName string` + The standard output that was captured. - The canonical name of the agent that produced this item. + - `CreatedBy string` -### Beta Response Computer Tool Call + The identifier of the actor that created the item. -- `type BetaResponseComputerToolCall struct{…}` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - `ID string` + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - The unique ID of the computer call. + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - - `CallID string` + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - An identifier used when responding to the tool call with output. + - `Type ShellCallOutput` - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + The type of the shell call output. Always `shell_call_output`. - The pending safety checks for the computer call. + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `ID string` + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - The ID of the pending safety check. + The agent that produced this item. - - `Code string` + - `AgentName string` - The type of the pending safety check. + The canonical name of the agent that produced this item. - - `Message string` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - Details about the pending safety check. + The execution context that produced this tool call. - - `Status BetaResponseComputerToolCallStatus` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Type Direct` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `const DirectDirect Direct = "direct"` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `CallerID string` - - `Type BetaResponseComputerToolCallType` + The call ID of the program item that produced this tool call. - The type of the computer call. Always `computer_call`. + - `Type Program` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `const ProgramProgram Program = "program"` - - `Action BetaComputerActionUnion` + - `CreatedBy string` - A click action. + The identifier of the actor that created the item. - - `type BetaComputerActionClick struct{…}` + - `type BetaResponseApplyPatchToolCall struct{…}` - A click action. + A tool call that applies file diffs by creating, deleting, or updating files. - - `Button string` + - `ID string` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `CallID string` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + The unique ID of the apply patch tool call generated by the model. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - - `Type Click` + Instruction describing how to create a file via the apply_patch tool. - Specifies the event type. For a click action, this property is always `click`. + - `Diff string` - - `const ClickClick Click = "click"` + Diff to apply. - - `X int64` + - `Path string` - The x-coordinate where the click occurred. + Path of the file to create. - - `Y int64` + - `Type CreateFile` - The y-coordinate where the click occurred. + Create a new file with the provided diff. - - `Keys []string` + - `const CreateFileCreateFile CreateFile = "create_file"` - The keys being held while clicking. + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - - `type BetaComputerActionDoubleClick struct{…}` + Instruction describing how to delete a file via the apply_patch tool. - A double click action. + - `Path string` - - `Keys []string` + Path of the file to delete. - The keys being held while double-clicking. + - `Type DeleteFile` - - `Type DoubleClick` + Delete the specified file. - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `X int64` + Instruction describing how to update a file via the apply_patch tool. - The x-coordinate where the double click occurred. + - `Diff string` - - `Y int64` + Diff to apply. - The y-coordinate where the double click occurred. + - `Path string` - - `type BetaComputerActionDrag struct{…}` + Path of the file to update. - A drag action. + - `Type UpdateFile` - - `Path []BetaComputerActionDragPath` + Update an existing file with the provided diff. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `Status BetaResponseApplyPatchToolCallStatus` - - `X int64` + The status of the apply patch tool call. One of `in_progress` or `completed`. - The x-coordinate. + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `Y int64` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - The y-coordinate. + - `Type ApplyPatchCall` - - `Type Drag` + The type of the item. Always `apply_patch_call`. - Specifies the event type. For a drag action, this property is always set to `drag`. + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `const DragDrag Drag = "drag"` + - `Agent BetaResponseApplyPatchToolCallAgent` - - `Keys []string` + The agent that produced this item. - The keys being held while dragging the mouse. + - `AgentName string` - - `type BetaComputerActionKeypress struct{…}` + The canonical name of the agent that produced this item. - A collection of keypresses the model would like to perform. + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - `Keys []string` + The execution context that produced this tool call. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `Type Keypress` + - `Type Direct` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `const DirectDirect Direct = "direct"` - - `const KeypressKeypress Keypress = "keypress"` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `type BetaComputerActionMove struct{…}` + - `CallerID string` - A mouse move action. + The call ID of the program item that produced this tool call. - - `Type Move` + - `Type Program` - Specifies the event type. For a move action, this property is always set to `move`. + - `const ProgramProgram Program = "program"` - - `const MoveMove Move = "move"` + - `CreatedBy string` - - `X int64` + The ID of the entity that created this tool call. - The x-coordinate to move to. + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `Y int64` + The output emitted by an apply patch tool call. - The y-coordinate to move to. + - `ID string` - - `Keys []string` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - The keys being held while moving the mouse. + - `CallID string` - - `type BetaComputerActionScreenshot struct{…}` + The unique ID of the apply patch tool call generated by the model. - A screenshot action. + - `Status BetaResponseApplyPatchToolCallOutputStatus` - - `Type Screenshot` + The status of the apply patch tool call output. One of `completed` or `failed`. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - - `type BetaComputerActionScroll struct{…}` + - `Type ApplyPatchCallOutput` - A scroll action. + The type of the item. Always `apply_patch_call_output`. - - `ScrollX int64` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - The horizontal scroll distance. + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - `ScrollY int64` + The agent that produced this item. - The vertical scroll distance. + - `AgentName string` - - `Type Scroll` + The canonical name of the agent that produced this item. - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - `const ScrollScroll Scroll = "scroll"` + The execution context that produced this tool call. - - `X int64` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - The x-coordinate where the scroll occurred. + - `Type Direct` - - `Y int64` + - `const DirectDirect Direct = "direct"` - The y-coordinate where the scroll occurred. + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - `Keys []string` + - `CallerID string` - The keys being held while scrolling. + The call ID of the program item that produced this tool call. - - `type BetaComputerActionType struct{…}` + - `Type Program` - An action to type in text. + - `const ProgramProgram Program = "program"` - - `Text string` + - `CreatedBy string` - The text to type. + The ID of the entity that created this tool call output. - - `Type Type` + - `Output string` - Specifies the event type. For a type action, this property is always set to `type`. + Optional textual output returned by the apply patch tool. - - `const TypeType Type = "type"` + - `type BetaResponseOutputItemMcpCall struct{…}` - - `type BetaComputerActionWait struct{…}` + An invocation of a tool on an MCP server. - A wait action. + - `ID string` - - `Type Wait` + The unique ID of the tool call. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `Arguments string` - - `const WaitWait Wait = "wait"` + A JSON string of the arguments passed to the tool. - - `Actions BetaComputerActionList` + - `Name string` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + The name of the tool that was run. - - `type BetaComputerActionClick struct{…}` + - `ServerLabel string` - A click action. + The label of the MCP server running the tool. - - `type BetaComputerActionDoubleClick struct{…}` + - `Type McpCall` - A double click action. + The type of the item. Always `mcp_call`. - - `type BetaComputerActionDrag struct{…}` + - `const McpCallMcpCall McpCall = "mcp_call"` - A drag action. + - `Agent BetaResponseOutputItemMcpCallAgent` - - `type BetaComputerActionKeypress struct{…}` + The agent that produced this item. - A collection of keypresses the model would like to perform. + - `AgentName string` - - `type BetaComputerActionMove struct{…}` + The canonical name of the agent that produced this item. - A mouse move action. + - `ApprovalRequestID string` - - `type BetaComputerActionScreenshot struct{…}` + 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. - A screenshot action. + - `Error string` - - `type BetaComputerActionScroll struct{…}` + The error from the tool call, if any. - A scroll action. + - `Output string` - - `type BetaComputerActionType struct{…}` + The output from the tool call. - An action to type in text. + - `Status string` - - `type BetaComputerActionWait struct{…}` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - A wait action. + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - `Agent BetaResponseComputerToolCallAgent` + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - The agent that produced this item. + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `AgentName string` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - The canonical name of the agent that produced this item. + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` -### Beta Response Computer Tool Call Output Item + - `type BetaResponseOutputItemMcpListTools struct{…}` -- `type BetaResponseComputerToolCallOutputItem struct{…}` + A list of tools available on an MCP server. - `ID string` - The unique ID of the computer call tool output. + The unique ID of the list. - - `CallID string` + - `ServerLabel string` - The ID of the computer tool call that produced the output. + The label of the MCP server. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - A computer screenshot image used with the computer use tool. + The tools available on the server. - - `Type ComputerScreenshot` + - `InputSchema any` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + The JSON schema describing the tool's input. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `Name string` - - `FileID string` + The name of the tool. - The identifier of an uploaded file that contains the screenshot. + - `Annotations any` - - `ImageURL string` + Additional annotations about the tool. - The URL of the screenshot image. + - `Description string` - - `Status BetaResponseComputerToolCallOutputItemStatus` + The description of the tool. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `Type McpListTools` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + The type of the item. Always `mcp_list_tools`. - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `Agent BetaResponseOutputItemMcpListToolsAgent` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + The agent that produced this item. - - `Type ComputerCallOutput` + - `AgentName string` - The type of the computer tool call output. Always `computer_call_output`. + The canonical name of the agent that produced this item. - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `Error string` - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + Error message if the server could not list tools. - The safety checks reported by the API that have been acknowledged by the - developer. + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - `ID string` + A request for human approval of a tool invocation. - The ID of the pending safety check. + - `ID string` - - `Code string` + The unique ID of the approval request. - The type of the pending safety check. + - `Arguments string` - - `Message string` + A JSON string of arguments for the tool. - Details about the pending safety check. + - `Name string` - - `Agent BetaResponseComputerToolCallOutputItemAgent` + The name of the tool to run. - The agent that produced this item. + - `ServerLabel string` - - `AgentName string` + The label of the MCP server making the request. - The canonical name of the agent that produced this item. + - `Type McpApprovalRequest` - - `CreatedBy string` + The type of the item. Always `mcp_approval_request`. - The identifier of the actor that created the item. + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` -### Beta Response Computer Tool Call Output Screenshot + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` -- `type BetaResponseComputerToolCallOutputScreenshot struct{…}` + The agent that produced this item. - A computer screenshot image used with the computer use tool. + - `AgentName string` - - `Type ComputerScreenshot` + The canonical name of the agent that produced this item. - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + A response to an MCP approval request. - - `FileID string` + - `ID string` - The identifier of an uploaded file that contains the screenshot. + The unique ID of the approval response - - `ImageURL string` + - `ApprovalRequestID string` - The URL of the screenshot image. + The ID of the approval request being answered. -### Beta Response Container Reference + - `Approve bool` -- `type BetaResponseContainerReference struct{…}` + Whether the request was approved. - Represents a container created with /v1/containers. + - `Type McpApprovalResponse` - - `ContainerID string` + The type of the item. Always `mcp_approval_response`. - - `Type ContainerReference` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - The environment type. Always `container_reference`. + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + The agent that produced this item. -### Beta Response Content + - `AgentName string` -- `type BetaResponseContentUnion interface{…}` + The canonical name of the agent that produced this item. - Multi-modal input and output contents. + - `Reason string` - - `type BetaResponseInputText struct{…}` + Optional reason for the decision. - A text input to the model. + - `type BetaResponseCustomToolCall struct{…}` - - `Text string` + A call to a custom tool created by the model. - The text input to the model. + - `type BetaResponseCustomToolCallOutputItem struct{…}` - - `Type InputText` + The output of a custom tool call from your code, being sent back to the model. - The type of the input item. Always `input_text`. + - `ID string` - - `const InputTextInputText InputText = "input_text"` + The unique ID of the custom tool call output item. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `Status string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Mode Explicit` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - The breakpoint mode. Always `explicit`. + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `type BetaResponseInputImage struct{…}` + - `CreatedBy string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The identifier of the actor that created the item. - - `Detail BetaResponseInputImageDetail` + - `ParallelToolCalls bool` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + Whether to allow the model to run tool calls in parallel. - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `Temperature float64` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `ToolChoice BetaResponseToolChoiceUnion` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - - `Type InputImage` + - `type BetaToolChoiceOptions string` - The type of the input item. Always `input_image`. + Controls which (if any) tool is called by the model. - - `const InputImageInputImage InputImage = "input_image"` + `none` means the model will not call any tool and instead generates a message. - - `FileID string` + `auto` means the model can pick between generating a message or calling one or + more tools. - The ID of the file to be sent to the model. + `required` means the model must call one or more tools. - - `ImageURL string` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaToolChoiceAllowed struct{…}` - - `Mode Explicit` + Constrains the tools available to the model to a pre-defined set. - The breakpoint mode. Always `explicit`. + - `Mode BetaToolChoiceAllowedMode` - - `const ExplicitExplicit Explicit = "explicit"` + Constrains the tools available to the model to a pre-defined set. - - `type BetaResponseInputFile struct{…}` + `auto` allows the model to pick from among the allowed tools and generate a + message. - A file input to the model. + `required` requires the model to call one or more of the allowed tools. - - `Type InputFile` + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - The type of the input item. Always `input_file`. + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - - `const InputFileInputFile InputFile = "input_file"` + - `Tools []map[string, any]` - - `Detail BetaResponseInputFileDetail` + A list of tool definitions that the model should be allowed to call. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + For the Responses API, the list of tool definitions might look like: - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `Type AllowedTools` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + Allowed tool configuration type. Always `allowed_tools`. - - `FileData string` + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - The content of the file to be sent to the model. + - `type BetaToolChoiceTypes struct{…}` - - `FileID string` + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - The ID of the file to be sent to the model. + - `Type BetaToolChoiceTypesType` - - `FileURL string` + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - The URL of the file to be sent to the model. + Allowed values are: - - `Filename string` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - The name of the file to be sent to the model. + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `Mode Explicit` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - The breakpoint mode. Always `explicit`. + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - - `type BetaResponseOutputText struct{…}` + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - A text output from the model. + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `type BetaToolChoiceFunction struct{…}` - The annotations of the text output. + Use this option to force the model to call a specific function. - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `Name string` - A citation to a file. + The name of the function to call. - - `FileID string` + - `Type Function` - The ID of the file. + For function calling, the type is always `function`. - - `Filename string` + - `const FunctionFunction Function = "function"` - The filename of the file cited. + - `type BetaToolChoiceMcp struct{…}` - - `Index int64` + Use this option to force the model to call a specific tool on a remote MCP server. - The index of the file in the list of files. + - `ServerLabel string` - - `Type FileCitation` + The label of the MCP server to use. - The type of the file citation. Always `file_citation`. + - `Type Mcp` - - `const FileCitationFileCitation FileCitation = "file_citation"` + For MCP tools, the type is always `mcp`. - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `const McpMcp Mcp = "mcp"` - A citation for a web resource used to generate a model response. + - `Name string` - - `EndIndex int64` + The name of the tool to call on the server. - The index of the last character of the URL citation in the message. + - `type BetaToolChoiceCustom struct{…}` - - `StartIndex int64` + Use this option to force the model to call a specific custom tool. - The index of the first character of the URL citation in the message. + - `Name string` - - `Title string` + The name of the custom tool to call. - The title of the web resource. + - `Type Custom` - - `Type URLCitation` + For custom tool calling, the type is always `custom`. - The type of the URL citation. Always `url_citation`. + - `const CustomCustom Custom = "custom"` - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - - `URL string` + - `Type ProgrammaticToolCalling` - The URL of the web resource. + The tool to call. Always `programmatic_tool_calling`. - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - A citation for a container file used to generate a model response. + - `type BetaToolChoiceApplyPatch struct{…}` - - `ContainerID string` + Forces the model to call the apply_patch tool when executing a tool call. - The ID of the container file. + - `Type ApplyPatch` - - `EndIndex int64` + The tool to call. Always `apply_patch`. - The index of the last character of the container file citation in the message. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `FileID string` + - `type BetaToolChoiceShell struct{…}` - The ID of the file. + Forces the model to call the shell tool when a tool call is required. - - `Filename string` + - `Type Shell` - The filename of the container file cited. + The tool to call. Always `shell`. - - `StartIndex int64` + - `const ShellShell Shell = "shell"` - The index of the first character of the container file citation in the message. + - `Tools []BetaToolUnion` - - `Type ContainerFileCitation` + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. - The type of the container file citation. Always `container_file_citation`. + We support the following categories of tools: - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `type BetaFunctionTool struct{…}` - A path to a file. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `FileID string` + - `type BetaFileSearchTool struct{…}` - The ID of the file. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Index int64` + - `type BetaComputerTool struct{…}` - The index of the file in the list of files. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Type FilePath` + - `type BetaComputerUsePreviewTool struct{…}` - The type of the file path. Always `file_path`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const FilePathFilePath FilePath = "file_path"` + - `type BetaWebSearchTool struct{…}` - - `Text string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The text output from the model. + - `type BetaToolMcp struct{…}` - - `Type OutputText` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The type of the output text. Always `output_text`. + - `type BetaToolCodeInterpreter struct{…}` - - `const OutputTextOutputText OutputText = "output_text"` + A tool that runs Python code to help generate a response to a prompt. - - `Logprobs []BetaResponseOutputTextLogprob` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Token string` + - `type BetaToolImageGeneration struct{…}` - - `Bytes []int64` + A tool that generates images using the GPT image models. - - `Logprob float64` + - `type BetaToolLocalShell struct{…}` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + A tool that allows the model to execute shell commands in a local environment. - - `Token string` + - `type BetaFunctionShellTool struct{…}` - - `Bytes []int64` + A tool that allows the model to execute shell commands. - - `Logprob float64` + - `type BetaCustomTool struct{…}` - - `type BetaResponseOutputRefusal struct{…}` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - A refusal from the model. + - `type BetaNamespaceTool struct{…}` - - `Refusal string` + Groups function/custom tools under a shared namespace. - The refusal explanation from the model. + - `type BetaToolSearchTool struct{…}` - - `Type Refusal` + Hosted or BYOT tool search configuration for deferred tools. - The type of the refusal. Always `refusal`. + - `type BetaWebSearchPreviewTool struct{…}` - - `const RefusalRefusal Refusal = "refusal"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `BetaResponseContentReasoningText` + - `type BetaApplyPatchTool struct{…}` - - `Text string` + Allows the assistant to create, delete, or update files using unified diffs. - The reasoning text from the model. + - `TopP float64` - - `Type ReasoningText` + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - The type of the reasoning text. Always `reasoning_text`. + We generally recommend altering this or `temperature` but not both. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Background bool` -### Beta Response Content Part Added Event + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). -- `type BetaResponseContentPartAddedEvent struct{…}` + - `CompletedAt float64` - Emitted when a new content part is added. + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - - `ContentIndex int64` + - `Conversation BetaResponseConversation` - The index of the content part that was added. + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - - `ItemID string` + - `ID string` - The ID of the output item that the content part was added to. + The unique ID of the conversation that this response was associated with. - - `OutputIndex int64` + - `MaxOutputTokens int64` - The index of the output item that the content part was added to. + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - - `Part BetaResponseContentPartAddedEventPartUnion` + - `MaxToolCalls int64` - The content part that was added. + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `type BetaResponseOutputText struct{…}` + - `Moderation BetaResponseModeration` - A text output from the model. + Moderation results for the response input and output, if moderated completions were requested. - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `Input BetaResponseModerationInputUnion` - The annotations of the text output. + Moderation for the response input. - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `type BetaResponseModerationInputModerationResult struct{…}` - A citation to a file. + A moderation result produced for the response input or output. - - `FileID string` + - `Categories map[string, bool]` - The ID of the file. + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `Filename string` + - `CategoryAppliedInputTypes map[string, []string]` - The filename of the file cited. + Which modalities of input are reflected by the score for each category. - - `Index int64` + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` - The index of the file in the list of files. + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` - - `Type FileCitation` + - `CategoryScores map[string, float64]` - The type of the file citation. Always `file_citation`. + A dictionary of moderation categories to scores. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `Flagged bool` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + A boolean indicating whether the content was flagged by any category. - A citation for a web resource used to generate a model response. + - `Model string` - - `EndIndex int64` + The moderation model that produced this result. - The index of the last character of the URL citation in the message. + - `Type ModerationResult` - - `StartIndex int64` + The object type, which was always `moderation_result` for successful moderation results. - The index of the first character of the URL citation in the message. + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `Title string` + - `type BetaResponseModerationInputError struct{…}` - The title of the web resource. + An error produced while attempting moderation for the response input or output. - - `Type URLCitation` + - `Code string` - The type of the URL citation. Always `url_citation`. + The error code. - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Message string` - - `URL string` + The error message. - The URL of the web resource. + - `Type Error` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + The object type, which was always `error` for moderation failures. - A citation for a container file used to generate a model response. + - `const ErrorError Error = "error"` - - `ContainerID string` + - `Output BetaResponseModerationOutputUnion` - The ID of the container file. + Moderation for the response output. - - `EndIndex int64` + - `type BetaResponseModerationOutputModerationResult struct{…}` - The index of the last character of the container file citation in the message. + A moderation result produced for the response input or output. - - `FileID string` + - `Categories map[string, bool]` - The ID of the file. + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `Filename string` + - `CategoryAppliedInputTypes map[string, []string]` - The filename of the container file cited. + Which modalities of input are reflected by the score for each category. - - `StartIndex int64` + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` - The index of the first character of the container file citation in the message. + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` - - `Type ContainerFileCitation` + - `CategoryScores map[string, float64]` - The type of the container file citation. Always `container_file_citation`. + A dictionary of moderation categories to scores. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `Flagged bool` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + A boolean indicating whether the content was flagged by any category. - A path to a file. + - `Model string` - - `FileID string` + The moderation model that produced this result. - The ID of the file. + - `Type ModerationResult` - - `Index int64` + The object type, which was always `moderation_result` for successful moderation results. - The index of the file in the list of files. + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `Type FilePath` + - `type BetaResponseModerationOutputError struct{…}` - The type of the file path. Always `file_path`. + An error produced while attempting moderation for the response input or output. - - `const FilePathFilePath FilePath = "file_path"` + - `Code string` - - `Text string` + The error code. - The text output from the model. + - `Message string` - - `Type OutputText` + The error message. - The type of the output text. Always `output_text`. + - `Type Error` - - `const OutputTextOutputText OutputText = "output_text"` + The object type, which was always `error` for moderation failures. - - `Logprobs []BetaResponseOutputTextLogprob` + - `const ErrorError Error = "error"` - - `Token string` + - `PreviousResponseID string` - - `Bytes []int64` + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - - `Logprob float64` + - `Prompt BetaResponsePrompt` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - - `Token string` + - `ID string` - - `Bytes []int64` + The unique identifier of the prompt template to use. - - `Logprob float64` + - `Variables map[string, BetaResponsePromptVariableUnion]` - - `type BetaResponseOutputRefusal struct{…}` + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - A refusal from the model. + - `string` - - `Refusal string` + - `type BetaResponseInputText struct{…}` - The refusal explanation from the model. + A text input to the model. - - `Type Refusal` + - `type BetaResponseInputImage struct{…}` - The type of the refusal. Always `refusal`. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const RefusalRefusal Refusal = "refusal"` + - `type BetaResponseInputFile struct{…}` - - `type BetaResponseContentPartAddedEventPartReasoningText struct{…}` + A file input to the model. - Reasoning text from the model. + - `Version string` - - `Text string` + Optional version of the prompt template. - The reasoning text from the model. + - `PromptCacheKey string` - - `Type ReasoningText` + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - The type of the reasoning text. Always `reasoning_text`. + - `PromptCacheOptions BetaResponsePromptCacheOptions` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - `SequenceNumber int64` + - `Mode string` - The sequence number of this event. + Whether implicit prompt-cache breakpoints were enabled. - - `Type ResponseContentPartAdded` + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` - The type of the event. Always `response.content_part.added`. + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` - - `const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"` + - `Ttl string` - - `Agent BetaResponseContentPartAddedEventAgent` + The minimum lifetime applied to each cache breakpoint. - The agent that owns this multi-agent streaming event. + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` - - `AgentName string` + - `PromptCacheRetention BetaResponsePromptCacheRetention` - The canonical name of the agent that produced this item. + Deprecated. Use `prompt_cache_options.ttl` instead. -### Beta Response Content Part Done Event + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. -- `type BetaResponseContentPartDoneEvent struct{…}` + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - Emitted when a content part is done. + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - `ContentIndex int64` + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` - The index of the content part that is done. + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` - - `ItemID string` + - `Reasoning BetaResponseReasoning` - The ID of the output item that the content part was added to. + **gpt-5 and o-series models only** - - `OutputIndex int64` + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - The index of the output item that the content part was added to. + - `Context string` - - `Part BetaResponseContentPartDoneEventPartUnion` + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - The content part that is done. + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` - - `type BetaResponseOutputText struct{…}` + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` - A text output from the model. + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `Effort string` - The annotations of the text output. + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` - A citation to a file. + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` - - `FileID string` + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` - The ID of the file. + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` - - `Filename string` + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` - The filename of the file cited. + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` - - `Index int64` + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` - The index of the file in the list of files. + - `GenerateSummary string` - - `Type FileCitation` + **Deprecated:** use `summary` instead. - The type of the file citation. Always `file_citation`. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` - A citation for a web resource used to generate a model response. + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` - - `EndIndex int64` + - `Mode string` - The index of the last character of the URL citation in the message. + Controls the reasoning execution mode for the request. - - `StartIndex int64` + When returned on a response, this is the effective execution mode. - The index of the first character of the URL citation in the message. + - `string` - - `Title string` + - `string` - The title of the web resource. + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` - - `Type URLCitation` + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` - The type of the URL citation. Always `url_citation`. + - `Summary string` - - `const URLCitationURLCitation URLCitation = "url_citation"` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `URL string` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - The URL of the web resource. + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` - A citation for a container file used to generate a model response. + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` - - `ContainerID string` + - `SafetyIdentifier string` - The ID of the container file. + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `EndIndex int64` + - `ServiceTier BetaResponseServiceTier` - The index of the last character of the container file citation in the message. + Specifies the processing type used for serving the request. - - `FileID string` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - The ID of the file. + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - `Filename string` + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` - The filename of the container file cited. + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` - - `StartIndex int64` + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` - The index of the first character of the container file citation in the message. + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` - - `Type ContainerFileCitation` + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` - The type of the container file citation. Always `container_file_citation`. + - `Status BetaResponseStatus` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` - A path to a file. + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` - - `FileID string` + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` - The ID of the file. + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` - - `Index int64` + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` - The index of the file in the list of files. + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` - - `Type FilePath` + - `Text BetaResponseTextConfig` - The type of the file path. Always `file_path`. + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - - `const FilePathFilePath FilePath = "file_path"` + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - - `Text string` + - `Format BetaResponseFormatTextConfigUnion` - The text output from the model. + An object specifying the format that the model must output. - - `Type OutputText` + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The type of the output text. Always `output_text`. + The default format is `{ "type": "text" }` with no additional options. - - `const OutputTextOutputText OutputText = "output_text"` + **Not recommended for gpt-4o and newer models:** - - `Logprobs []BetaResponseOutputTextLogprob` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - - `Token string` + - `type BetaResponseFormatTextConfigText struct{…}` - - `Bytes []int64` + Default response format. Used to generate text responses. - - `Logprob float64` + - `Type Text` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + The type of response format being defined. Always `text`. - - `Token string` + - `const TextText Text = "text"` - - `Bytes []int64` + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - - `Logprob float64` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `type BetaResponseOutputRefusal struct{…}` + - `Name string` - A refusal from the model. + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `Refusal string` + - `Schema map[string, any]` - The refusal explanation from the model. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `Type Refusal` + - `Type JSONSchema` - The type of the refusal. Always `refusal`. + The type of response format being defined. Always `json_schema`. - - `const RefusalRefusal Refusal = "refusal"` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `type BetaResponseContentPartDoneEventPartReasoningText struct{…}` + - `Description string` - Reasoning text from the model. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `Text string` + - `Strict bool` - The reasoning text from the model. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Type ReasoningText` + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - The type of the reasoning text. Always `reasoning_text`. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Type JSONObject` - - `SequenceNumber int64` + The type of response format being defined. Always `json_object`. - The sequence number of this event. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `Type ResponseContentPartDone` + - `Verbosity BetaResponseTextConfigVerbosity` - The type of the event. Always `response.content_part.done`. + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - - `const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"` + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - - `Agent BetaResponseContentPartDoneEventAgent` + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - The agent that owns this multi-agent streaming event. + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - - `AgentName string` + - `TopLogprobs int64` - The canonical name of the agent that produced this item. + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. -### Beta Response Conversation Param + - `Truncation BetaResponseTruncation` -- `type BetaResponseConversationParamResp struct{…}` + The truncation strategy to use for the model response. - The conversation that this response belongs to. + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `ID string` + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` - The unique ID of the conversation. + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` -### Beta Response Created Event + - `Usage BetaResponseUsage` -- `type BetaResponseCreatedEvent struct{…}` + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - An event that is emitted when a response is created. + - `InputTokens int64` - - `Response BetaResponse` + The number of input tokens. - The response that was created. + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - - `ID string` + A detailed breakdown of the input tokens. - Unique identifier for this Response. + - `CacheWriteTokens int64` - - `CreatedAt float64` + The number of input tokens that were written to the cache. - Unix timestamp (in seconds) of when this Response was created. + - `CachedTokens int64` - - `Error BetaResponseError` + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - An error object returned when the model fails to generate a Response. + - `OutputTokens int64` - - `Code BetaResponseErrorCode` + The number of output tokens. - The error code for the response. + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + A detailed breakdown of the output tokens. - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + - `ReasoningTokens int64` - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + The number of reasoning tokens. - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + - `TotalTokens int64` - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + The total number of tokens used. - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + - `User string` - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + - `SequenceNumber int64` - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + The sequence number of this event. - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + - `Type ResponseIncomplete` - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + The type of the event. Always `response.incomplete`. - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + - `const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"` - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + - `Agent BetaResponseIncompleteEventAgent` - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + - `AgentName string` - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + The canonical name of the agent that produced this item. - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` +### Beta Response Inject Created Event - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` +- `type BetaResponseInjectCreatedEvent struct{…}` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + Emitted when all injected input items were validated and committed to the + active response. - - `Message string` + - `ResponseID string` - A human-readable description of the error. + The ID of the response that accepted the input. - - `IncompleteDetails BetaResponseIncompleteDetails` + - `SequenceNumber int64` - Details about why the response is incomplete. + The sequence number for this event. - - `Reason string` + - `Type ResponseInjectCreated` - The reason why the response is incomplete. + The event discriminator. Always `response.inject.created`. - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + - `const ResponseInjectCreatedResponseInjectCreated ResponseInjectCreated = "response.inject.created"` - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + - `StreamID string` - - `Instructions BetaResponseInstructionsUnion` + The multiplexed WebSocket stream that emitted the event. This field is + present only when WebSocket multiplexing is enabled separately. - A system (or developer) message inserted into the model's context. +### Beta Response Inject Event - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. +- `type BetaResponseInjectEvent struct{…}` - - `string` + Injects input items into an active response over a WebSocket connection. + The items are validated and committed atomically. Currently, the server + accepts client-owned tool outputs that resume a waiting agent. - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + - `Input []BetaResponseInputItemUnion` - A list of one or many input items to the model, containing - different content types. + Input items to inject into the active response. - `type BetaEasyInputMessage struct{…}` @@ -66241,6 +79869,8 @@ func main() { - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + - `Type BetaEasyInputMessageType` The type of the message input. Always `message`. @@ -66488,6 +80118,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -67668,7 +81300,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -67725,7 +81361,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -69545,229 +83185,1125 @@ func main() { - `Type McpApprovalResponse` - The type of the item. Always `mcp_approval_response`. + The type of the item. Always `mcp_approval_response`. + + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + + - `ID string` + + The unique ID of the approval response + + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Reason string` + + Optional reason for the decision. + + - `type BetaResponseInputItemMcpCall 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"` + + - `Agent BetaResponseInputItemMcpCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `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 BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + + - `type BetaResponseCustomToolCallOutput struct{…}` + + The output of a custom tool call from your code, being sent back to the model. + + - `CallID string` + + The call ID, used to map this custom tool call output to a custom tool call. + + - `Output BetaResponseCustomToolCallOutputOutputUnion` + + The output from the custom tool call generated by your code. + Can be a string or an list of output content. + + - `string` + + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + + Text, image, or file output of the custom tool call. + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type CustomToolCallOutput` + + The type of the custom tool call output. Always `custom_tool_call_output`. + + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + + - `ID string` + + The unique ID of the custom tool call output in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseCustomToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. + + - `CallID string` + + An identifier used to map this custom tool call to a tool call output. + + - `Input string` + + The input for the custom tool call generated by the model. + + - `Name string` + + The name of the custom tool being called. + + - `Type CustomToolCall` + + The type of the custom tool call. Always `custom_tool_call`. + + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + + - `ID string` + + The unique ID of the custom tool call in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseCustomToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `Namespace string` + + The namespace of the custom tool being called. + + - `type BetaResponseInputItemCompactionTrigger struct{…}` + + Compacts the current context. Must be the final input item. + + - `Type CompactionTrigger` + + The type of the item. Always `compaction_trigger`. + + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + + - `Agent BetaResponseInputItemCompactionTriggerAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemItemReference struct{…}` + + An internal identifier for an item to reference. + + - `ID string` + + The ID of the item to reference. + + - `Agent BetaResponseInputItemItemReferenceAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Type string` + + The type of item to reference. Always `item_reference`. + + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + + - `type BetaResponseInputItemProgram struct{…}` + + - `ID string` + + The unique ID of this program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The item type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseInputItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of this program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output. + + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The item type. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseInputItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `ResponseID string` + + The ID of the active response that should receive the input. + + - `Type ResponseInject` + + The event discriminator. Always `response.inject`. + + - `const ResponseInjectResponseInject ResponseInject = "response.inject"` + +### Beta Response Inject Failed Event + +- `type BetaResponseInjectFailedEvent struct{…}` + + Emitted when injected input could not be committed to a response. The event + returns the uncommitted raw input so the client can retry it in another + response when appropriate. + + - `Error BetaResponseInjectFailedEventError` + + Information about why the input was not committed. + + - `Code string` + + A machine-readable error code. + + - `const BetaResponseInjectFailedEventErrorCodeResponseAlreadyCompleted BetaResponseInjectFailedEventErrorCode = "response_already_completed"` + + - `const BetaResponseInjectFailedEventErrorCodeResponseNotFound BetaResponseInjectFailedEventErrorCode = "response_not_found"` + + - `Message string` + + A human-readable description of the error. + + - `Input []BetaResponseInputItemUnion` + + The raw input items that were not committed. + + - `type BetaEasyInputMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + + - `Content BetaEasyInputMessageContentUnion` + + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. + + - `string` + + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + + A list of one or many input items to the model, containing different content + types. + + - `type BetaResponseInputText 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"` + + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `Detail BetaResponseInputImageDetail` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type InputFile` + + The type of the input item. Always `input_file`. + + - `const InputFileInputFile InputFile = "input_file"` + + - `Detail BetaResponseInputFileDetail` + + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. + + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `Role BetaEasyInputMessageRole` + + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. + + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + + - `Phase BetaEasyInputMessagePhase` + + 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 BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + + - `Type BetaEasyInputMessageType` + + The type of the message input. Always `message`. + + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + + - `type BetaResponseInputItemMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + + - `Content BetaResponseInputMessageContentList` + + A list of one or many input items to the model, containing different content + types. + + - `Role string` + + The role of the message input. One of `user`, `system`, or `developer`. + + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + + - `Agent BetaResponseInputItemMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status string` + + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + + - `Type string` + + The type of the message input. Always set to `message`. + + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + + - `type BetaResponseOutputMessage struct{…}` + + An output message from the model. + + - `ID string` + + The unique ID of the output message. + + - `Content []BetaResponseOutputMessageContentUnion` + + The content of the output message. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation 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 BetaResponseOutputTextAnnotationFilePath 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 []BetaResponseOutputTextLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + + - `Token string` + + - `Bytes []int64` + + - `Logprob float64` + + - `type BetaResponseOutputRefusal 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 BetaResponseOutputMessageStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + + - `Type Message` + + The type of the output message. Always `message`. + + - `const MessageMessage Message = "message"` + + - `Agent BetaResponseOutputMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Phase BetaResponseOutputMessagePhase` + + 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 BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + + - `type BetaResponseFileSearchToolCall struct{…}` + + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + + - `ID string` + + The unique ID of the file search tool call. + + - `Queries []string` + + The queries used to search for files. + + - `Status BetaResponseFileSearchToolCallStatus` + + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + + - `Type FileSearchCall` + + The type of the file search tool call. Always `file_search_call`. + + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + + - `Agent BetaResponseFileSearchToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Results []BetaResponseFileSearchToolCallResult` + + The results of the file search tool call. + + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + + 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 BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) 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 []BetaResponseComputerToolCallPendingSafetyCheck` + + 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 BetaResponseComputerToolCallStatus` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + + - `Type BetaResponseComputerToolCallType` + + The type of the computer call. Always `computer_call`. + + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + + - `Action BetaComputerActionUnion` + + A click action. + + - `type BetaComputerActionClick struct{…}` + + A click action. + + - `Button string` + + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `ID string` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - The unique ID of the approval response + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - The agent that produced this item. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `AgentName string` + - `Type Click` - The canonical name of the agent that produced this item. + Specifies the event type. For a click action, this property is always `click`. - - `Reason string` + - `const ClickClick Click = "click"` - Optional reason for the decision. + - `X int64` - - `type BetaResponseInputItemMcpCall struct{…}` + The x-coordinate where the click occurred. - An invocation of a tool on an MCP server. + - `Y int64` - - `ID string` + The y-coordinate where the click occurred. - The unique ID of the tool call. + - `Keys []string` - - `Arguments string` + The keys being held while clicking. - A JSON string of the arguments passed to the tool. + - `type BetaComputerActionDoubleClick struct{…}` - - `Name string` + A double click action. - The name of the tool that was run. + - `Keys []string` - - `ServerLabel string` + The keys being held while double-clicking. - The label of the MCP server running the tool. + - `Type DoubleClick` - - `Type McpCall` + Specifies the event type. For a double click action, this property is always set to `double_click`. - The type of the item. Always `mcp_call`. + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `const McpCallMcpCall McpCall = "mcp_call"` + - `X int64` - - `Agent BetaResponseInputItemMcpCallAgent` + The x-coordinate where the double click occurred. - The agent that produced this item. + - `Y int64` - - `AgentName string` + The y-coordinate where the double click occurred. - The canonical name of the agent that produced this item. + - `type BetaComputerActionDrag struct{…}` - - `ApprovalRequestID string` + A drag action. - 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. + - `Path []BetaComputerActionDragPath` - - `Error string` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - The error from the tool call, if any. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `Output string` + - `X int64` - The output from the tool call. + The x-coordinate. - - `Status string` + - `Y int64` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + The y-coordinate. - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + - `Type Drag` - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + Specifies the event type. For a drag action, this property is always set to `drag`. - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + - `const DragDrag Drag = "drag"` - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + - `Keys []string` - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + The keys being held while dragging the mouse. - - `type BetaResponseCustomToolCallOutput struct{…}` + - `type BetaComputerActionKeypress struct{…}` - The output of a custom tool call from your code, being sent back to the model. + A collection of keypresses the model would like to perform. - - `CallID string` + - `Keys []string` - The call ID, used to map this custom tool call output to a custom tool call. + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `Output BetaResponseCustomToolCallOutputOutputUnion` + - `Type Keypress` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `string` + - `const KeypressKeypress Keypress = "keypress"` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + - `type BetaComputerActionMove struct{…}` - Text, image, or file output of the custom tool call. + A mouse move action. - - `type BetaResponseInputText struct{…}` + - `Type Move` - A text input to the model. + Specifies the event type. For a move action, this property is always set to `move`. - - `type BetaResponseInputImage struct{…}` + - `const MoveMove Move = "move"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `X int64` - - `type BetaResponseInputFile struct{…}` + The x-coordinate to move to. - A file input to the model. + - `Y int64` - - `Type CustomToolCallOutput` + The y-coordinate to move to. - The type of the custom tool call output. Always `custom_tool_call_output`. + - `Keys []string` - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + The keys being held while moving the mouse. - - `ID string` + - `type BetaComputerActionScreenshot struct{…}` - The unique ID of the custom tool call output in the OpenAI platform. + A screenshot action. - - `Agent BetaResponseCustomToolCallOutputAgent` + - `Type Screenshot` - The agent that produced this item. + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `AgentName string` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - The canonical name of the agent that produced this item. + - `type BetaComputerActionScroll struct{…}` - - `Caller BetaResponseCustomToolCallOutputCallerUnion` + A scroll action. - The execution context that produced this tool call. + - `ScrollX int64` - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + The horizontal scroll distance. - - `Type Direct` + - `ScrollY int64` - The caller type. Always `direct`. + The vertical scroll distance. - - `const DirectDirect Direct = "direct"` + - `Type Scroll` - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `CallerID string` + - `const ScrollScroll Scroll = "scroll"` - The call ID of the program item that produced this tool call. + - `X int64` - - `Type Program` + The x-coordinate where the scroll occurred. - The caller type. Always `program`. + - `Y int64` - - `const ProgramProgram Program = "program"` + The y-coordinate where the scroll occurred. - - `type BetaResponseCustomToolCall struct{…}` + - `Keys []string` - A call to a custom tool created by the model. + The keys being held while scrolling. - - `CallID string` + - `type BetaComputerActionType struct{…}` - An identifier used to map this custom tool call to a tool call output. + An action to type in text. - - `Input string` + - `Text string` - The input for the custom tool call generated by the model. + The text to type. - - `Name string` + - `Type Type` - The name of the custom tool being called. + Specifies the event type. For a type action, this property is always set to `type`. - - `Type CustomToolCall` + - `const TypeType Type = "type"` - The type of the custom tool call. Always `custom_tool_call`. + - `type BetaComputerActionWait struct{…}` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + A wait action. - - `ID string` + - `Type Wait` - The unique ID of the custom tool call in the OpenAI platform. + Specifies the event type. For a wait action, this property is always set to `wait`. - - `Agent BetaResponseCustomToolCallAgent` + - `const WaitWait Wait = "wait"` - The agent that produced this item. + - `Actions BetaComputerActionList` - - `AgentName string` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - The canonical name of the agent that produced this item. + - `type BetaComputerActionClick struct{…}` - - `Caller BetaResponseCustomToolCallCallerUnion` + A click action. - The execution context that produced this tool call. + - `type BetaComputerActionDoubleClick struct{…}` - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + A double click action. - - `Type Direct` + - `type BetaComputerActionDrag struct{…}` - - `const DirectDirect Direct = "direct"` + A drag action. - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `type BetaComputerActionKeypress struct{…}` - - `CallerID string` + A collection of keypresses the model would like to perform. - The call ID of the program item that produced this tool call. + - `type BetaComputerActionMove struct{…}` - - `Type Program` + A mouse move action. - - `const ProgramProgram Program = "program"` + - `type BetaComputerActionScreenshot struct{…}` - - `Namespace string` + A screenshot action. - The namespace of the custom tool being called. + - `type BetaComputerActionScroll struct{…}` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + A scroll action. - Compacts the current context. Must be the final input item. + - `type BetaComputerActionType struct{…}` - - `Type CompactionTrigger` + An action to type in text. - The type of the item. Always `compaction_trigger`. + - `type BetaComputerActionWait struct{…}` - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + A wait action. - - `Agent BetaResponseInputItemCompactionTriggerAgent` + - `Agent BetaResponseComputerToolCallAgent` The agent that produced this item. @@ -69775,53 +84311,60 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemItemReference struct{…}` + - `type BetaResponseInputItemComputerCallOutput struct{…}` - An internal identifier for an item to reference. + The output of a computer tool call. - - `ID string` + - `CallID string` - The ID of the item to reference. + The ID of the computer tool call that produced the output. - - `Agent BetaResponseInputItemItemReferenceAgent` + - `Output BetaResponseComputerToolCallOutputScreenshot` - The agent that produced this item. + A computer screenshot image used with the computer use tool. - - `AgentName string` + - `Type ComputerScreenshot` - The canonical name of the agent that produced this item. + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `Type string` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - The type of item to reference. Always `item_reference`. + - `FileID string` - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + The identifier of an uploaded file that contains the screenshot. - - `type BetaResponseInputItemProgram struct{…}` + - `ImageURL string` - - `ID string` + The URL of the screenshot image. - The unique ID of this program item. + - `Type ComputerCallOutput` - - `CallID string` + The type of the computer tool call output. Always `computer_call_output`. - The stable call ID of the program item. + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `Code string` + - `ID string` - The JavaScript source executed by programmatic tool calling. + The ID of the computer tool call output. - - `Fingerprint string` + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - Opaque program replay fingerprint that must be round-tripped. + The safety checks reported by the API that have been acknowledged by the developer. - - `Type Program` + - `ID string` - The item type. Always `program`. + The ID of the pending safety check. - - `const ProgramProgram Program = "program"` + - `Code string` - - `Agent BetaResponseInputItemProgramAgent` + The type of the pending safety check. + + - `Message string` + + Details about the pending safety check. + + - `Agent BetaResponseInputItemComputerCallOutputAgent` The agent that produced this item. @@ -69829,331 +84372,317 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemProgramOutput struct{…}` + - `Status string` - - `ID string` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - The unique ID of this program output item. + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `CallID string` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - The call ID of the program item. + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - - `Result string` + - `type BetaResponseFunctionWebSearch struct{…}` - The result produced by the program item. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `Status string` + - `ID string` - The terminal status of the program output. + The unique ID of the web search tool call. - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `Action BetaResponseFunctionWebSearchActionUnion` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + 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 ProgramOutput` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - The item type. Always `program_output`. + Action type "search" - Performs a web search query. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `Type Search` - - `Agent BetaResponseInputItemProgramOutputAgent` + The action type. - The agent that produced this item. + - `const SearchSearch Search = "search"` - - `AgentName string` + - `Queries []string` - The canonical name of the agent that produced this item. + The search queries. - - `Metadata map[string, string]` + - `Query string` - 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. + The search query. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `Model BetaResponseModel` + The sources used in the search. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `Type URL` - - `type BetaResponseModel string` + The type of source. Always `url`. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `const URLURL URL = "url"` - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + - `URL string` - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + The URL of the source. - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + Action type "open_page" - Opens a specific URL from search results. - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + - `Type OpenPage` - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + The action type. - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + - `const OpenPageOpenPage OpenPage = "open_page"` - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + - `URL string` - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + The URL opened by the model. - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + Action type "find_in_page": Searches for a pattern within a loaded page. - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + - `Pattern string` - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + The pattern or text to search for within the page. - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + - `Type FindInPage` - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + The action type. - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + - `URL string` - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + The URL of the page searched for the pattern. - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + - `Status BetaResponseFunctionWebSearchStatus` - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + The status of the web search tool call. - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + - `Type WebSearchCall` - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + The type of the web search tool call. Always `web_search_call`. - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + - `Agent BetaResponseFunctionWebSearchAgent` - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + The agent that produced this item. - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + - `AgentName string` - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + - `type BetaResponseFunctionToolCall struct{…}` - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + - `Arguments string` - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + A JSON string of the arguments to pass to the function. - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + - `CallID string` - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + The unique ID of the function tool call generated by the model. - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + - `Name string` - - `const BetaResponseModelO1 BetaResponseModel = "o1"` + The name of the function to run. - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + - `Type FunctionCall` - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + The type of the function tool call. Always `function_call`. - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + - `ID string` - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + The unique ID of the function tool call. - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + - `Agent BetaResponseFunctionToolCallAgent` - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + The agent that produced this item. - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + - `AgentName string` - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + - `Caller BetaResponseFunctionToolCallCallerUnion` - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + The execution context that produced this tool call. - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + - `Type Direct` - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + - `const DirectDirect Direct = "direct"` - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + - `CallerID string` - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + The call ID of the program item that produced this tool call. - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + - `Type Program` - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + - `Namespace string` - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + The namespace of the function to run. - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + - `Status BetaResponseFunctionToolCallStatus` - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + The output of a function tool call. - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + - `CallID string` - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + The unique ID of the function tool call generated by the model. - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + Text, image, or file output of the function tool call. - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + - `string` - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + An array of content outputs (text, image, file) for the function tool call. - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + - `type BetaResponseInputTextContent struct{…}` - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + A text input to the model. - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + - `Text string` - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + The text input to the model. - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + - `Type InputText` - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + The type of the input item. Always `input_text`. - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + - `const InputTextInputText InputText = "input_text"` - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + - `Mode Explicit` - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + The breakpoint mode. Always `explicit`. - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + - `const ExplicitExplicit Explicit = "explicit"` - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + - `type BetaResponseInputImageContent struct{…}` - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + - `Type InputImage` - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + The type of the input item. Always `input_image`. - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + - `const InputImageInputImage InputImage = "input_image"` - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + - `Detail BetaResponseInputImageContentDetail` - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - - `string` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - - `Object Response` + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - The object type of this resource - always set to `response`. + - `FileID string` - - `const ResponseResponse Response = "response"` + The ID of the file to be sent to the model. - - `Output []BetaResponseOutputItemUnion` + - `ImageURL string` - An array of content items generated by the model. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `type BetaResponseOutputMessage struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - An output message from the model. + - `Mode Explicit` - - `type BetaResponseFileSearchToolCall struct{…}` + The breakpoint mode. Always `explicit`. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseFunctionToolCall struct{…}` + - `type BetaResponseInputFileContent struct{…}` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + A file input to the model. - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `Type InputFile` - - `ID string` + The type of the input item. Always `input_file`. - The unique ID of the function call tool output. + - `const InputFileInputFile InputFile = "input_file"` - - `CallID string` + - `Detail BetaResponseInputFileContentDetail` - The unique ID of the function tool call generated by the model. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - The output from the function call generated by your code. - Can be a string or an list of output content. + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - - `string` + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `FileData string` - Text, image, or file output of the function call. + The base64-encoded data of the file to be sent to the model. - - `type BetaResponseInputText struct{…}` + - `FileID string` - A text input to the model. + The ID of the file to be sent to the model. - - `type BetaResponseInputImage struct{…}` + - `FileURL string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The URL of the file to be sent to the model. - - `type BetaResponseInputFile struct{…}` + - `Filename string` - A file input to the model. + The name of the file to be sent to the model. - - `Status BetaResponseFunctionToolCallOutputItemStatus` + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + - `Mode Explicit` - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + The breakpoint mode. Always `explicit`. - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `const ExplicitExplicit Explicit = "explicit"` - `Type FunctionCallOutput` @@ -70161,7 +84690,11 @@ func main() { - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `ID string` + + The unique ID of the function tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemFunctionCallOutputAgent` The agent that produced this item. @@ -70169,11 +84702,11 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - `Type Direct` @@ -70181,7 +84714,7 @@ func main() { - `const DirectDirect Direct = "direct"` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - `CallerID string` @@ -70193,249 +84726,263 @@ func main() { - `const ProgramProgram Program = "program"` - - `CreatedBy string` + - `Status string` - The identifier of the actor that created the item. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - - `ID string` + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - The unique ID of the agent message. + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + + - `type BetaResponseInputItemAgentMessage struct{…}` + + A message routed between agents. - `Author string` The sending agent identity. - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + - `Content []BetaResponseInputItemAgentMessageContentUnion` - Encrypted content sent between agents. + Plaintext, image, or encrypted content sent between agents. - - `type BetaResponseInputText struct{…}` + - `type BetaResponseInputTextContent struct{…}` A text input to the model. - - `type BetaResponseOutputText struct{…}` + - `type BetaResponseInputImageContent struct{…}` - A text output from the model. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - A text content. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `Text string` + - `EncryptedContent string` - - `Type Text` + Opaque encrypted content. - - `const TextText Text = "text"` + - `Type EncryptedContent` - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + The type of the input item. Always `encrypted_content`. - A summary text from the model. + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `Text string` + - `Recipient string` - A summary of the reasoning output from the model so far. + The destination agent identity. - - `Type SummaryText` + - `Type AgentMessage` - The type of the object. Always `summary_text`. + The item type. Always `agent_message`. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `ID string` - Reasoning text from the model. + The unique ID of this agent message item. - - `Text string` + - `Agent BetaResponseInputItemAgentMessageAgent` - The reasoning text from the model. + The agent that produced this item. - - `Type ReasoningText` + - `AgentName string` - The type of the reasoning text. Always `reasoning_text`. + The canonical name of the agent that produced this item. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - - `type BetaResponseOutputRefusal struct{…}` + - `Action string` - A refusal from the model. + The multi-agent action that was executed. - - `type BetaResponseInputImage struct{…}` + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - A screenshot of a computer. + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `Detail string` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `Arguments string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + The action arguments as a JSON string. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `CallID string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + The unique ID linking this call to its output. - - `FileID string` + - `Type MultiAgentCall` - The identifier of an uploaded file that contains the screenshot. + The item type. Always `multi_agent_call`. - - `ImageURL string` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - The URL of the screenshot image. + - `ID string` - - `Type ComputerScreenshot` + The unique ID of this multi-agent call. - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `Agent BetaResponseInputItemMultiAgentCallAgent` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + The agent that produced this item. - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `AgentName string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The canonical name of the agent that produced this item. - - `Mode Explicit` + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - The breakpoint mode. Always `explicit`. + - `Action string` - - `const ExplicitExplicit Explicit = "explicit"` + The multi-agent action that produced this result. - - `type BetaResponseInputFile struct{…}` + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - A file input to the model. + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - - `EncryptedContent string` + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - Opaque encrypted content. + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - - `Type EncryptedContent` + - `CallID string` - The type of the input item. Always `encrypted_content`. + The unique ID of the multi-agent call. - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `Recipient string` + Text output returned by the multi-agent action. - The destination agent identity. + - `Text string` - - `Type AgentMessage` + The text content. - The type of the item. Always `agent_message`. + - `Type OutputText` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + The content type. Always `output_text`. - - `Agent BetaResponseOutputItemAgentMessageAgent` + - `const OutputTextOutputText OutputText = "output_text"` - The agent that produced this item. + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - `AgentName string` + Citations associated with the text content. - The canonical name of the agent that produced this item. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + - `FileID string` - - `ID string` + The ID of the file. - The unique ID of the multi-agent call item. + - `Filename string` - - `Action string` + The filename of the file cited. - The multi-agent action to execute. + - `Index int64` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + The index of the file in the list of files. - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + - `Type FileCitation` - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + The citation type. Always `file_citation`. - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + - `EndIndex int64` - - `Arguments string` + The index of the last character of the citation in the message. - The JSON string of arguments generated for the action. + - `StartIndex int64` - - `CallID string` + The index of the first character of the citation in the message. - The unique ID linking this call to its output. + - `Title string` - - `Type MultiAgentCall` + The title of the cited resource. - The type of the multi-agent call. Always `multi_agent_call`. + - `Type URLCitation` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + The citation type. Always `url_citation`. - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + - `const URLCitationURLCitation URLCitation = "url_citation"` - The agent that produced this item. + - `URL string` - - `AgentName string` + The URL of the cited resource. - The canonical name of the agent that produced this item. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + - `ContainerID string` - - `ID string` + The ID of the container. - The unique ID of the multi-agent call output item. + - `EndIndex int64` - - `Action string` + The index of the last character of the citation in the message. - The multi-agent action that produced this result. + - `FileID string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + The ID of the container file. - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `Filename string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + The filename of the container file cited. - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `StartIndex int64` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + The index of the first character of the citation in the message. - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + - `Type ContainerFileCitation` - - `CallID string` + The citation type. Always `container_file_citation`. - The unique ID of the multi-agent call. + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `Output []BetaResponseOutputText` + - `Type MultiAgentCallOutput` - Text output returned by the multi-agent action. + The item type. Always `multi_agent_call_output`. - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - The annotations of the text output. + - `ID string` - - `Text string` + The unique ID of this multi-agent call output. - The text output from the model. + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` - - `Type OutputText` + The agent that produced this item. - The type of the output text. Always `output_text`. + - `AgentName string` - - `Logprobs []BetaResponseOutputTextLogprob` + The canonical name of the agent that produced this item. - - `Type MultiAgentCallOutput` + - `type BetaResponseInputItemToolSearchCall struct{…}` - The type of the multi-agent result. Always `multi_agent_call_output`. + - `Arguments any` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + The arguments supplied to the tool search call. - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `Type ToolSearchCall` + + The item type. Always `tool_search_call`. + + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + + - `ID string` + + The unique ID of this tool search call. + + - `Agent BetaResponseInputItemToolSearchCallAgent` The agent that produced this item. @@ -70443,1081 +84990,1131 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseFunctionWebSearch struct{…}` - - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `CallID string` - - `type BetaResponseComputerToolCall struct{…}` + The unique ID of the tool search call generated by the model. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `Execution string` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + Whether tool search was executed by the server or by the client. - - `ID string` + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - The unique ID of the computer call tool output. + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - - `CallID string` + - `Status string` - The ID of the computer tool call that produced the output. + The status of the tool search call. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - A computer screenshot image used with the computer use tool. + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `Tools []BetaToolUnion` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + The loaded tool definitions returned by the tool search output. - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `type BetaFunctionTool struct{…}` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Type ComputerCallOutput` + - `Name string` - The type of the computer tool call output. Always `computer_call_output`. + The name of the function to call. - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `Parameters map[string, any]` - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + A JSON schema object describing the parameters of the function. - The safety checks reported by the API that have been acknowledged by the - developer. + - `Strict bool` - - `ID string` + Whether strict parameter validation is enforced for this function tool. - The ID of the pending safety check. + - `Type Function` - - `Code string` + The type of the function tool. Always `function`. - The type of the pending safety check. + - `const FunctionFunction Function = "function"` - - `Message string` + - `AllowedCallers []string` - Details about the pending safety check. + The tool invocation context(s). - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - The agent that produced this item. + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - - `AgentName string` + - `DeferLoading bool` - The canonical name of the agent that produced this item. + Whether this function is deferred and loaded via tool search. - - `CreatedBy string` + - `Description string` - The identifier of the actor that created the item. + A description of the function. Used by the model to determine whether or not to call the function. - - `type BetaResponseReasoningItem struct{…}` + - `OutputSchema map[string, any]` - 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](https://platform.openai.com/docs/guides/conversation-state). + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `type BetaResponseOutputItemProgram struct{…}` + - `type BetaFileSearchTool struct{…}` - - `ID string` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The unique ID of the program item. + - `Type FileSearch` - - `CallID string` + The type of the file search tool. Always `file_search`. - The stable call ID of the program item. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Code string` + - `VectorStoreIDs []string` - The JavaScript source executed by programmatic tool calling. + The IDs of the vector stores to search. - - `Fingerprint string` + - `Filters BetaFileSearchToolFiltersUnion` - Opaque program replay fingerprint that must be round-tripped. + A filter to apply. - - `Type Program` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - The type of the item. Always `program`. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const ProgramProgram Program = "program"` + - `Key string` - - `Agent BetaResponseOutputItemProgramAgent` + The key to compare against the value. - The agent that produced this item. + - `Type string` - - `AgentName string` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - The canonical name of the agent that produced this item. + - `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 - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `ID string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - The unique ID of the program output item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `CallID string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - The call ID of the program item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Result string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The result produced by the program item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `Status string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - The terminal status of the program output item. + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + The value to compare against the attribute key; supports string, number, or boolean types. - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + - `string` - - `Type ProgramOutput` + - `float64` - The type of the item. Always `program_output`. + - `bool` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `string` - The agent that produced this item. + - `float64` - - `AgentName string` + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - The canonical name of the agent that produced this item. + Combine multiple filters using `and` or `or`. - - `type BetaResponseToolSearchCall struct{…}` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `ID string` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - The unique ID of the tool search call item. + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `Arguments any` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - Arguments used for the tool search call. + - `Key string` - - `CallID string` + The key to compare against the value. - The unique ID of the tool search call generated by the model. + - `Type string` - - `Execution BetaResponseToolSearchCallExecution` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - Whether tool search was executed by the server or by the client. + - `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 BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `Status BetaResponseToolSearchCallStatus` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - The status of the tool search call item that was recorded. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - `Type ToolSearchCall` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - The type of the item. Always `tool_search_call`. + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + The value to compare against the attribute key; supports string, number, or boolean types. - - `Agent BetaResponseToolSearchCallAgent` + - `string` - The agent that produced this item. + - `float64` - - `AgentName string` + - `bool` - The canonical name of the agent that produced this item. + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `CreatedBy string` + - `string` - The identifier of the actor that created the item. + - `float64` - - `type BetaResponseToolSearchOutputItem struct{…}` + - `Type string` - - `ID string` + Type of operation: `and` or `or`. - The unique ID of the tool search output item. + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `CallID string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - The unique ID of the tool search call generated by the model. + - `MaxNumResults int64` - - `Execution BetaResponseToolSearchOutputItemExecution` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - Whether tool search was executed by the server or by the client. + - `RankingOptions BetaFileSearchToolRankingOptions` - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + Ranking options for search. - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `Status BetaResponseToolSearchOutputItemStatus` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - The status of the tool search output item that was recorded. + - `EmbeddingWeight float64` - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + The weight of the embedding in the reciprocal ranking fusion. - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `TextWeight float64` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + The weight of the text in the reciprocal ranking fusion. - - `Tools []BetaToolUnion` + - `Ranker string` - The loaded tool definitions returned by tool search. + The ranker to use for the file search. - - `type BetaFunctionTool struct{…}` + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - - `type BetaFileSearchTool struct{…}` + - `ScoreThreshold float64` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + 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 BetaComputerTool struct{…}` A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Type Computer` + + The type of the computer tool. Always `computer`. + + - `const ComputerComputer Computer = "computer"` + - `type BetaComputerUsePreviewTool struct{…}` A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type BetaWebSearchTool struct{…}` + - `DisplayHeight int64` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The height of the computer display. - - `type BetaToolMcp struct{…}` + - `DisplayWidth int64` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The width of the computer display. - - `type BetaToolCodeInterpreter struct{…}` + - `Environment BetaComputerUsePreviewToolEnvironment` - A tool that runs Python code to help generate a response to a prompt. + The type of computer environment to control. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - - `type BetaToolImageGeneration struct{…}` + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - A tool that generates images using the GPT image models. + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `type BetaToolLocalShell struct{…}` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - A tool that allows the model to execute shell commands in a local environment. + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `type BetaFunctionShellTool struct{…}` + - `Type ComputerUsePreview` - A tool that allows the model to execute shell commands. + The type of the computer use tool. Always `computer_use_preview`. - - `type BetaCustomTool struct{…}` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `type BetaWebSearchTool struct{…}` - - `type BetaNamespaceTool struct{…}` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Groups function/custom tools under a shared namespace. + - `Type BetaWebSearchToolType` - - `type BetaToolSearchTool struct{…}` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - Hosted or BYOT tool search configuration for deferred tools. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Filters BetaWebSearchToolFilters` - - `type BetaApplyPatchTool struct{…}` + Filters for the search. - Allows the assistant to create, delete, or update files using unified diffs. + - `AllowedDomains []string` - - `Type ToolSearchOutput` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - The type of the item. Always `tool_search_output`. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - - `Agent BetaResponseToolSearchOutputItemAgent` + 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. - The agent that produced this item. + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - - `AgentName string` + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - The canonical name of the agent that produced this item. + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - - `CreatedBy string` + - `UserLocation BetaWebSearchToolUserLocation` - The identifier of the actor that created the item. + The approximate location of the user. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `City string` - - `ID string` + Free text input for the city of the user, e.g. `San Francisco`. - The unique ID of the additional tools item. + - `Country string` - - `Role string` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The role that provided the additional tools. + - `Region string` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + Free text input for the region of the user, e.g. `California`. - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + - `Timezone string` - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `Type string` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + The type of location approximation. Always `approximate`. - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + - `type BetaToolMcp struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Tools []BetaToolUnion` + - `ServerLabel string` - The additional tool definitions made available at this item. + A label for this MCP server, used to identify it in tool calls. - - `type BetaFunctionTool struct{…}` + - `Type Mcp` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The type of the MCP tool. Always `mcp`. - - `type BetaFileSearchTool struct{…}` + - `const McpMcp Mcp = "mcp"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `AllowedCallers []string` - - `type BetaComputerTool struct{…}` + The tool invocation context(s). - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `type BetaWebSearchTool struct{…}` + List of allowed tool names or a filter object. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `type BetaToolMcp struct{…}` + A string array of allowed tool names - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `type BetaToolCodeInterpreter struct{…}` + A filter object to specify which tools are allowed. - A tool that runs Python code to help generate a response to a prompt. + - `ReadOnly bool` - - `type BetaToolProgrammaticToolCalling struct{…}` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `type BetaToolImageGeneration struct{…}` + - `ToolNames []string` - A tool that generates images using the GPT image models. + List of allowed tool names. - - `type BetaToolLocalShell struct{…}` + - `Authorization string` - A tool that allows the model to execute shell commands in a local environment. + 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. - - `type BetaFunctionShellTool struct{…}` + - `ConnectorID string` - A tool that allows the model to execute shell commands. + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `type BetaCustomTool struct{…}` + Currently supported `connector_id` values are: - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - 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` - - `type BetaNamespaceTool struct{…}` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - Groups function/custom tools under a shared namespace. + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `type BetaToolSearchTool struct{…}` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - Hosted or BYOT tool search configuration for deferred tools. + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `type BetaApplyPatchTool struct{…}` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - Allows the assistant to create, delete, or update files using unified diffs. + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `Type AdditionalTools` + - `DeferLoading bool` - The type of the item. Always `additional_tools`. + Whether this MCP tool is deferred and discovered via tool search. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `Headers map[string, string]` - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - The agent that produced this item. + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `AgentName string` + Specify which of the MCP server's tools require approval. - The canonical name of the agent that produced this item. + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `type BetaResponseCompactionItem 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. - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `ID string` + A filter object to specify which tools are allowed. - The unique ID of the compaction item. + - `ReadOnly bool` - - `EncryptedContent string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The encrypted content that was produced by compaction. + - `ToolNames []string` - - `Type Compaction` + List of allowed tool names. - The type of the item. Always `compaction`. + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - - `const CompactionCompaction Compaction = "compaction"` + A filter object to specify which tools are allowed. - - `Agent BetaResponseCompactionItemAgent` + - `ReadOnly bool` - The agent that produced this item. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `AgentName string` + - `ToolNames []string` - The canonical name of the agent that produced this item. + List of allowed tool names. - - `CreatedBy string` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - The identifier of the actor that created the item. + 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. - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - An image generation request made by the model. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - - `ID string` + - `ServerDescription string` - The unique ID of the image generation call. + Optional description of the MCP server, used to provide more context. - - `Result string` + - `ServerURL string` - The generated image encoded in base64. + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `Status string` + - `TunnelID string` - The status of the image generation call. + 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. - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + - `type BetaToolCodeInterpreter struct{…}` - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + A tool that runs Python code to help generate a response to a prompt. - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `Container BetaToolCodeInterpreterContainerUnion` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + 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. - - `Type ImageGenerationCall` + - `string` - The type of the image generation call. Always `image_generation_call`. + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `Type Auto` - The agent that produced this item. + Always `auto`. - - `AgentName string` + - `const AutoAuto Auto = "auto"` - The canonical name of the agent that produced this item. + - `FileIDs []string` - - `type BetaResponseCodeInterpreterToolCall struct{…}` + An optional list of uploaded files to make available to your code. - A tool call to run code. + - `MemoryLimit string` - - `type BetaResponseOutputItemLocalShellCall struct{…}` + The memory limit for the code interpreter container. - A tool call to run a command on the local shell. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - - `ID string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - The unique ID of the local shell call. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - - `Action BetaResponseOutputItemLocalShellCallAction` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - Execute a shell command on the server. + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - - `Command []string` + Network access policy for the container. - The command to run. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `Env map[string, string]` + - `Type Disabled` - Environment variables to set for the command. + Disable outbound network access. Always `disabled`. - - `Type Exec` + - `const DisabledDisabled Disabled = "disabled"` - The type of the local shell action. Always `exec`. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `const ExecExec Exec = "exec"` + - `AllowedDomains []string` - - `TimeoutMs int64` + A list of allowed domains when type is `allowlist`. - Optional timeout in milliseconds for the command. + - `Type Allowlist` - - `User string` + Allow outbound network access only to specified domains. Always `allowlist`. - Optional user to run the command as. + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `WorkingDirectory string` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - Optional working directory to run the command in. + Optional domain-scoped secrets for allowlisted domains. - - `CallID string` + - `Domain string` - The unique ID of the local shell tool call generated by the model. + The domain associated with the secret. - - `Status string` + - `Name string` - The status of the local shell call. + The name of the secret to inject for the domain. - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + - `Value string` - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + The secret value to inject for the domain. - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `Type CodeInterpreter` - - `Type LocalShellCall` + The type of the code interpreter tool. Always `code_interpreter`. - The type of the local shell call. Always `local_shell_call`. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `AllowedCallers []string` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + The tool invocation context(s). - The agent that produced this item. + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - - `AgentName string` + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - The canonical name of the agent that produced this item. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + - `Type ProgrammaticToolCalling` - The output of a local shell tool call. + The type of the tool. Always `programmatic_tool_calling`. - - `ID string` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - The unique ID of the local shell tool call generated by the model. + - `type BetaToolImageGeneration struct{…}` - - `Output string` + A tool that generates images using the GPT image models. - A JSON string of the output of the local shell tool call. + - `Type ImageGeneration` - - `Type LocalShellCallOutput` + The type of the image generation tool. Always `image_generation`. - The type of the local shell tool call output. Always `local_shell_call_output`. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `Action string` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + Whether to generate a new image or edit an existing image. Default: `auto`. - The agent that produced this item. + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - - `AgentName string` + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - The canonical name of the agent that produced this item. + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - - `Status string` + - `Background string` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + 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. - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + `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. - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `type BetaResponseFunctionShellToolCall struct{…}` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - A tool call that executes one or more shell commands in a managed environment. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `ID string` + - `InputFidelity string` - The unique ID of the shell tool call. Populated when this item is returned via API. + 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`. - - `Action BetaResponseFunctionShellToolCallAction` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - The shell commands and limits that describe how to run the tool call. + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - - `Commands []string` + - `InputImageMask BetaToolImageGenerationInputImageMask` - - `MaxOutputLength int64` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - Optional maximum number of characters to return from each command. + - `FileID string` - - `TimeoutMs int64` + File ID for the mask image. - Optional timeout in milliseconds for the commands. + - `ImageURL string` - - `CallID string` + Base64-encoded mask image. - The unique ID of the shell tool call generated by the model. + - `Model string` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + The image generation model to use. Default: `gpt-image-1`. - Represents the use of a local environment to perform shell actions. + - `string` - - `type BetaResponseLocalEnvironment struct{…}` + - `string` - Represents the use of a local environment to perform shell actions. + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - - `Type Local` + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - The environment type. Always `local`. + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - - `const LocalLocal Local = "local"` + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `type BetaResponseContainerReference struct{…}` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - Represents a container created with /v1/containers. + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - `ContainerID string` + - `Moderation string` - - `Type ContainerReference` + Moderation level for the generated image. Default: `auto`. - The environment type. Always `container_reference`. + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - - `Status BetaResponseFunctionShellToolCallStatus` + - `OutputCompression int64` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + Compression level for the output image. Default: 100. - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + - `OutputFormat string` - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `Type ShellCall` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - The type of the item. Always `shell_call`. + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - - `const ShellCallShellCall ShellCall = "shell_call"` + - `PartialImages int64` - - `Agent BetaResponseFunctionShellToolCallAgent` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The agent that produced this item. + - `Quality string` - - `AgentName string` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - The canonical name of the agent that produced this item. + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - The execution context that produced this tool call. + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - - `Type Direct` + - `Size string` - - `const DirectDirect Direct = "direct"` + 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`. - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `string` - - `CallerID string` + - `string` - The call ID of the program item that produced this tool call. + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - - `Type Program` + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `const ProgramProgram Program = "program"` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - - `CreatedBy string` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - The ID of the entity that created this tool call. + - `type BetaToolLocalShell struct{…}` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + A tool that allows the model to execute shell commands in a local environment. - The output of a shell tool call that was emitted. + - `Type LocalShell` - - `ID string` + The type of the local shell tool. Always `local_shell`. - The unique ID of the shell call output. Populated when this item is returned via API. + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `CallID string` + - `type BetaFunctionShellTool struct{…}` - The unique ID of the shell tool call generated by the model. + A tool that allows the model to execute shell commands. - - `MaxOutputLength int64` + - `Type Shell` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + The type of the shell tool. Always `shell`. - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + - `const ShellShell Shell = "shell"` - An array of shell call output contents + - `AllowedCallers []string` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + The tool invocation context(s). - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - Indicates that the shell call exceeded its configured time limit. + - `Environment BetaFunctionShellToolEnvironmentUnion` - - `Type Timeout` + - `type BetaContainerAuto struct{…}` - The outcome type. Always `timeout`. + - `Type ContainerAuto` - - `const TimeoutTimeout Timeout = "timeout"` + Automatically creates a container for this request - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - Indicates that the shell commands finished and returned an exit code. + - `FileIDs []string` - - `ExitCode int64` + An optional list of uploaded files to make available to your code. - Exit code from the shell process. + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `Type Exit` + The memory limit for the container. - The outcome type. Always `exit`. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `const ExitExit Exit = "exit"` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `Stderr string` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - The standard error output that was captured. + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `Stdout string` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - The standard output that was captured. + Network access policy for the container. - - `CreatedBy string` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The identifier of the actor that created the item. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `Skills []BetaContainerAutoSkillUnion` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + An optional list of skills referenced by id or inline data. - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `type BetaSkillReference struct{…}` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `SkillID string` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + The ID of the referenced skill. - - `Type ShellCallOutput` + - `Type SkillReference` - The type of the shell call output. Always `shell_call_output`. + References a skill created with the /v1/skills endpoint. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `Version string` - The agent that produced this item. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `AgentName string` + - `type BetaInlineSkill struct{…}` - The canonical name of the agent that produced this item. + - `Description string` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + The description of the skill. - The execution context that produced this tool call. + - `Name string` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + The name of the skill. - - `Type Direct` + - `Source BetaInlineSkillSource` - - `const DirectDirect Direct = "direct"` + Inline skill payload - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `Data string` - - `CallerID string` + Base64-encoded skill zip bundle. - The call ID of the program item that produced this tool call. + - `MediaType ApplicationZip` - - `Type Program` + The media type of the inline skill payload. Must be `application/zip`. - - `const ProgramProgram Program = "program"` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `CreatedBy string` + - `Type Base64` - The identifier of the actor that created the item. + The type of the inline skill source. Must be `base64`. - - `type BetaResponseApplyPatchToolCall struct{…}` + - `const Base64Base64 Base64 = "base64"` - A tool call that applies file diffs by creating, deleting, or updating files. + - `Type Inline` - - `ID string` + Defines an inline skill for this request. - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `const InlineInline Inline = "inline"` - - `CallID string` + - `type BetaLocalEnvironment struct{…}` - The unique ID of the apply patch tool call generated by the model. + - `Type Local` - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + Use a local computer environment. - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `const LocalLocal Local = "local"` - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `Skills []BetaLocalSkill` - Instruction describing how to create a file via the apply_patch tool. + An optional list of skills. - - `Diff string` + - `Description string` - Diff to apply. + The description of the skill. + + - `Name string` + + The name of the skill. - `Path string` - Path of the file to create. + The path to the directory containing the skill. - - `Type CreateFile` + - `type BetaContainerReference struct{…}` - Create a new file with the provided diff. + - `ContainerID string` - - `const CreateFileCreateFile CreateFile = "create_file"` + The ID of the referenced container. - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `Type ContainerReference` - Instruction describing how to delete a file via the apply_patch tool. + References a container created with the /v1/containers endpoint - - `Path string` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - Path of the file to delete. + - `type BetaCustomTool struct{…}` - - `Type DeleteFile` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - Delete the specified file. + - `Name string` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + The name of the custom tool, used to identify it in tool calls. - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `Type Custom` - Instruction describing how to update a file via the apply_patch tool. + The type of the custom tool. Always `custom`. - - `Diff string` + - `const CustomCustom Custom = "custom"` - Diff to apply. + - `AllowedCallers []string` - - `Path string` + The tool invocation context(s). - Path of the file to update. + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `Type UpdateFile` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - Update an existing file with the provided diff. + - `DeferLoading bool` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + Whether this tool should be deferred and discovered via tool search. - - `Status BetaResponseApplyPatchToolCallStatus` + - `Description string` - The status of the apply patch tool call. One of `in_progress` or `completed`. + Optional description of the custom tool, used to provide more context. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `Format BetaCustomToolFormatUnion` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + The input format for the custom tool. Default is unconstrained text. - - `Type ApplyPatchCall` + - `type BetaCustomToolFormatText struct{…}` - The type of the item. Always `apply_patch_call`. + Unconstrained free-form text. - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `Type Text` - - `Agent BetaResponseApplyPatchToolCallAgent` + Unconstrained text format. Always `text`. - The agent that produced this item. + - `const TextText Text = "text"` - - `AgentName string` + - `type BetaCustomToolFormatGrammar struct{…}` - The canonical name of the agent that produced this item. + A grammar defined by the user. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `Definition string` - The execution context that produced this tool call. + The grammar definition. - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `Syntax string` - - `Type Direct` + The syntax of the grammar definition. One of `lark` or `regex`. - - `const DirectDirect Direct = "direct"` + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `CallerID string` + - `Type Grammar` - The call ID of the program item that produced this tool call. + Grammar format. Always `grammar`. - - `Type Program` + - `const GrammarGrammar Grammar = "grammar"` - - `const ProgramProgram Program = "program"` + - `type BetaNamespaceTool struct{…}` - - `CreatedBy string` + Groups function/custom tools under a shared namespace. - The ID of the entity that created this tool call. + - `Description string` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + A description of the namespace shown to the model. - The output emitted by an apply patch tool call. + - `Name string` - - `ID string` + The namespace name used in tool calls (for example, `crm`). - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `Tools []BetaNamespaceToolToolUnion` - - `CallID string` + The function/custom tools available inside this namespace. - The unique ID of the apply patch tool call generated by the model. + - `type BetaNamespaceToolToolFunction struct{…}` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + - `Name string` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `Type Function` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `const FunctionFunction Function = "function"` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `AllowedCallers []string` - - `Type ApplyPatchCallOutput` + The tool invocation context(s). - The type of the item. Always `apply_patch_call_output`. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `DeferLoading bool` - The agent that produced this item. + Whether this function should be deferred and discovered via tool search. - - `AgentName string` + - `Description string` - The canonical name of the agent that produced this item. + - `OutputSchema map[string, any]` - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - The execution context that produced this tool call. + - `Parameters any` - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `Strict bool` - - `Type Direct` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `const DirectDirect Direct = "direct"` + - `type BetaCustomTool struct{…}` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `CallerID string` + - `Type Namespace` - The call ID of the program item that produced this tool call. + The type of the tool. Always `namespace`. - - `Type Program` + - `const NamespaceNamespace Namespace = "namespace"` - - `const ProgramProgram Program = "program"` + - `type BetaToolSearchTool struct{…}` - - `CreatedBy string` + Hosted or BYOT tool search configuration for deferred tools. - The ID of the entity that created this tool call output. + - `Type ToolSearch` - - `Output string` + The type of the tool. Always `tool_search`. - Optional textual output returned by the apply patch tool. + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `type BetaResponseOutputItemMcpCall struct{…}` + - `Description string` - An invocation of a tool on an MCP server. + Description shown to the model for a client-executed tool search tool. - - `ID string` + - `Execution BetaToolSearchToolExecution` - The unique ID of the tool call. + Whether tool search is executed by the server or by the client. - - `Arguments string` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - A JSON string of the arguments passed to the tool. + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `Name string` + - `Parameters any` - The name of the tool that was run. + Parameter schema for a client-executed tool search tool. - - `ServerLabel string` + - `type BetaWebSearchPreviewTool struct{…}` - The label of the MCP server running the tool. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type McpCall` + - `Type BetaWebSearchPreviewToolType` - The type of the item. Always `mcp_call`. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `Agent BetaResponseOutputItemMcpCallAgent` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - The agent that produced this item. + - `SearchContentTypes []string` - - `AgentName string` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - The canonical name of the agent that produced this item. + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `ApprovalRequestID string` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - 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. + 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. - - `Error string` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - The error from the tool call, if any. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `Output string` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - The output from the tool call. + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `Status string` + The user's location. - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `Type Approximate` - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + The type of location approximation. Always `approximate`. - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + - `const ApproximateApproximate Approximate = "approximate"` - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + - `City string` - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + Free text input for the city of the user, e.g. `San Francisco`. - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + - `Country string` - - `type BetaResponseOutputItemMcpListTools struct{…}` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - A list of tools available on an MCP server. + - `Region string` - - `ID string` + Free text input for the region of the user, e.g. `California`. - The unique ID of the list. + - `Timezone string` - - `ServerLabel string` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The label of the MCP server. + - `type BetaApplyPatchTool struct{…}` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + Allows the assistant to create, delete, or update files using unified diffs. - The tools available on the server. + - `Type ApplyPatch` - - `InputSchema any` + The type of the tool. Always `apply_patch`. - The JSON schema describing the tool's input. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `Name string` + - `AllowedCallers []string` - The name of the tool. + The tool invocation context(s). - - `Annotations any` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - Additional annotations about the tool. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `Description string` + - `Type ToolSearchOutput` - The description of the tool. + The item type. Always `tool_search_output`. - - `Type McpListTools` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - The type of the item. Always `mcp_list_tools`. + - `ID string` - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + The unique ID of this tool search output. - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` The agent that produced this item. @@ -71525,932 +86122,835 @@ func main() { The canonical name of the agent that produced this item. - - `Error string` - - Error message if the server could not list tools. - - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - A request for human approval of a tool invocation. - - - `ID string` - - The unique ID of the approval request. - - - `Arguments string` + - `CallID string` - A JSON string of arguments for the tool. + The unique ID of the tool search call generated by the model. - - `Name string` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - The name of the tool to run. + Whether tool search was executed by the server or by the client. - - `ServerLabel string` + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - The label of the MCP server making the request. + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - `Type McpApprovalRequest` + - `Status BetaResponseToolSearchOutputItemParamStatus` - The type of the item. Always `mcp_approval_request`. + The status of the tool search output. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - The agent that produced this item. + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - - `AgentName string` + - `type BetaResponseInputItemAdditionalTools struct{…}` - The canonical name of the agent that produced this item. + - `Role Developer` - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + The role that provided the additional tools. Only `developer` is supported. - A response to an MCP approval request. + - `const DeveloperDeveloper Developer = "developer"` - - `ID string` + - `Tools []BetaToolUnion` - The unique ID of the approval response + A list of additional tools made available at this item. - - `ApprovalRequestID string` + - `type BetaFunctionTool struct{…}` - The ID of the approval request being answered. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Approve bool` + - `type BetaFileSearchTool struct{…}` - Whether the request was approved. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Type McpApprovalResponse` + - `type BetaComputerTool struct{…}` - The type of the item. Always `mcp_approval_response`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `type BetaComputerUsePreviewTool struct{…}` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The agent that produced this item. + - `type BetaWebSearchTool struct{…}` - - `AgentName string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The canonical name of the agent that produced this item. + - `type BetaToolMcp struct{…}` - - `Reason string` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - Optional reason for the decision. + - `type BetaToolCodeInterpreter struct{…}` - - `type BetaResponseCustomToolCall struct{…}` + A tool that runs Python code to help generate a response to a prompt. - A call to a custom tool created by the model. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `type BetaToolImageGeneration struct{…}` - The output of a custom tool call from your code, being sent back to the model. + A tool that generates images using the GPT image models. - - `ID string` + - `type BetaToolLocalShell struct{…}` - The unique ID of the custom tool call output item. + A tool that allows the model to execute shell commands in a local environment. - - `Status string` + - `type BetaFunctionShellTool struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + A tool that allows the model to execute shell commands. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `type BetaCustomTool struct{…}` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `type BetaNamespaceTool struct{…}` - - `CreatedBy string` + Groups function/custom tools under a shared namespace. - The identifier of the actor that created the item. + - `type BetaToolSearchTool struct{…}` - - `ParallelToolCalls bool` + Hosted or BYOT tool search configuration for deferred tools. - Whether to allow the model to run tool calls in parallel. + - `type BetaWebSearchPreviewTool struct{…}` - - `Temperature float64` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `type BetaApplyPatchTool struct{…}` - - `ToolChoice BetaResponseToolChoiceUnion` + Allows the assistant to create, delete, or update files using unified diffs. - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `Type AdditionalTools` - - `type BetaToolChoiceOptions string` + The item type. Always `additional_tools`. - Controls which (if any) tool is called by the model. + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - `none` means the model will not call any tool and instead generates a message. + - `ID string` - `auto` means the model can pick between generating a message or calling one or - more tools. + The unique ID of this additional tools item. - `required` means the model must call one or more tools. + - `Agent BetaResponseInputItemAdditionalToolsAgent` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + The agent that produced this item. - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + - `AgentName string` - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + The canonical name of the agent that produced this item. - - `type BetaToolChoiceAllowed struct{…}` + - `type BetaResponseReasoningItem struct{…}` - Constrains the tools available to the model to a pre-defined set. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `Mode BetaToolChoiceAllowedMode` + - `ID string` - Constrains the tools available to the model to a pre-defined set. + The unique identifier of the reasoning content. - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `Summary []BetaResponseReasoningItemSummary` - `required` requires the model to call one or more of the allowed tools. + Reasoning summary content. - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + - `Text string` - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + A summary of the reasoning output from the model so far. - - `Tools []map[string, any]` + - `Type SummaryText` - A list of tool definitions that the model should be allowed to call. + The type of the object. Always `summary_text`. - For the Responses API, the list of tool definitions might look like: + - `const SummaryTextSummaryText SummaryText = "summary_text"` - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `Type Reasoning` - - `Type AllowedTools` + The type of the object. Always `reasoning`. - Allowed tool configuration type. Always `allowed_tools`. + - `const ReasoningReasoning Reasoning = "reasoning"` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `Agent BetaResponseReasoningItemAgent` - - `type BetaToolChoiceTypes struct{…}` + The agent that produced this item. - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `AgentName string` - - `Type BetaToolChoiceTypesType` + The canonical name of the agent that produced this item. - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `Content []BetaResponseReasoningItemContent` - Allowed values are: + Reasoning text content. - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + - `Text string` - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + The reasoning text from the model. - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + - `Type ReasoningText` - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + The type of the reasoning text. Always `reasoning_text`. - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + - `EncryptedContent string` - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + - `Status BetaResponseReasoningItemStatus` - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `type BetaToolChoiceFunction struct{…}` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - Use this option to force the model to call a specific function. + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `Name string` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - The name of the function to call. + - `type BetaResponseCompactionItemParamResp struct{…}` - - `Type Function` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - For function calling, the type is always `function`. + - `EncryptedContent string` - - `const FunctionFunction Function = "function"` + The encrypted content of the compaction summary. - - `type BetaToolChoiceMcp struct{…}` + - `Type Compaction` - Use this option to force the model to call a specific tool on a remote MCP server. + The type of the item. Always `compaction`. - - `ServerLabel string` + - `const CompactionCompaction Compaction = "compaction"` - The label of the MCP server to use. + - `ID string` - - `Type Mcp` + The ID of the compaction item. - For MCP tools, the type is always `mcp`. + - `Agent BetaResponseCompactionItemParamAgentResp` - - `const McpMcp Mcp = "mcp"` + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the tool to call on the server. + The canonical name of the agent that produced this item. - - `type BetaToolChoiceCustom struct{…}` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - Use this option to force the model to call a specific custom tool. + An image generation request made by the model. - - `Name string` + - `ID string` - The name of the custom tool to call. + The unique ID of the image generation call. - - `Type Custom` + - `Result string` - For custom tool calling, the type is always `custom`. + The generated image encoded in base64. - - `const CustomCustom Custom = "custom"` + - `Status string` - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + The status of the image generation call. - - `Type ProgrammaticToolCalling` + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - The tool to call. Always `programmatic_tool_calling`. + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - - `type BetaToolChoiceApplyPatch struct{…}` + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - Forces the model to call the apply_patch tool when executing a tool call. + - `Type ImageGenerationCall` - - `Type ApplyPatch` + The type of the image generation call. Always `image_generation_call`. - The tool to call. Always `apply_patch`. + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `Agent BetaResponseInputItemImageGenerationCallAgent` - - `type BetaToolChoiceShell struct{…}` + The agent that produced this item. - Forces the model to call the shell tool when a tool call is required. + - `AgentName string` - - `Type Shell` + The canonical name of the agent that produced this item. - The tool to call. Always `shell`. + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const ShellShell Shell = "shell"` + A tool call to run code. - - `Tools []BetaToolUnion` + - `ID string` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + The unique ID of the code interpreter tool call. - We support the following categories of tools: + - `Code string` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + The code to run, or null if not available. - - `type BetaFunctionTool struct{…}` + - `ContainerID string` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The ID of the container used to run the code. - - `type BetaFileSearchTool struct{…}` + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `type BetaComputerTool struct{…}` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The logs output from the code interpreter. - - `type BetaComputerUsePreviewTool struct{…}` + - `Logs string` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The logs output from the code interpreter. - - `type BetaWebSearchTool struct{…}` + - `Type Logs` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The type of the output. Always `logs`. - - `type BetaToolMcp struct{…}` + - `const LogsLogs Logs = "logs"` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `type BetaToolCodeInterpreter struct{…}` + The image output from the code interpreter. - A tool that runs Python code to help generate a response to a prompt. + - `Type Image` - - `type BetaToolProgrammaticToolCalling struct{…}` + The type of the output. Always `image`. - - `type BetaToolImageGeneration struct{…}` + - `const ImageImage Image = "image"` - A tool that generates images using the GPT image models. + - `URL string` - - `type BetaToolLocalShell struct{…}` + The URL of the image output from the code interpreter. - A tool that allows the model to execute shell commands in a local environment. + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `type BetaFunctionShellTool struct{…}` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - A tool that allows the model to execute shell commands. + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `type BetaCustomTool struct{…}` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `type BetaNamespaceTool struct{…}` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - Groups function/custom tools under a shared namespace. + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `type BetaToolSearchTool struct{…}` + - `Type CodeInterpreterCall` - Hosted or BYOT tool search configuration for deferred tools. + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `type BetaWebSearchPreviewTool struct{…}` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `type BetaApplyPatchTool struct{…}` + The agent that produced this item. - Allows the assistant to create, delete, or update files using unified diffs. + - `AgentName string` - - `TopP float64` + The canonical name of the agent that produced this item. - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + - `type BetaResponseInputItemLocalShellCall struct{…}` - We generally recommend altering this or `temperature` but not both. + A tool call to run a command on the local shell. - - `Background bool` + - `ID string` - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + The unique ID of the local shell call. - - `CompletedAt float64` + - `Action BetaResponseInputItemLocalShellCallAction` - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. + Execute a shell command on the server. - - `Conversation BetaResponseConversation` + - `Command []string` - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + The command to run. - - `ID string` + - `Env map[string, string]` - The unique ID of the conversation that this response was associated with. + Environment variables to set for the command. - - `MaxOutputTokens int64` + - `Type Exec` - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + The type of the local shell action. Always `exec`. - - `MaxToolCalls int64` + - `const ExecExec Exec = "exec"` - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + - `TimeoutMs int64` - - `Moderation BetaResponseModeration` + Optional timeout in milliseconds for the command. - Moderation results for the response input and output, if moderated completions were requested. + - `User string` - - `Input BetaResponseModerationInputUnion` + Optional user to run the command as. - Moderation for the response input. + - `WorkingDirectory string` - - `type BetaResponseModerationInputModerationResult struct{…}` + Optional working directory to run the command in. - A moderation result produced for the response input or output. + - `CallID string` - - `Categories map[string, bool]` + The unique ID of the local shell tool call generated by the model. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `Status string` - - `CategoryAppliedInputTypes map[string, []string]` + The status of the local shell call. - Which modalities of input are reflected by the score for each category. + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - - `CategoryScores map[string, float64]` + - `Type LocalShellCall` - A dictionary of moderation categories to scores. + The type of the local shell call. Always `local_shell_call`. - - `Flagged bool` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - A boolean indicating whether the content was flagged by any category. + - `Agent BetaResponseInputItemLocalShellCallAgent` - - `Model string` + The agent that produced this item. - The moderation model that produced this result. + - `AgentName string` - - `Type ModerationResult` + The canonical name of the agent that produced this item. - The object type, which was always `moderation_result` for successful moderation results. + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + The output of a local shell tool call. - - `type BetaResponseModerationInputError struct{…}` + - `ID string` - An error produced while attempting moderation for the response input or output. + The unique ID of the local shell tool call generated by the model. - - `Code string` + - `Output string` - The error code. + A JSON string of the output of the local shell tool call. - - `Message string` + - `Type LocalShellCallOutput` - The error message. + The type of the local shell tool call output. Always `local_shell_call_output`. - - `Type Error` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - The object type, which was always `error` for moderation failures. + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - - `const ErrorError Error = "error"` + The agent that produced this item. - - `Output BetaResponseModerationOutputUnion` + - `AgentName string` - Moderation for the response output. + The canonical name of the agent that produced this item. - - `type BetaResponseModerationOutputModerationResult struct{…}` + - `Status string` - A moderation result produced for the response input or output. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `Categories map[string, bool]` + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - - `CategoryAppliedInputTypes map[string, []string]` + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - Which modalities of input are reflected by the score for each category. + - `type BetaResponseInputItemShellCall struct{…}` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + A tool representing a request to execute one or more shell commands. - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + - `Action BetaResponseInputItemShellCallAction` - - `CategoryScores map[string, float64]` + The shell commands and limits that describe how to run the tool call. - A dictionary of moderation categories to scores. + - `Commands []string` - - `Flagged bool` + Ordered shell commands for the execution environment to run. - A boolean indicating whether the content was flagged by any category. + - `MaxOutputLength int64` - - `Model string` + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - The moderation model that produced this result. + - `TimeoutMs int64` - - `Type ModerationResult` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - The object type, which was always `moderation_result` for successful moderation results. + - `CallID string` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + The unique ID of the shell tool call generated by the model. - - `type BetaResponseModerationOutputError struct{…}` + - `Type ShellCall` - An error produced while attempting moderation for the response input or output. + The type of the item. Always `shell_call`. - - `Code string` + - `const ShellCallShellCall ShellCall = "shell_call"` - The error code. + - `ID string` - - `Message string` + The unique ID of the shell tool call. Populated when this item is returned via API. - The error message. + - `Agent BetaResponseInputItemShellCallAgent` - - `Type Error` + The agent that produced this item. - The object type, which was always `error` for moderation failures. + - `AgentName string` - - `const ErrorError Error = "error"` + The canonical name of the agent that produced this item. - - `PreviousResponseID string` + - `Caller BetaResponseInputItemShellCallCallerUnion` - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + The execution context that produced this tool call. - - `Prompt BetaResponsePrompt` + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + - `Type Direct` - - `ID string` + The caller type. Always `direct`. - The unique identifier of the prompt template to use. + - `const DirectDirect Direct = "direct"` - - `Variables map[string, BetaResponsePromptVariableUnion]` + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + - `CallerID string` - - `string` + The call ID of the program item that produced this tool call. - - `type BetaResponseInputText struct{…}` + - `Type Program` - A text input to the model. + The caller type. Always `program`. - - `type BetaResponseInputImage struct{…}` + - `const ProgramProgram Program = "program"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - `type BetaResponseInputFile struct{…}` + The environment to execute the shell commands in. - A file input to the model. + - `type BetaLocalEnvironment struct{…}` - - `Version string` + - `type BetaContainerReference struct{…}` - Optional version of the prompt template. + - `Status string` - - `PromptCacheKey string` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - - `PromptCacheOptions BetaResponsePromptCacheOptions` + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - - `Mode string` + - `type BetaResponseInputItemShellCallOutput struct{…}` - Whether implicit prompt-cache breakpoints were enabled. + The streamed output items emitted by a shell tool call. - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `CallID string` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + The unique ID of the shell tool call generated by the model. - - `Ttl string` + - `Output []BetaResponseFunctionShellCallOutputContent` - The minimum lifetime applied to each cache breakpoint. + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - `PromptCacheRetention BetaResponsePromptCacheRetention` + The exit or timeout outcome associated with this shell call. - Deprecated. Use `prompt_cache_options.ttl` instead. + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + Indicates that the shell call exceeded its configured time limit. - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + - `Type Timeout` - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + The outcome type. Always `timeout`. - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `const TimeoutTimeout Timeout = "timeout"` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - `Reasoning BetaResponseReasoning` + Indicates that the shell commands finished and returned an exit code. - **gpt-5 and o-series models only** + - `ExitCode int64` - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + The exit code returned by the shell process. - - `Context string` + - `Type Exit` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + The outcome type. Always `exit`. - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + - `const ExitExit Exit = "exit"` - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + - `Stderr string` - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + Captured stderr output for the shell call. - - `Effort string` + - `Stdout string` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + Captured stdout output for the shell call. - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + - `Type ShellCallOutput` - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + The type of the item. Always `shell_call_output`. - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + - `ID string` - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + - `Agent BetaResponseInputItemShellCallOutputAgent` - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + The agent that produced this item. - - `GenerateSummary string` + - `AgentName string` - **Deprecated:** use `summary` instead. + The canonical name of the agent that produced this item. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + The execution context that produced this tool call. - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + - `Type Direct` - - `Mode string` + The caller type. Always `direct`. - Controls the reasoning execution mode for the request. + - `const DirectDirect Direct = "direct"` - When returned on a response, this is the effective execution mode. + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - `string` + - `CallerID string` - - `string` + The call ID of the program item that produced this tool call. - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + - `Type Program` - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + The caller type. Always `program`. - - `Summary string` + - `const ProgramProgram Program = "program"` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `MaxOutputLength int64` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + - `Status string` - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + The status of the shell call output. - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - - `SafetyIdentifier string` + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - - `ServiceTier BetaResponseServiceTier` + - `type BetaResponseInputItemApplyPatchCall struct{…}` - Specifies the processing type used for serving the request. + A tool call representing a request to create, delete, or update files using diff patches. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `CallID string` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + The unique ID of the apply patch tool call generated by the model. - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + The specific create, delete, or update instruction for the apply_patch tool call. - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + Instruction for creating a new file via the apply_patch tool. - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + - `Diff string` - - `Status BetaResponseStatus` + Unified diff content to apply when creating the file. - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `Path string` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + Path of the file to create relative to the workspace root. - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `Type CreateFile` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + The operation type. Always `create_file`. - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + - `const CreateFileCreateFile CreateFile = "create_file"` - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + Instruction for deleting an existing file via the apply_patch tool. - - `Text BetaResponseTextConfig` + - `Path string` - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + Path of the file to delete relative to the workspace root. - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `Type DeleteFile` - - `Format BetaResponseFormatTextConfigUnion` + The operation type. Always `delete_file`. - An object specifying the format that the model must output. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - The default format is `{ "type": "text" }` with no additional options. + Instruction for updating an existing file via the apply_patch tool. - **Not recommended for gpt-4o and newer models:** + - `Diff string` - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + Unified diff content to apply to the existing file. - - `type BetaResponseFormatTextConfigText struct{…}` + - `Path string` - Default response format. Used to generate text responses. + Path of the file to update relative to the workspace root. - - `Type Text` + - `Type UpdateFile` - The type of response format being defined. Always `text`. + The operation type. Always `update_file`. - - `const TextText Text = "text"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + - `Status string` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `Name string` + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - - `Schema map[string, any]` + - `Type ApplyPatchCall` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + The type of the item. Always `apply_patch_call`. - - `Type JSONSchema` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - The type of response format being defined. Always `json_schema`. + - `ID string` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `Description string` + - `Agent BetaResponseInputItemApplyPatchCallAgent` - A description of what the response format is for, used by the model to - determine how to respond in the format. + The agent that produced this item. - - `Strict bool` + - `AgentName string` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + The canonical name of the agent that produced this item. - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + The execution context that produced this tool call. - - `Type JSONObject` + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - The type of response format being defined. Always `json_object`. + - `Type Direct` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The caller type. Always `direct`. - - `Verbosity BetaResponseTextConfigVerbosity` + - `const DirectDirect Direct = "direct"` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + - `CallerID string` - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + The call ID of the program item that produced this tool call. - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + - `Type Program` - - `TopLogprobs int64` + The caller type. Always `program`. - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + - `const ProgramProgram Program = "program"` - - `Truncation BetaResponseTruncation` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - The truncation strategy to use for the model response. + The streamed output emitted by an apply patch tool call. - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `CallID string` - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + The unique ID of the apply patch tool call generated by the model. - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + - `Status string` - - `Usage BetaResponseUsage` + The status of the apply patch tool call output. One of `completed` or `failed`. - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - - `InputTokens int64` + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - The number of input tokens. + - `Type ApplyPatchCallOutput` - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + The type of the item. Always `apply_patch_call_output`. - A detailed breakdown of the input tokens. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `CacheWriteTokens int64` + - `ID string` - The number of input tokens that were written to the cache. + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `CachedTokens int64` + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + The agent that produced this item. - - `OutputTokens int64` + - `AgentName string` - The number of output tokens. + The canonical name of the agent that produced this item. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - A detailed breakdown of the output tokens. + The execution context that produced this tool call. - - `ReasoningTokens int64` + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - The number of reasoning tokens. + - `Type Direct` - - `TotalTokens int64` + The caller type. Always `direct`. - The total number of tokens used. + - `const DirectDirect Direct = "direct"` - - `User string` + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `CallerID string` - - `SequenceNumber int64` + The call ID of the program item that produced this tool call. - The sequence number for this event. + - `Type Program` - - `Type ResponseCreated` + The caller type. Always `program`. - The type of the event. Always `response.created`. + - `const ProgramProgram Program = "program"` - - `const ResponseCreatedResponseCreated ResponseCreated = "response.created"` + - `Output string` - - `Agent BetaResponseCreatedEventAgent` + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - The agent that owns this multi-agent streaming event. + - `type BetaResponseInputItemMcpListTools struct{…}` - - `AgentName string` + A list of tools available on an MCP server. - The canonical name of the agent that produced this item. + - `ID string` -### Beta Response Custom Tool Call + The unique ID of the list. -- `type BetaResponseCustomToolCall struct{…}` + - `ServerLabel string` - A call to a custom tool created by the model. + The label of the MCP server. - - `CallID string` + - `Tools []BetaResponseInputItemMcpListToolsTool` - An identifier used to map this custom tool call to a tool call output. + The tools available on the server. - - `Input string` + - `InputSchema any` - The input for the custom tool call generated by the model. + The JSON schema describing the tool's input. - `Name string` - The name of the custom tool being called. + The name of the tool. - - `Type CustomToolCall` + - `Annotations any` - The type of the custom tool call. Always `custom_tool_call`. + Additional annotations about the tool. - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `Description string` - - `ID string` + The description of the tool. - The unique ID of the custom tool call in the OpenAI platform. + - `Type McpListTools` - - `Agent BetaResponseCustomToolCallAgent` + The type of the item. Always `mcp_list_tools`. + + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + + - `Agent BetaResponseInputItemMcpListToolsAgent` The agent that produced this item. @@ -72458,130 +86958,140 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `Error string` - The execution context that produced this tool call. + Error message if the server could not list tools. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - - `Type Direct` + A request for human approval of a tool invocation. - - `const DirectDirect Direct = "direct"` + - `ID string` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + The unique ID of the approval request. - - `CallerID string` + - `Arguments string` - The call ID of the program item that produced this tool call. + A JSON string of arguments for the tool. - - `Type Program` + - `Name string` - - `const ProgramProgram Program = "program"` + The name of the tool to run. - - `Namespace string` + - `ServerLabel string` - The namespace of the custom tool being called. + The label of the MCP server making the request. -### Beta Response Custom Tool Call Input Delta Event + - `Type McpApprovalRequest` -- `type BetaResponseCustomToolCallInputDeltaEvent struct{…}` + The type of the item. Always `mcp_approval_request`. - Event representing a delta (partial update) to the input of a custom tool call. + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Delta string` + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - The incremental input data (delta) for the custom tool call. + The agent that produced this item. - - `ItemID string` + - `AgentName string` - Unique identifier for the API item associated with this event. + The canonical name of the agent that produced this item. - - `OutputIndex int64` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - The index of the output this delta applies to. + A response to an MCP approval request. - - `SequenceNumber int64` + - `ApprovalRequestID string` - The sequence number of this event. + The ID of the approval request being answered. - - `Type ResponseCustomToolCallInputDelta` + - `Approve bool` - The event type identifier. + Whether the request was approved. - - `const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"` + - `Type McpApprovalResponse` - - `Agent BetaResponseCustomToolCallInputDeltaEventAgent` + The type of the item. Always `mcp_approval_response`. - The agent that owns this multi-agent streaming event. + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + + - `ID string` + + The unique ID of the approval response + + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response Custom Tool Call Input Done Event + - `Reason string` -- `type BetaResponseCustomToolCallInputDoneEvent struct{…}` + Optional reason for the decision. - Event indicating that input for a custom tool call is complete. + - `type BetaResponseInputItemMcpCall struct{…}` - - `Input string` + An invocation of a tool on an MCP server. - The complete input data for the custom tool call. + - `ID string` - - `ItemID string` + The unique ID of the tool call. - Unique identifier for the API item associated with this event. + - `Arguments string` - - `OutputIndex int64` + A JSON string of the arguments passed to the tool. - The index of the output this event applies to. + - `Name string` - - `SequenceNumber int64` + The name of the tool that was run. - The sequence number of this event. + - `ServerLabel string` - - `Type ResponseCustomToolCallInputDone` + The label of the MCP server running the tool. - The event type identifier. + - `Type McpCall` - - `const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"` + The type of the item. Always `mcp_call`. - - `Agent BetaResponseCustomToolCallInputDoneEventAgent` + - `const McpCallMcpCall McpCall = "mcp_call"` - The agent that owns this multi-agent streaming event. + - `Agent BetaResponseInputItemMcpCallAgent` + + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response Custom Tool Call Item + - `ApprovalRequestID string` -- `type BetaResponseCustomToolCallItem struct{…}` + 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. - A call to a custom tool created by the model. + - `Error string` - - `ID string` + The error from the tool call, if any. - The unique ID of the custom tool call item. + - `Output string` - - `Status string` + The output from the tool call. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Status string` - - `const BetaResponseCustomToolCallItemStatusInProgress BetaResponseCustomToolCallItemStatus = "in_progress"` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `const BetaResponseCustomToolCallItemStatusCompleted BetaResponseCustomToolCallItemStatus = "completed"` + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - `const BetaResponseCustomToolCallItemStatusIncomplete BetaResponseCustomToolCallItemStatus = "incomplete"` + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - `CreatedBy string` + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - The identifier of the actor that created the item. + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` -### Beta Response Custom Tool Call Output + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` -- `type BetaResponseCustomToolCallOutput struct{…}` + - `type BetaResponseCustomToolCallOutput struct{…}` The output of a custom tool call from your code, being sent back to the model. @@ -72604,112 +87114,14 @@ func main() { 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"` - - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseInputImage struct{…}` An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Detail BetaResponseInputImageDetail` - - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. - - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseInputFile struct{…}` A file input to the model. - - `Type InputFile` - - The type of the input item. Always `input_file`. - - - `const InputFileInputFile InputFile = "input_file"` - - - `Detail BetaResponseInputFileDetail` - - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. - - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - `Type CustomToolCallOutput` The type of the custom tool call output. Always `custom_tool_call_output`. @@ -72752,210 +87164,194 @@ func main() { - `const ProgramProgram Program = "program"` -### Beta Response Custom Tool Call Output Item - -- `type BetaResponseCustomToolCallOutputItem 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 BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `type BetaResponseCustomToolCall struct{…}` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + A call to a custom tool created by the model. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `CallID string` - - `CreatedBy string` + An identifier used to map this custom tool call to a tool call output. - The identifier of the actor that created the item. + - `Input string` -### Beta Response Error + The input for the custom tool call generated by the model. -- `type BetaResponseError struct{…}` + - `Name string` - An error object returned when the model fails to generate a Response. + The name of the custom tool being called. - - `Code BetaResponseErrorCode` + - `Type CustomToolCall` - The error code for the response. + The type of the custom tool call. Always `custom_tool_call`. - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + - `ID string` - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + The unique ID of the custom tool call in the OpenAI platform. - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + - `Agent BetaResponseCustomToolCallAgent` - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + The agent that produced this item. - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + - `AgentName string` - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + The canonical name of the agent that produced this item. - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + - `Caller BetaResponseCustomToolCallCallerUnion` - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + The execution context that produced this tool call. - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + - `Type Direct` - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + - `const DirectDirect Direct = "direct"` - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + - `CallerID string` - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + The call ID of the program item that produced this tool call. - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + - `Type Program` - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `Namespace string` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + The namespace of the custom tool being called. - - `Message string` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - A human-readable description of the error. + Compacts the current context. Must be the final input item. -### Beta Response Error Event + - `Type CompactionTrigger` -- `type BetaResponseErrorEvent struct{…}` + The type of the item. Always `compaction_trigger`. - Emitted when an error occurs. + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `Code string` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - The error code. + The agent that produced this item. - - `Message string` + - `AgentName string` - The error message. + The canonical name of the agent that produced this item. - - `Param string` + - `type BetaResponseInputItemItemReference struct{…}` - The error parameter. + An internal identifier for an item to reference. - - `SequenceNumber int64` + - `ID string` - The sequence number of this event. + The ID of the item to reference. - - `Type Error` + - `Agent BetaResponseInputItemItemReferenceAgent` - The type of the event. Always `error`. + The agent that produced this item. - - `const ErrorError Error = "error"` + - `AgentName string` - - `Agent BetaResponseErrorEventAgent` + The canonical name of the agent that produced this item. - The agent that owns this multi-agent streaming event. + - `Type string` - - `AgentName string` + The type of item to reference. Always `item_reference`. - The canonical name of the agent that produced this item. + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` -### Beta Response Failed Event + - `type BetaResponseInputItemProgram struct{…}` -- `type BetaResponseFailedEvent struct{…}` + - `ID string` - An event that is emitted when a response fails. + The unique ID of this program item. - - `Response BetaResponse` + - `CallID string` - The response that failed. + The stable call ID of the program item. - - `ID string` + - `Code string` - Unique identifier for this Response. + The JavaScript source executed by programmatic tool calling. - - `CreatedAt float64` + - `Fingerprint string` - Unix timestamp (in seconds) of when this Response was created. + Opaque program replay fingerprint that must be round-tripped. - - `Error BetaResponseError` + - `Type Program` - An error object returned when the model fails to generate a Response. + The item type. Always `program`. - - `Code BetaResponseErrorCode` + - `const ProgramProgram Program = "program"` - The error code for the response. + - `Agent BetaResponseInputItemProgramAgent` - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + The agent that produced this item. - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + - `AgentName string` - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + The canonical name of the agent that produced this item. - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + - `type BetaResponseInputItemProgramOutput struct{…}` - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `ID string` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + The unique ID of this program output item. - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + - `CallID string` - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + The call ID of the program item. - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + - `Result string` - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + The result produced by the program item. - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + - `Status string` - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + The terminal status of the program output. - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + - `Type ProgramOutput` - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + The item type. Always `program_output`. - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `Agent BetaResponseInputItemProgramOutputAgent` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + The agent that produced this item. - - `Message string` + - `AgentName string` - A human-readable description of the error. + The canonical name of the agent that produced this item. - - `IncompleteDetails BetaResponseIncompleteDetails` + - `ResponseID string` - Details about why the response is incomplete. + The ID of the response that rejected the input. - - `Reason string` + - `SequenceNumber int64` - The reason why the response is incomplete. + The sequence number for this event. - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + - `Type ResponseInjectFailed` - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + The event discriminator. Always `response.inject.failed`. - - `Instructions BetaResponseInstructionsUnion` + - `const ResponseInjectFailedResponseInjectFailed ResponseInjectFailed = "response.inject.failed"` - A system (or developer) message inserted into the model's context. + - `StreamID string` - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + The multiplexed WebSocket stream that emitted the event. This field is + present only when WebSocket multiplexing is enabled separately. - - `string` +### Beta Response Input - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` +- `type BetaResponseInput []BetaResponseInputItemUnion` A list of one or many input items to the model, containing different content types. @@ -73111,6 +87507,8 @@ func main() { - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + - `Type BetaEasyInputMessageType` The type of the message input. Always `message`. @@ -73358,6 +87756,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -74538,7 +88938,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -74595,7 +88999,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -76735,437 +91143,94 @@ func main() { The canonical name of the agent that produced this item. - - `Metadata map[string, string]` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `Model BetaResponseModel` - - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - - - `type BetaResponseModel string` - - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - - - `const BetaResponseModelO3 BetaResponseModel = "o3"` - - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - - - `const BetaResponseModelO1 BetaResponseModel = "o1"` - - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` - - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` - - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - - - `string` - - - `Object Response` - - The object type of this resource - always set to `response`. - - - `const ResponseResponse Response = "response"` - - - `Output []BetaResponseOutputItemUnion` - - An array of content items generated by the model. - - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - - - `type BetaResponseOutputMessage struct{…}` - - An output message from the model. - - - `type BetaResponseFileSearchToolCall struct{…}` +### Beta Response Input Audio - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. +- `type BetaResponseInputAudio struct{…}` - - `type BetaResponseFunctionToolCall struct{…}` + An audio input to the model. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `InputAudio BetaResponseInputAudioInputAudio` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `Data string` - - `ID string` + Base64-encoded audio data. - The unique ID of the function call tool output. + - `Format string` - - `CallID string` + The format of the audio data. Currently supported formats are `mp3` and + `wav`. - The unique ID of the function tool call generated by the model. + - `const BetaResponseInputAudioInputAudioFormatMP3 BetaResponseInputAudioInputAudioFormat = "mp3"` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `const BetaResponseInputAudioInputAudioFormatWAV BetaResponseInputAudioInputAudioFormat = "wav"` - The output from the function call generated by your code. - Can be a string or an list of output content. + - `Type InputAudio` - - `string` + The type of the input item. Always `input_audio`. - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `const InputAudioInputAudio InputAudio = "input_audio"` - Text, image, or file output of the function call. +### Beta Response Input Content - - `type BetaResponseInputText struct{…}` +- `type BetaResponseInputContentUnion interface{…}` A text input to the model. - - `type BetaResponseInputImage struct{…}` - - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - - `type BetaResponseInputFile struct{…}` - - A file input to the model. - - - `Status BetaResponseFunctionToolCallOutputItemStatus` - - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - - `Type FunctionCallOutput` - - The type of the function tool call output. Always `function_call_output`. - - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - - `Agent BetaResponseFunctionToolCallOutputItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - The caller type. Always `program`. - - - `const ProgramProgram Program = "program"` - - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseOutputItemAgentMessage struct{…}` - - - `ID string` - - The unique ID of the agent message. - - - `Author string` - - The sending agent identity. - - - `Content []BetaResponseOutputItemAgentMessageContentUnion` - - Encrypted content sent between agents. - - `type BetaResponseInputText struct{…}` A text input to the model. - - `type BetaResponseOutputText struct{…}` - - A text output from the model. - - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - - A text content. - - - `Text string` - - - `Type Text` - - - `const TextText Text = "text"` - - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - - A summary text from the model. - - `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 BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + The text input to the model. - Reasoning text from the model. + - `Type InputText` - - `Text string` + The type of the input item. Always `input_text`. - The reasoning text from the model. + - `const InputTextInputText InputText = "input_text"` - - `Type ReasoningText` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - The type of the reasoning text. Always `reasoning_text`. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Mode Explicit` - - `type BetaResponseOutputRefusal struct{…}` + The breakpoint mode. Always `explicit`. - A refusal from the model. + - `const ExplicitExplicit Explicit = "explicit"` - `type BetaResponseInputImage struct{…}` An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + - `Detail BetaResponseInputImageDetail` - A screenshot of a computer. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `Detail string` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `Type InputImage` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + The type of the input item. Always `input_image`. + + - `const InputImageInputImage InputImage = "input_image"` - `FileID string` - The identifier of an uploaded file that contains the screenshot. + The ID of the file to be sent to the model. - `ImageURL string` - The URL of the screenshot image. - - - `Type ComputerScreenshot` - - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -77179,802 +91244,419 @@ func main() { A file input to the model. - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - - Opaque encrypted content that Responses API decrypts inside trusted model execution. - - - `EncryptedContent string` - - Opaque encrypted content. - - - `Type EncryptedContent` - - The type of the input item. Always `encrypted_content`. - - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - - `Recipient string` - - The destination agent identity. - - - `Type AgentMessage` - - The type of the item. Always `agent_message`. - - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - - `Agent BetaResponseOutputItemAgentMessageAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - - `ID string` - - The unique ID of the multi-agent call item. - - - `Action string` - - The multi-agent action to execute. - - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - - - `Arguments string` - - The JSON string of arguments generated for the action. - - - `CallID string` - - The unique ID linking this call to its output. - - - `Type MultiAgentCall` - - The type of the multi-agent call. Always `multi_agent_call`. - - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - - `Agent BetaResponseOutputItemMultiAgentCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - - - `ID string` - - The unique ID of the multi-agent call output item. - - - `Action string` - - The multi-agent action that produced this result. - - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - - - `CallID string` - - The unique ID of the multi-agent call. - - - `Output []BetaResponseOutputText` - - Text output returned by the multi-agent action. - - - `Annotations []BetaResponseOutputTextAnnotationUnion` - - The annotations of the text output. - - - `Text string` - - The text output from the model. - - - `Type OutputText` - - The type of the output text. Always `output_text`. - - - `Logprobs []BetaResponseOutputTextLogprob` - - - `Type MultiAgentCallOutput` - - The type of the multi-agent result. Always `multi_agent_call_output`. - - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseFunctionWebSearch struct{…}` - - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - - `type BetaResponseComputerToolCall struct{…}` - - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - - `type BetaResponseComputerToolCallOutputItem 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 BetaResponseComputerToolCallOutputScreenshot` - - A computer screenshot image used with the computer use tool. - - - `Status BetaResponseComputerToolCallOutputItemStatus` - - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. - - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - - `Type ComputerCallOutput` - - The type of the computer tool call output. Always `computer_call_output`. - - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - 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. - - - `Agent BetaResponseComputerToolCallOutputItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). - - - `type BetaResponseOutputItemProgram struct{…}` - - - `ID string` - - The unique ID of the program item. - - - `CallID string` - - The stable call ID of the program item. - - - `Code string` - - The JavaScript source executed by programmatic tool calling. - - - `Fingerprint string` - - Opaque program replay fingerprint that must be round-tripped. - - - `Type Program` - - The type of the item. Always `program`. - - - `const ProgramProgram Program = "program"` - - - `Agent BetaResponseOutputItemProgramAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseOutputItemProgramOutput struct{…}` - - - `ID string` - - The unique ID of the program output item. - - - `CallID string` - - The call ID of the program item. - - - `Result string` - - The result produced by the program item. - - - `Status string` - - The terminal status of the program output item. - - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - - `Type ProgramOutput` - - The type of the item. Always `program_output`. - - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - - `Agent BetaResponseOutputItemProgramOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseToolSearchCall 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 BetaResponseToolSearchCallExecution` - - Whether tool search was executed by the server or by the client. - - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - - `Status BetaResponseToolSearchCallStatus` - - The status of the tool search call item that was recorded. - - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - - - `Type ToolSearchCall` - - The type of the item. Always `tool_search_call`. - - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - - `Agent BetaResponseToolSearchCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseToolSearchOutputItem 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 BetaResponseToolSearchOutputItemExecution` - - Whether tool search was executed by the server or by the client. - - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - - - `Status BetaResponseToolSearchOutputItemStatus` - - The status of the tool search output item that was recorded. - - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - - - `Tools []BetaToolUnion` - - The loaded tool definitions returned by tool search. - - - `type BetaFunctionTool struct{…}` - - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - - `type BetaFileSearchTool struct{…}` - - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - - `type BetaComputerTool struct{…}` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type BetaComputerUsePreviewTool struct{…}` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type BetaWebSearchTool struct{…}` - - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `type BetaToolMcp struct{…}` - - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - - `type BetaToolCodeInterpreter struct{…}` - - A tool that runs Python code to help generate a response to a prompt. - - - `type BetaToolProgrammaticToolCalling struct{…}` - - - `type BetaToolImageGeneration struct{…}` - - A tool that generates images using the GPT image models. + - `Type InputFile` - - `type BetaToolLocalShell struct{…}` + The type of the input item. Always `input_file`. - A tool that allows the model to execute shell commands in a local environment. + - `const InputFileInputFile InputFile = "input_file"` - - `type BetaFunctionShellTool struct{…}` + - `Detail BetaResponseInputFileDetail` - A tool that allows the model to execute shell commands. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `type BetaCustomTool struct{…}` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `type BetaNamespaceTool struct{…}` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - Groups function/custom tools under a shared namespace. + - `FileData string` - - `type BetaToolSearchTool struct{…}` + The content of the file to be sent to the model. - Hosted or BYOT tool search configuration for deferred tools. + - `FileID string` - - `type BetaWebSearchPreviewTool struct{…}` + The ID of the file to be sent to the model. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `FileURL string` - - `type BetaApplyPatchTool struct{…}` + The URL of the file to be sent to the model. - Allows the assistant to create, delete, or update files using unified diffs. + - `Filename string` - - `Type ToolSearchOutput` + The name of the file to be sent to the model. - The type of the item. Always `tool_search_output`. + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Agent BetaResponseToolSearchOutputItemAgent` + - `Mode Explicit` - The agent that produced this item. + The breakpoint mode. Always `explicit`. - - `AgentName string` + - `const ExplicitExplicit Explicit = "explicit"` - The canonical name of the agent that produced this item. +### Beta Response Input File - - `CreatedBy string` +- `type BetaResponseInputFile struct{…}` - The identifier of the actor that created the item. + A file input to the model. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `Type InputFile` - - `ID string` + The type of the input item. Always `input_file`. - The unique ID of the additional tools item. + - `const InputFileInputFile InputFile = "input_file"` - - `Role string` + - `Detail BetaResponseInputFileDetail` - The role that provided the additional tools. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `FileData string` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + The content of the file to be sent to the model. - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + - `FileID string` - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + The ID of the file to be sent to the model. - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + - `FileURL string` - - `Tools []BetaToolUnion` + The URL of the file to be sent to the model. - The additional tool definitions made available at this item. + - `Filename string` - - `type BetaFunctionTool struct{…}` + The name of the file to be sent to the model. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `type BetaFileSearchTool struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `Mode Explicit` - - `type BetaComputerTool struct{…}` + The breakpoint mode. Always `explicit`. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaComputerUsePreviewTool struct{…}` +### Beta Response Input File Content - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). +- `type BetaResponseInputFileContent struct{…}` - - `type BetaWebSearchTool struct{…}` + A file input to the model. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Type InputFile` - - `type BetaToolMcp struct{…}` + The type of the input item. Always `input_file`. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const InputFileInputFile InputFile = "input_file"` - - `type BetaToolCodeInterpreter struct{…}` + - `Detail BetaResponseInputFileContentDetail` - A tool that runs Python code to help generate a response to a prompt. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `type BetaToolImageGeneration struct{…}` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - A tool that generates images using the GPT image models. + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `type BetaToolLocalShell struct{…}` + - `FileData string` - A tool that allows the model to execute shell commands in a local environment. + The base64-encoded data of the file to be sent to the model. - - `type BetaFunctionShellTool struct{…}` + - `FileID string` - A tool that allows the model to execute shell commands. + The ID of the file to be sent to the model. - - `type BetaCustomTool struct{…}` + - `FileURL string` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The URL of the file to be sent to the model. - - `type BetaNamespaceTool struct{…}` + - `Filename string` - Groups function/custom tools under a shared namespace. + The name of the file to be sent to the model. - - `type BetaToolSearchTool struct{…}` + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - Hosted or BYOT tool search configuration for deferred tools. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `type BetaWebSearchPreviewTool struct{…}` + - `Mode Explicit` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The breakpoint mode. Always `explicit`. - - `type BetaApplyPatchTool struct{…}` + - `const ExplicitExplicit Explicit = "explicit"` - Allows the assistant to create, delete, or update files using unified diffs. +### Beta Response Input Image - - `Type AdditionalTools` +- `type BetaResponseInputImage struct{…}` - The type of the item. Always `additional_tools`. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `Detail BetaResponseInputImageDetail` - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The agent that produced this item. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `AgentName string` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - The canonical name of the agent that produced this item. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `type BetaResponseCompactionItem struct{…}` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `Type InputImage` - - `ID string` + The type of the input item. Always `input_image`. - The unique ID of the compaction item. + - `const InputImageInputImage InputImage = "input_image"` - - `EncryptedContent string` + - `FileID string` - The encrypted content that was produced by compaction. + The ID of the file to be sent to the model. - - `Type Compaction` + - `ImageURL string` - The type of the item. Always `compaction`. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `const CompactionCompaction Compaction = "compaction"` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `Agent BetaResponseCompactionItemAgent` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The agent that produced this item. + - `Mode Explicit` - - `AgentName string` + The breakpoint mode. Always `explicit`. - The canonical name of the agent that produced this item. + - `const ExplicitExplicit Explicit = "explicit"` - - `CreatedBy string` +### Beta Response Input Image Content - The identifier of the actor that created the item. +- `type BetaResponseInputImageContent struct{…}` - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - An image generation request made by the model. + - `Type InputImage` - - `ID string` + The type of the input item. Always `input_image`. - The unique ID of the image generation call. + - `const InputImageInputImage InputImage = "input_image"` - - `Result string` + - `Detail BetaResponseInputImageContentDetail` - The generated image encoded in base64. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `Status string` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - The status of the image generation call. + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `FileID string` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + The ID of the file to be sent to the model. - - `Type ImageGenerationCall` + - `ImageURL string` - The type of the image generation call. Always `image_generation_call`. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The agent that produced this item. + - `Mode Explicit` - - `AgentName string` + The breakpoint mode. Always `explicit`. - The canonical name of the agent that produced this item. + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseCodeInterpreterToolCall struct{…}` +### Beta Response Input Item - A tool call to run code. +- `type BetaResponseInputItemUnion interface{…}` - - `type BetaResponseOutputItemLocalShellCall struct{…}` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - A tool call to run a command on the local shell. + - `type BetaEasyInputMessage struct{…}` - - `ID string` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - The unique ID of the local shell call. + - `Content BetaEasyInputMessageContentUnion` - - `Action BetaResponseOutputItemLocalShellCallAction` + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - Execute a shell command on the server. + - `string` - - `Command []string` + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - The command to run. + A list of one or many input items to the model, containing different content + types. - - `Env map[string, string]` + - `type BetaResponseInputText struct{…}` - Environment variables to set for the command. + A text input to the model. - - `Type Exec` + - `Text string` - The type of the local shell action. Always `exec`. + The text input to the model. - - `const ExecExec Exec = "exec"` + - `Type InputText` - - `TimeoutMs int64` + The type of the input item. Always `input_text`. - Optional timeout in milliseconds for the command. + - `const InputTextInputText InputText = "input_text"` - - `User string` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - Optional user to run the command as. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `WorkingDirectory string` + - `Mode Explicit` - Optional working directory to run the command in. + The breakpoint mode. Always `explicit`. - - `CallID string` + - `const ExplicitExplicit Explicit = "explicit"` - The unique ID of the local shell tool call generated by the model. + - `type BetaResponseInputImage struct{…}` - - `Status string` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The status of the local shell call. + - `Detail BetaResponseInputImageDetail` - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `Type LocalShellCall` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - The type of the local shell call. Always `local_shell_call`. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `Type InputImage` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + The type of the input item. Always `input_image`. - The agent that produced this item. + - `const InputImageInputImage InputImage = "input_image"` - - `AgentName string` + - `FileID string` - The canonical name of the agent that produced this item. + The ID of the file to be sent to the model. - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + - `ImageURL string` - The output of a local shell tool call. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `ID string` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - The unique ID of the local shell tool call generated by the model. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Output string` + - `Mode Explicit` - A JSON string of the output of the local shell tool call. + The breakpoint mode. Always `explicit`. - - `Type LocalShellCallOutput` + - `const ExplicitExplicit Explicit = "explicit"` - The type of the local shell tool call output. Always `local_shell_call_output`. + - `type BetaResponseInputFile struct{…}` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + A file input to the model. - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + - `Type InputFile` - The agent that produced this item. + The type of the input item. Always `input_file`. - - `AgentName string` + - `const InputFileInputFile InputFile = "input_file"` - The canonical name of the agent that produced this item. + - `Detail BetaResponseInputFileDetail` - - `Status string` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + - `FileData string` - - `type BetaResponseFunctionShellToolCall struct{…}` + The content of the file to be sent to the model. - A tool call that executes one or more shell commands in a managed environment. + - `FileID string` - - `ID string` + The ID of the file to be sent to the model. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `FileURL string` - - `Action BetaResponseFunctionShellToolCallAction` + The URL of the file to be sent to the model. - The shell commands and limits that describe how to run the tool call. + - `Filename string` - - `Commands []string` + The name of the file to be sent to the model. - - `MaxOutputLength int64` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - Optional maximum number of characters to return from each command. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `TimeoutMs int64` + - `Mode Explicit` - Optional timeout in milliseconds for the commands. + The breakpoint mode. Always `explicit`. - - `CallID string` + - `const ExplicitExplicit Explicit = "explicit"` - The unique ID of the shell tool call generated by the model. + - `Role BetaEasyInputMessageRole` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - Represents the use of a local environment to perform shell actions. + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - - `type BetaResponseLocalEnvironment struct{…}` + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - Represents the use of a local environment to perform shell actions. + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - - `Type Local` + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - The environment type. Always `local`. + - `Phase BetaEasyInputMessagePhase` - - `const LocalLocal Local = "local"` + 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. - - `type BetaResponseContainerReference struct{…}` + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - Represents a container created with /v1/containers. + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - - `ContainerID string` + - `Type BetaEasyInputMessageType` - - `Type ContainerReference` + The type of the message input. Always `message`. - The environment type. Always `container_reference`. + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `type BetaResponseInputItemMessage struct{…}` - - `Status BetaResponseFunctionShellToolCallStatus` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `Content BetaResponseInputMessageContentList` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + A list of one or many input items to the model, containing different content + types. - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `Role string` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + The role of the message input. One of `user`, `system`, or `developer`. - - `Type ShellCall` + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` - The type of the item. Always `shell_call`. + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` - - `const ShellCallShellCall ShellCall = "shell_call"` + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` - - `Agent BetaResponseFunctionShellToolCallAgent` + - `Agent BetaResponseInputItemMessageAgent` The agent that produced this item. @@ -77982,1467 +91664,1393 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` - - The execution context that produced this tool call. + - `Status string` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Type Direct` + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - - `const DirectDirect Direct = "direct"` + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - - `CallerID string` + - `Type string` - The call ID of the program item that produced this tool call. + The type of the message input. Always set to `message`. - - `Type Program` + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - - `const ProgramProgram Program = "program"` + - `type BetaResponseOutputMessage struct{…}` - - `CreatedBy string` + An output message from the model. - The ID of the entity that created this tool call. + - `ID string` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + The unique ID of the output message. - The output of a shell tool call that was emitted. + - `Content []BetaResponseOutputMessageContentUnion` - - `ID string` + The content of the output message. - The unique ID of the shell call output. Populated when this item is returned via API. + - `type BetaResponseOutputText struct{…}` - - `CallID string` + A text output from the model. - The unique ID of the shell tool call generated by the model. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `MaxOutputLength int64` + The annotations of the text output. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + A citation to a file. - An array of shell call output contents + - `FileID string` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + The ID of the file. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Filename string` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + The filename of the file cited. - Indicates that the shell call exceeded its configured time limit. + - `Index int64` - - `Type Timeout` + The index of the file in the list of files. - The outcome type. Always `timeout`. + - `Type FileCitation` - - `const TimeoutTimeout Timeout = "timeout"` + The type of the file citation. Always `file_citation`. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `const FileCitationFileCitation FileCitation = "file_citation"` - Indicates that the shell commands finished and returned an exit code. + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - - `ExitCode int64` + A citation for a web resource used to generate a model response. - Exit code from the shell process. + - `EndIndex int64` - - `Type Exit` + The index of the last character of the URL citation in the message. - The outcome type. Always `exit`. + - `StartIndex int64` - - `const ExitExit Exit = "exit"` + The index of the first character of the URL citation in the message. - - `Stderr string` + - `Title string` - The standard error output that was captured. + The title of the web resource. - - `Stdout string` + - `Type URLCitation` - The standard output that was captured. + The type of the URL citation. Always `url_citation`. - - `CreatedBy string` + - `const URLCitationURLCitation URLCitation = "url_citation"` - The identifier of the actor that created the item. + - `URL string` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + The URL of the web resource. - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + A citation for a container file used to generate a model response. - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `ContainerID string` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + The ID of the container file. - - `Type ShellCallOutput` + - `EndIndex int64` - The type of the shell call output. Always `shell_call_output`. + The index of the last character of the container file citation in the message. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `FileID string` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + The ID of the file. - The agent that produced this item. + - `Filename string` - - `AgentName string` + The filename of the container file cited. - The canonical name of the agent that produced this item. + - `StartIndex int64` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + The index of the first character of the container file citation in the message. - The execution context that produced this tool call. + - `Type ContainerFileCitation` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + The type of the container file citation. Always `container_file_citation`. - - `Type Direct` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `const DirectDirect Direct = "direct"` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + A path to a file. - - `CallerID string` + - `FileID string` - The call ID of the program item that produced this tool call. + The ID of the file. - - `Type Program` + - `Index int64` - - `const ProgramProgram Program = "program"` + The index of the file in the list of files. - - `CreatedBy string` + - `Type FilePath` - The identifier of the actor that created the item. + The type of the file path. Always `file_path`. - - `type BetaResponseApplyPatchToolCall struct{…}` + - `const FilePathFilePath FilePath = "file_path"` - A tool call that applies file diffs by creating, deleting, or updating files. + - `Text string` - - `ID string` + The text output from the model. - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `Type OutputText` - - `CallID string` + The type of the output text. Always `output_text`. - The unique ID of the apply patch tool call generated by the model. + - `const OutputTextOutputText OutputText = "output_text"` - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `Logprobs []BetaResponseOutputTextLogprob` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `Token string` - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `Bytes []int64` - Instruction describing how to create a file via the apply_patch tool. + - `Logprob float64` - - `Diff string` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - Diff to apply. + - `Token string` - - `Path string` + - `Bytes []int64` - Path of the file to create. + - `Logprob float64` - - `Type CreateFile` + - `type BetaResponseOutputRefusal struct{…}` - Create a new file with the provided diff. + A refusal from the model. - - `const CreateFileCreateFile CreateFile = "create_file"` + - `Refusal string` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + The refusal explanation from the model. - Instruction describing how to delete a file via the apply_patch tool. + - `Type Refusal` - - `Path string` + The type of the refusal. Always `refusal`. - Path of the file to delete. + - `const RefusalRefusal Refusal = "refusal"` - - `Type DeleteFile` + - `Role Assistant` - Delete the specified file. + The role of the output message. Always `assistant`. - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `const AssistantAssistant Assistant = "assistant"` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `Status BetaResponseOutputMessageStatus` - Instruction describing how to update a file via the apply_patch tool. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `Diff string` + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - Diff to apply. + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - - `Path string` + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - Path of the file to update. + - `Type Message` - - `Type UpdateFile` + The type of the output message. Always `message`. - Update an existing file with the provided diff. + - `const MessageMessage Message = "message"` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `Agent BetaResponseOutputMessageAgent` - - `Status BetaResponseApplyPatchToolCallStatus` + The agent that produced this item. - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `AgentName string` - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + The canonical name of the agent that produced this item. - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + - `Phase BetaResponseOutputMessagePhase` - - `Type ApplyPatchCall` + 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. - The type of the item. Always `apply_patch_call`. + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - - `Agent BetaResponseApplyPatchToolCallAgent` + - `type BetaResponseFileSearchToolCall struct{…}` - The agent that produced this item. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `AgentName string` + - `ID string` - The canonical name of the agent that produced this item. + The unique ID of the file search tool call. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `Queries []string` - The execution context that produced this tool call. + The queries used to search for files. - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `Status BetaResponseFileSearchToolCallStatus` - - `Type Direct` + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `const DirectDirect Direct = "direct"` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `CallerID string` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - The call ID of the program item that produced this tool call. + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `Type Program` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - - `const ProgramProgram Program = "program"` + - `Type FileSearchCall` - - `CreatedBy string` + The type of the file search tool call. Always `file_search_call`. - The ID of the entity that created this tool call. + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + - `Agent BetaResponseFileSearchToolCallAgent` - The output emitted by an apply patch tool call. + The agent that produced this item. - - `ID string` + - `AgentName string` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The canonical name of the agent that produced this item. - - `CallID string` + - `Results []BetaResponseFileSearchToolCallResult` - The unique ID of the apply patch tool call generated by the model. + The results of the file search tool call. - - `Status BetaResponseApplyPatchToolCallOutputStatus` + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - The status of the apply patch tool call output. One of `completed` or `failed`. + 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. - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `string` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `float64` - - `Type ApplyPatchCallOutput` + - `bool` - The type of the item. Always `apply_patch_call_output`. + - `FileID string` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + The unique ID of the file. - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `Filename string` - The agent that produced this item. + The name of the file. - - `AgentName string` + - `Score float64` - The canonical name of the agent that produced this item. + The relevance score of the file - a value between 0 and 1. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `Text string` - The execution context that produced this tool call. + The text that was retrieved from the file. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `type BetaResponseComputerToolCall struct{…}` - - `Type Direct` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `const DirectDirect Direct = "direct"` + - `ID string` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + The unique ID of the computer call. - - `CallerID string` + - `CallID string` - The call ID of the program item that produced this tool call. + An identifier used when responding to the tool call with output. - - `Type Program` + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `const ProgramProgram Program = "program"` + The pending safety checks for the computer call. - - `CreatedBy string` + - `ID string` - The ID of the entity that created this tool call output. + The ID of the pending safety check. - - `Output string` + - `Code string` - Optional textual output returned by the apply patch tool. + The type of the pending safety check. - - `type BetaResponseOutputItemMcpCall struct{…}` + - `Message string` - An invocation of a tool on an MCP server. + Details about the pending safety check. - - `ID string` + - `Status BetaResponseComputerToolCallStatus` - The unique ID of the tool call. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Arguments string` + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - A JSON string of the arguments passed to the tool. + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - - `Name string` + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - The name of the tool that was run. + - `Type BetaResponseComputerToolCallType` - - `ServerLabel string` + The type of the computer call. Always `computer_call`. - The label of the MCP server running the tool. + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `Type McpCall` + - `Action BetaComputerActionUnion` - The type of the item. Always `mcp_call`. + A click action. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `type BetaComputerActionClick struct{…}` - - `Agent BetaResponseOutputItemMcpCallAgent` + A click action. - The agent that produced this item. + - `Button string` - - `AgentName string` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - The canonical name of the agent that produced this item. + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `ApprovalRequestID string` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - 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. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `Error string` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - The error from the tool call, if any. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `Output string` + - `Type Click` - The output from the tool call. + Specifies the event type. For a click action, this property is always `click`. - - `Status string` + - `const ClickClick Click = "click"` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `X int64` - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + The x-coordinate where the click occurred. - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + - `Y int64` - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + The y-coordinate where the click occurred. - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + - `Keys []string` - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + The keys being held while clicking. - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `type BetaComputerActionDoubleClick struct{…}` - A list of tools available on an MCP server. + A double click action. - - `ID string` + - `Keys []string` - The unique ID of the list. + The keys being held while double-clicking. - - `ServerLabel string` + - `Type DoubleClick` - The label of the MCP server. + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `Tools []BetaResponseOutputItemMcpListToolsTool` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - The tools available on the server. + - `X int64` - - `InputSchema any` + The x-coordinate where the double click occurred. - The JSON schema describing the tool's input. + - `Y int64` - - `Name string` + The y-coordinate where the double click occurred. - The name of the tool. + - `type BetaComputerActionDrag struct{…}` - - `Annotations any` + A drag action. - Additional annotations about the tool. + - `Path []BetaComputerActionDragPath` - - `Description string` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - The description of the tool. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `Type McpListTools` + - `X int64` - The type of the item. Always `mcp_list_tools`. + The x-coordinate. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `Y int64` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + The y-coordinate. - The agent that produced this item. + - `Type Drag` - - `AgentName string` + Specifies the event type. For a drag action, this property is always set to `drag`. - The canonical name of the agent that produced this item. + - `const DragDrag Drag = "drag"` - - `Error string` + - `Keys []string` - Error message if the server could not list tools. + The keys being held while dragging the mouse. - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + - `type BetaComputerActionKeypress struct{…}` - A request for human approval of a tool invocation. + A collection of keypresses the model would like to perform. - - `ID string` + - `Keys []string` - The unique ID of the approval request. + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `Arguments string` + - `Type Keypress` - A JSON string of arguments for the tool. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `Name string` + - `const KeypressKeypress Keypress = "keypress"` - The name of the tool to run. + - `type BetaComputerActionMove struct{…}` - - `ServerLabel string` + A mouse move action. - The label of the MCP server making the request. + - `Type Move` - - `Type McpApprovalRequest` + Specifies the event type. For a move action, this property is always set to `move`. - The type of the item. Always `mcp_approval_request`. + - `const MoveMove Move = "move"` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `X int64` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + The x-coordinate to move to. - The agent that produced this item. + - `Y int64` - - `AgentName string` + The y-coordinate to move to. - The canonical name of the agent that produced this item. + - `Keys []string` - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + The keys being held while moving the mouse. - A response to an MCP approval request. + - `type BetaComputerActionScreenshot struct{…}` - - `ID string` + A screenshot action. - The unique ID of the approval response + - `Type Screenshot` - - `ApprovalRequestID string` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - The ID of the approval request being answered. + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `Approve bool` + - `type BetaComputerActionScroll struct{…}` - Whether the request was approved. + A scroll action. - - `Type McpApprovalResponse` + - `ScrollX int64` - The type of the item. Always `mcp_approval_response`. + The horizontal scroll distance. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `ScrollY int64` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + The vertical scroll distance. - The agent that produced this item. + - `Type Scroll` - - `AgentName string` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - The canonical name of the agent that produced this item. + - `const ScrollScroll Scroll = "scroll"` - - `Reason string` + - `X int64` - Optional reason for the decision. + The x-coordinate where the scroll occurred. - - `type BetaResponseCustomToolCall struct{…}` + - `Y int64` - A call to a custom tool created by the model. + The y-coordinate where the scroll occurred. - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `Keys []string` - The output of a custom tool call from your code, being sent back to the model. + The keys being held while scrolling. - - `ID string` + - `type BetaComputerActionType struct{…}` - The unique ID of the custom tool call output item. + An action to type in text. - - `Status string` + - `Text string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The text to type. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `Type Type` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + Specifies the event type. For a type action, this property is always set to `type`. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `const TypeType Type = "type"` - - `CreatedBy string` + - `type BetaComputerActionWait struct{…}` - The identifier of the actor that created the item. + A wait action. - - `ParallelToolCalls bool` + - `Type Wait` - Whether to allow the model to run tool calls in parallel. + Specifies the event type. For a wait action, this property is always set to `wait`. - - `Temperature float64` + - `const WaitWait Wait = "wait"` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `Actions BetaComputerActionList` - - `ToolChoice BetaResponseToolChoiceUnion` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `type BetaComputerActionClick struct{…}` - - `type BetaToolChoiceOptions string` + A click action. - Controls which (if any) tool is called by the model. + - `type BetaComputerActionDoubleClick struct{…}` - `none` means the model will not call any tool and instead generates a message. + A double click action. - `auto` means the model can pick between generating a message or calling one or - more tools. + - `type BetaComputerActionDrag struct{…}` - `required` means the model must call one or more tools. + A drag action. - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + - `type BetaComputerActionKeypress struct{…}` - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + A collection of keypresses the model would like to perform. - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + - `type BetaComputerActionMove struct{…}` - - `type BetaToolChoiceAllowed struct{…}` + A mouse move action. - Constrains the tools available to the model to a pre-defined set. + - `type BetaComputerActionScreenshot struct{…}` - - `Mode BetaToolChoiceAllowedMode` + A screenshot action. - Constrains the tools available to the model to a pre-defined set. + - `type BetaComputerActionScroll struct{…}` - `auto` allows the model to pick from among the allowed tools and generate a - message. + A scroll action. - `required` requires the model to call one or more of the allowed tools. + - `type BetaComputerActionType struct{…}` - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + An action to type in text. - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + - `type BetaComputerActionWait struct{…}` - - `Tools []map[string, any]` + A wait action. - A list of tool definitions that the model should be allowed to call. + - `Agent BetaResponseComputerToolCallAgent` - For the Responses API, the list of tool definitions might look like: + The agent that produced this item. - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `AgentName string` - - `Type AllowedTools` + The canonical name of the agent that produced this item. - Allowed tool configuration type. Always `allowed_tools`. + - `type BetaResponseInputItemComputerCallOutput struct{…}` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + The output of a computer tool call. - - `type BetaToolChoiceTypes struct{…}` + - `CallID string` - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + The ID of the computer tool call that produced the output. - - `Type BetaToolChoiceTypesType` + - `Output BetaResponseComputerToolCallOutputScreenshot` - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + A computer screenshot image used with the computer use tool. - Allowed values are: + - `Type ComputerScreenshot` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + - `FileID string` - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + The identifier of an uploaded file that contains the screenshot. - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `ImageURL string` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + The URL of the screenshot image. - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `Type ComputerCallOutput` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + The type of the computer tool call output. Always `computer_call_output`. - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `type BetaToolChoiceFunction struct{…}` + - `ID string` - Use this option to force the model to call a specific function. + The ID of the computer tool call output. - - `Name string` + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - The name of the function to call. + The safety checks reported by the API that have been acknowledged by the developer. - - `Type Function` + - `ID string` - For function calling, the type is always `function`. + The ID of the pending safety check. - - `const FunctionFunction Function = "function"` + - `Code string` - - `type BetaToolChoiceMcp struct{…}` + The type of the pending safety check. - Use this option to force the model to call a specific tool on a remote MCP server. + - `Message string` - - `ServerLabel string` + Details about the pending safety check. - The label of the MCP server to use. + - `Agent BetaResponseInputItemComputerCallOutputAgent` - - `Type Mcp` + The agent that produced this item. - For MCP tools, the type is always `mcp`. + - `AgentName string` - - `const McpMcp Mcp = "mcp"` + The canonical name of the agent that produced this item. - - `Name string` + - `Status string` - The name of the tool to call on the server. + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - - `type BetaToolChoiceCustom struct{…}` + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - Use this option to force the model to call a specific custom tool. + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - - `Name string` + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - The name of the custom tool to call. + - `type BetaResponseFunctionWebSearch struct{…}` - - `Type Custom` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - For custom tool calling, the type is always `custom`. + - `ID string` - - `const CustomCustom Custom = "custom"` + The unique ID of the web search tool call. - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `Action BetaResponseFunctionWebSearchActionUnion` - - `Type ProgrammaticToolCalling` + 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). - The tool to call. Always `programmatic_tool_calling`. + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + Action type "search" - Performs a web search query. - - `type BetaToolChoiceApplyPatch struct{…}` + - `Type Search` - Forces the model to call the apply_patch tool when executing a tool call. + The action type. - - `Type ApplyPatch` + - `const SearchSearch Search = "search"` - The tool to call. Always `apply_patch`. + - `Queries []string` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + The search queries. - - `type BetaToolChoiceShell struct{…}` + - `Query string` - Forces the model to call the shell tool when a tool call is required. + The search query. - - `Type Shell` + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - The tool to call. Always `shell`. + The sources used in the search. - - `const ShellShell Shell = "shell"` + - `Type URL` - - `Tools []BetaToolUnion` + The type of source. Always `url`. - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + - `const URLURL URL = "url"` - We support the following categories of tools: + - `URL string` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + The URL of the source. - - `type BetaFunctionTool struct{…}` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + Action type "open_page" - Opens a specific URL from search results. - - `type BetaFileSearchTool struct{…}` + - `Type OpenPage` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The action type. - - `type BetaComputerTool struct{…}` + - `const OpenPageOpenPage OpenPage = "open_page"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `URL string` - - `type BetaComputerUsePreviewTool struct{…}` + The URL opened by the model. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - - `type BetaWebSearchTool struct{…}` + Action type "find_in_page": Searches for a pattern within a loaded page. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Pattern string` - - `type BetaToolMcp struct{…}` + The pattern or text to search for within the page. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Type FindInPage` - - `type BetaToolCodeInterpreter struct{…}` + The action type. - A tool that runs Python code to help generate a response to a prompt. + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `URL string` - - `type BetaToolImageGeneration struct{…}` + The URL of the page searched for the pattern. - A tool that generates images using the GPT image models. + - `Status BetaResponseFunctionWebSearchStatus` - - `type BetaToolLocalShell struct{…}` + The status of the web search tool call. - A tool that allows the model to execute shell commands in a local environment. + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - - `type BetaFunctionShellTool struct{…}` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - A tool that allows the model to execute shell commands. + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - - `type BetaCustomTool struct{…}` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Type WebSearchCall` - - `type BetaNamespaceTool struct{…}` + The type of the web search tool call. Always `web_search_call`. - Groups function/custom tools under a shared namespace. + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `type BetaToolSearchTool struct{…}` + - `Agent BetaResponseFunctionWebSearchAgent` - Hosted or BYOT tool search configuration for deferred tools. + The agent that produced this item. - - `type BetaWebSearchPreviewTool struct{…}` + - `AgentName string` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The canonical name of the agent that produced this item. - - `type BetaApplyPatchTool struct{…}` + - `type BetaResponseFunctionToolCall struct{…}` - Allows the assistant to create, delete, or update files using unified diffs. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `TopP float64` + - `Arguments string` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + A JSON string of the arguments to pass to the function. - We generally recommend altering this or `temperature` but not both. + - `CallID string` - - `Background bool` + The unique ID of the function tool call generated by the model. - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + - `Name string` - - `CompletedAt float64` + The name of the function to run. - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. + - `Type FunctionCall` - - `Conversation BetaResponseConversation` + The type of the function tool call. Always `function_call`. - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - `ID string` - The unique ID of the conversation that this response was associated with. + The unique ID of the function tool call. - - `MaxOutputTokens int64` + - `Agent BetaResponseFunctionToolCallAgent` - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + The agent that produced this item. - - `MaxToolCalls int64` + - `AgentName string` - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + The canonical name of the agent that produced this item. - - `Moderation BetaResponseModeration` + - `Caller BetaResponseFunctionToolCallCallerUnion` - Moderation results for the response input and output, if moderated completions were requested. + The execution context that produced this tool call. - - `Input BetaResponseModerationInputUnion` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - Moderation for the response input. + - `Type Direct` - - `type BetaResponseModerationInputModerationResult struct{…}` + - `const DirectDirect Direct = "direct"` - A moderation result produced for the response input or output. + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - `Categories map[string, bool]` + - `CallerID string` - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + The call ID of the program item that produced this tool call. - - `CategoryAppliedInputTypes map[string, []string]` + - `Type Program` - Which modalities of input are reflected by the score for each category. + - `const ProgramProgram Program = "program"` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + - `Namespace string` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + The namespace of the function to run. - - `CategoryScores map[string, float64]` + - `Status BetaResponseFunctionToolCallStatus` - A dictionary of moderation categories to scores. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Flagged bool` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - A boolean indicating whether the content was flagged by any category. + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `Model string` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - The moderation model that produced this result. + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `Type ModerationResult` + The output of a function tool call. - The object type, which was always `moderation_result` for successful moderation results. + - `CallID string` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + The unique ID of the function tool call generated by the model. - - `type BetaResponseModerationInputError struct{…}` + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - An error produced while attempting moderation for the response input or output. + Text, image, or file output of the function tool call. - - `Code string` + - `string` - The error code. + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `Message string` + An array of content outputs (text, image, file) for the function tool call. - The error message. + - `type BetaResponseInputTextContent struct{…}` - - `Type Error` + A text input to the model. - The object type, which was always `error` for moderation failures. + - `Text string` - - `const ErrorError Error = "error"` + The text input to the model. - - `Output BetaResponseModerationOutputUnion` + - `Type InputText` - Moderation for the response output. + The type of the input item. Always `input_text`. - - `type BetaResponseModerationOutputModerationResult struct{…}` + - `const InputTextInputText InputText = "input_text"` - A moderation result produced for the response input or output. + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `Categories map[string, bool]` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `Mode Explicit` - - `CategoryAppliedInputTypes map[string, []string]` + The breakpoint mode. Always `explicit`. - Which modalities of input are reflected by the score for each category. + - `const ExplicitExplicit Explicit = "explicit"` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + - `type BetaResponseInputImageContent struct{…}` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `CategoryScores map[string, float64]` + - `Type InputImage` - A dictionary of moderation categories to scores. + The type of the input item. Always `input_image`. - - `Flagged bool` + - `const InputImageInputImage InputImage = "input_image"` - A boolean indicating whether the content was flagged by any category. + - `Detail BetaResponseInputImageContentDetail` - - `Model string` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The moderation model that produced this result. + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - - `Type ModerationResult` + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - The object type, which was always `moderation_result` for successful moderation results. + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - - `type BetaResponseModerationOutputError struct{…}` + - `FileID string` - An error produced while attempting moderation for the response input or output. + The ID of the file to be sent to the model. - - `Code string` + - `ImageURL string` - The error code. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `Message string` + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - The error message. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Type Error` + - `Mode Explicit` - The object type, which was always `error` for moderation failures. + The breakpoint mode. Always `explicit`. - - `const ErrorError Error = "error"` + - `const ExplicitExplicit Explicit = "explicit"` - - `PreviousResponseID string` + - `type BetaResponseInputFileContent struct{…}` - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + A file input to the model. - - `Prompt BetaResponsePrompt` + - `Type InputFile` - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + The type of the input item. Always `input_file`. - - `ID string` + - `const InputFileInputFile InputFile = "input_file"` - The unique identifier of the prompt template to use. + - `Detail BetaResponseInputFileContentDetail` - - `Variables map[string, BetaResponsePromptVariableUnion]` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `string` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - - `type BetaResponseInputText struct{…}` + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - A text input to the model. + - `FileData string` - - `type BetaResponseInputImage struct{…}` + The base64-encoded data of the file to be sent to the model. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `FileID string` - - `type BetaResponseInputFile struct{…}` + The ID of the file to be sent to the model. - A file input to the model. + - `FileURL string` - - `Version string` + The URL of the file to be sent to the model. - Optional version of the prompt template. + - `Filename string` - - `PromptCacheKey string` + The name of the file to be sent to the model. - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - - `PromptCacheOptions BetaResponsePromptCacheOptions` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + - `Mode Explicit` - - `Mode string` + The breakpoint mode. Always `explicit`. - Whether implicit prompt-cache breakpoints were enabled. + - `const ExplicitExplicit Explicit = "explicit"` - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `Type FunctionCallOutput` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + The type of the function tool call output. Always `function_call_output`. - - `Ttl string` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - The minimum lifetime applied to each cache breakpoint. + - `ID string` - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + The unique ID of the function tool call output. Populated when this item is returned via API. - - `PromptCacheRetention BetaResponsePromptCacheRetention` + - `Agent BetaResponseInputItemFunctionCallOutputAgent` - Deprecated. Use `prompt_cache_options.ttl` instead. + The agent that produced this item. - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + - `AgentName string` - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + The canonical name of the agent that produced this item. - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + The execution context that produced this tool call. - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - - `Reasoning BetaResponseReasoning` + - `Type Direct` - **gpt-5 and o-series models only** + The caller type. Always `direct`. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `const DirectDirect Direct = "direct"` - - `Context string` + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + - `CallerID string` - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + The call ID of the program item that produced this tool call. - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + - `Type Program` - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + The caller type. Always `program`. - - `Effort string` + - `const ProgramProgram Program = "program"` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `Status string` - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + - `type BetaResponseInputItemAgentMessage struct{…}` - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + A message routed between agents. - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + - `Author string` - - `GenerateSummary string` + The sending agent identity. - **Deprecated:** use `summary` instead. + - `Content []BetaResponseInputItemAgentMessageContentUnion` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + Plaintext, image, or encrypted content sent between agents. - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + - `type BetaResponseInputTextContent struct{…}` - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + A text input to the model. - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + - `type BetaResponseInputImageContent struct{…}` - - `Mode string` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - Controls the reasoning execution mode for the request. + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - When returned on a response, this is the effective execution mode. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `string` + - `EncryptedContent string` - - `string` + Opaque encrypted content. - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + - `Type EncryptedContent` - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + The type of the input item. Always `encrypted_content`. - - `Summary string` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `Recipient string` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + The destination agent identity. - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + - `Type AgentMessage` - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + The item type. Always `agent_message`. - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `SafetyIdentifier string` + - `ID string` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + The unique ID of this agent message item. - - `ServiceTier BetaResponseServiceTier` + - `Agent BetaResponseInputItemAgentMessageAgent` - Specifies the processing type used for serving the request. + The agent that produced this item. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `AgentName string` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + The canonical name of the agent that produced this item. - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + - `Action string` - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + The multi-agent action that was executed. - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `Status BetaResponseStatus` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + - `Arguments string` - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + The action arguments as a JSON string. - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `CallID string` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + The unique ID linking this call to its output. - - `Text BetaResponseTextConfig` + - `Type MultiAgentCall` - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + The item type. Always `multi_agent_call`. - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `Format BetaResponseFormatTextConfigUnion` + - `ID string` - An object specifying the format that the model must output. + The unique ID of this multi-agent call. - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Agent BetaResponseInputItemMultiAgentCallAgent` - The default format is `{ "type": "text" }` with no additional options. + The agent that produced this item. - **Not recommended for gpt-4o and newer models:** + - `AgentName string` - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + The canonical name of the agent that produced this item. - - `type BetaResponseFormatTextConfigText struct{…}` + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - Default response format. Used to generate text responses. + - `Action string` - - `Type Text` + The multi-agent action that produced this result. - The type of response format being defined. Always `text`. + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const TextText Text = "text"` + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - - `Name string` + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - - `Schema map[string, any]` + - `CallID string` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + The unique ID of the multi-agent call. - - `Type JSONSchema` + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - The type of response format being defined. Always `json_schema`. + Text output returned by the multi-agent action. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `Text string` - - `Description string` + The text content. - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `Type OutputText` - - `Strict bool` + The content type. Always `output_text`. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const OutputTextOutputText OutputText = "output_text"` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + Citations associated with the text content. - - `Type JSONObject` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - The type of response format being defined. Always `json_object`. + - `FileID string` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The ID of the file. - - `Verbosity BetaResponseTextConfigVerbosity` + - `Filename string` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + The filename of the file cited. - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + - `Index int64` - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + The index of the file in the list of files. - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + - `Type FileCitation` - - `TopLogprobs int64` + The citation type. Always `file_citation`. - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `Truncation BetaResponseTruncation` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - The truncation strategy to use for the model response. + - `EndIndex int64` - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + The index of the last character of the citation in the message. - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + - `StartIndex int64` - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + The index of the first character of the citation in the message. - - `Usage BetaResponseUsage` + - `Title string` - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + The title of the cited resource. - - `InputTokens int64` + - `Type URLCitation` - The number of input tokens. + The citation type. Always `url_citation`. - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + - `const URLCitationURLCitation URLCitation = "url_citation"` - A detailed breakdown of the input tokens. + - `URL string` - - `CacheWriteTokens int64` + The URL of the cited resource. - The number of input tokens that were written to the cache. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `CachedTokens int64` + - `ContainerID string` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + The ID of the container. - - `OutputTokens int64` + - `EndIndex int64` - The number of output tokens. + The index of the last character of the citation in the message. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `FileID string` - A detailed breakdown of the output tokens. + The ID of the container file. - - `ReasoningTokens int64` + - `Filename string` - The number of reasoning tokens. + The filename of the container file cited. - - `TotalTokens int64` + - `StartIndex int64` - The total number of tokens used. + The index of the first character of the citation in the message. - - `User string` + - `Type ContainerFileCitation` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + The citation type. Always `container_file_citation`. - - `SequenceNumber int64` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - The sequence number of this event. + - `Type MultiAgentCallOutput` - - `Type ResponseFailed` + The item type. Always `multi_agent_call_output`. - The type of the event. Always `response.failed`. + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `const ResponseFailedResponseFailed ResponseFailed = "response.failed"` + - `ID string` - - `Agent BetaResponseFailedEventAgent` + The unique ID of this multi-agent call output. - The agent that owns this multi-agent streaming event. + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response File Search Call Completed Event + - `type BetaResponseInputItemToolSearchCall struct{…}` -- `type BetaResponseFileSearchCallCompletedEvent struct{…}` + - `Arguments any` - Emitted when a file search call is completed (results found). + The arguments supplied to the tool search call. - - `ItemID string` + - `Type ToolSearchCall` - The ID of the output item that the file search call is initiated. + The item type. Always `tool_search_call`. - - `OutputIndex int64` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - The index of the output item that the file search call is initiated. + - `ID string` - - `SequenceNumber int64` + The unique ID of this tool search call. - The sequence number of this event. + - `Agent BetaResponseInputItemToolSearchCallAgent` - - `Type ResponseFileSearchCallCompleted` + The agent that produced this item. - The type of the event. Always `response.file_search_call.completed`. + - `AgentName string` - - `const ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"` + The canonical name of the agent that produced this item. - - `Agent BetaResponseFileSearchCallCompletedEventAgent` + - `CallID string` - The agent that owns this multi-agent streaming event. + The unique ID of the tool search call generated by the model. - - `AgentName string` + - `Execution string` - The canonical name of the agent that produced this item. + Whether tool search was executed by the server or by the client. -### Beta Response File Search Call In Progress Event + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` -- `type BetaResponseFileSearchCallInProgressEvent struct{…}` + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - Emitted when a file search call is initiated. + - `Status string` - - `ItemID string` + The status of the tool search call. - The ID of the output item that the file search call is initiated. + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - - `OutputIndex int64` + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - The index of the output item that the file search call is initiated. + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - - `SequenceNumber int64` + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - The sequence number of this event. + - `Tools []BetaToolUnion` - - `Type ResponseFileSearchCallInProgress` + The loaded tool definitions returned by the tool search output. - The type of the event. Always `response.file_search_call.in_progress`. + - `type BetaFunctionTool struct{…}` - - `const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Agent BetaResponseFileSearchCallInProgressEventAgent` + - `Name string` - The agent that owns this multi-agent streaming event. + The name of the function to call. - - `AgentName string` + - `Parameters map[string, any]` - The canonical name of the agent that produced this item. + A JSON schema object describing the parameters of the function. -### Beta Response File Search Call Searching Event + - `Strict bool` -- `type BetaResponseFileSearchCallSearchingEvent struct{…}` + Whether strict parameter validation is enforced for this function tool. - Emitted when a file search is currently searching. + - `Type Function` - - `ItemID string` + The type of the function tool. Always `function`. - The ID of the output item that the file search call is initiated. + - `const FunctionFunction Function = "function"` - - `OutputIndex int64` + - `AllowedCallers []string` - The index of the output item that the file search call is searching. + The tool invocation context(s). - - `SequenceNumber int64` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - The sequence number of this event. + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - - `Type ResponseFileSearchCallSearching` + - `DeferLoading bool` - The type of the event. Always `response.file_search_call.searching`. + Whether this function is deferred and loaded via tool search. - - `const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"` + - `Description string` - - `Agent BetaResponseFileSearchCallSearchingEventAgent` + A description of the function. Used by the model to determine whether or not to call the function. - The agent that owns this multi-agent streaming event. + - `OutputSchema map[string, any]` - - `AgentName string` + A JSON schema object describing the JSON value encoded in string outputs for this function. - The canonical name of the agent that produced this item. + - `type BetaFileSearchTool struct{…}` -### Beta Response File Search Tool Call + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). -- `type BetaResponseFileSearchToolCall struct{…}` + - `Type FileSearch` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The type of the file search tool. Always `file_search`. - - `ID string` + - `const FileSearchFileSearch FileSearch = "file_search"` - The unique ID of the file search tool call. + - `VectorStoreIDs []string` - - `Queries []string` + The IDs of the vector stores to search. - The queries used to search for files. + - `Filters BetaFileSearchToolFiltersUnion` - - `Status BetaResponseFileSearchToolCallStatus` + A filter to apply. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `Key string` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + The key to compare against the value. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `Type string` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `Type FileSearchCall` + - `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 - The type of the file search tool call. Always `file_search_call`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - `Agent BetaResponseFileSearchToolCallAgent` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - The agent that produced this item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - `AgentName string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - The canonical name of the agent that produced this item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - - `Results []BetaResponseFileSearchToolCallResult` + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - The results of the file search tool call. + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - 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. + The value to compare against the attribute key; supports string, number, or boolean types. - `string` @@ -79450,1076 +93058,1112 @@ func main() { - `bool` - - `FileID string` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - The unique ID of the file. + - `string` - - `Filename string` + - `float64` - The name of the file. + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `Score float64` + Combine multiple filters using `and` or `or`. - The relevance score of the file - a value between 0 and 1. + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `Text string` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - The text that was retrieved from the file. + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` -### Beta Response Format Text Config + A filter used to compare a specified attribute key to a given value using a defined comparison operation. -- `type BetaResponseFormatTextConfigUnion interface{…}` + - `Key string` - An object specifying the format that the model must output. + The key to compare against the value. - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Type string` - The default format is `{ "type": "text" }` with no additional options. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - **Not recommended for gpt-4o and newer models:** + - `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 - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `type BetaResponseFormatTextConfigText struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - Default response format. Used to generate text responses. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `Type Text` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - The type of response format being defined. Always `text`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `const TextText Text = "text"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `Name string` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + The value to compare against the attribute key; supports string, number, or boolean types. - - `Schema map[string, any]` + - `string` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `float64` - - `Type JSONSchema` + - `bool` - The type of response format being defined. Always `json_schema`. + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `string` - - `Description string` + - `float64` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `Type string` - - `Strict bool` + Type of operation: `and` or `or`. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `MaxNumResults int64` - - `Type JSONObject` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - The type of response format being defined. Always `json_object`. + - `RankingOptions BetaFileSearchToolRankingOptions` - - `const JSONObjectJSONObject JSONObject = "json_object"` + Ranking options for search. -### Beta Response Format Text JSON Schema Config + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` -- `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `EmbeddingWeight float64` - - `Name string` + The weight of the embedding in the reciprocal ranking fusion. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `TextWeight float64` - - `Schema map[string, any]` + The weight of the text in the reciprocal ranking fusion. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `Ranker string` - - `Type JSONSchema` + The ranker to use for the file search. - The type of response format being defined. Always `json_schema`. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - - `Description string` + - `ScoreThreshold float64` - A description of what the response format is for, used by the model to - determine how to respond in the format. + 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. - - `Strict bool` + - `type BetaComputerTool struct{…}` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). -### Beta Response Function Call Arguments Delta Event + - `Type Computer` -- `type BetaResponseFunctionCallArgumentsDeltaEvent struct{…}` + The type of the computer tool. Always `computer`. - Emitted when there is a partial function-call arguments delta. + - `const ComputerComputer Computer = "computer"` - - `Delta string` + - `type BetaComputerUsePreviewTool struct{…}` - The function-call arguments delta that is added. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `ItemID string` + - `DisplayHeight int64` - The ID of the output item that the function-call arguments delta is added to. + The height of the computer display. - - `OutputIndex int64` + - `DisplayWidth int64` - The index of the output item that the function-call arguments delta is added to. + The width of the computer display. - - `SequenceNumber int64` + - `Environment BetaComputerUsePreviewToolEnvironment` - The sequence number of this event. + The type of computer environment to control. - - `Type ResponseFunctionCallArgumentsDelta` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - The type of the event. Always `response.function_call_arguments.delta`. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `Agent BetaResponseFunctionCallArgumentsDeltaEventAgent` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - The agent that owns this multi-agent streaming event. + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `AgentName string` + - `Type ComputerUsePreview` - The canonical name of the agent that produced this item. + The type of the computer use tool. Always `computer_use_preview`. -### Beta Response Function Call Arguments Done Event + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` -- `type BetaResponseFunctionCallArgumentsDoneEvent struct{…}` + - `type BetaWebSearchTool struct{…}` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `Type BetaWebSearchToolType` + + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + + - `Filters BetaWebSearchToolFilters` + + 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. - Emitted when function-call arguments are finalized. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `Arguments string` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - The function-call arguments. + 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. - - `ItemID string` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - The ID of the item. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `Name string` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - The name of the function that was called. + - `UserLocation BetaWebSearchToolUserLocation` - - `OutputIndex int64` + The approximate location of the user. - The index of the output item. + - `City string` - - `SequenceNumber int64` + Free text input for the city of the user, e.g. `San Francisco`. - The sequence number of this event. + - `Country string` - - `Type ResponseFunctionCallArgumentsDone` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"` + - `Region string` - - `Agent BetaResponseFunctionCallArgumentsDoneEventAgent` + Free text input for the region of the user, e.g. `California`. - The agent that owns this multi-agent streaming event. + - `Timezone string` - - `AgentName string` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The canonical name of the agent that produced this item. + - `Type string` -### Beta Response Function Call Output Item + The type of location approximation. Always `approximate`. -- `type BetaResponseFunctionCallOutputItemUnion interface{…}` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - A piece of message content, such as text, an image, or a file. + - `type BetaToolMcp struct{…}` - - `type BetaResponseInputTextContent struct{…}` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - A text input to the model. + - `ServerLabel string` - - `Text string` + A label for this MCP server, used to identify it in tool calls. - The text input to the model. + - `Type Mcp` - - `Type InputText` + The type of the MCP tool. Always `mcp`. - The type of the input item. Always `input_text`. + - `const McpMcp Mcp = "mcp"` - - `const InputTextInputText InputText = "input_text"` + - `AllowedCallers []string` - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + The tool invocation context(s). - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - - `Mode Explicit` + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - The breakpoint mode. Always `explicit`. + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `const ExplicitExplicit Explicit = "explicit"` + List of allowed tool names or a filter object. - - `type BetaResponseInputImageContent struct{…}` + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + A string array of allowed tool names - - `Type InputImage` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - The type of the input item. Always `input_image`. + A filter object to specify which tools are allowed. - - `const InputImageInputImage InputImage = "input_image"` + - `ReadOnly bool` - - `Detail BetaResponseInputImageContentDetail` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `ToolNames []string` - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + List of allowed tool names. - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + - `Authorization string` - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + 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. - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `ConnectorID string` - - `FileID 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - The ID of the file to be sent to the model. + Currently supported `connector_id` values are: - - `ImageURL string` + - 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` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `Mode Explicit` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - The breakpoint mode. Always `explicit`. + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `type BetaResponseInputFileContent struct{…}` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - A file input to the model. + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `Type InputFile` + - `DeferLoading bool` - The type of the input item. Always `input_file`. + Whether this MCP tool is deferred and discovered via tool search. - - `const InputFileInputFile InputFile = "input_file"` + - `Headers map[string, string]` - - `Detail BetaResponseInputFileContentDetail` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + Specify which of the MCP server's tools require approval. - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `FileData string` + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - The base64-encoded data of the file to be sent to the model. + A filter object to specify which tools are allowed. - - `FileID string` + - `ReadOnly bool` - The ID of the file to be sent to the model. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `FileURL string` + - `ToolNames []string` - The URL of the file to be sent to the model. + List of allowed tool names. - - `Filename string` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - The name of the file to be sent to the model. + A filter object to specify which tools are allowed. - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `ReadOnly bool` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Mode Explicit` + - `ToolNames []string` - The breakpoint mode. Always `explicit`. + List of allowed tool names. - - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` -### Beta Response Function Call Output Item List + 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. -- `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - An array of content outputs (text, image, file) for the function tool call. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - - `type BetaResponseInputTextContent struct{…}` + - `ServerDescription string` - A text input to the model. + Optional description of the MCP server, used to provide more context. - - `Text string` + - `ServerURL string` - The text input to the model. + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `Type InputText` + - `TunnelID string` - The type of the input item. Always `input_text`. + 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. - - `const InputTextInputText InputText = "input_text"` + - `type BetaToolCodeInterpreter struct{…}` - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + A tool that runs Python code to help generate a response to a prompt. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Container BetaToolCodeInterpreterContainerUnion` - - `Mode Explicit` + 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. - The breakpoint mode. Always `explicit`. + - `string` - - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `type BetaResponseInputImageContent struct{…}` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + - `Type Auto` - - `Type InputImage` + Always `auto`. - The type of the input item. Always `input_image`. + - `const AutoAuto Auto = "auto"` - - `const InputImageInputImage InputImage = "input_image"` + - `FileIDs []string` - - `Detail BetaResponseInputImageContentDetail` + An optional list of uploaded files to make available to your code. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `MemoryLimit string` - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + The memory limit for the code interpreter container. - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - - `FileID string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - The ID of the file to be sent to the model. + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - - `ImageURL string` + Network access policy for the container. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `Type Disabled` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Disable outbound network access. Always `disabled`. - - `Mode Explicit` + - `const DisabledDisabled Disabled = "disabled"` - The breakpoint mode. Always `explicit`. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + - `AllowedDomains []string` - - `type BetaResponseInputFileContent struct{…}` + A list of allowed domains when type is `allowlist`. - A file input to the model. + - `Type Allowlist` - - `Type InputFile` + Allow outbound network access only to specified domains. Always `allowlist`. - The type of the input item. Always `input_file`. + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `const InputFileInputFile InputFile = "input_file"` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `Detail BetaResponseInputFileContentDetail` + Optional domain-scoped secrets for allowlisted domains. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Domain string` - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + The domain associated with the secret. - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + - `Name string` - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + The name of the secret to inject for the domain. - - `FileData string` + - `Value string` - The base64-encoded data of the file to be sent to the model. + The secret value to inject for the domain. - - `FileID string` + - `Type CodeInterpreter` - The ID of the file to be sent to the model. + The type of the code interpreter tool. Always `code_interpreter`. - - `FileURL string` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The URL of the file to be sent to the model. + - `AllowedCallers []string` - - `Filename string` + The tool invocation context(s). - The name of the file to be sent to the model. + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Mode Explicit` + - `Type ProgrammaticToolCalling` - The breakpoint mode. Always `explicit`. + The type of the tool. Always `programmatic_tool_calling`. - - `const ExplicitExplicit Explicit = "explicit"` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` -### Beta Response Function Shell Call Output Content + - `type BetaToolImageGeneration struct{…}` -- `type BetaResponseFunctionShellCallOutputContent struct{…}` + A tool that generates images using the GPT image models. - Captured stdout and stderr for a portion of a shell tool call output. + - `Type ImageGeneration` - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + The type of the image generation tool. Always `image_generation`. - The exit or timeout outcome associated with this shell call. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + - `Action string` - Indicates that the shell call exceeded its configured time limit. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `Type Timeout` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - The outcome type. Always `timeout`. + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `const TimeoutTimeout Timeout = "timeout"` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + - `Background string` - Indicates that the shell commands finished and returned an exit code. + 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. - - `ExitCode int64` + `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. - The exit code returned by the shell process. + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - - `Type Exit` + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - The outcome type. Always `exit`. + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - - `const ExitExit Exit = "exit"` + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `Stderr string` + - `InputFidelity string` - Captured stderr output for the shell call. + 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`. - - `Stdout string` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - Captured stdout output for the shell call. + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` -### Beta Response Function Shell Tool Call + - `InputImageMask BetaToolImageGenerationInputImageMask` -- `type BetaResponseFunctionShellToolCall struct{…}` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - A tool call that executes one or more shell commands in a managed environment. + - `FileID string` - - `ID string` + File ID for the mask image. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `ImageURL string` - - `Action BetaResponseFunctionShellToolCallAction` + Base64-encoded mask image. - The shell commands and limits that describe how to run the tool call. + - `Model string` - - `Commands []string` + The image generation model to use. Default: `gpt-image-1`. - - `MaxOutputLength int64` + - `string` - Optional maximum number of characters to return from each command. + - `string` - - `TimeoutMs int64` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - Optional timeout in milliseconds for the commands. + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `CallID string` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - The unique ID of the shell tool call generated by the model. + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - Represents the use of a local environment to perform shell actions. + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - `type BetaResponseLocalEnvironment struct{…}` + - `Moderation string` - Represents the use of a local environment to perform shell actions. + Moderation level for the generated image. Default: `auto`. - - `Type Local` + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - The environment type. Always `local`. + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - - `const LocalLocal Local = "local"` + - `OutputCompression int64` - - `type BetaResponseContainerReference struct{…}` + Compression level for the output image. Default: 100. - Represents a container created with /v1/containers. + - `OutputFormat string` - - `ContainerID string` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `Type ContainerReference` + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - The environment type. Always `container_reference`. + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - - `Status BetaResponseFunctionShellToolCallStatus` + - `PartialImages int64` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + - `Quality string` - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `Type ShellCall` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - The type of the item. Always `shell_call`. + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `const ShellCallShellCall ShellCall = "shell_call"` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - - `Agent BetaResponseFunctionShellToolCallAgent` + - `Size string` - The agent that produced this item. + 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`. - - `AgentName string` + - `string` - The canonical name of the agent that produced this item. + - `string` - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - The execution context that produced this tool call. + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - - `Type Direct` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - - `const DirectDirect Direct = "direct"` + - `type BetaToolLocalShell struct{…}` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + A tool that allows the model to execute shell commands in a local environment. - - `CallerID string` + - `Type LocalShell` - The call ID of the program item that produced this tool call. + The type of the local shell tool. Always `local_shell`. - - `Type Program` + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `const ProgramProgram Program = "program"` + - `type BetaFunctionShellTool struct{…}` - - `CreatedBy string` + A tool that allows the model to execute shell commands. - The ID of the entity that created this tool call. + - `Type Shell` -### Beta Response Function Shell Tool Call Output + The type of the shell tool. Always `shell`. -- `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `const ShellShell Shell = "shell"` - The output of a shell tool call that was emitted. + - `AllowedCallers []string` - - `ID string` + The tool invocation context(s). - The unique ID of the shell call output. Populated when this item is returned via API. + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - `CallID string` + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - The unique ID of the shell tool call generated by the model. + - `Environment BetaFunctionShellToolEnvironmentUnion` - - `MaxOutputLength int64` + - `type BetaContainerAuto struct{…}` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `Type ContainerAuto` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + Automatically creates a container for this request - An array of shell call output contents + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + - `FileIDs []string` - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + An optional list of uploaded files to make available to your code. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + - `MemoryLimit BetaContainerAutoMemoryLimit` - Indicates that the shell call exceeded its configured time limit. + The memory limit for the container. - - `Type Timeout` + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - The outcome type. Always `timeout`. + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `const TimeoutTimeout Timeout = "timeout"` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - Indicates that the shell commands finished and returned an exit code. + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - `ExitCode int64` + Network access policy for the container. - Exit code from the shell process. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `Type Exit` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - The outcome type. Always `exit`. + - `Skills []BetaContainerAutoSkillUnion` - - `const ExitExit Exit = "exit"` + An optional list of skills referenced by id or inline data. - - `Stderr string` + - `type BetaSkillReference struct{…}` - The standard error output that was captured. + - `SkillID string` - - `Stdout string` + The ID of the referenced skill. - The standard output that was captured. + - `Type SkillReference` - - `CreatedBy string` + References a skill created with the /v1/skills endpoint. - The identifier of the actor that created the item. + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `Version string` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `type BetaInlineSkill struct{…}` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `Description string` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + The description of the skill. - - `Type ShellCallOutput` + - `Name string` - The type of the shell call output. Always `shell_call_output`. + The name of the skill. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `Source BetaInlineSkillSource` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + Inline skill payload - The agent that produced this item. + - `Data string` - - `AgentName string` + Base64-encoded skill zip bundle. - The canonical name of the agent that produced this item. + - `MediaType ApplicationZip` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + The media type of the inline skill payload. Must be `application/zip`. - The execution context that produced this tool call. + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `Type Base64` - - `Type Direct` + The type of the inline skill source. Must be `base64`. - - `const DirectDirect Direct = "direct"` + - `const Base64Base64 Base64 = "base64"` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `Type Inline` - - `CallerID string` + Defines an inline skill for this request. - The call ID of the program item that produced this tool call. + - `const InlineInline Inline = "inline"` - - `Type Program` + - `type BetaLocalEnvironment struct{…}` - - `const ProgramProgram Program = "program"` + - `Type Local` - - `CreatedBy string` + Use a local computer environment. - The identifier of the actor that created the item. + - `const LocalLocal Local = "local"` -### Beta Response Function Tool Call + - `Skills []BetaLocalSkill` -- `type BetaResponseFunctionToolCall struct{…}` + An optional list of skills. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `Description string` - - `Arguments string` + The description of the skill. - A JSON string of the arguments to pass to the function. + - `Name string` - - `CallID string` + The name of the skill. - The unique ID of the function tool call generated by the model. + - `Path string` - - `Name string` + The path to the directory containing the skill. - The name of the function to run. + - `type BetaContainerReference struct{…}` - - `Type FunctionCall` + - `ContainerID string` - The type of the function tool call. Always `function_call`. + The ID of the referenced container. - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + - `Type ContainerReference` - - `ID string` + References a container created with the /v1/containers endpoint - The unique ID of the function tool call. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `Agent BetaResponseFunctionToolCallAgent` + - `type BetaCustomTool struct{…}` - The agent that produced this item. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `AgentName string` + - `Name string` - The canonical name of the agent that produced this item. + The name of the custom tool, used to identify it in tool calls. - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `Type Custom` - The execution context that produced this tool call. + The type of the custom tool. Always `custom`. - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `const CustomCustom Custom = "custom"` - - `Type Direct` + - `AllowedCallers []string` - - `const DirectDirect Direct = "direct"` + The tool invocation context(s). - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `CallerID string` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - The call ID of the program item that produced this tool call. + - `DeferLoading bool` - - `Type Program` + Whether this tool should be deferred and discovered via tool search. - - `const ProgramProgram Program = "program"` + - `Description string` - - `Namespace string` + Optional description of the custom tool, used to provide more context. - The namespace of the function to run. + - `Format BetaCustomToolFormatUnion` - - `Status BetaResponseFunctionToolCallStatus` + The input format for the custom tool. Default is unconstrained text. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type BetaCustomToolFormatText struct{…}` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + Unconstrained free-form text. - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `Type Text` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + Unconstrained text format. Always `text`. -### Beta Response Function Tool Call Item + - `const TextText Text = "text"` -- `type BetaResponseFunctionToolCallItem struct{…}` + - `type BetaCustomToolFormatGrammar struct{…}` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + A grammar defined by the user. - - `ID string` + - `Definition string` - The unique ID of the function tool call. + The grammar definition. - - `Status string` + - `Syntax string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The syntax of the grammar definition. One of `lark` or `regex`. - - `const BetaResponseFunctionToolCallItemStatusInProgress BetaResponseFunctionToolCallItemStatus = "in_progress"` + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `const BetaResponseFunctionToolCallItemStatusCompleted BetaResponseFunctionToolCallItemStatus = "completed"` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `const BetaResponseFunctionToolCallItemStatusIncomplete BetaResponseFunctionToolCallItemStatus = "incomplete"` + - `Type Grammar` - - `CreatedBy string` + Grammar format. Always `grammar`. - The identifier of the actor that created the item. + - `const GrammarGrammar Grammar = "grammar"` -### Beta Response Function Tool Call Output Item + - `type BetaNamespaceTool struct{…}` -- `type BetaResponseFunctionToolCallOutputItem struct{…}` + Groups function/custom tools under a shared namespace. - - `ID string` + - `Description string` - The unique ID of the function call tool output. + A description of the namespace shown to the model. - - `CallID string` + - `Name string` - The unique ID of the function tool call generated by the model. + The namespace name used in tool calls (for example, `crm`). - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `Tools []BetaNamespaceToolToolUnion` - The output from the function call generated by your code. - Can be a string or an list of output content. + The function/custom tools available inside this namespace. - - `string` + - `type BetaNamespaceToolToolFunction struct{…}` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `Name string` - Text, image, or file output of the function call. + - `Type Function` - - `type BetaResponseInputText struct{…}` + - `const FunctionFunction Function = "function"` - A text input to the model. + - `AllowedCallers []string` - - `Text string` + The tool invocation context(s). - The text input to the model. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `Type InputText` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - The type of the input item. Always `input_text`. + - `DeferLoading bool` - - `const InputTextInputText InputText = "input_text"` + Whether this function should be deferred and discovered via tool search. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `Description string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `OutputSchema map[string, any]` - - `Mode Explicit` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - The breakpoint mode. Always `explicit`. + - `Parameters any` - - `const ExplicitExplicit Explicit = "explicit"` + - `Strict bool` - - `type BetaResponseInputImage struct{…}` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `type BetaCustomTool struct{…}` - - `Detail BetaResponseInputImageDetail` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Type Namespace` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + The type of the tool. Always `namespace`. - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `const NamespaceNamespace Namespace = "namespace"` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `type BetaToolSearchTool struct{…}` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + Hosted or BYOT tool search configuration for deferred tools. - - `Type InputImage` + - `Type ToolSearch` - The type of the input item. Always `input_image`. + The type of the tool. Always `tool_search`. - - `const InputImageInputImage InputImage = "input_image"` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `FileID string` + - `Description string` - The ID of the file to be sent to the model. + Description shown to the model for a client-executed tool search tool. - - `ImageURL string` + - `Execution BetaToolSearchToolExecution` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + Whether tool search is executed by the server or by the client. - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `Mode Explicit` + - `Parameters any` - The breakpoint mode. Always `explicit`. + Parameter schema for a client-executed tool search tool. - - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaWebSearchPreviewTool struct{…}` - - `type BetaResponseInputFile struct{…}` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - A file input to the model. + - `Type BetaWebSearchPreviewToolType` - - `Type InputFile` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The type of the input item. Always `input_file`. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `const InputFileInputFile InputFile = "input_file"` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `Detail BetaResponseInputFileDetail` + - `SearchContentTypes []string` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + 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. - - `FileData string` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - The content of the file to be sent to the model. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `FileID string` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - The ID of the file to be sent to the model. + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `FileURL string` + The user's location. - The URL of the file to be sent to the model. + - `Type Approximate` - - `Filename string` + The type of location approximation. Always `approximate`. - The name of the file to be sent to the model. + - `const ApproximateApproximate Approximate = "approximate"` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `City string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Free text input for the city of the user, e.g. `San Francisco`. - - `Mode Explicit` + - `Country string` - The breakpoint mode. Always `explicit`. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const ExplicitExplicit Explicit = "explicit"` + - `Region string` - - `Status BetaResponseFunctionToolCallOutputItemStatus` + Free text input for the region of the user, e.g. `California`. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Timezone string` - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + - `type BetaApplyPatchTool struct{…}` - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + Allows the assistant to create, delete, or update files using unified diffs. - - `Type FunctionCallOutput` + - `Type ApplyPatch` - The type of the function tool call output. Always `function_call_output`. + The type of the tool. Always `apply_patch`. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `AllowedCallers []string` - The agent that produced this item. + The tool invocation context(s). - - `AgentName string` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - The canonical name of the agent that produced this item. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `Type ToolSearchOutput` - The execution context that produced this tool call. + The item type. Always `tool_search_output`. - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `Type Direct` + - `ID string` - The caller type. Always `direct`. + The unique ID of this tool search output. - - `const DirectDirect Direct = "direct"` + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + The agent that produced this item. - - `CallerID string` + - `AgentName string` - The call ID of the program item that produced this tool call. + The canonical name of the agent that produced this item. - - `Type Program` + - `CallID string` - The caller type. Always `program`. + The unique ID of the tool search call generated by the model. - - `const ProgramProgram Program = "program"` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - - `CreatedBy string` + Whether tool search was executed by the server or by the client. - The identifier of the actor that created the item. + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` -### Beta Response Function Web Search + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` -- `type BetaResponseFunctionWebSearch struct{…}` + - `Status BetaResponseToolSearchOutputItemParamStatus` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + The status of the tool search output. - - `ID string` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - The unique ID of the web search tool call. + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `Action BetaResponseFunctionWebSearchActionUnion` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - 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 BetaResponseInputItemAdditionalTools struct{…}` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `Role Developer` - Action type "search" - Performs a web search query. + The role that provided the additional tools. Only `developer` is supported. - - `Type Search` + - `const DeveloperDeveloper Developer = "developer"` - The action type. + - `Tools []BetaToolUnion` - - `const SearchSearch Search = "search"` + A list of additional tools made available at this item. - - `Queries []string` + - `type BetaFunctionTool struct{…}` - The search queries. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Query string` + - `type BetaFileSearchTool struct{…}` - The search query. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + - `type BetaComputerTool struct{…}` - The sources used in the search. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Type URL` + - `type BetaComputerUsePreviewTool struct{…}` - The type of source. Always `url`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const URLURL URL = "url"` + - `type BetaWebSearchTool struct{…}` - - `URL string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The URL of the source. + - `type BetaToolMcp struct{…}` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - Action type "open_page" - Opens a specific URL from search results. + - `type BetaToolCodeInterpreter struct{…}` - - `Type OpenPage` + A tool that runs Python code to help generate a response to a prompt. - The action type. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `const OpenPageOpenPage OpenPage = "open_page"` + - `type BetaToolImageGeneration struct{…}` - - `URL string` + A tool that generates images using the GPT image models. - The URL opened by the model. + - `type BetaToolLocalShell struct{…}` - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + A tool that allows the model to execute shell commands in a local environment. - Action type "find_in_page": Searches for a pattern within a loaded page. + - `type BetaFunctionShellTool struct{…}` - - `Pattern string` + A tool that allows the model to execute shell commands. - The pattern or text to search for within the page. + - `type BetaCustomTool struct{…}` - - `Type FindInPage` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The action type. + - `type BetaNamespaceTool struct{…}` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + Groups function/custom tools under a shared namespace. - - `URL string` + - `type BetaToolSearchTool struct{…}` - The URL of the page searched for the pattern. + Hosted or BYOT tool search configuration for deferred tools. - - `Status BetaResponseFunctionWebSearchStatus` + - `type BetaWebSearchPreviewTool struct{…}` - The status of the web search tool call. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `type BetaApplyPatchTool struct{…}` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + Allows the assistant to create, delete, or update files using unified diffs. - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `Type AdditionalTools` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + The item type. Always `additional_tools`. - - `Type WebSearchCall` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - The type of the web search tool call. Always `web_search_call`. + - `ID string` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + The unique ID of this additional tools item. - - `Agent BetaResponseFunctionWebSearchAgent` + - `Agent BetaResponseInputItemAdditionalToolsAgent` The agent that produced this item. @@ -80527,670 +94171,645 @@ func main() { The canonical name of the agent that produced this item. -### Beta Response Image Gen Call Completed Event - -- `type BetaResponseImageGenCallCompletedEvent struct{…}` - - Emitted when an image generation tool call has completed and the final image is available. - - - `ItemID string` + - `type BetaResponseReasoningItem struct{…}` - The unique identifier of the image generation item being processed. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `OutputIndex int64` + - `ID string` - The index of the output item in the response's output array. + The unique identifier of the reasoning content. - - `SequenceNumber int64` + - `Summary []BetaResponseReasoningItemSummary` - The sequence number of this event. + Reasoning summary content. - - `Type ResponseImageGenerationCallCompleted` + - `Text string` - The type of the event. Always 'response.image_generation_call.completed'. + A summary of the reasoning output from the model so far. - - `const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"` + - `Type SummaryText` - - `Agent BetaResponseImageGenCallCompletedEventAgent` + The type of the object. Always `summary_text`. - The agent that owns this multi-agent streaming event. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `AgentName string` + - `Type Reasoning` - The canonical name of the agent that produced this item. + The type of the object. Always `reasoning`. -### Beta Response Image Gen Call Generating Event + - `const ReasoningReasoning Reasoning = "reasoning"` -- `type BetaResponseImageGenCallGeneratingEvent struct{…}` + - `Agent BetaResponseReasoningItemAgent` - Emitted when an image generation tool call is actively generating an image (intermediate state). + The agent that produced this item. - - `ItemID string` + - `AgentName string` - The unique identifier of the image generation item being processed. + The canonical name of the agent that produced this item. - - `OutputIndex int64` + - `Content []BetaResponseReasoningItemContent` - The index of the output item in the response's output array. + Reasoning text content. - - `SequenceNumber int64` + - `Text string` - The sequence number of the image generation item being processed. + The reasoning text from the model. - - `Type ResponseImageGenerationCallGenerating` + - `Type ReasoningText` - The type of the event. Always 'response.image_generation_call.generating'. + The type of the reasoning text. Always `reasoning_text`. - - `const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `Agent BetaResponseImageGenCallGeneratingEventAgent` + - `EncryptedContent string` - The agent that owns this multi-agent streaming event. + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `AgentName string` + - `Status BetaResponseReasoningItemStatus` - The canonical name of the agent that produced this item. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. -### Beta Response Image Gen Call In Progress Event + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` -- `type BetaResponseImageGenCallInProgressEvent struct{…}` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - Emitted when an image generation tool call is in progress. + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `ItemID string` + - `type BetaResponseCompactionItemParamResp struct{…}` - The unique identifier of the image generation item being processed. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `OutputIndex int64` + - `EncryptedContent string` - The index of the output item in the response's output array. + The encrypted content of the compaction summary. - - `SequenceNumber int64` + - `Type Compaction` - The sequence number of the image generation item being processed. + The type of the item. Always `compaction`. - - `Type ResponseImageGenerationCallInProgress` + - `const CompactionCompaction Compaction = "compaction"` - The type of the event. Always 'response.image_generation_call.in_progress'. + - `ID string` - - `const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"` + The ID of the compaction item. - - `Agent BetaResponseImageGenCallInProgressEventAgent` + - `Agent BetaResponseCompactionItemParamAgentResp` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response Image Gen Call Partial Image Event - -- `type BetaResponseImageGenCallPartialImageEvent struct{…}` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - Emitted when a partial image is available during image generation streaming. + An image generation request made by the model. - - `ItemID string` + - `ID string` - The unique identifier of the image generation item being processed. + The unique ID of the image generation call. - - `OutputIndex int64` + - `Result string` - The index of the output item in the response's output array. + The generated image encoded in base64. - - `PartialImageB64 string` + - `Status string` - Base64-encoded partial image data, suitable for rendering as an image. + The status of the image generation call. - - `PartialImageIndex int64` + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - `SequenceNumber int64` + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - The sequence number of the image generation item being processed. + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - - `Type ResponseImageGenerationCallPartialImage` + - `Type ImageGenerationCall` - The type of the event. Always 'response.image_generation_call.partial_image'. + The type of the image generation call. Always `image_generation_call`. - - `const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseImageGenCallPartialImageEventAgent` + - `Agent BetaResponseInputItemImageGenerationCallAgent` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response In Progress Event - -- `type BetaResponseInProgressEvent struct{…}` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - Emitted when the response is in progress. + A tool call to run code. - - `Response BetaResponse` + - `ID string` - The response that is in progress. + The unique ID of the code interpreter tool call. - - `ID string` + - `Code string` - Unique identifier for this Response. + The code to run, or null if not available. - - `CreatedAt float64` + - `ContainerID string` - Unix timestamp (in seconds) of when this Response was created. + The ID of the container used to run the code. - - `Error BetaResponseError` + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - An error object returned when the model fails to generate a Response. + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `Code BetaResponseErrorCode` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - The error code for the response. + The logs output from the code interpreter. - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + - `Logs string` - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + The logs output from the code interpreter. - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + - `Type Logs` - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + The type of the output. Always `logs`. - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `const LogsLogs Logs = "logs"` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + The image output from the code interpreter. - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + - `Type Image` - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + The type of the output. Always `image`. - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + - `const ImageImage Image = "image"` - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + - `URL string` - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + The URL of the image output from the code interpreter. - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `Message string` + - `Type CodeInterpreterCall` - A human-readable description of the error. + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `IncompleteDetails BetaResponseIncompleteDetails` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - Details about why the response is incomplete. + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `Reason string` + The agent that produced this item. - The reason why the response is incomplete. + - `AgentName string` - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + The canonical name of the agent that produced this item. - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + - `type BetaResponseInputItemLocalShellCall struct{…}` - - `Instructions BetaResponseInstructionsUnion` + A tool call to run a command on the local shell. - A system (or developer) message inserted into the model's context. + - `ID string` - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + The unique ID of the local shell call. - - `string` + - `Action BetaResponseInputItemLocalShellCallAction` - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + Execute a shell command on the server. - A list of one or many input items to the model, containing - different content types. + - `Command []string` - - `type BetaEasyInputMessage struct{…}` + The command to run. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `Env map[string, string]` - - `Content BetaEasyInputMessageContentUnion` + Environment variables to set for the command. - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `Type Exec` - - `string` + The type of the local shell action. Always `exec`. - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `const ExecExec Exec = "exec"` - A list of one or many input items to the model, containing different content - types. + - `TimeoutMs int64` - - `type BetaResponseInputText struct{…}` + Optional timeout in milliseconds for the command. - A text input to the model. + - `User string` - - `Text string` + Optional user to run the command as. - The text input to the model. + - `WorkingDirectory string` - - `Type InputText` + Optional working directory to run the command in. - The type of the input item. Always `input_text`. + - `CallID string` - - `const InputTextInputText InputText = "input_text"` + The unique ID of the local shell tool call generated by the model. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `Status string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The status of the local shell call. - - `Mode Explicit` + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - The breakpoint mode. Always `explicit`. + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - - `type BetaResponseInputImage struct{…}` + - `Type LocalShellCall` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The type of the local shell call. Always `local_shell_call`. - - `Detail BetaResponseInputImageDetail` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Agent BetaResponseInputItemLocalShellCallAgent` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + The agent that produced this item. - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `AgentName string` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + The canonical name of the agent that produced this item. - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `Type InputImage` + The output of a local shell tool call. - The type of the input item. Always `input_image`. + - `ID string` - - `const InputImageInputImage InputImage = "input_image"` + The unique ID of the local shell tool call generated by the model. - - `FileID string` + - `Output string` - The ID of the file to be sent to the model. + A JSON string of the output of the local shell tool call. - - `ImageURL string` + - `Type LocalShellCallOutput` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + The type of the local shell tool call output. Always `local_shell_call_output`. - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - - `Mode Explicit` + The agent that produced this item. - The breakpoint mode. Always `explicit`. + - `AgentName string` - - `const ExplicitExplicit Explicit = "explicit"` + The canonical name of the agent that produced this item. - - `type BetaResponseInputFile struct{…}` + - `Status string` - A file input to the model. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `Type InputFile` + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - The type of the input item. Always `input_file`. + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - - `const InputFileInputFile InputFile = "input_file"` + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - - `Detail BetaResponseInputFileDetail` + - `type BetaResponseInputItemShellCall struct{…}` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + A tool representing a request to execute one or more shell commands. - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `Action BetaResponseInputItemShellCallAction` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + The shell commands and limits that describe how to run the tool call. - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `Commands []string` - - `FileData string` + Ordered shell commands for the execution environment to run. - The content of the file to be sent to the model. + - `MaxOutputLength int64` - - `FileID string` + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - The ID of the file to be sent to the model. + - `TimeoutMs int64` - - `FileURL string` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - The URL of the file to be sent to the model. + - `CallID string` - - `Filename string` + The unique ID of the shell tool call generated by the model. - The name of the file to be sent to the model. + - `Type ShellCall` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + The type of the item. Always `shell_call`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const ShellCallShellCall ShellCall = "shell_call"` - - `Mode Explicit` + - `ID string` - The breakpoint mode. Always `explicit`. + The unique ID of the shell tool call. Populated when this item is returned via API. - - `const ExplicitExplicit Explicit = "explicit"` + - `Agent BetaResponseInputItemShellCallAgent` - - `Role BetaEasyInputMessageRole` + The agent that produced this item. - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + - `AgentName string` - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + The canonical name of the agent that produced this item. - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + - `Caller BetaResponseInputItemShellCallCallerUnion` - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + The execution context that produced this tool call. - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - `Phase BetaEasyInputMessagePhase` + - `Type Direct` - 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. + The caller type. Always `direct`. - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const DirectDirect Direct = "direct"` - - `Type BetaEasyInputMessageType` + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - The type of the message input. Always `message`. + - `CallerID string` - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + The call ID of the program item that produced this tool call. - - `type BetaResponseInputItemMessage struct{…}` + - `Type Program` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + The caller type. Always `program`. - - `Content BetaResponseInputMessageContentList` + - `const ProgramProgram Program = "program"` - A list of one or many input items to the model, containing different content - types. + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - `Role string` + The environment to execute the shell commands in. - The role of the message input. One of `user`, `system`, or `developer`. + - `type BetaLocalEnvironment struct{…}` - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + - `type BetaContainerReference struct{…}` - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + - `Status string` - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `Agent BetaResponseInputItemMessageAgent` + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - The agent that produced this item. + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - - `AgentName string` + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - The canonical name of the agent that produced this item. + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `Status string` + The streamed output items emitted by a shell tool call. - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `CallID string` - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + The unique ID of the shell tool call generated by the model. - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + - `Output []BetaResponseFunctionShellCallOutputContent` - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `Type string` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - The type of the message input. Always set to `message`. + The exit or timeout outcome associated with this shell call. - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - - `type BetaResponseOutputMessage struct{…}` + Indicates that the shell call exceeded its configured time limit. - An output message from the model. + - `Type Timeout` - - `ID string` + The outcome type. Always `timeout`. - The unique ID of the output message. + - `const TimeoutTimeout Timeout = "timeout"` - - `Content []BetaResponseOutputMessageContentUnion` + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - The content of the output message. + Indicates that the shell commands finished and returned an exit code. - - `type BetaResponseOutputText struct{…}` + - `ExitCode int64` - A text output from the model. + The exit code returned by the shell process. - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `Type Exit` - The annotations of the text output. + The outcome type. Always `exit`. - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `const ExitExit Exit = "exit"` - A citation to a file. + - `Stderr string` - - `FileID string` + Captured stderr output for the shell call. - The ID of the file. + - `Stdout string` - - `Filename string` + Captured stdout output for the shell call. - The filename of the file cited. + - `Type ShellCallOutput` - - `Index int64` + The type of the item. Always `shell_call_output`. - The index of the file in the list of files. + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `Type FileCitation` + - `ID string` - The type of the file citation. Always `file_citation`. + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `Agent BetaResponseInputItemShellCallOutputAgent` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + The agent that produced this item. - A citation for a web resource used to generate a model response. + - `AgentName string` - - `EndIndex int64` + The canonical name of the agent that produced this item. - The index of the last character of the URL citation in the message. + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - - `StartIndex int64` + The execution context that produced this tool call. - The index of the first character of the URL citation in the message. + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - `Title string` + - `Type Direct` - The title of the web resource. + The caller type. Always `direct`. - - `Type URLCitation` + - `const DirectDirect Direct = "direct"` - The type of the URL citation. Always `url_citation`. + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `CallerID string` - - `URL string` + The call ID of the program item that produced this tool call. - The URL of the web resource. + - `Type Program` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + The caller type. Always `program`. - A citation for a container file used to generate a model response. + - `const ProgramProgram Program = "program"` - - `ContainerID string` + - `MaxOutputLength int64` - The ID of the container file. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `EndIndex int64` + - `Status string` - The index of the last character of the container file citation in the message. + The status of the shell call output. - - `FileID string` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - The ID of the file. + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - - `Filename string` + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - The filename of the container file cited. + - `type BetaResponseInputItemApplyPatchCall struct{…}` - - `StartIndex int64` + A tool call representing a request to create, delete, or update files using diff patches. - The index of the first character of the container file citation in the message. + - `CallID string` - - `Type ContainerFileCitation` + The unique ID of the apply patch tool call generated by the model. - The type of the container file citation. Always `container_file_citation`. + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + The specific create, delete, or update instruction for the apply_patch tool call. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - A path to a file. + Instruction for creating a new file via the apply_patch tool. - - `FileID string` + - `Diff string` - The ID of the file. + Unified diff content to apply when creating the file. - - `Index int64` + - `Path string` - The index of the file in the list of files. + Path of the file to create relative to the workspace root. - - `Type FilePath` + - `Type CreateFile` - The type of the file path. Always `file_path`. + The operation type. Always `create_file`. - - `const FilePathFilePath FilePath = "file_path"` + - `const CreateFileCreateFile CreateFile = "create_file"` - - `Text string` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - The text output from the model. + Instruction for deleting an existing file via the apply_patch tool. - - `Type OutputText` + - `Path string` - The type of the output text. Always `output_text`. + Path of the file to delete relative to the workspace root. - - `const OutputTextOutputText OutputText = "output_text"` + - `Type DeleteFile` - - `Logprobs []BetaResponseOutputTextLogprob` + The operation type. Always `delete_file`. - - `Token string` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `Bytes []int64` + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - - `Logprob float64` + Instruction for updating an existing file via the apply_patch tool. - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `Diff string` - - `Token string` + Unified diff content to apply to the existing file. - - `Bytes []int64` + - `Path string` - - `Logprob float64` + Path of the file to update relative to the workspace root. - - `type BetaResponseOutputRefusal struct{…}` + - `Type UpdateFile` - A refusal from the model. + The operation type. Always `update_file`. - - `Refusal string` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - The refusal explanation from the model. + - `Status string` - - `Type Refusal` + The status of the apply patch tool call. One of `in_progress` or `completed`. - The type of the refusal. Always `refusal`. + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `const RefusalRefusal Refusal = "refusal"` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - - `Role Assistant` + - `Type ApplyPatchCall` - The role of the output message. Always `assistant`. + The type of the item. Always `apply_patch_call`. - - `const AssistantAssistant Assistant = "assistant"` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `Status BetaResponseOutputMessageStatus` + - `ID string` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + - `Agent BetaResponseInputItemApplyPatchCallAgent` - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + The agent that produced this item. - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + - `AgentName string` - - `Type Message` + The canonical name of the agent that produced this item. - The type of the output message. Always `message`. + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - - `const MessageMessage Message = "message"` + The execution context that produced this tool call. - - `Agent BetaResponseOutputMessageAgent` + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - The agent that produced this item. + - `Type Direct` - - `AgentName string` + The caller type. Always `direct`. - The canonical name of the agent that produced this item. + - `const DirectDirect Direct = "direct"` - - `Phase BetaResponseOutputMessagePhase` + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - 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. + - `CallerID string` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + The call ID of the program item that produced this tool call. - - `type BetaResponseFileSearchToolCall struct{…}` + - `Type Program` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The caller type. Always `program`. - - `ID string` + - `const ProgramProgram Program = "program"` - The unique ID of the file search tool call. + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - - `Queries []string` + The streamed output emitted by an apply patch tool call. - The queries used to search for files. + - `CallID string` - - `Status BetaResponseFileSearchToolCallStatus` + The unique ID of the apply patch tool call generated by the model. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `Status string` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + The status of the apply patch tool call output. One of `completed` or `failed`. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `Type ApplyPatchCallOutput` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + The type of the item. Always `apply_patch_call_output`. - - `Type FileSearchCall` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - The type of the file search tool call. Always `file_search_call`. + - `ID string` - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `Agent BetaResponseFileSearchToolCallAgent` + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` The agent that produced this item. @@ -81198,323 +94817,313 @@ func main() { The canonical name of the agent that produced this item. - - `Results []BetaResponseFileSearchToolCallResult` - - The results of the file search tool call. + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + The execution context that produced this tool call. - 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. + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - - `string` + - `Type Direct` - - `float64` + The caller type. Always `direct`. - - `bool` + - `const DirectDirect Direct = "direct"` - - `FileID string` + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - The unique ID of the file. + - `CallerID string` - - `Filename string` + The call ID of the program item that produced this tool call. - The name of the file. + - `Type Program` - - `Score float64` + The caller type. Always `program`. - The relevance score of the file - a value between 0 and 1. + - `const ProgramProgram Program = "program"` - - `Text string` + - `Output string` - The text that was retrieved from the file. + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - `type BetaResponseComputerToolCall struct{…}` + - `type BetaResponseInputItemMcpListTools struct{…}` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + A list of tools available on an MCP server. - `ID string` - The unique ID of the computer call. + The unique ID of the list. - - `CallID string` + - `ServerLabel string` - An identifier used when responding to the tool call with output. + The label of the MCP server. - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + - `Tools []BetaResponseInputItemMcpListToolsTool` - The pending safety checks for the computer call. + The tools available on the server. - - `ID string` + - `InputSchema any` - The ID of the pending safety check. + The JSON schema describing the tool's input. - - `Code string` + - `Name string` - The type of the pending safety check. + The name of the tool. - - `Message string` + - `Annotations any` - Details about the pending safety check. + Additional annotations about the tool. - - `Status BetaResponseComputerToolCallStatus` + - `Description string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The description of the tool. - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `Type McpListTools` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + The type of the item. Always `mcp_list_tools`. - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Type BetaResponseComputerToolCallType` + - `Agent BetaResponseInputItemMcpListToolsAgent` - The type of the computer call. Always `computer_call`. + The agent that produced this item. - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `AgentName string` - - `Action BetaComputerActionUnion` + The canonical name of the agent that produced this item. - A click action. + - `Error string` - - `type BetaComputerActionClick struct{…}` + Error message if the server could not list tools. - A click action. + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - - `Button string` + A request for human approval of a tool invocation. - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `ID string` - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + The unique ID of the approval request. - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `Arguments string` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + A JSON string of arguments for the tool. - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `Name string` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + The name of the tool to run. - - `Type Click` + - `ServerLabel string` - Specifies the event type. For a click action, this property is always `click`. + The label of the MCP server making the request. - - `const ClickClick Click = "click"` + - `Type McpApprovalRequest` - - `X int64` + The type of the item. Always `mcp_approval_request`. - The x-coordinate where the click occurred. + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Y int64` + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - The y-coordinate where the click occurred. + The agent that produced this item. - - `Keys []string` + - `AgentName string` - The keys being held while clicking. + The canonical name of the agent that produced this item. - - `type BetaComputerActionDoubleClick struct{…}` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - A double click action. + A response to an MCP approval request. - - `Keys []string` + - `ApprovalRequestID string` - The keys being held while double-clicking. + The ID of the approval request being answered. - - `Type DoubleClick` + - `Approve bool` - Specifies the event type. For a double click action, this property is always set to `double_click`. + Whether the request was approved. - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `Type McpApprovalResponse` - - `X int64` + The type of the item. Always `mcp_approval_response`. - The x-coordinate where the double click occurred. + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `Y int64` + - `ID string` - The y-coordinate where the double click occurred. + The unique ID of the approval response - - `type BetaComputerActionDrag struct{…}` + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` - A drag action. + The agent that produced this item. - - `Path []BetaComputerActionDragPath` + - `AgentName string` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + The canonical name of the agent that produced this item. - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `Reason string` - - `X int64` + Optional reason for the decision. - The x-coordinate. + - `type BetaResponseInputItemMcpCall struct{…}` - - `Y int64` + An invocation of a tool on an MCP server. - The y-coordinate. + - `ID string` - - `Type Drag` + The unique ID of the tool call. - Specifies the event type. For a drag action, this property is always set to `drag`. + - `Arguments string` - - `const DragDrag Drag = "drag"` + A JSON string of the arguments passed to the tool. - - `Keys []string` + - `Name string` - The keys being held while dragging the mouse. + The name of the tool that was run. - - `type BetaComputerActionKeypress struct{…}` + - `ServerLabel string` - A collection of keypresses the model would like to perform. + The label of the MCP server running the tool. - - `Keys []string` + - `Type McpCall` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + The type of the item. Always `mcp_call`. - - `Type Keypress` + - `const McpCallMcpCall McpCall = "mcp_call"` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `Agent BetaResponseInputItemMcpCallAgent` - - `const KeypressKeypress Keypress = "keypress"` + The agent that produced this item. - - `type BetaComputerActionMove struct{…}` + - `AgentName string` - A mouse move action. + The canonical name of the agent that produced this item. - - `Type Move` + - `ApprovalRequestID string` - Specifies the event type. For a move action, this property is always set to `move`. + 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. - - `const MoveMove Move = "move"` + - `Error string` - - `X int64` + The error from the tool call, if any. - The x-coordinate to move to. + - `Output string` - - `Y int64` + The output from the tool call. - The y-coordinate to move to. + - `Status string` - - `Keys []string` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - The keys being held while moving the mouse. + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - `type BetaComputerActionScreenshot struct{…}` + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - A screenshot action. + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - - `Type Screenshot` + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `type BetaResponseCustomToolCallOutput struct{…}` - - `type BetaComputerActionScroll struct{…}` + The output of a custom tool call from your code, being sent back to the model. - A scroll action. + - `CallID string` - - `ScrollX int64` + The call ID, used to map this custom tool call output to a custom tool call. - The horizontal scroll distance. + - `Output BetaResponseCustomToolCallOutputOutputUnion` - - `ScrollY int64` + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - The vertical scroll distance. + - `string` - - `Type Scroll` + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + Text, image, or file output of the custom tool call. - - `const ScrollScroll Scroll = "scroll"` + - `type BetaResponseInputText struct{…}` - - `X int64` + A text input to the model. - The x-coordinate where the scroll occurred. + - `type BetaResponseInputImage struct{…}` - - `Y int64` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The y-coordinate where the scroll occurred. + - `type BetaResponseInputFile struct{…}` - - `Keys []string` + A file input to the model. - The keys being held while scrolling. + - `Type CustomToolCallOutput` - - `type BetaComputerActionType struct{…}` + The type of the custom tool call output. Always `custom_tool_call_output`. - An action to type in text. + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - - `Text string` + - `ID string` - The text to type. + The unique ID of the custom tool call output in the OpenAI platform. - - `Type Type` + - `Agent BetaResponseCustomToolCallOutputAgent` - Specifies the event type. For a type action, this property is always set to `type`. + The agent that produced this item. - - `const TypeType Type = "type"` + - `AgentName string` - - `type BetaComputerActionWait struct{…}` + The canonical name of the agent that produced this item. - A wait action. + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - `Type Wait` + The execution context that produced this tool call. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - - `const WaitWait Wait = "wait"` + - `Type Direct` - - `Actions BetaComputerActionList` + The caller type. Always `direct`. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `const DirectDirect Direct = "direct"` - - `type BetaComputerActionClick struct{…}` + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - A click action. + - `CallerID string` - - `type BetaComputerActionDoubleClick struct{…}` + The call ID of the program item that produced this tool call. - A double click action. + - `Type Program` - - `type BetaComputerActionDrag struct{…}` + The caller type. Always `program`. - A drag action. + - `const ProgramProgram Program = "program"` - - `type BetaComputerActionKeypress struct{…}` + - `type BetaResponseCustomToolCall struct{…}` - A collection of keypresses the model would like to perform. + A call to a custom tool created by the model. - - `type BetaComputerActionMove struct{…}` + - `CallID string` - A mouse move action. + An identifier used to map this custom tool call to a tool call output. - - `type BetaComputerActionScreenshot struct{…}` + - `Input string` - A screenshot action. + The input for the custom tool call generated by the model. - - `type BetaComputerActionScroll struct{…}` + - `Name string` - A scroll action. + The name of the custom tool being called. - - `type BetaComputerActionType struct{…}` + - `Type CustomToolCall` - An action to type in text. + The type of the custom tool call. Always `custom_tool_call`. - - `type BetaComputerActionWait struct{…}` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - A wait action. + - `ID string` - - `Agent BetaResponseComputerToolCallAgent` + The unique ID of the custom tool call in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallAgent` The agent that produced this item. @@ -81522,60 +95131,57 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemComputerCallOutput struct{…}` - - The output of a computer tool call. + - `Caller BetaResponseCustomToolCallCallerUnion` - - `CallID string` + The execution context that produced this tool call. - The ID of the computer tool call that produced the output. + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Type Direct` - A computer screenshot image used with the computer use tool. + - `const DirectDirect Direct = "direct"` - - `Type ComputerScreenshot` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `CallerID string` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + The call ID of the program item that produced this tool call. - - `FileID string` + - `Type Program` - The identifier of an uploaded file that contains the screenshot. + - `const ProgramProgram Program = "program"` - - `ImageURL string` + - `Namespace string` - The URL of the screenshot image. + The namespace of the custom tool being called. - - `Type ComputerCallOutput` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - The type of the computer tool call output. Always `computer_call_output`. + Compacts the current context. Must be the final input item. - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `Type CompactionTrigger` - - `ID string` + The type of the item. Always `compaction_trigger`. - The ID of the computer tool call output. + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - The safety checks reported by the API that have been acknowledged by the developer. + The agent that produced this item. - - `ID string` + - `AgentName string` - The ID of the pending safety check. + The canonical name of the agent that produced this item. - - `Code string` + - `type BetaResponseInputItemItemReference struct{…}` - The type of the pending safety check. + An internal identifier for an item to reference. - - `Message string` + - `ID string` - Details about the pending safety check. + The ID of the item to reference. - - `Agent BetaResponseInputItemComputerCallOutputAgent` + - `Agent BetaResponseInputItemItemReferenceAgent` The agent that produced this item. @@ -81583,209 +95189,211 @@ func main() { The canonical name of the agent that produced this item. - - `Status string` + - `Type string` - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + The type of item to reference. Always `item_reference`. - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `type BetaResponseInputItemProgram struct{…}` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + - `ID string` - - `type BetaResponseFunctionWebSearch struct{…}` + The unique ID of this program item. - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `CallID string` - - `ID string` + The stable call ID of the program item. - The unique ID of the web search tool call. + - `Code string` - - `Action BetaResponseFunctionWebSearchActionUnion` + The JavaScript source executed by programmatic tool calling. - 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). + - `Fingerprint string` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + Opaque program replay fingerprint that must be round-tripped. - Action type "search" - Performs a web search query. + - `Type Program` - - `Type Search` + The item type. Always `program`. - The action type. + - `const ProgramProgram Program = "program"` - - `const SearchSearch Search = "search"` + - `Agent BetaResponseInputItemProgramAgent` - - `Queries []string` + The agent that produced this item. - The search queries. + - `AgentName string` - - `Query string` + The canonical name of the agent that produced this item. - The search query. + - `type BetaResponseInputItemProgramOutput struct{…}` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + - `ID string` - The sources used in the search. + The unique ID of this program output item. - - `Type URL` + - `CallID string` - The type of source. Always `url`. + The call ID of the program item. - - `const URLURL URL = "url"` + - `Result string` - - `URL string` + The result produced by the program item. - The URL of the source. + - `Status string` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + The terminal status of the program output. - Action type "open_page" - Opens a specific URL from search results. + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `Type OpenPage` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The item type. Always `program_output`. - The action type. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `const OpenPageOpenPage OpenPage = "open_page"` + - `Agent BetaResponseInputItemProgramOutputAgent` - - `URL string` + The agent that produced this item. - The URL opened by the model. + - `AgentName string` - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + The canonical name of the agent that produced this item. - Action type "find_in_page": Searches for a pattern within a loaded page. +### Beta Response Input Message Content List - - `Pattern string` +- `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - The pattern or text to search for within the page. + A list of one or many input items to the model, containing different content + types. - - `Type FindInPage` + - `type BetaResponseInputText struct{…}` - The action type. + A text input to the model. - - `const FindInPageFindInPage FindInPage = "find_in_page"` + - `Text string` - - `URL string` + The text input to the model. - The URL of the page searched for the pattern. + - `Type InputText` - - `Status BetaResponseFunctionWebSearchStatus` + The type of the input item. Always `input_text`. - The status of the web search tool call. + - `const InputTextInputText InputText = "input_text"` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `Mode Explicit` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + The breakpoint mode. Always `explicit`. - - `Type WebSearchCall` + - `const ExplicitExplicit Explicit = "explicit"` - The type of the web search tool call. Always `web_search_call`. + - `type BetaResponseInputImage struct{…}` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Agent BetaResponseFunctionWebSearchAgent` + - `Detail BetaResponseInputImageDetail` - The agent that produced this item. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `AgentName string` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - The canonical name of the agent that produced this item. + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `type BetaResponseFunctionToolCall struct{…}` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `Arguments string` + - `Type InputImage` - A JSON string of the arguments to pass to the function. + The type of the input item. Always `input_image`. - - `CallID string` + - `const InputImageInputImage InputImage = "input_image"` - The unique ID of the function tool call generated by the model. + - `FileID string` - - `Name string` + The ID of the file to be sent to the model. - The name of the function to run. + - `ImageURL string` - - `Type FunctionCall` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - The type of the function tool call. Always `function_call`. + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `ID string` + - `Mode Explicit` - The unique ID of the function tool call. + The breakpoint mode. Always `explicit`. - - `Agent BetaResponseFunctionToolCallAgent` + - `const ExplicitExplicit Explicit = "explicit"` - The agent that produced this item. + - `type BetaResponseInputFile struct{…}` - - `AgentName string` + A file input to the model. - The canonical name of the agent that produced this item. + - `Type InputFile` - - `Caller BetaResponseFunctionToolCallCallerUnion` + The type of the input item. Always `input_file`. - The execution context that produced this tool call. + - `const InputFileInputFile InputFile = "input_file"` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `Detail BetaResponseInputFileDetail` - - `Type Direct` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const DirectDirect Direct = "direct"` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `CallerID string` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - The call ID of the program item that produced this tool call. + - `FileData string` - - `Type Program` + The content of the file to be sent to the model. - - `const ProgramProgram Program = "program"` + - `FileID string` - - `Namespace string` + The ID of the file to be sent to the model. - The namespace of the function to run. + - `FileURL string` - - `Status BetaResponseFunctionToolCallStatus` + The URL of the file to be sent to the model. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Filename string` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + The name of the file to be sent to the model. - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `Mode Explicit` - The output of a function tool call. + The breakpoint mode. Always `explicit`. - - `CallID string` + - `const ExplicitExplicit Explicit = "explicit"` - The unique ID of the function tool call generated by the model. +### Beta Response Input Message Item - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` +- `type BetaResponseInputMessageItem struct{…}` - Text, image, or file output of the function tool call. + - `ID string` - - `string` + The unique ID of the message input. - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `Content BetaResponseInputMessageContentList` - An array of content outputs (text, image, file) for the function tool call. + A list of one or many input items to the model, containing different content + types. - - `type BetaResponseInputTextContent struct{…}` + - `type BetaResponseInputText struct{…}` A text input to the model. @@ -81799,7 +95407,7 @@ func main() { - `const InputTextInputText InputText = "input_text"` - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -81809,27 +95417,27 @@ func main() { - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseInputImageContent struct{…}` + - `type BetaResponseInputImage struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Type InputImage` + - `Detail BetaResponseInputImageDetail` - The type of the input item. Always `input_image`. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const InputImageInputImage InputImage = "input_image"` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `Detail BetaResponseInputImageContentDetail` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + - `Type InputImage` - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + The type of the input item. Always `input_image`. - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `const InputImageInputImage InputImage = "input_image"` - `FileID string` @@ -81839,7 +95447,7 @@ func main() { The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -81849,7 +95457,7 @@ func main() { - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseInputFileContent struct{…}` + - `type BetaResponseInputFile struct{…}` A file input to the model. @@ -81859,19 +95467,19 @@ func main() { - `const InputFileInputFile InputFile = "input_file"` - - `Detail BetaResponseInputFileContentDetail` + - `Detail BetaResponseInputFileDetail` The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - `FileData string` - The base64-encoded data of the file to be sent to the model. + The content of the file to be sent to the model. - `FileID string` @@ -81885,7 +95493,7 @@ func main() { The name of the file to be sent to the model. - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -81895,17 +95503,23 @@ func main() { - `const ExplicitExplicit Explicit = "explicit"` - - `Type FunctionCallOutput` + - `Role BetaResponseInputMessageItemRole` - The type of the function tool call output. Always `function_call_output`. + The role of the message input. One of `user`, `system`, or `developer`. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `const BetaResponseInputMessageItemRoleUser BetaResponseInputMessageItemRole = "user"` - - `ID string` + - `const BetaResponseInputMessageItemRoleSystem BetaResponseInputMessageItemRole = "system"` - The unique ID of the function tool call output. Populated when this item is returned via API. + - `const BetaResponseInputMessageItemRoleDeveloper BetaResponseInputMessageItemRole = "developer"` - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + - `Type Message` + + The type of the message input. Always set to `message`. + + - `const MessageMessage Message = "message"` + + - `Agent BetaResponseInputMessageItemAgent` The agent that produced this item. @@ -81913,181 +95527,254 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `Status BetaResponseInputMessageItemStatus` - The execution context that produced this tool call. + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + - `const BetaResponseInputMessageItemStatusInProgress BetaResponseInputMessageItemStatus = "in_progress"` - - `Type Direct` + - `const BetaResponseInputMessageItemStatusCompleted BetaResponseInputMessageItemStatus = "completed"` - The caller type. Always `direct`. + - `const BetaResponseInputMessageItemStatusIncomplete BetaResponseInputMessageItemStatus = "incomplete"` - - `const DirectDirect Direct = "direct"` +### Beta Response Input Text - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` +- `type BetaResponseInputText struct{…}` - - `CallerID string` + A text input to the model. - The call ID of the program item that produced this tool call. + - `Text string` - - `Type Program` + The text input to the model. - The caller type. Always `program`. + - `Type InputText` - - `const ProgramProgram Program = "program"` + The type of the input item. Always `input_text`. - - `Status string` + - `const InputTextInputText InputText = "input_text"` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + - `Mode Explicit` - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + The breakpoint mode. Always `explicit`. - - `type BetaResponseInputItemAgentMessage struct{…}` + - `const ExplicitExplicit Explicit = "explicit"` - A message routed between agents. +### Beta Response Input Text Content - - `Author string` +- `type BetaResponseInputTextContent struct{…}` - The sending agent identity. + A text input to the model. - - `Content []BetaResponseInputItemAgentMessageContentUnion` + - `Text string` - Plaintext, image, or encrypted content sent between agents. + The text input to the model. - - `type BetaResponseInputTextContent struct{…}` + - `Type InputText` + + The type of the input item. Always `input_text`. + + - `const InputTextInputText InputText = "input_text"` + + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `Mode Explicit` + + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + +### Beta Response Item + +- `type BetaResponseItemUnion interface{…}` + + Content item used to generate a response. + + - `type BetaResponseInputMessageItem struct{…}` + + - `ID string` + + The unique ID of the message input. + + - `Content BetaResponseInputMessageContentList` + + A list of one or many input items to the model, containing different content + types. + + - `type BetaResponseInputText struct{…}` A text input to the model. - - `type BetaResponseInputImageContent struct{…}` + - `Text string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + The text input to the model. - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + - `Type InputText` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The type of the input item. Always `input_text`. - - `EncryptedContent string` + - `const InputTextInputText InputText = "input_text"` - Opaque encrypted content. + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `Type EncryptedContent` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The type of the input item. Always `encrypted_content`. + - `Mode Explicit` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + The breakpoint mode. Always `explicit`. - - `Recipient string` + - `const ExplicitExplicit Explicit = "explicit"` - The destination agent identity. + - `type BetaResponseInputImage struct{…}` - - `Type AgentMessage` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The item type. Always `agent_message`. + - `Detail BetaResponseInputImageDetail` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `ID string` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - The unique ID of this agent message item. + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `Agent BetaResponseInputItemAgentMessageAgent` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - The agent that produced this item. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `AgentName string` + - `Type InputImage` - The canonical name of the agent that produced this item. + The type of the input item. Always `input_image`. - - `type BetaResponseInputItemMultiAgentCall struct{…}` + - `const InputImageInputImage InputImage = "input_image"` - - `Action string` + - `FileID string` - The multi-agent action that was executed. + The ID of the file to be sent to the model. - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + - `ImageURL string` - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `Mode Explicit` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + The breakpoint mode. Always `explicit`. - - `Arguments string` + - `const ExplicitExplicit Explicit = "explicit"` - The action arguments as a JSON string. + - `type BetaResponseInputFile struct{…}` - - `CallID string` + A file input to the model. - The unique ID linking this call to its output. + - `Type InputFile` - - `Type MultiAgentCall` + The type of the input item. Always `input_file`. - The item type. Always `multi_agent_call`. + - `const InputFileInputFile InputFile = "input_file"` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `Detail BetaResponseInputFileDetail` - - `ID string` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - The unique ID of this multi-agent call. + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `Agent BetaResponseInputItemMultiAgentCallAgent` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - The agent that produced this item. + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `AgentName string` + - `FileData string` - The canonical name of the agent that produced this item. + The content of the file to be sent to the model. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `FileID string` - - `Action string` + The ID of the file to be sent to the model. - The multi-agent action that produced this result. + - `FileURL string` - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + The URL of the file to be sent to the model. - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `Filename string` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + The name of the file to be sent to the model. - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + - `Mode Explicit` - - `CallID string` + The breakpoint mode. Always `explicit`. - The unique ID of the multi-agent call. + - `const ExplicitExplicit Explicit = "explicit"` - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + - `Role BetaResponseInputMessageItemRole` - Text output returned by the multi-agent action. + The role of the message input. One of `user`, `system`, or `developer`. - - `Text string` + - `const BetaResponseInputMessageItemRoleUser BetaResponseInputMessageItemRole = "user"` - The text content. + - `const BetaResponseInputMessageItemRoleSystem BetaResponseInputMessageItemRole = "system"` - - `Type OutputText` + - `const BetaResponseInputMessageItemRoleDeveloper BetaResponseInputMessageItemRole = "developer"` - The content type. Always `output_text`. + - `Type Message` - - `const OutputTextOutputText OutputText = "output_text"` + The type of the message input. Always set to `message`. - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + - `const MessageMessage Message = "message"` - Citations associated with the text content. + - `Agent BetaResponseInputMessageItemAgent` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Status BetaResponseInputMessageItemStatus` + + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `const BetaResponseInputMessageItemStatusInProgress BetaResponseInputMessageItemStatus = "in_progress"` + + - `const BetaResponseInputMessageItemStatusCompleted BetaResponseInputMessageItemStatus = "completed"` + + - `const BetaResponseInputMessageItemStatusIncomplete BetaResponseInputMessageItemStatus = "incomplete"` + + - `type BetaResponseOutputMessage struct{…}` + + An output message from the model. + + - `ID string` + + The unique ID of the output message. + + - `Content []BetaResponseOutputMessageContentUnion` + + The content of the output message. + + - `type BetaResponseOutputText struct{…}` + + A text output from the model. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + + A citation to a file. - `FileID string` @@ -82103,47 +95790,51 @@ func main() { - `Type FileCitation` - The citation type. Always `file_citation`. + The type of the file citation. Always `file_citation`. - `const FileCitationFileCitation FileCitation = "file_citation"` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + + A citation for a web resource used to generate a model response. - `EndIndex int64` - The index of the last character of the citation in the message. + The index of the last character of the URL citation in the message. - `StartIndex int64` - The index of the first character of the citation in the message. + The index of the first character of the URL citation in the message. - `Title string` - The title of the cited resource. + The title of the web resource. - `Type URLCitation` - The citation type. Always `url_citation`. + The type of the URL citation. Always `url_citation`. - `const URLCitationURLCitation URLCitation = "url_citation"` - `URL string` - The URL of the cited resource. + The URL of the web resource. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + + A citation for a container file used to generate a model response. - `ContainerID string` - The ID of the container. + The ID of the container file. - `EndIndex int64` - The index of the last character of the citation in the message. + The index of the last character of the container file citation in the message. - `FileID string` - The ID of the container file. + The ID of the file. - `Filename string` @@ -82151,2249 +95842,2303 @@ func main() { - `StartIndex int64` - The index of the first character of the citation in the message. + The index of the first character of the container file citation in the message. - `Type ContainerFileCitation` - The citation type. Always `container_file_citation`. + The type of the container file citation. Always `container_file_citation`. - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `Type MultiAgentCallOutput` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - The item type. Always `multi_agent_call_output`. + A path to a file. - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `FileID string` - - `ID string` + The ID of the file. - The unique ID of this multi-agent call output. + - `Index int64` - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + The index of the file in the list of files. - The agent that produced this item. + - `Type FilePath` - - `AgentName string` + The type of the file path. Always `file_path`. - The canonical name of the agent that produced this item. + - `const FilePathFilePath FilePath = "file_path"` - - `type BetaResponseInputItemToolSearchCall struct{…}` + - `Text string` - - `Arguments any` + The text output from the model. - The arguments supplied to the tool search call. + - `Type OutputText` - - `Type ToolSearchCall` + The type of the output text. Always `output_text`. - The item type. Always `tool_search_call`. + - `const OutputTextOutputText OutputText = "output_text"` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `Logprobs []BetaResponseOutputTextLogprob` - - `ID string` + - `Token string` - The unique ID of this tool search call. + - `Bytes []int64` - - `Agent BetaResponseInputItemToolSearchCallAgent` + - `Logprob float64` - The agent that produced this item. + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - - `AgentName string` + - `Token string` - The canonical name of the agent that produced this item. + - `Bytes []int64` - - `CallID string` + - `Logprob float64` - The unique ID of the tool search call generated by the model. + - `type BetaResponseOutputRefusal struct{…}` - - `Execution string` + A refusal from the model. - Whether tool search was executed by the server or by the client. + - `Refusal string` - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + The refusal explanation from the model. - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + - `Type Refusal` - - `Status string` + The type of the refusal. Always `refusal`. - The status of the tool search call. + - `const RefusalRefusal Refusal = "refusal"` - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + - `Role Assistant` - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + The role of the output message. Always `assistant`. - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + - `const AssistantAssistant Assistant = "assistant"` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + - `Status BetaResponseOutputMessageStatus` - - `Tools []BetaToolUnion` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - The loaded tool definitions returned by the tool search output. + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `type BetaFunctionTool struct{…}` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `Name string` + - `Type Message` - The name of the function to call. + The type of the output message. Always `message`. - - `Parameters map[string, any]` + - `const MessageMessage Message = "message"` - A JSON schema object describing the parameters of the function. + - `Agent BetaResponseOutputMessageAgent` - - `Strict bool` + The agent that produced this item. - Whether strict parameter validation is enforced for this function tool. + - `AgentName string` - - `Type Function` + The canonical name of the agent that produced this item. - The type of the function tool. Always `function`. + - `Phase BetaResponseOutputMessagePhase` - - `const FunctionFunction Function = "function"` + 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. - - `AllowedCallers []string` + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - The tool invocation context(s). + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `type BetaResponseFileSearchToolCall struct{…}` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `DeferLoading bool` + - `ID string` - Whether this function is deferred and loaded via tool search. + The unique ID of the file search tool call. - - `Description string` + - `Queries []string` - A description of the function. Used by the model to determine whether or not to call the function. + The queries used to search for files. - - `OutputSchema map[string, any]` + - `Status BetaResponseFileSearchToolCallStatus` - A JSON schema object describing the JSON value encoded in string outputs for this function. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `type BetaFileSearchTool struct{…}` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `Type FileSearch` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - The type of the file search tool. Always `file_search`. + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - - `VectorStoreIDs []string` + - `Type FileSearchCall` - The IDs of the vector stores to search. + The type of the file search tool call. Always `file_search_call`. - - `Filters BetaFileSearchToolFiltersUnion` + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - A filter to apply. + - `Agent BetaResponseFileSearchToolCallAgent` - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + The agent that produced this item. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `AgentName string` - - `Key string` + The canonical name of the agent that produced this item. - The key to compare against the value. + - `Results []BetaResponseFileSearchToolCallResult` - - `Type string` + The results of the file search tool call. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - - `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 + 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. - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `float64` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + - `bool` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `FileID string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + The unique ID of the file. - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + - `Filename string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + The name of the file. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `Score float64` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + The relevance score of the file - a value between 0 and 1. - The value to compare against the attribute key; supports string, number, or boolean types. + - `Text string` - - `string` + The text that was retrieved from the file. - - `float64` + - `type BetaResponseComputerToolCall struct{…}` - - `bool` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `ID string` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + The unique ID of the computer call. - Combine multiple filters using `and` or `or`. + - `CallID string` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + An identifier used when responding to the tool call with output. - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + The pending safety checks for the computer call. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `ID string` - - `Key string` + The ID of the pending safety check. - The key to compare against the value. + - `Code string` - - `Type string` + The type of the pending safety check. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `Message string` - - `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 + Details about the pending safety check. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `Status BetaResponseComputerToolCallStatus` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + - `Type BetaResponseComputerToolCallType` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + The type of the computer call. Always `computer_call`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + - `Action BetaComputerActionUnion` - The value to compare against the attribute key; supports string, number, or boolean types. + A click action. - - `string` + - `type BetaComputerActionClick struct{…}` - - `float64` + A click action. - - `bool` + - `Button string` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `Type string` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - Type of operation: `and` or `or`. + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `MaxNumResults int64` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `Type Click` - - `RankingOptions BetaFileSearchToolRankingOptions` + Specifies the event type. For a click action, this property is always `click`. - Ranking options for search. + - `const ClickClick Click = "click"` - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `X int64` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + The x-coordinate where the click occurred. - - `EmbeddingWeight float64` + - `Y int64` - The weight of the embedding in the reciprocal ranking fusion. + The y-coordinate where the click occurred. - - `TextWeight float64` + - `Keys []string` - The weight of the text in the reciprocal ranking fusion. + The keys being held while clicking. - - `Ranker string` + - `type BetaComputerActionDoubleClick struct{…}` - The ranker to use for the file search. + A double click action. - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + - `Keys []string` - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + The keys being held while double-clicking. - - `ScoreThreshold float64` + - `Type DoubleClick` - 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. + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `type BetaComputerTool struct{…}` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `X int64` - - `Type Computer` + The x-coordinate where the double click occurred. - The type of the computer tool. Always `computer`. + - `Y int64` - - `const ComputerComputer Computer = "computer"` + The y-coordinate where the double click occurred. - - `type BetaComputerUsePreviewTool struct{…}` + - `type BetaComputerActionDrag struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + A drag action. - - `DisplayHeight int64` + - `Path []BetaComputerActionDragPath` - The height of the computer display. + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `DisplayWidth int64` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - The width of the computer display. + - `X int64` - - `Environment BetaComputerUsePreviewToolEnvironment` + The x-coordinate. - The type of computer environment to control. + - `Y int64` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + The y-coordinate. - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `Type Drag` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + Specifies the event type. For a drag action, this property is always set to `drag`. - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `const DragDrag Drag = "drag"` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + - `Keys []string` - - `Type ComputerUsePreview` + The keys being held while dragging the mouse. - The type of the computer use tool. Always `computer_use_preview`. + - `type BetaComputerActionKeypress struct{…}` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + A collection of keypresses the model would like to perform. - - `type BetaWebSearchTool struct{…}` + - `Keys []string` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `Type BetaWebSearchToolType` + - `Type Keypress` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `const KeypressKeypress Keypress = "keypress"` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `type BetaComputerActionMove struct{…}` - - `Filters BetaWebSearchToolFilters` + A mouse move action. - Filters for the search. + - `Type Move` - - `AllowedDomains []string` + Specifies the event type. For a move action, this property is always set to `move`. - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `const MoveMove Move = "move"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `X int64` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + The x-coordinate to move to. - 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. + - `Y int64` - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + The y-coordinate to move to. - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `Keys []string` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + The keys being held while moving the mouse. - - `UserLocation BetaWebSearchToolUserLocation` + - `type BetaComputerActionScreenshot struct{…}` - The approximate location of the user. + A screenshot action. - - `City string` + - `Type Screenshot` - Free text input for the city of the user, e.g. `San Francisco`. + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `Country string` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `type BetaComputerActionScroll struct{…}` - - `Region string` + A scroll action. - Free text input for the region of the user, e.g. `California`. + - `ScrollX int64` - - `Timezone string` + The horizontal scroll distance. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `ScrollY int64` - - `Type string` + The vertical scroll distance. - The type of location approximation. Always `approximate`. + - `Type Scroll` - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `type BetaToolMcp struct{…}` + - `const ScrollScroll Scroll = "scroll"` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `X int64` - - `ServerLabel string` + The x-coordinate where the scroll occurred. - A label for this MCP server, used to identify it in tool calls. + - `Y int64` - - `Type Mcp` + The y-coordinate where the scroll occurred. - The type of the MCP tool. Always `mcp`. + - `Keys []string` - - `const McpMcp Mcp = "mcp"` + The keys being held while scrolling. - - `AllowedCallers []string` + - `type BetaComputerActionType struct{…}` - The tool invocation context(s). + An action to type in text. - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + - `Text string` - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + The text to type. - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `Type Type` - List of allowed tool names or a filter object. + Specifies the event type. For a type action, this property is always set to `type`. - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `const TypeType Type = "type"` - A string array of allowed tool names + - `type BetaComputerActionWait struct{…}` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + A wait action. - A filter object to specify which tools are allowed. + - `Type Wait` - - `ReadOnly bool` + Specifies the event type. For a wait action, this property is always set to `wait`. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `const WaitWait Wait = "wait"` - - `ToolNames []string` + - `Actions BetaComputerActionList` - List of allowed tool names. + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `Authorization string` + - `type BetaComputerActionClick struct{…}` - 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. + A click action. - - `ConnectorID string` + - `type BetaComputerActionDoubleClick struct{…}` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + A double click action. - Currently supported `connector_id` values are: + - `type BetaComputerActionDrag struct{…}` - - 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` + A drag action. - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + - `type BetaComputerActionKeypress struct{…}` - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + A collection of keypresses the model would like to perform. - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `type BetaComputerActionMove struct{…}` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + A mouse move action. - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `type BetaComputerActionScreenshot struct{…}` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + A screenshot action. - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `type BetaComputerActionScroll struct{…}` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + A scroll action. - - `DeferLoading bool` + - `type BetaComputerActionType struct{…}` - Whether this MCP tool is deferred and discovered via tool search. + An action to type in text. - - `Headers map[string, string]` + - `type BetaComputerActionWait struct{…}` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + A wait action. - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `Agent BetaResponseComputerToolCallAgent` - Specify which of the MCP server's tools require approval. + The agent that produced this item. - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + - `AgentName string` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + The canonical name of the agent that produced this item. - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - A filter object to specify which tools are allowed. + - `ID string` - - `ReadOnly bool` + The unique ID of the computer call tool output. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `CallID string` + + The ID of the computer tool call that produced the output. + + - `Output BetaResponseComputerToolCallOutputScreenshot` + + 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 BetaResponseComputerToolCallOutputItemStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + + - `Type ComputerCallOutput` + + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `ToolNames []string` + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - List of allowed tool names. + The safety checks reported by the API that have been acknowledged by the + developer. - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `ID string` - A filter object to specify which tools are allowed. + The ID of the pending safety check. - - `ReadOnly bool` + - `Code string` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The type of the pending safety check. - - `ToolNames []string` + - `Message string` - List of allowed tool names. + Details about the pending safety check. - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `Agent BetaResponseComputerToolCallOutputItemAgent` - 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. + The agent that produced this item. - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `AgentName string` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + The canonical name of the agent that produced this item. - - `ServerDescription string` + - `CreatedBy string` - Optional description of the MCP server, used to provide more context. + The identifier of the actor that created the item. - - `ServerURL string` + - `type BetaResponseFunctionWebSearch struct{…}` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `TunnelID string` + - `ID 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. + The unique ID of the web search tool call. - - `type BetaToolCodeInterpreter struct{…}` + - `Action BetaResponseFunctionWebSearchActionUnion` - A tool that runs Python code to help generate a response to a prompt. + 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). - - `Container BetaToolCodeInterpreterContainerUnion` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - 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. + Action type "search" - Performs a web search query. - - `string` + - `Type Search` - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + The action type. - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `const SearchSearch Search = "search"` - - `Type Auto` + - `Queries []string` - Always `auto`. + The search queries. - - `const AutoAuto Auto = "auto"` + - `Query string` - - `FileIDs []string` + The search query. - An optional list of uploaded files to make available to your code. + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `MemoryLimit string` + The sources used in the search. - The memory limit for the code interpreter container. + - `Type URL` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + The type of source. Always `url`. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `const URLURL URL = "url"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `URL string` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + The URL of the source. - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - Network access policy for the container. + Action type "open_page" - Opens a specific URL from search results. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `Type OpenPage` - - `Type Disabled` + The action type. - Disable outbound network access. Always `disabled`. + - `const OpenPageOpenPage OpenPage = "open_page"` - - `const DisabledDisabled Disabled = "disabled"` + - `URL string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The URL opened by the model. - - `AllowedDomains []string` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - A list of allowed domains when type is `allowlist`. + Action type "find_in_page": Searches for a pattern within a loaded page. - - `Type Allowlist` + - `Pattern string` - Allow outbound network access only to specified domains. Always `allowlist`. + The pattern or text to search for within the page. - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `Type FindInPage` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + The action type. - Optional domain-scoped secrets for allowlisted domains. + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `Domain string` + - `URL string` - The domain associated with the secret. + The URL of the page searched for the pattern. - - `Name string` + - `Status BetaResponseFunctionWebSearchStatus` - The name of the secret to inject for the domain. + The status of the web search tool call. - - `Value string` + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - The secret value to inject for the domain. + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - `Type CodeInterpreter` + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - The type of the code interpreter tool. Always `code_interpreter`. + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `Type WebSearchCall` - - `AllowedCallers []string` + The type of the web search tool call. Always `web_search_call`. - The tool invocation context(s). + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `Agent BetaResponseFunctionWebSearchAgent` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + The agent that produced this item. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `AgentName string` - - `Type ProgrammaticToolCalling` + The canonical name of the agent that produced this item. - The type of the tool. Always `programmatic_tool_calling`. + - `type BetaResponseFunctionToolCallItem struct{…}` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `type BetaToolImageGeneration struct{…}` + - `ID string` - A tool that generates images using the GPT image models. + The unique ID of the function tool call. - - `Type ImageGeneration` + - `Status string` - The type of the image generation tool. Always `image_generation`. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `const BetaResponseFunctionToolCallItemStatusInProgress BetaResponseFunctionToolCallItemStatus = "in_progress"` - - `Action string` + - `const BetaResponseFunctionToolCallItemStatusCompleted BetaResponseFunctionToolCallItemStatus = "completed"` - Whether to generate a new image or edit an existing image. Default: `auto`. + - `const BetaResponseFunctionToolCallItemStatusIncomplete BetaResponseFunctionToolCallItemStatus = "incomplete"` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + - `CreatedBy string` - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + The identifier of the actor that created the item. - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `Background string` + - `ID 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. + The unique ID of the function call tool output. - `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. + - `CallID string` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + The unique ID of the function tool call generated by the model. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + The output from the function call generated by your code. + Can be a string or an list of output content. - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `string` - - `InputFidelity string` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - 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`. + Text, image, or file output of the function call. - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + - `type BetaResponseInputText struct{…}` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + A text input to the model. - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `type BetaResponseInputImage struct{…}` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `FileID string` + - `type BetaResponseInputFile struct{…}` - File ID for the mask image. + A file input to the model. - - `ImageURL string` + - `Status BetaResponseFunctionToolCallOutputItemStatus` - Base64-encoded mask image. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Model string` + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - The image generation model to use. Default: `gpt-image-1`. + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - - `string` + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `string` + - `Type FunctionCallOutput` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + The type of the function tool call output. Always `function_call_output`. - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + The agent that produced this item. - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + - `AgentName string` - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + The canonical name of the agent that produced this item. - - `Moderation string` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - Moderation level for the generated image. Default: `auto`. + The execution context that produced this tool call. - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `Type Direct` - - `OutputCompression int64` + The caller type. Always `direct`. - Compression level for the output image. Default: 100. + - `const DirectDirect Direct = "direct"` - - `OutputFormat string` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `CallerID string` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + The call ID of the program item that produced this tool call. - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + - `Type Program` - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + The caller type. Always `program`. - - `PartialImages int64` + - `const ProgramProgram Program = "program"` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `CreatedBy string` - - `Quality string` + The identifier of the actor that created the item. - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `type BetaResponseItemAgentMessage struct{…}` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `ID string` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + The unique ID of the agent message. - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `Author string` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The sending agent identity. - - `Size string` + - `Content []BetaResponseItemAgentMessageContentUnion` - 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`. + Encrypted content sent between agents. - - `string` + - `type BetaResponseInputText struct{…}` - - `string` + A text input to the model. - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `type BetaResponseOutputText struct{…}` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + A text output from the model. - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `type BetaResponseItemAgentMessageContentText struct{…}` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + A text content. - - `type BetaToolLocalShell struct{…}` + - `Text string` - A tool that allows the model to execute shell commands in a local environment. + - `Type Text` - - `Type LocalShell` + - `const TextText Text = "text"` - The type of the local shell tool. Always `local_shell`. + - `type BetaResponseItemAgentMessageContentSummaryText struct{…}` - - `const LocalShellLocalShell LocalShell = "local_shell"` + A summary text from the model. - - `type BetaFunctionShellTool struct{…}` + - `Text string` - A tool that allows the model to execute shell commands. + A summary of the reasoning output from the model so far. - - `Type Shell` + - `Type SummaryText` - The type of the shell tool. Always `shell`. + The type of the object. Always `summary_text`. - - `const ShellShell Shell = "shell"` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `AllowedCallers []string` + - `type BetaResponseItemAgentMessageContentReasoningText struct{…}` - The tool invocation context(s). + Reasoning text from the model. - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + - `Text string` - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + The reasoning text from the model. - - `Environment BetaFunctionShellToolEnvironmentUnion` + - `Type ReasoningText` - - `type BetaContainerAuto struct{…}` + The type of the reasoning text. Always `reasoning_text`. - - `Type ContainerAuto` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - Automatically creates a container for this request + - `type BetaResponseOutputRefusal struct{…}` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + A refusal from the model. - - `FileIDs []string` + - `type BetaResponseInputImage struct{…}` - An optional list of uploaded files to make available to your code. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `type BetaResponseItemAgentMessageContentComputerScreenshot struct{…}` - The memory limit for the container. + A screenshot of a computer. - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `Detail string` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailLow BetaResponseItemAgentMessageContentComputerScreenshotDetail = "low"` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseItemAgentMessageContentComputerScreenshotDetail = "high"` - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseItemAgentMessageContentComputerScreenshotDetail = "auto"` - Network access policy for the container. + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseItemAgentMessageContentComputerScreenshotDetail = "original"` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `FileID string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The identifier of an uploaded file that contains the screenshot. - - `Skills []BetaContainerAutoSkillUnion` + - `ImageURL string` - An optional list of skills referenced by id or inline data. + The URL of the screenshot image. - - `type BetaSkillReference struct{…}` + - `Type ComputerScreenshot` - - `SkillID string` + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - The ID of the referenced skill. + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `Type SkillReference` + - `PromptCacheBreakpoint BetaResponseItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - References a skill created with the /v1/skills endpoint. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `Mode Explicit` - - `Version string` + The breakpoint mode. Always `explicit`. - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaInlineSkill struct{…}` + - `type BetaResponseInputFile struct{…}` - - `Description string` + A file input to the model. - The description of the skill. + - `type BetaResponseItemAgentMessageContentEncryptedContent struct{…}` - - `Name string` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - The name of the skill. + - `EncryptedContent string` - - `Source BetaInlineSkillSource` + Opaque encrypted content. - Inline skill payload + - `Type EncryptedContent` - - `Data string` + The type of the input item. Always `encrypted_content`. - Base64-encoded skill zip bundle. + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `MediaType ApplicationZip` + - `Recipient string` - The media type of the inline skill payload. Must be `application/zip`. + The destination agent identity. - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `Type AgentMessage` - - `Type Base64` + The type of the item. Always `agent_message`. - The type of the inline skill source. Must be `base64`. + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `const Base64Base64 Base64 = "base64"` + - `Agent BetaResponseItemAgentMessageAgent` - - `Type Inline` + The agent that produced this item. - Defines an inline skill for this request. + - `AgentName string` - - `const InlineInline Inline = "inline"` + The canonical name of the agent that produced this item. - - `type BetaLocalEnvironment struct{…}` + - `type BetaResponseItemMultiAgentCall struct{…}` - - `Type Local` + - `ID string` - Use a local computer environment. + The unique ID of the multi-agent call item. - - `const LocalLocal Local = "local"` + - `Action string` - - `Skills []BetaLocalSkill` + The multi-agent action to execute. - An optional list of skills. + - `const BetaResponseItemMultiAgentCallActionSpawnAgent BetaResponseItemMultiAgentCallAction = "spawn_agent"` - - `Description string` + - `const BetaResponseItemMultiAgentCallActionInterruptAgent BetaResponseItemMultiAgentCallAction = "interrupt_agent"` - The description of the skill. + - `const BetaResponseItemMultiAgentCallActionListAgents BetaResponseItemMultiAgentCallAction = "list_agents"` - - `Name string` + - `const BetaResponseItemMultiAgentCallActionSendMessage BetaResponseItemMultiAgentCallAction = "send_message"` - The name of the skill. + - `const BetaResponseItemMultiAgentCallActionFollowupTask BetaResponseItemMultiAgentCallAction = "followup_task"` - - `Path string` + - `const BetaResponseItemMultiAgentCallActionWaitAgent BetaResponseItemMultiAgentCallAction = "wait_agent"` - The path to the directory containing the skill. + - `Arguments string` - - `type BetaContainerReference struct{…}` + The JSON string of arguments generated for the action. - - `ContainerID string` + - `CallID string` - The ID of the referenced container. + The unique ID linking this call to its output. - - `Type ContainerReference` + - `Type MultiAgentCall` - References a container created with the /v1/containers endpoint + The type of the multi-agent call. Always `multi_agent_call`. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `type BetaCustomTool struct{…}` + - `Agent BetaResponseItemMultiAgentCallAgent` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the custom tool, used to identify it in tool calls. + The canonical name of the agent that produced this item. - - `Type Custom` + - `type BetaResponseItemMultiAgentCallOutput struct{…}` - The type of the custom tool. Always `custom`. + - `ID string` - - `const CustomCustom Custom = "custom"` + The unique ID of the multi-agent call output item. - - `AllowedCallers []string` + - `Action string` - The tool invocation context(s). + The multi-agent action that produced this result. - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `const BetaResponseItemMultiAgentCallOutputActionSpawnAgent BetaResponseItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + - `const BetaResponseItemMultiAgentCallOutputActionInterruptAgent BetaResponseItemMultiAgentCallOutputAction = "interrupt_agent"` - - `DeferLoading bool` + - `const BetaResponseItemMultiAgentCallOutputActionListAgents BetaResponseItemMultiAgentCallOutputAction = "list_agents"` - Whether this tool should be deferred and discovered via tool search. + - `const BetaResponseItemMultiAgentCallOutputActionSendMessage BetaResponseItemMultiAgentCallOutputAction = "send_message"` - - `Description string` + - `const BetaResponseItemMultiAgentCallOutputActionFollowupTask BetaResponseItemMultiAgentCallOutputAction = "followup_task"` - Optional description of the custom tool, used to provide more context. + - `const BetaResponseItemMultiAgentCallOutputActionWaitAgent BetaResponseItemMultiAgentCallOutputAction = "wait_agent"` - - `Format BetaCustomToolFormatUnion` + - `CallID string` - The input format for the custom tool. Default is unconstrained text. + The unique ID of the multi-agent call. - - `type BetaCustomToolFormatText struct{…}` + - `Output []BetaResponseOutputText` - Unconstrained free-form text. + Text output returned by the multi-agent action. - - `Type Text` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - Unconstrained text format. Always `text`. + The annotations of the text output. - - `const TextText Text = "text"` + - `Text string` - - `type BetaCustomToolFormatGrammar struct{…}` + The text output from the model. - A grammar defined by the user. + - `Type OutputText` - - `Definition string` + The type of the output text. Always `output_text`. - The grammar definition. + - `Logprobs []BetaResponseOutputTextLogprob` - - `Syntax string` + - `Type MultiAgentCallOutput` - The syntax of the grammar definition. One of `lark` or `regex`. + The type of the multi-agent result. Always `multi_agent_call_output`. - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `Agent BetaResponseItemMultiAgentCallOutputAgent` - - `Type Grammar` + The agent that produced this item. - Grammar format. Always `grammar`. + - `AgentName string` - - `const GrammarGrammar Grammar = "grammar"` + The canonical name of the agent that produced this item. - - `type BetaNamespaceTool struct{…}` + - `type BetaResponseToolSearchCall struct{…}` - Groups function/custom tools under a shared namespace. + - `ID string` - - `Description string` + The unique ID of the tool search call item. - A description of the namespace shown to the model. + - `Arguments any` - - `Name string` + Arguments used for the tool search call. - The namespace name used in tool calls (for example, `crm`). + - `CallID string` - - `Tools []BetaNamespaceToolToolUnion` + The unique ID of the tool search call generated by the model. - The function/custom tools available inside this namespace. + - `Execution BetaResponseToolSearchCallExecution` - - `type BetaNamespaceToolToolFunction struct{…}` + Whether tool search was executed by the server or by the client. - - `Name string` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - `Type Function` + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `const FunctionFunction Function = "function"` + - `Status BetaResponseToolSearchCallStatus` - - `AllowedCallers []string` + The status of the tool search call item that was recorded. - The tool invocation context(s). + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - - `DeferLoading bool` + - `Type ToolSearchCall` - Whether this function should be deferred and discovered via tool search. + The type of the item. Always `tool_search_call`. - - `Description string` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `OutputSchema map[string, any]` + - `Agent BetaResponseToolSearchCallAgent` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + The agent that produced this item. - - `Parameters any` + - `AgentName string` - - `Strict bool` + The canonical name of the agent that produced this item. - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + - `CreatedBy string` - - `type BetaCustomTool struct{…}` + The identifier of the actor that created the item. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `type BetaResponseToolSearchOutputItem struct{…}` - - `Type Namespace` + - `ID string` - The type of the tool. Always `namespace`. + The unique ID of the tool search output item. - - `const NamespaceNamespace Namespace = "namespace"` + - `CallID string` - - `type BetaToolSearchTool struct{…}` + The unique ID of the tool search call generated by the model. - Hosted or BYOT tool search configuration for deferred tools. + - `Execution BetaResponseToolSearchOutputItemExecution` - - `Type ToolSearch` + Whether tool search was executed by the server or by the client. - The type of the tool. Always `tool_search`. + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - - `Description string` + - `Status BetaResponseToolSearchOutputItemStatus` - Description shown to the model for a client-executed tool search tool. + The status of the tool search output item that was recorded. - - `Execution BetaToolSearchToolExecution` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - Whether tool search is executed by the server or by the client. + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `Tools []BetaToolUnion` - - `Parameters any` + The loaded tool definitions returned by tool search. - Parameter schema for a client-executed tool search tool. + - `type BetaFunctionTool struct{…}` - - `type BetaWebSearchPreviewTool struct{…}` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Name string` - - `Type BetaWebSearchPreviewToolType` + The name of the function to call. - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `Parameters map[string, any]` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + A JSON schema object describing the parameters of the function. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + - `Strict bool` - - `SearchContentTypes []string` + Whether strict parameter validation is enforced for this function tool. - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `Type Function` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + The type of the function tool. Always `function`. - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `const FunctionFunction Function = "function"` - 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. + - `AllowedCallers []string` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + The tool invocation context(s). - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `DeferLoading bool` - The user's location. + Whether this function is deferred and loaded via tool search. - - `Type Approximate` + - `Description string` - The type of location approximation. Always `approximate`. + A description of the function. Used by the model to determine whether or not to call the function. - - `const ApproximateApproximate Approximate = "approximate"` + - `OutputSchema map[string, any]` - - `City string` + A JSON schema object describing the JSON value encoded in string outputs for this function. - Free text input for the city of the user, e.g. `San Francisco`. + - `type BetaFileSearchTool struct{…}` - - `Country string` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `Type FileSearch` - - `Region string` + The type of the file search tool. Always `file_search`. - Free text input for the region of the user, e.g. `California`. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Timezone string` + - `VectorStoreIDs []string` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + The IDs of the vector stores to search. - - `type BetaApplyPatchTool struct{…}` + - `Filters BetaFileSearchToolFiltersUnion` - Allows the assistant to create, delete, or update files using unified diffs. + A filter to apply. - - `Type ApplyPatch` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - The type of the tool. Always `apply_patch`. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `Key string` - - `AllowedCallers []string` + The key to compare against the value. - The tool invocation context(s). + - `Type string` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `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 - - `Type ToolSearchOutput` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - The item type. Always `tool_search_output`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `ID string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - The unique ID of this tool search output. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The agent that produced this item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `AgentName string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - The canonical name of the agent that produced this item. + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - `CallID string` + The value to compare against the attribute key; supports string, number, or boolean types. - The unique ID of the tool search call generated by the model. + - `string` - - `Execution BetaResponseToolSearchOutputItemParamExecution` + - `float64` - Whether tool search was executed by the server or by the client. + - `bool` - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + - `string` - - `Status BetaResponseToolSearchOutputItemParamStatus` + - `float64` - The status of the tool search output. + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + Combine multiple filters using `and` or `or`. - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `Role Developer` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - The role that provided the additional tools. Only `developer` is supported. + - `Key string` - - `const DeveloperDeveloper Developer = "developer"` + The key to compare against the value. - - `Tools []BetaToolUnion` + - `Type string` - A list of additional tools made available at this item. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `type BetaFunctionTool struct{…}` + - `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 - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `type BetaFileSearchTool struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `type BetaComputerTool struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - `type BetaWebSearchTool struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - `type BetaToolMcp struct{…}` + The value to compare against the attribute key; supports string, number, or boolean types. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `string` - - `type BetaToolCodeInterpreter struct{…}` + - `float64` - A tool that runs Python code to help generate a response to a prompt. + - `bool` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `type BetaToolImageGeneration struct{…}` + - `string` - A tool that generates images using the GPT image models. + - `float64` - - `type BetaToolLocalShell struct{…}` + - `Type string` - A tool that allows the model to execute shell commands in a local environment. + Type of operation: `and` or `or`. - - `type BetaFunctionShellTool struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - A tool that allows the model to execute shell commands. + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - `type BetaCustomTool struct{…}` + - `MaxNumResults int64` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `type BetaNamespaceTool struct{…}` + - `RankingOptions BetaFileSearchToolRankingOptions` - Groups function/custom tools under a shared namespace. + Ranking options for search. - - `type BetaToolSearchTool struct{…}` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - Hosted or BYOT tool search configuration for deferred tools. + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `type BetaWebSearchPreviewTool struct{…}` + - `EmbeddingWeight float64` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The weight of the embedding in the reciprocal ranking fusion. - - `type BetaApplyPatchTool struct{…}` + - `TextWeight float64` - Allows the assistant to create, delete, or update files using unified diffs. + The weight of the text in the reciprocal ranking fusion. - - `Type AdditionalTools` + - `Ranker string` - The item type. Always `additional_tools`. + The ranker to use for the file search. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `ID string` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - The unique ID of this additional tools item. + - `ScoreThreshold float64` - - `Agent BetaResponseInputItemAdditionalToolsAgent` + 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. - The agent that produced this item. + - `type BetaComputerTool struct{…}` - - `AgentName string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The canonical name of the agent that produced this item. + - `Type Computer` - - `type BetaResponseReasoningItem struct{…}` + The type of the computer tool. Always `computer`. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `const ComputerComputer Computer = "computer"` - - `ID string` + - `type BetaComputerUsePreviewTool struct{…}` - The unique identifier of the reasoning content. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Summary []BetaResponseReasoningItemSummary` + - `DisplayHeight int64` - Reasoning summary content. + The height of the computer display. - - `Text string` + - `DisplayWidth int64` - A summary of the reasoning output from the model so far. + The width of the computer display. - - `Type SummaryText` + - `Environment BetaComputerUsePreviewToolEnvironment` - The type of the object. Always `summary_text`. + The type of computer environment to control. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - - `Type Reasoning` + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - The type of the object. Always `reasoning`. + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `const ReasoningReasoning Reasoning = "reasoning"` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `Agent BetaResponseReasoningItemAgent` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - The agent that produced this item. + - `Type ComputerUsePreview` - - `AgentName string` + The type of the computer use tool. Always `computer_use_preview`. - The canonical name of the agent that produced this item. + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - - `Content []BetaResponseReasoningItemContent` + - `type BetaWebSearchTool struct{…}` - Reasoning text content. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Text string` + - `Type BetaWebSearchToolType` - The reasoning text from the model. + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `Type ReasoningText` + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - The type of the reasoning text. Always `reasoning_text`. + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Filters BetaWebSearchToolFilters` - - `EncryptedContent string` + Filters for the search. - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `AllowedDomains []string` - - `Status BetaResponseReasoningItemStatus` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + 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 BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - - `type BetaResponseCompactionItemParamResp struct{…}` + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - - `EncryptedContent string` + - `UserLocation BetaWebSearchToolUserLocation` - The encrypted content of the compaction summary. + The approximate location of the user. - - `Type Compaction` + - `City string` - The type of the item. Always `compaction`. + Free text input for the city of the user, e.g. `San Francisco`. - - `const CompactionCompaction Compaction = "compaction"` + - `Country string` - - `ID string` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The ID of the compaction item. + - `Region string` - - `Agent BetaResponseCompactionItemParamAgentResp` + Free text input for the region of the user, e.g. `California`. - The agent that produced this item. + - `Timezone string` - - `AgentName string` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The canonical name of the agent that produced this item. + - `Type string` - - `type BetaResponseInputItemImageGenerationCall struct{…}` + The type of location approximation. Always `approximate`. - An image generation request made by the model. + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `ID string` + - `type BetaToolMcp struct{…}` - The unique ID of the image generation call. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Result string` + - `ServerLabel string` - The generated image encoded in base64. + A label for this MCP server, used to identify it in tool calls. - - `Status string` + - `Type Mcp` - The status of the image generation call. + The type of the MCP tool. Always `mcp`. - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `const McpMcp Mcp = "mcp"` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + - `AllowedCallers []string` - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + The tool invocation context(s). - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - - `Type ImageGenerationCall` + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - The type of the image generation call. Always `image_generation_call`. + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + List of allowed tool names or a filter object. - - `Agent BetaResponseInputItemImageGenerationCallAgent` + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - The agent that produced this item. + A string array of allowed tool names - - `AgentName string` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - The canonical name of the agent that produced this item. + A filter object to specify which tools are allowed. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `ReadOnly bool` - A tool call to run code. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `ID string` + - `ToolNames []string` - The unique ID of the code interpreter tool call. + List of allowed tool names. - - `Code string` + - `Authorization string` - The code to run, or null if not available. + 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. - - `ContainerID string` + - `ConnectorID string` - The ID of the container used to run the code. + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + Currently supported `connector_id` values are: - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - 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` - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - The logs output from the code interpreter. + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `Logs string` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - The logs output from the code interpreter. + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - - `Type Logs` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - The type of the output. Always `logs`. + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `const LogsLogs Logs = "logs"` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - The image output from the code interpreter. + - `DeferLoading bool` - - `Type Image` + Whether this MCP tool is deferred and discovered via tool search. - The type of the output. Always `image`. + - `Headers map[string, string]` - - `const ImageImage Image = "image"` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `URL string` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - The URL of the image output from the code interpreter. + Specify which of the MCP server's tools require approval. - - `Status BetaResponseCodeInterpreterToolCallStatus` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + A filter object to specify which tools are allowed. - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `ReadOnly bool` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + - `ToolNames []string` - - `Type CodeInterpreterCall` + List of allowed tool names. - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + A filter object to specify which tools are allowed. - - `Agent BetaResponseCodeInterpreterToolCallAgent` + - `ReadOnly bool` - The agent that produced this item. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `AgentName string` + - `ToolNames []string` - The canonical name of the agent that produced this item. + List of allowed tool names. - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - A tool call to run a command on the local shell. + 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. - - `ID string` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - The unique ID of the local shell call. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - - `Action BetaResponseInputItemLocalShellCallAction` + - `ServerDescription string` - Execute a shell command on the server. + Optional description of the MCP server, used to provide more context. - - `Command []string` + - `ServerURL string` - The command to run. + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `Env map[string, string]` + - `TunnelID string` - Environment variables to set for the command. + 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 Exec` + - `type BetaToolCodeInterpreter struct{…}` - The type of the local shell action. Always `exec`. + A tool that runs Python code to help generate a response to a prompt. - - `const ExecExec Exec = "exec"` + - `Container BetaToolCodeInterpreterContainerUnion` - - `TimeoutMs int64` + 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. - Optional timeout in milliseconds for the command. + - `string` - - `User string` + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - Optional user to run the command as. + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `WorkingDirectory string` + - `Type Auto` - Optional working directory to run the command in. + Always `auto`. - - `CallID string` + - `const AutoAuto Auto = "auto"` - The unique ID of the local shell tool call generated by the model. + - `FileIDs []string` - - `Status string` + An optional list of uploaded files to make available to your code. - The status of the local shell call. + - `MemoryLimit string` - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + The memory limit for the code interpreter container. - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `Type LocalShellCall` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - The type of the local shell call. Always `local_shell_call`. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - - `Agent BetaResponseInputItemLocalShellCallAgent` + Network access policy for the container. - The agent that produced this item. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `AgentName string` + - `Type Disabled` - The canonical name of the agent that produced this item. + Disable outbound network access. Always `disabled`. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `const DisabledDisabled Disabled = "disabled"` - The output of a local shell tool call. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `ID string` + - `AllowedDomains []string` - The unique ID of the local shell tool call generated by the model. + A list of allowed domains when type is `allowlist`. - - `Output string` + - `Type Allowlist` - A JSON string of the output of the local shell tool call. + Allow outbound network access only to specified domains. Always `allowlist`. - - `Type LocalShellCallOutput` + - `const AllowlistAllowlist Allowlist = "allowlist"` - The type of the local shell tool call output. Always `local_shell_call_output`. + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + Optional domain-scoped secrets for allowlisted domains. - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + - `Domain string` - The agent that produced this item. + The domain associated with the secret. - - `AgentName string` + - `Name string` - The canonical name of the agent that produced this item. + The name of the secret to inject for the domain. - - `Status string` + - `Value string` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + The secret value to inject for the domain. - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + - `Type CodeInterpreter` - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + The type of the code interpreter tool. Always `code_interpreter`. - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `type BetaResponseInputItemShellCall struct{…}` + - `AllowedCallers []string` - A tool representing a request to execute one or more shell commands. + The tool invocation context(s). - - `Action BetaResponseInputItemShellCallAction` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - The shell commands and limits that describe how to run the tool call. + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `Commands []string` + - `type BetaToolProgrammaticToolCalling struct{…}` - Ordered shell commands for the execution environment to run. + - `Type ProgrammaticToolCalling` - - `MaxOutputLength int64` + The type of the tool. Always `programmatic_tool_calling`. - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `TimeoutMs int64` + - `type BetaToolImageGeneration struct{…}` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + A tool that generates images using the GPT image models. - - `CallID string` + - `Type ImageGeneration` - The unique ID of the shell tool call generated by the model. + The type of the image generation tool. Always `image_generation`. - - `Type ShellCall` + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - The type of the item. Always `shell_call`. + - `Action string` - - `const ShellCallShellCall ShellCall = "shell_call"` + Whether to generate a new image or edit an existing image. Default: `auto`. - - `ID string` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - The unique ID of the shell tool call. Populated when this item is returned via API. + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `Agent BetaResponseInputItemShellCallAgent` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - The agent that produced this item. + - `Background string` - - `AgentName 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. - The canonical name of the agent that produced this item. + `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. - - `Caller BetaResponseInputItemShellCallCallerUnion` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - The execution context that produced this tool call. + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - - `Type Direct` + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - The caller type. Always `direct`. + - `InputFidelity string` - - `const DirectDirect Direct = "direct"` + 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`. - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - - `CallerID string` + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - The call ID of the program item that produced this tool call. + - `InputImageMask BetaToolImageGenerationInputImageMask` - - `Type Program` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - The caller type. Always `program`. + - `FileID string` - - `const ProgramProgram Program = "program"` + File ID for the mask image. - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + - `ImageURL string` - The environment to execute the shell commands in. + Base64-encoded mask image. - - `type BetaLocalEnvironment struct{…}` + - `Model string` - - `type BetaContainerReference struct{…}` + The image generation model to use. Default: `gpt-image-1`. - - `Status string` + - `string` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `string` - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - The streamed output items emitted by a shell tool call. + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - - `CallID string` + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - The unique ID of the shell tool call generated by the model. + - `Moderation string` - - `Output []BetaResponseFunctionShellCallOutputContent` + Moderation level for the generated image. Default: `auto`. - Captured chunks of stdout and stderr output, along with their associated outcomes. + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - The exit or timeout outcome associated with this shell call. + - `OutputCompression int64` - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + Compression level for the output image. Default: 100. - Indicates that the shell call exceeded its configured time limit. + - `OutputFormat string` - - `Type Timeout` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - The outcome type. Always `timeout`. + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `const TimeoutTimeout Timeout = "timeout"` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - Indicates that the shell commands finished and returned an exit code. + - `PartialImages int64` - - `ExitCode int64` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The exit code returned by the shell process. + - `Quality string` - - `Type Exit` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - The outcome type. Always `exit`. + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `const ExitExit Exit = "exit"` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - - `Stderr string` + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - Captured stderr output for the shell call. + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - - `Stdout string` + - `Size string` - Captured stdout output for the shell call. + 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`. - - `Type ShellCallOutput` + - `string` - The type of the item. Always `shell_call_output`. + - `string` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - - `ID string` + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - The agent that produced this item. + - `type BetaToolLocalShell struct{…}` - - `AgentName string` + A tool that allows the model to execute shell commands in a local environment. - The canonical name of the agent that produced this item. + - `Type LocalShell` - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + The type of the local shell tool. Always `local_shell`. - The execution context that produced this tool call. + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + - `type BetaFunctionShellTool struct{…}` - - `Type Direct` + A tool that allows the model to execute shell commands. - The caller type. Always `direct`. + - `Type Shell` - - `const DirectDirect Direct = "direct"` + The type of the shell tool. Always `shell`. - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + - `const ShellShell Shell = "shell"` - - `CallerID string` + - `AllowedCallers []string` - The call ID of the program item that produced this tool call. + The tool invocation context(s). - - `Type Program` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - The caller type. Always `program`. + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - `const ProgramProgram Program = "program"` + - `Environment BetaFunctionShellToolEnvironmentUnion` - - `MaxOutputLength int64` + - `type BetaContainerAuto struct{…}` - The maximum number of UTF-8 characters captured for this shell call's combined output. + - `Type ContainerAuto` - - `Status string` + Automatically creates a container for this request - The status of the shell call output. + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + - `FileIDs []string` - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + An optional list of uploaded files to make available to your code. - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `type BetaResponseInputItemApplyPatchCall struct{…}` + The memory limit for the container. - A tool call representing a request to create, delete, or update files using diff patches. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `CallID string` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - The unique ID of the apply patch tool call generated by the model. + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - The specific create, delete, or update instruction for the apply_patch tool call. + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + Network access policy for the container. - Instruction for creating a new file via the apply_patch tool. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `Diff string` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - Unified diff content to apply when creating the file. + - `Skills []BetaContainerAutoSkillUnion` - - `Path string` + An optional list of skills referenced by id or inline data. - Path of the file to create relative to the workspace root. + - `type BetaSkillReference struct{…}` - - `Type CreateFile` + - `SkillID string` - The operation type. Always `create_file`. + The ID of the referenced skill. - - `const CreateFileCreateFile CreateFile = "create_file"` + - `Type SkillReference` - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + References a skill created with the /v1/skills endpoint. - Instruction for deleting an existing file via the apply_patch tool. + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `Path string` + - `Version string` - Path of the file to delete relative to the workspace root. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `Type DeleteFile` + - `type BetaInlineSkill struct{…}` - The operation type. Always `delete_file`. + - `Description string` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + The description of the skill. - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + - `Name string` - Instruction for updating an existing file via the apply_patch tool. + The name of the skill. - - `Diff string` + - `Source BetaInlineSkillSource` - Unified diff content to apply to the existing file. + Inline skill payload - - `Path string` + - `Data string` - Path of the file to update relative to the workspace root. + Base64-encoded skill zip bundle. - - `Type UpdateFile` + - `MediaType ApplicationZip` - The operation type. Always `update_file`. + The media type of the inline skill payload. Must be `application/zip`. - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `Status string` + - `Type Base64` - The status of the apply patch tool call. One of `in_progress` or `completed`. + The type of the inline skill source. Must be `base64`. - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + - `const Base64Base64 Base64 = "base64"` - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + - `Type Inline` - - `Type ApplyPatchCall` + Defines an inline skill for this request. - The type of the item. Always `apply_patch_call`. + - `const InlineInline Inline = "inline"` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `type BetaLocalEnvironment struct{…}` - - `ID string` + - `Type Local` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + Use a local computer environment. - - `Agent BetaResponseInputItemApplyPatchCallAgent` + - `const LocalLocal Local = "local"` - The agent that produced this item. + - `Skills []BetaLocalSkill` - - `AgentName string` + An optional list of skills. - The canonical name of the agent that produced this item. + - `Description string` - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + The description of the skill. - The execution context that produced this tool call. + - `Name string` - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + The name of the skill. - - `Type Direct` + - `Path string` - The caller type. Always `direct`. + The path to the directory containing the skill. - - `const DirectDirect Direct = "direct"` + - `type BetaContainerReference struct{…}` - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `ContainerID string` - - `CallerID string` + The ID of the referenced container. - The call ID of the program item that produced this tool call. + - `Type ContainerReference` - - `Type Program` + References a container created with the /v1/containers endpoint - The caller type. Always `program`. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `const ProgramProgram Program = "program"` + - `type BetaCustomTool struct{…}` - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The streamed output emitted by an apply patch tool call. + - `Name string` - - `CallID string` + The name of the custom tool, used to identify it in tool calls. - The unique ID of the apply patch tool call generated by the model. + - `Type Custom` - - `Status string` + The type of the custom tool. Always `custom`. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const CustomCustom Custom = "custom"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `AllowedCallers []string` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + The tool invocation context(s). - - `Type ApplyPatchCallOutput` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - The type of the item. Always `apply_patch_call_output`. + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `DeferLoading bool` - - `ID string` + Whether this tool should be deferred and discovered via tool search. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `Description string` - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + Optional description of the custom tool, used to provide more context. - The agent that produced this item. + - `Format BetaCustomToolFormatUnion` - - `AgentName string` + The input format for the custom tool. Default is unconstrained text. - The canonical name of the agent that produced this item. + - `type BetaCustomToolFormatText struct{…}` - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + Unconstrained free-form text. - The execution context that produced this tool call. + - `Type Text` - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + Unconstrained text format. Always `text`. - - `Type Direct` + - `const TextText Text = "text"` - The caller type. Always `direct`. + - `type BetaCustomToolFormatGrammar struct{…}` - - `const DirectDirect Direct = "direct"` + A grammar defined by the user. - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + - `Definition string` - - `CallerID string` + The grammar definition. - The call ID of the program item that produced this tool call. + - `Syntax string` - - `Type Program` + The syntax of the grammar definition. One of `lark` or `regex`. - The caller type. Always `program`. + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `const ProgramProgram Program = "program"` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `Output string` + - `Type Grammar` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + Grammar format. Always `grammar`. - - `type BetaResponseInputItemMcpListTools struct{…}` + - `const GrammarGrammar Grammar = "grammar"` - A list of tools available on an MCP server. + - `type BetaNamespaceTool struct{…}` - - `ID string` + Groups function/custom tools under a shared namespace. - The unique ID of the list. + - `Description string` - - `ServerLabel string` + A description of the namespace shown to the model. - The label of the MCP server. + - `Name string` - - `Tools []BetaResponseInputItemMcpListToolsTool` + The namespace name used in tool calls (for example, `crm`). - The tools available on the server. + - `Tools []BetaNamespaceToolToolUnion` - - `InputSchema any` + The function/custom tools available inside this namespace. - The JSON schema describing the tool's input. + - `type BetaNamespaceToolToolFunction struct{…}` - `Name string` - The name of the tool. - - - `Annotations any` + - `Type Function` - Additional annotations about the tool. + - `const FunctionFunction Function = "function"` - - `Description string` + - `AllowedCallers []string` - The description of the tool. + The tool invocation context(s). - - `Type McpListTools` + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - The type of the item. Always `mcp_list_tools`. + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `DeferLoading bool` - - `Agent BetaResponseInputItemMcpListToolsAgent` + Whether this function should be deferred and discovered via tool search. - The agent that produced this item. + - `Description string` - - `AgentName string` + - `OutputSchema map[string, any]` - The canonical name of the agent that produced this item. + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `Error string` + - `Parameters any` - Error message if the server could not list tools. + - `Strict bool` - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - A request for human approval of a tool invocation. + - `type BetaCustomTool struct{…}` - - `ID string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The unique ID of the approval request. + - `Type Namespace` - - `Arguments string` + The type of the tool. Always `namespace`. - A JSON string of arguments for the tool. + - `const NamespaceNamespace Namespace = "namespace"` - - `Name string` + - `type BetaToolSearchTool struct{…}` - The name of the tool to run. + Hosted or BYOT tool search configuration for deferred tools. - - `ServerLabel string` + - `Type ToolSearch` - The label of the MCP server making the request. + The type of the tool. Always `tool_search`. - - `Type McpApprovalRequest` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - The type of the item. Always `mcp_approval_request`. + - `Description string` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + Description shown to the model for a client-executed tool search tool. - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `Execution BetaToolSearchToolExecution` - The agent that produced this item. + Whether tool search is executed by the server or by the client. - - `AgentName string` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - The canonical name of the agent that produced this item. + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - `Parameters any` - A response to an MCP approval request. + Parameter schema for a client-executed tool search tool. - - `ApprovalRequestID string` + - `type BetaWebSearchPreviewTool struct{…}` - The ID of the approval request being answered. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Approve bool` + - `Type BetaWebSearchPreviewToolType` - Whether the request was approved. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `Type McpApprovalResponse` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - The type of the item. Always `mcp_approval_response`. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `SearchContentTypes []string` - - `ID string` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - The unique ID of the approval response + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - The agent that produced this item. + 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. - - `AgentName string` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - The canonical name of the agent that produced this item. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `Reason string` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - Optional reason for the decision. + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `type BetaResponseInputItemMcpCall struct{…}` + The user's location. - An invocation of a tool on an MCP server. + - `Type Approximate` - - `ID string` + The type of location approximation. Always `approximate`. - The unique ID of the tool call. + - `const ApproximateApproximate Approximate = "approximate"` - - `Arguments string` + - `City string` - A JSON string of the arguments passed to the tool. + Free text input for the city of the user, e.g. `San Francisco`. - - `Name string` + - `Country string` - The name of the tool that was run. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `ServerLabel string` + - `Region string` - The label of the MCP server running the tool. + Free text input for the region of the user, e.g. `California`. - - `Type McpCall` + - `Timezone string` - The type of the item. Always `mcp_call`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `type BetaApplyPatchTool struct{…}` - - `Agent BetaResponseInputItemMcpCallAgent` + Allows the assistant to create, delete, or update files using unified diffs. - The agent that produced this item. + - `Type ApplyPatch` - - `AgentName string` + The type of the tool. Always `apply_patch`. - The canonical name of the agent that produced this item. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `ApprovalRequestID string` + - `AllowedCallers []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. + The tool invocation context(s). - - `Error string` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - The error from the tool call, if any. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `Output string` + - `Type ToolSearchOutput` - The output from the tool call. + The type of the item. Always `tool_search_output`. - - `Status string` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `Agent BetaResponseToolSearchOutputItemAgent` - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + The agent that produced this item. - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + - `AgentName string` - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + The canonical name of the agent that produced this item. - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + - `CreatedBy string` - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + The identifier of the actor that created the item. - - `type BetaResponseCustomToolCallOutput struct{…}` + - `type BetaResponseItemAdditionalTools struct{…}` - The output of a custom tool call from your code, being sent back to the model. + - `ID string` - - `CallID string` + The unique ID of the additional tools item. - The call ID, used to map this custom tool call output to a custom tool call. + - `Role string` - - `Output BetaResponseCustomToolCallOutputOutputUnion` + The role that provided the additional tools. - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + - `const BetaResponseItemAdditionalToolsRoleUnknown BetaResponseItemAdditionalToolsRole = "unknown"` - - `string` + - `const BetaResponseItemAdditionalToolsRoleUser BetaResponseItemAdditionalToolsRole = "user"` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + - `const BetaResponseItemAdditionalToolsRoleAssistant BetaResponseItemAdditionalToolsRole = "assistant"` - Text, image, or file output of the custom tool call. + - `const BetaResponseItemAdditionalToolsRoleSystem BetaResponseItemAdditionalToolsRole = "system"` - - `type BetaResponseInputText struct{…}` + - `const BetaResponseItemAdditionalToolsRoleCritic BetaResponseItemAdditionalToolsRole = "critic"` - A text input to the model. + - `const BetaResponseItemAdditionalToolsRoleDiscriminator BetaResponseItemAdditionalToolsRole = "discriminator"` - - `type BetaResponseInputImage struct{…}` + - `const BetaResponseItemAdditionalToolsRoleDeveloper BetaResponseItemAdditionalToolsRole = "developer"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const BetaResponseItemAdditionalToolsRoleTool BetaResponseItemAdditionalToolsRole = "tool"` - - `type BetaResponseInputFile struct{…}` + - `Tools []BetaToolUnion` - A file input to the model. + The additional tool definitions made available at this item. - - `Type CustomToolCallOutput` + - `type BetaFunctionTool struct{…}` - The type of the custom tool call output. Always `custom_tool_call_output`. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `type BetaFileSearchTool struct{…}` - - `ID string` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The unique ID of the custom tool call output in the OpenAI platform. + - `type BetaComputerTool struct{…}` - - `Agent BetaResponseCustomToolCallOutputAgent` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The agent that produced this item. + - `type BetaComputerUsePreviewTool struct{…}` - - `AgentName string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The canonical name of the agent that produced this item. + - `type BetaWebSearchTool struct{…}` - - `Caller BetaResponseCustomToolCallOutputCallerUnion` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The execution context that produced this tool call. + - `type BetaToolMcp struct{…}` - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Type Direct` + - `type BetaToolCodeInterpreter struct{…}` - The caller type. Always `direct`. + A tool that runs Python code to help generate a response to a prompt. - - `const DirectDirect Direct = "direct"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `type BetaToolImageGeneration struct{…}` - - `CallerID string` + A tool that generates images using the GPT image models. - The call ID of the program item that produced this tool call. + - `type BetaToolLocalShell struct{…}` - - `Type Program` + A tool that allows the model to execute shell commands in a local environment. - The caller type. Always `program`. + - `type BetaFunctionShellTool struct{…}` - - `const ProgramProgram Program = "program"` + A tool that allows the model to execute shell commands. - - `type BetaResponseCustomToolCall struct{…}` + - `type BetaCustomTool struct{…}` - A call to a custom tool created by the model. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `CallID string` + - `type BetaNamespaceTool struct{…}` - An identifier used to map this custom tool call to a tool call output. + Groups function/custom tools under a shared namespace. - - `Input string` + - `type BetaToolSearchTool struct{…}` - The input for the custom tool call generated by the model. + Hosted or BYOT tool search configuration for deferred tools. - - `Name string` + - `type BetaWebSearchPreviewTool struct{…}` - The name of the custom tool being called. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type CustomToolCall` + - `type BetaApplyPatchTool struct{…}` - The type of the custom tool call. Always `custom_tool_call`. + Allows the assistant to create, delete, or update files using unified diffs. - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `Type AdditionalTools` - - `ID string` + The type of the item. Always `additional_tools`. - The unique ID of the custom tool call in the OpenAI platform. + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `Agent BetaResponseCustomToolCallAgent` + - `Agent BetaResponseItemAdditionalToolsAgent` The agent that produced this item. @@ -84401,41 +98146,38 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - - `Type Direct` + - `type BetaResponseReasoningItem struct{…}` - - `const DirectDirect Direct = "direct"` + 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](https://platform.openai.com/docs/guides/conversation-state). - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `ID string` - - `CallerID string` + The unique identifier of the reasoning content. - The call ID of the program item that produced this tool call. + - `Summary []BetaResponseReasoningItemSummary` - - `Type Program` + Reasoning summary content. - - `const ProgramProgram Program = "program"` + - `Text string` - - `Namespace string` + A summary of the reasoning output from the model so far. - The namespace of the custom tool being called. + - `Type SummaryText` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + The type of the object. Always `summary_text`. - Compacts the current context. Must be the final input item. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `Type CompactionTrigger` + - `Type Reasoning` - The type of the item. Always `compaction_trigger`. + The type of the object. Always `reasoning`. - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `const ReasoningReasoning Reasoning = "reasoning"` - - `Agent BetaResponseInputItemCompactionTriggerAgent` + - `Agent BetaResponseReasoningItemAgent` The agent that produced this item. @@ -84443,33 +98185,41 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemItemReference struct{…}` + - `Content []BetaResponseReasoningItemContent` - An internal identifier for an item to reference. + Reasoning text content. - - `ID string` + - `Text string` - The ID of the item to reference. + The reasoning text from the model. - - `Agent BetaResponseInputItemItemReferenceAgent` + - `Type ReasoningText` - The agent that produced this item. + The type of the reasoning text. Always `reasoning_text`. - - `AgentName string` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - The canonical name of the agent that produced this item. + - `EncryptedContent string` - - `Type string` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - The type of item to reference. Always `item_reference`. + - `Status BetaResponseReasoningItemStatus` - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `type BetaResponseInputItemProgram struct{…}` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + + - `type BetaResponseItemProgram struct{…}` - `ID string` - The unique ID of this program item. + The unique ID of the program item. - `CallID string` @@ -84485,11 +98235,11 @@ func main() { - `Type Program` - The item type. Always `program`. + The type of the item. Always `program`. - `const ProgramProgram Program = "program"` - - `Agent BetaResponseInputItemProgramAgent` + - `Agent BetaResponseItemProgramAgent` The agent that produced this item. @@ -84497,11 +98247,11 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemProgramOutput struct{…}` + - `type BetaResponseItemProgramOutput struct{…}` - `ID string` - The unique ID of this program output item. + The unique ID of the program output item. - `CallID string` @@ -84513,19 +98263,19 @@ func main() { - `Status string` - The terminal status of the program output. + The terminal status of the program output item. - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `const BetaResponseItemProgramOutputStatusCompleted BetaResponseItemProgramOutputStatus = "completed"` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + - `const BetaResponseItemProgramOutputStatusIncomplete BetaResponseItemProgramOutputStatus = "incomplete"` - `Type ProgramOutput` - The item type. Always `program_output`. + The type of the item. Always `program_output`. - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `Agent BetaResponseInputItemProgramOutputAgent` + - `Agent BetaResponseItemProgramOutputAgent` The agent that produced this item. @@ -84533,303 +98283,322 @@ func main() { The canonical name of the agent that produced this item. - - `Metadata map[string, string]` + - `type BetaResponseCompactionItem struct{…}` - 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. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `ID string` - - `Model BetaResponseModel` + The unique ID of the compaction item. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `EncryptedContent string` - - `type BetaResponseModel string` + The encrypted content that was produced by compaction. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `Type Compaction` - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + The type of the item. Always `compaction`. - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + - `const CompactionCompaction Compaction = "compaction"` - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + - `Agent BetaResponseCompactionItemAgent` - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + The agent that produced this item. - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + - `AgentName string` - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + - `CreatedBy string` - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + The identifier of the actor that created the item. - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + - `type BetaResponseItemImageGenerationCall struct{…}` - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + An image generation request made by the model. - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + - `ID string` - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + The unique ID of the image generation call. - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + - `Result string` - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + The generated image encoded in base64. - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + - `Status string` - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + The status of the image generation call. - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + - `const BetaResponseItemImageGenerationCallStatusInProgress BetaResponseItemImageGenerationCallStatus = "in_progress"` - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + - `const BetaResponseItemImageGenerationCallStatusCompleted BetaResponseItemImageGenerationCallStatus = "completed"` - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + - `const BetaResponseItemImageGenerationCallStatusGenerating BetaResponseItemImageGenerationCallStatus = "generating"` - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + - `const BetaResponseItemImageGenerationCallStatusFailed BetaResponseItemImageGenerationCallStatus = "failed"` - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + - `Type ImageGenerationCall` - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + The type of the image generation call. Always `image_generation_call`. - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + - `Agent BetaResponseItemImageGenerationCallAgent` - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + The agent that produced this item. - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + - `AgentName string` - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + A tool call to run code. - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + - `ID string` - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + The unique ID of the code interpreter tool call. - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + - `Code string` - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + The code to run, or null if not available. - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + - `ContainerID string` - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + The ID of the container used to run the code. - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `const BetaResponseModelO1 BetaResponseModel = "o1"` + The logs output from the code interpreter. - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + - `Logs string` - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + The logs output from the code interpreter. - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + - `Type Logs` - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + The type of the output. Always `logs`. - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + - `const LogsLogs Logs = "logs"` - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + The image output from the code interpreter. - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + - `Type Image` - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + The type of the output. Always `image`. - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + - `const ImageImage Image = "image"` + + - `URL string` + + The URL of the image output from the code interpreter. + + - `Status BetaResponseCodeInterpreterToolCallStatus` + + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + + - `Type CodeInterpreterCall` + + The type of the code interpreter tool call. Always `code_interpreter_call`. + + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + + - `Agent BetaResponseCodeInterpreterToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + - `type BetaResponseItemLocalShellCall struct{…}` - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + A tool call to run a command on the local shell. - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + - `ID string` - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + The unique ID of the local shell call. - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `Action BetaResponseItemLocalShellCallAction` - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + Execute a shell command on the server. - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + - `Command []string` - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + The command to run. - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `Env map[string, string]` - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + Environment variables to set for the command. - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + - `Type Exec` - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + The type of the local shell action. Always `exec`. - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + - `const ExecExec Exec = "exec"` - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + - `TimeoutMs int64` - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + Optional timeout in milliseconds for the command. - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + - `User string` - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + Optional user to run the command as. - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + - `WorkingDirectory string` - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + Optional working directory to run the command in. - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + - `CallID string` - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + The unique ID of the local shell tool call generated by the model. - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + - `Status string` - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + The status of the local shell call. - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + - `const BetaResponseItemLocalShellCallStatusInProgress BetaResponseItemLocalShellCallStatus = "in_progress"` - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + - `const BetaResponseItemLocalShellCallStatusCompleted BetaResponseItemLocalShellCallStatus = "completed"` - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + - `const BetaResponseItemLocalShellCallStatusIncomplete BetaResponseItemLocalShellCallStatus = "incomplete"` - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + - `Type LocalShellCall` - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + The type of the local shell call. Always `local_shell_call`. - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + - `Agent BetaResponseItemLocalShellCallAgent` - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + The agent that produced this item. - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + - `AgentName string` - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + - `type BetaResponseItemLocalShellCallOutput struct{…}` - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + The output of a local shell tool call. - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + - `ID string` - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + The unique ID of the local shell tool call generated by the model. - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + - `Output string` - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + A JSON string of the output of the local shell tool call. - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + - `Type LocalShellCallOutput` - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + The type of the local shell tool call output. Always `local_shell_call_output`. - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + - `Agent BetaResponseItemLocalShellCallOutputAgent` - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + The agent that produced this item. - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + - `AgentName string` - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + The canonical name of the agent that produced this item. - - `string` + - `Status string` - - `Object Response` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - The object type of this resource - always set to `response`. + - `const BetaResponseItemLocalShellCallOutputStatusInProgress BetaResponseItemLocalShellCallOutputStatus = "in_progress"` - - `const ResponseResponse Response = "response"` + - `const BetaResponseItemLocalShellCallOutputStatusCompleted BetaResponseItemLocalShellCallOutputStatus = "completed"` - - `Output []BetaResponseOutputItemUnion` + - `const BetaResponseItemLocalShellCallOutputStatusIncomplete BetaResponseItemLocalShellCallOutputStatus = "incomplete"` - An array of content items generated by the model. + - `type BetaResponseFunctionShellToolCall struct{…}` - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + A tool call that executes one or more shell commands in a managed environment. - - `type BetaResponseOutputMessage struct{…}` + - `ID string` - An output message from the model. + The unique ID of the shell tool call. Populated when this item is returned via API. - - `type BetaResponseFileSearchToolCall struct{…}` + - `Action BetaResponseFunctionShellToolCallAction` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The shell commands and limits that describe how to run the tool call. - - `type BetaResponseFunctionToolCall struct{…}` + - `Commands []string` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `MaxOutputLength int64` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + Optional maximum number of characters to return from each command. - - `ID string` + - `TimeoutMs int64` - The unique ID of the function call tool output. + Optional timeout in milliseconds for the commands. - `CallID string` - The unique ID of the function tool call generated by the model. + The unique ID of the shell tool call generated by the model. - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - The output from the function call generated by your code. - Can be a string or an list of output content. + Represents the use of a local environment to perform shell actions. - - `string` + - `type BetaResponseLocalEnvironment struct{…}` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + Represents the use of a local environment to perform shell actions. - Text, image, or file output of the function call. + - `Type Local` - - `type BetaResponseInputText struct{…}` + The environment type. Always `local`. - A text input to the model. + - `const LocalLocal Local = "local"` - - `type BetaResponseInputImage struct{…}` + - `type BetaResponseContainerReference struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + Represents a container created with /v1/containers. - - `type BetaResponseInputFile struct{…}` + - `ContainerID string` - A file input to the model. + - `Type ContainerReference` - - `Status BetaResponseFunctionToolCallOutputItemStatus` + The environment type. Always `container_reference`. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + - `Status BetaResponseFunctionShellToolCallStatus` - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - - `Type FunctionCallOutput` + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - The type of the function tool call output. Always `function_call_output`. + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `Type ShellCall` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + The type of the item. Always `shell_call`. + + - `const ShellCallShellCall ShellCall = "shell_call"` + + - `Agent BetaResponseFunctionShellToolCallAgent` The agent that produced this item. @@ -84837,19 +98606,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - `CallerID string` @@ -84857,195 +98624,201 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - `CreatedBy string` - The identifier of the actor that created the item. + The ID of the entity that created this tool call. - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` + + The output of a shell tool call that was emitted. - `ID string` - The unique ID of the agent message. + The unique ID of the shell call output. Populated when this item is returned via API. - - `Author string` + - `CallID string` - The sending agent identity. + The unique ID of the shell tool call generated by the model. - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + - `MaxOutputLength int64` - Encrypted content sent between agents. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `type BetaResponseInputText struct{…}` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - A text input to the model. + An array of shell call output contents - - `type BetaResponseOutputText struct{…}` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - A text output from the model. + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - A text content. + Indicates that the shell call exceeded its configured time limit. - - `Text string` + - `Type Timeout` - - `Type Text` + The outcome type. Always `timeout`. - - `const TextText Text = "text"` + - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - A summary text from the model. + Indicates that the shell commands finished and returned an exit code. - - `Text string` + - `ExitCode int64` - A summary of the reasoning output from the model so far. + Exit code from the shell process. - - `Type SummaryText` + - `Type Exit` - The type of the object. Always `summary_text`. + The outcome type. Always `exit`. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `const ExitExit Exit = "exit"` - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `Stderr string` - Reasoning text from the model. + The standard error output that was captured. - - `Text string` + - `Stdout string` - The reasoning text from the model. + The standard output that was captured. - - `Type ReasoningText` + - `CreatedBy string` - The type of the reasoning text. Always `reasoning_text`. + The identifier of the actor that created the item. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `type BetaResponseOutputRefusal struct{…}` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - A refusal from the model. + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `type BetaResponseInputImage struct{…}` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + - `Type ShellCallOutput` - A screenshot of a computer. + The type of the shell call output. Always `shell_call_output`. - - `Detail string` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + The agent that produced this item. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + - `AgentName string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + The canonical name of the agent that produced this item. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - - `FileID string` + The execution context that produced this tool call. - The identifier of an uploaded file that contains the screenshot. + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `ImageURL string` + - `Type Direct` - The URL of the screenshot image. + - `const DirectDirect Direct = "direct"` - - `Type ComputerScreenshot` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `CallerID string` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + The call ID of the program item that produced this tool call. - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `Type Program` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const ProgramProgram Program = "program"` - - `Mode Explicit` + - `CreatedBy string` - The breakpoint mode. Always `explicit`. + The identifier of the actor that created the item. - - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaResponseApplyPatchToolCall struct{…}` - - `type BetaResponseInputFile struct{…}` + A tool call that applies file diffs by creating, deleting, or updating files. - A file input to the model. + - `ID string` - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `CallID string` - - `EncryptedContent string` + The unique ID of the apply patch tool call generated by the model. - Opaque encrypted content. + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - - `Type EncryptedContent` + One of the create_file, delete_file, or update_file operations applied via apply_patch. - The type of the input item. Always `encrypted_content`. + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + Instruction describing how to create a file via the apply_patch tool. - - `Recipient string` + - `Diff string` - The destination agent identity. + Diff to apply. - - `Type AgentMessage` + - `Path string` - The type of the item. Always `agent_message`. + Path of the file to create. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `Type CreateFile` - - `Agent BetaResponseOutputItemAgentMessageAgent` + Create a new file with the provided diff. - The agent that produced this item. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `AgentName string` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - The canonical name of the agent that produced this item. + Instruction describing how to delete a file via the apply_patch tool. - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + - `Path string` - - `ID string` + Path of the file to delete. - The unique ID of the multi-agent call item. + - `Type DeleteFile` - - `Action string` + Delete the specified file. - The multi-agent action to execute. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + Instruction describing how to update a file via the apply_patch tool. - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + - `Diff string` - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + Diff to apply. - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + - `Path string` - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + Path of the file to update. - - `Arguments string` + - `Type UpdateFile` - The JSON string of arguments generated for the action. + Update an existing file with the provided diff. - - `CallID string` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - The unique ID linking this call to its output. + - `Status BetaResponseApplyPatchToolCallStatus` - - `Type MultiAgentCall` + The status of the apply patch tool call. One of `in_progress` or `completed`. - The type of the multi-agent call. Always `multi_agent_call`. + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + - `Type ApplyPatchCall` + + The type of the item. Always `apply_patch_call`. + + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + + - `Agent BetaResponseApplyPatchToolCallAgent` The agent that produced this item. @@ -85053,57 +98826,57 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - `ID string` + The execution context that produced this tool call. - The unique ID of the multi-agent call output item. + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `Action string` + - `Type Direct` - The multi-agent action that produced this result. + - `const DirectDirect Direct = "direct"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `CallerID string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + The call ID of the program item that produced this tool call. - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `Type Program` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + - `CreatedBy string` - - `CallID string` + The ID of the entity that created this tool call. - The unique ID of the multi-agent call. + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `Output []BetaResponseOutputText` + The output emitted by an apply patch tool call. - Text output returned by the multi-agent action. + - `ID string` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - The annotations of the text output. + - `CallID string` - - `Text string` + The unique ID of the apply patch tool call generated by the model. - The text output from the model. + - `Status BetaResponseApplyPatchToolCallOutputStatus` - - `Type OutputText` + The status of the apply patch tool call output. One of `completed` or `failed`. - The type of the output text. Always `output_text`. + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `Logprobs []BetaResponseOutputTextLogprob` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - - `Type MultiAgentCallOutput` + - `Type ApplyPatchCallOutput` - The type of the multi-agent result. Always `multi_agent_call_output`. + The type of the item. Always `apply_patch_call_output`. - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` The agent that produced this item. @@ -85111,67 +98884,73 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseFunctionWebSearch struct{…}` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + The execution context that produced this tool call. - - `type BetaResponseComputerToolCall struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `Type Direct` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `const DirectDirect Direct = "direct"` - - `ID string` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - The unique ID of the computer call tool output. + - `CallerID string` - - `CallID string` + The call ID of the program item that produced this tool call. - The ID of the computer tool call that produced the output. + - `Type Program` - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `const ProgramProgram Program = "program"` - A computer screenshot image used with the computer use tool. + - `CreatedBy string` - - `Status BetaResponseComputerToolCallOutputItemStatus` + The ID of the entity that created this tool call output. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `Output string` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + Optional textual output returned by the apply patch tool. - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `type BetaResponseItemMcpListTools struct{…}` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + A list of tools available on an MCP server. - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `ID string` - - `Type ComputerCallOutput` + The unique ID of the list. - The type of the computer tool call output. Always `computer_call_output`. + - `ServerLabel string` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + The label of the MCP server. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `Tools []BetaResponseItemMcpListToolsTool` - The safety checks reported by the API that have been acknowledged by the - developer. + The tools available on the server. - - `ID string` + - `InputSchema any` - The ID of the pending safety check. + The JSON schema describing the tool's input. - - `Code string` + - `Name string` - The type of the pending safety check. + The name of the tool. - - `Message string` + - `Annotations any` - Details about the pending safety check. + Additional annotations about the tool. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `Description string` + + The description of the tool. + + - `Type McpListTools` + + The type of the item. Always `mcp_list_tools`. + + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + + - `Agent BetaResponseItemMcpListToolsAgent` The agent that produced this item. @@ -85179,42 +98958,37 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` - - The identifier of the actor that created the item. + - `Error string` - - `type BetaResponseReasoningItem struct{…}` + Error message if the server could not list tools. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `type BetaResponseItemMcpApprovalRequest struct{…}` - - `type BetaResponseOutputItemProgram struct{…}` + A request for human approval of a tool invocation. - `ID string` - The unique ID of the program item. + The unique ID of the approval request. - - `CallID string` + - `Arguments string` - The stable call ID of the program item. + A JSON string of arguments for the tool. - - `Code string` + - `Name string` - The JavaScript source executed by programmatic tool calling. + The name of the tool to run. - - `Fingerprint string` + - `ServerLabel string` - Opaque program replay fingerprint that must be round-tripped. + The label of the MCP server making the request. - - `Type Program` + - `Type McpApprovalRequest` - The type of the item. Always `program`. + The type of the item. Always `mcp_approval_request`. - - `const ProgramProgram Program = "program"` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Agent BetaResponseOutputItemProgramAgent` + - `Agent BetaResponseItemMcpApprovalRequestAgent` The agent that produced this item. @@ -85222,35 +98996,29 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemProgramOutput struct{…}` - - - `ID string` - - The unique ID of the program output item. - - - `CallID string` + - `type BetaResponseItemMcpApprovalResponse struct{…}` - The call ID of the program item. + A response to an MCP approval request. - - `Result string` + - `ID string` - The result produced by the program item. + The unique ID of the approval response - - `Status string` + - `ApprovalRequestID string` - The terminal status of the program output item. + The ID of the approval request being answered. - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + - `Approve bool` - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + Whether the request was approved. - - `Type ProgramOutput` + - `Type McpApprovalResponse` - The type of the item. Always `program_output`. + The type of the item. Always `mcp_approval_response`. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `Agent BetaResponseItemMcpApprovalResponseAgent` The agent that produced this item. @@ -85258,45 +99026,37 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseToolSearchCall struct{…}` - - - `ID string` - - The unique ID of the tool search call item. - - - `Arguments any` - - Arguments used for the tool search call. + - `Reason string` - - `CallID string` + Optional reason for the decision. - The unique ID of the tool search call generated by the model. + - `type BetaResponseItemMcpCall struct{…}` - - `Execution BetaResponseToolSearchCallExecution` + An invocation of a tool on an MCP server. - Whether tool search was executed by the server or by the client. + - `ID string` - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + The unique ID of the tool call. - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `Arguments string` - - `Status BetaResponseToolSearchCallStatus` + A JSON string of the arguments passed to the tool. - The status of the tool search call item that was recorded. + - `Name string` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + The name of the tool that was run. - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `ServerLabel string` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + The label of the MCP server running the tool. - - `Type ToolSearchCall` + - `Type McpCall` - The type of the item. Always `tool_search_call`. + The type of the item. Always `mcp_call`. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `const McpCallMcpCall McpCall = "mcp_call"` - - `Agent BetaResponseToolSearchCallAgent` + - `Agent BetaResponseItemMcpCallAgent` The agent that produced this item. @@ -85304,583 +99064,561 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseToolSearchOutputItem struct{…}` + - `ApprovalRequestID string` - - `ID 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. - The unique ID of the tool search output item. + - `Error string` - - `CallID string` + The error from the tool call, if any. - The unique ID of the tool search call generated by the model. + - `Output string` - - `Execution BetaResponseToolSearchOutputItemExecution` + The output from the tool call. - Whether tool search was executed by the server or by the client. + - `Status string` - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `const BetaResponseItemMcpCallStatusInProgress BetaResponseItemMcpCallStatus = "in_progress"` - - `Status BetaResponseToolSearchOutputItemStatus` + - `const BetaResponseItemMcpCallStatusCompleted BetaResponseItemMcpCallStatus = "completed"` - The status of the tool search output item that was recorded. + - `const BetaResponseItemMcpCallStatusIncomplete BetaResponseItemMcpCallStatus = "incomplete"` - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `const BetaResponseItemMcpCallStatusCalling BetaResponseItemMcpCallStatus = "calling"` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `const BetaResponseItemMcpCallStatusFailed BetaResponseItemMcpCallStatus = "failed"` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + - `type BetaResponseCustomToolCallItem struct{…}` - - `Tools []BetaToolUnion` + A call to a custom tool created by the model. - The loaded tool definitions returned by tool search. + - `ID string` - - `type BetaFunctionTool struct{…}` + The unique ID of the custom tool call item. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Status string` - - `type BetaFileSearchTool struct{…}` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaResponseCustomToolCallItemStatusInProgress BetaResponseCustomToolCallItemStatus = "in_progress"` - - `type BetaComputerTool struct{…}` + - `const BetaResponseCustomToolCallItemStatusCompleted BetaResponseCustomToolCallItemStatus = "completed"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseCustomToolCallItemStatusIncomplete BetaResponseCustomToolCallItemStatus = "incomplete"` - - `type BetaComputerUsePreviewTool struct{…}` + - `CreatedBy string` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The identifier of the actor that created the item. - - `type BetaWebSearchTool struct{…}` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The output of a custom tool call from your code, being sent back to the model. - - `type BetaToolMcp struct{…}` + - `ID string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The unique ID of the custom tool call output item. - - `type BetaToolCodeInterpreter struct{…}` + - `Status string` - A tool that runs Python code to help generate a response to a prompt. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `type BetaToolImageGeneration struct{…}` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - A tool that generates images using the GPT image models. + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `type BetaToolLocalShell struct{…}` + - `CreatedBy string` - A tool that allows the model to execute shell commands in a local environment. + The identifier of the actor that created the item. - - `type BetaFunctionShellTool struct{…}` +### Beta Response Local Environment - A tool that allows the model to execute shell commands. +- `type BetaResponseLocalEnvironment struct{…}` - - `type BetaCustomTool struct{…}` + Represents the use of a local environment to perform shell actions. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Type Local` - - `type BetaNamespaceTool struct{…}` + The environment type. Always `local`. - Groups function/custom tools under a shared namespace. + - `const LocalLocal Local = "local"` - - `type BetaToolSearchTool struct{…}` +### Beta Response Mcp Call Arguments Delta Event - Hosted or BYOT tool search configuration for deferred tools. +- `type BetaResponseMcpCallArgumentsDeltaEvent struct{…}` - - `type BetaWebSearchPreviewTool struct{…}` + Emitted when there is a delta (partial update) to the arguments of an MCP tool call. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Delta string` - - `type BetaApplyPatchTool struct{…}` + A JSON string containing the partial update to the arguments for the MCP tool call. - Allows the assistant to create, delete, or update files using unified diffs. + - `ItemID string` - - `Type ToolSearchOutput` + The unique identifier of the MCP tool call item being processed. - The type of the item. Always `tool_search_output`. + - `OutputIndex int64` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + The index of the output item in the response's output array. - - `Agent BetaResponseToolSearchOutputItemAgent` + - `SequenceNumber int64` - The agent that produced this item. + The sequence number of this event. - - `AgentName string` + - `Type ResponseMcpCallArgumentsDelta` - The canonical name of the agent that produced this item. + The type of the event. Always 'response.mcp_call_arguments.delta'. - - `CreatedBy string` + - `const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"` - The identifier of the actor that created the item. + - `Agent BetaResponseMcpCallArgumentsDeltaEventAgent` - - `type BetaResponseOutputItemAdditionalTools struct{…}` + The agent that owns this multi-agent streaming event. - - `ID string` + - `AgentName string` - The unique ID of the additional tools item. + The canonical name of the agent that produced this item. - - `Role string` +### Beta Response Mcp Call Arguments Done Event - The role that provided the additional tools. +- `type BetaResponseMcpCallArgumentsDoneEvent struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + Emitted when the arguments for an MCP tool call are finalized. - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + - `Arguments string` - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + A JSON string containing the finalized arguments for the MCP tool call. - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `ItemID string` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + The unique identifier of the MCP tool call item being processed. - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + - `OutputIndex int64` - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + The index of the output item in the response's output array. - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + - `SequenceNumber int64` - - `Tools []BetaToolUnion` + The sequence number of this event. - The additional tool definitions made available at this item. + - `Type ResponseMcpCallArgumentsDone` - - `type BetaFunctionTool struct{…}` + The type of the event. Always 'response.mcp_call_arguments.done'. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"` - - `type BetaFileSearchTool struct{…}` + - `Agent BetaResponseMcpCallArgumentsDoneEventAgent` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The agent that owns this multi-agent streaming event. - - `type BetaComputerTool struct{…}` + - `AgentName string` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The canonical name of the agent that produced this item. - - `type BetaComputerUsePreviewTool struct{…}` +### Beta Response Mcp Call Completed Event - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). +- `type BetaResponseMcpCallCompletedEvent struct{…}` - - `type BetaWebSearchTool struct{…}` + Emitted when an MCP tool call has completed successfully. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `ItemID string` - - `type BetaToolMcp struct{…}` + The ID of the MCP tool call item that completed. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `OutputIndex int64` - - `type BetaToolCodeInterpreter struct{…}` + The index of the output item that completed. - A tool that runs Python code to help generate a response to a prompt. + - `SequenceNumber int64` - - `type BetaToolProgrammaticToolCalling struct{…}` + The sequence number of this event. - - `type BetaToolImageGeneration struct{…}` + - `Type ResponseMcpCallCompleted` - A tool that generates images using the GPT image models. + The type of the event. Always 'response.mcp_call.completed'. - - `type BetaToolLocalShell struct{…}` + - `const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"` - A tool that allows the model to execute shell commands in a local environment. + - `Agent BetaResponseMcpCallCompletedEventAgent` - - `type BetaFunctionShellTool struct{…}` + The agent that owns this multi-agent streaming event. - A tool that allows the model to execute shell commands. + - `AgentName string` - - `type BetaCustomTool struct{…}` + The canonical name of the agent that produced this item. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) +### Beta Response Mcp Call Failed Event - - `type BetaNamespaceTool struct{…}` +- `type BetaResponseMcpCallFailedEvent struct{…}` - Groups function/custom tools under a shared namespace. + Emitted when an MCP tool call has failed. - - `type BetaToolSearchTool struct{…}` + - `ItemID string` - Hosted or BYOT tool search configuration for deferred tools. + The ID of the MCP tool call item that failed. - - `type BetaWebSearchPreviewTool struct{…}` + - `OutputIndex int64` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The index of the output item that failed. - - `type BetaApplyPatchTool struct{…}` + - `SequenceNumber int64` - Allows the assistant to create, delete, or update files using unified diffs. + The sequence number of this event. - - `Type AdditionalTools` + - `Type ResponseMcpCallFailed` - The type of the item. Always `additional_tools`. + The type of the event. Always 'response.mcp_call.failed'. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"` - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + - `Agent BetaResponseMcpCallFailedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseCompactionItem struct{…}` - - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - - `ID string` +### Beta Response Mcp Call In Progress Event - The unique ID of the compaction item. +- `type BetaResponseMcpCallInProgressEvent struct{…}` - - `EncryptedContent string` + Emitted when an MCP tool call is in progress. - The encrypted content that was produced by compaction. + - `ItemID string` - - `Type Compaction` + The unique identifier of the MCP tool call item being processed. - The type of the item. Always `compaction`. + - `OutputIndex int64` - - `const CompactionCompaction Compaction = "compaction"` + The index of the output item in the response's output array. - - `Agent BetaResponseCompactionItemAgent` + - `SequenceNumber int64` - The agent that produced this item. + The sequence number of this event. - - `AgentName string` + - `Type ResponseMcpCallInProgress` - The canonical name of the agent that produced this item. + The type of the event. Always 'response.mcp_call.in_progress'. - - `CreatedBy string` + - `const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"` - The identifier of the actor that created the item. + - `Agent BetaResponseMcpCallInProgressEventAgent` - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + The agent that owns this multi-agent streaming event. - An image generation request made by the model. + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - The unique ID of the image generation call. +### Beta Response Mcp List Tools Completed Event - - `Result string` +- `type BetaResponseMcpListToolsCompletedEvent struct{…}` - The generated image encoded in base64. + Emitted when the list of available MCP tools has been successfully retrieved. - - `Status string` + - `ItemID string` - The status of the image generation call. + The ID of the MCP tool call item that produced this output. - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + - `OutputIndex int64` - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + The index of the output item that was processed. - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `SequenceNumber int64` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + The sequence number of this event. - - `Type ImageGenerationCall` + - `Type ResponseMcpListToolsCompleted` - The type of the image generation call. Always `image_generation_call`. + The type of the event. Always 'response.mcp_list_tools.completed'. - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"` - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `Agent BetaResponseMcpListToolsCompletedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCall struct{…}` - - A tool call to run code. - - - `type BetaResponseOutputItemLocalShellCall struct{…}` - - A tool call to run a command on the local shell. +### Beta Response Mcp List Tools Failed Event - - `ID string` +- `type BetaResponseMcpListToolsFailedEvent struct{…}` - The unique ID of the local shell call. + Emitted when the attempt to list available MCP tools has failed. - - `Action BetaResponseOutputItemLocalShellCallAction` + - `ItemID string` - Execute a shell command on the server. + The ID of the MCP tool call item that failed. - - `Command []string` + - `OutputIndex int64` - The command to run. + The index of the output item that failed. - - `Env map[string, string]` + - `SequenceNumber int64` - Environment variables to set for the command. + The sequence number of this event. - - `Type Exec` + - `Type ResponseMcpListToolsFailed` - The type of the local shell action. Always `exec`. + The type of the event. Always 'response.mcp_list_tools.failed'. - - `const ExecExec Exec = "exec"` + - `const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"` - - `TimeoutMs int64` + - `Agent BetaResponseMcpListToolsFailedEventAgent` - Optional timeout in milliseconds for the command. + The agent that owns this multi-agent streaming event. - - `User string` + - `AgentName string` - Optional user to run the command as. + The canonical name of the agent that produced this item. - - `WorkingDirectory string` +### Beta Response Mcp List Tools In Progress Event - Optional working directory to run the command in. +- `type BetaResponseMcpListToolsInProgressEvent struct{…}` - - `CallID string` + Emitted when the system is in the process of retrieving the list of available MCP tools. - The unique ID of the local shell tool call generated by the model. + - `ItemID string` - - `Status string` + The ID of the MCP tool call item that is being processed. - The status of the local shell call. + - `OutputIndex int64` - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + The index of the output item that is being processed. - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + - `SequenceNumber int64` - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + The sequence number of this event. - - `Type LocalShellCall` + - `Type ResponseMcpListToolsInProgress` - The type of the local shell call. Always `local_shell_call`. + The type of the event. Always 'response.mcp_list_tools.in_progress'. - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + - `Agent BetaResponseMcpListToolsInProgressEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemLocalShellCallOutput 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. +### Beta Response Output Audio - - `Type LocalShellCallOutput` +- `type BetaResponseOutputAudio struct{…}` - The type of the local shell tool call output. Always `local_shell_call_output`. + An audio output from the model. - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `Data string` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + Base64-encoded audio data from the model. - The agent that produced this item. + - `Transcript string` - - `AgentName string` + The transcript of the audio data from the model. - The canonical name of the agent that produced this item. + - `Type OutputAudio` - - `Status string` + The type of the output audio. Always `output_audio`. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `const OutputAudioOutputAudio OutputAudio = "output_audio"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` +### Beta Response Output Item - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` +- `type BetaResponseOutputItemUnion interface{…}` - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + An output message from the model. - - `type BetaResponseFunctionShellToolCall struct{…}` + - `type BetaResponseOutputMessage struct{…}` - A tool call that executes one or more shell commands in a managed environment. + An output message from the model. - `ID string` - The unique ID of the shell tool call. Populated when this item is returned via API. + The unique ID of the output message. - - `Action BetaResponseFunctionShellToolCallAction` + - `Content []BetaResponseOutputMessageContentUnion` - The shell commands and limits that describe how to run the tool call. + The content of the output message. - - `Commands []string` + - `type BetaResponseOutputText struct{…}` - - `MaxOutputLength int64` + A text output from the model. - Optional maximum number of characters to return from each command. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `TimeoutMs int64` + The annotations of the text output. - Optional timeout in milliseconds for the commands. + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `CallID string` + A citation to a file. + + - `FileID string` - The unique ID of the shell tool call generated by the model. + The ID of the file. - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + - `Filename string` - Represents the use of a local environment to perform shell actions. + The filename of the file cited. - - `type BetaResponseLocalEnvironment struct{…}` + - `Index int64` - Represents the use of a local environment to perform shell actions. + The index of the file in the list of files. - - `Type Local` + - `Type FileCitation` - The environment type. Always `local`. + The type of the file citation. Always `file_citation`. - - `const LocalLocal Local = "local"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `type BetaResponseContainerReference struct{…}` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - Represents a container created with /v1/containers. + A citation for a web resource used to generate a model response. - - `ContainerID string` + - `EndIndex int64` - - `Type ContainerReference` + The index of the last character of the URL citation in the message. - The environment type. Always `container_reference`. + - `StartIndex int64` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + The index of the first character of the URL citation in the message. - - `Status BetaResponseFunctionShellToolCallStatus` + - `Title string` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + The title of the web resource. - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + - `Type URLCitation` - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + The type of the URL citation. Always `url_citation`. - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `Type ShellCall` + - `URL string` - The type of the item. Always `shell_call`. + The URL of the web resource. - - `const ShellCallShellCall ShellCall = "shell_call"` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `Agent BetaResponseFunctionShellToolCallAgent` + A citation for a container file used to generate a model response. - The agent that produced this item. + - `ContainerID string` - - `AgentName string` + The ID of the container file. - The canonical name of the agent that produced this item. + - `EndIndex int64` - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + The index of the last character of the container file citation in the message. - The execution context that produced this tool call. + - `FileID string` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + The ID of the file. - - `Type Direct` + - `Filename string` - - `const DirectDirect Direct = "direct"` + The filename of the container file cited. - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `StartIndex int64` - - `CallerID string` + The index of the first character of the container file citation in the message. - The call ID of the program item that produced this tool call. + - `Type ContainerFileCitation` - - `Type Program` + The type of the container file citation. Always `container_file_citation`. - - `const ProgramProgram Program = "program"` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `CreatedBy string` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - The ID of the entity that created this tool call. + A path to a file. - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `FileID string` - The output of a shell tool call that was emitted. + The ID of the file. - - `ID string` + - `Index int64` - The unique ID of the shell call output. Populated when this item is returned via API. + The index of the file in the list of files. - - `CallID string` + - `Type FilePath` - The unique ID of the shell tool call generated by the model. + The type of the file path. Always `file_path`. - - `MaxOutputLength int64` + - `const FilePathFilePath FilePath = "file_path"` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `Text string` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + The text output from the model. - An array of shell call output contents + - `Type OutputText` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + The type of the output text. Always `output_text`. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `const OutputTextOutputText OutputText = "output_text"` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + - `Logprobs []BetaResponseOutputTextLogprob` - Indicates that the shell call exceeded its configured time limit. + - `Token string` - - `Type Timeout` + - `Bytes []int64` - The outcome type. Always `timeout`. + - `Logprob float64` - - `const TimeoutTimeout Timeout = "timeout"` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `Token string` - Indicates that the shell commands finished and returned an exit code. + - `Bytes []int64` - - `ExitCode int64` + - `Logprob float64` - Exit code from the shell process. + - `type BetaResponseOutputRefusal struct{…}` - - `Type Exit` + A refusal from the model. - The outcome type. Always `exit`. + - `Refusal string` - - `const ExitExit Exit = "exit"` + The refusal explanation from the model. - - `Stderr string` + - `Type Refusal` - The standard error output that was captured. + The type of the refusal. Always `refusal`. - - `Stdout string` + - `const RefusalRefusal Refusal = "refusal"` - The standard output that was captured. + - `Role Assistant` - - `CreatedBy string` + The role of the output message. Always `assistant`. - The identifier of the actor that created the item. + - `const AssistantAssistant Assistant = "assistant"` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `Status BetaResponseOutputMessageStatus` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `Type ShellCallOutput` + - `Type Message` - The type of the shell call output. Always `shell_call_output`. + The type of the output message. Always `message`. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const MessageMessage Message = "message"` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `Agent BetaResponseOutputMessageAgent` The agent that produced this item. @@ -85888,111 +99626,120 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `Phase BetaResponseOutputMessagePhase` - The execution context that produced this tool call. + 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. - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `Type Direct` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - - `const DirectDirect Direct = "direct"` + - `type BetaResponseFileSearchToolCall struct{…}` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `CallerID string` + - `ID string` - The call ID of the program item that produced this tool call. + The unique ID of the file search tool call. - - `Type Program` + - `Queries []string` - - `const ProgramProgram Program = "program"` + The queries used to search for files. - - `CreatedBy string` + - `Status BetaResponseFileSearchToolCallStatus` - The identifier of the actor that created the item. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `type BetaResponseApplyPatchToolCall struct{…}` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - A tool call that applies file diffs by creating, deleting, or updating files. + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `ID string` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `CallID string` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - The unique ID of the apply patch tool call generated by the model. + - `Type FileSearchCall` - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + The type of the file search tool call. Always `file_search_call`. - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `Agent BetaResponseFileSearchToolCallAgent` - Instruction describing how to create a file via the apply_patch tool. + The agent that produced this item. - - `Diff string` + - `AgentName string` - Diff to apply. + The canonical name of the agent that produced this item. - - `Path string` + - `Results []BetaResponseFileSearchToolCallResult` - Path of the file to create. + The results of the file search tool call. - - `Type CreateFile` + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - Create a new file with the provided diff. + 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. - - `const CreateFileCreateFile CreateFile = "create_file"` + - `string` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `float64` - Instruction describing how to delete a file via the apply_patch tool. + - `bool` - - `Path string` + - `FileID string` - Path of the file to delete. + The unique ID of the file. - - `Type DeleteFile` + - `Filename string` - Delete the specified file. + The name of the file. - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `Score float64` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + The relevance score of the file - a value between 0 and 1. - Instruction describing how to update a file via the apply_patch tool. + - `Text string` - - `Diff string` + The text that was retrieved from the file. - Diff to apply. + - `type BetaResponseFunctionToolCall struct{…}` - - `Path string` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - Path of the file to update. + - `Arguments string` - - `Type UpdateFile` + A JSON string of the arguments to pass to the function. - Update an existing file with the provided diff. + - `CallID string` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + The unique ID of the function tool call generated by the model. - - `Status BetaResponseApplyPatchToolCallStatus` + - `Name string` - The status of the apply patch tool call. One of `in_progress` or `completed`. + The name of the function to run. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `Type FunctionCall` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + The type of the function tool call. Always `function_call`. - - `Type ApplyPatchCall` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - The type of the item. Always `apply_patch_call`. + - `ID string` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + The unique ID of the function tool call. - - `Agent BetaResponseApplyPatchToolCallAgent` + - `Agent BetaResponseFunctionToolCallAgent` The agent that produced this item. @@ -86000,17 +99747,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `Caller BetaResponseFunctionToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - `Type Direct` - `const DirectDirect Direct = "direct"` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - `CallerID string` @@ -86020,172 +99767,170 @@ func main() { - `const ProgramProgram Program = "program"` - - `CreatedBy string` - - The ID of the entity that created this tool call. - - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + - `Namespace string` - The output emitted by an apply patch tool call. + The namespace of the function to run. - - `ID string` + - `Status BetaResponseFunctionToolCallStatus` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `CallID string` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - The unique ID of the apply patch tool call generated by the model. + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `ID string` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + The unique ID of the function call tool output. - - `Type ApplyPatchCallOutput` + - `CallID string` - The type of the item. Always `apply_patch_call_output`. + The unique ID of the function tool call generated by the model. - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + The output from the function call generated by your code. + Can be a string or an list of output content. - The agent that produced this item. + - `string` - - `AgentName string` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - The canonical name of the agent that produced this item. + Text, image, or file output of the function call. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `type BetaResponseInputText struct{…}` - The execution context that produced this tool call. + A text input to the model. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `Text string` - - `Type Direct` + The text input to the model. - - `const DirectDirect Direct = "direct"` + - `Type InputText` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + The type of the input item. Always `input_text`. - - `CallerID string` + - `const InputTextInputText InputText = "input_text"` - The call ID of the program item that produced this tool call. + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `Type Program` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const ProgramProgram Program = "program"` + - `Mode Explicit` - - `CreatedBy string` + The breakpoint mode. Always `explicit`. - The ID of the entity that created this tool call output. + - `const ExplicitExplicit Explicit = "explicit"` - - `Output string` + - `type BetaResponseInputImage struct{…}` - Optional textual output returned by the apply patch tool. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `type BetaResponseOutputItemMcpCall struct{…}` + - `Detail BetaResponseInputImageDetail` - An invocation of a tool on an MCP server. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `ID string` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - The unique ID of the tool call. + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `Arguments string` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - A JSON string of the arguments passed to the tool. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `Name string` + - `Type InputImage` - The name of the tool that was run. + The type of the input item. Always `input_image`. - - `ServerLabel string` + - `const InputImageInputImage InputImage = "input_image"` - The label of the MCP server running the tool. + - `FileID string` - - `Type McpCall` + The ID of the file to be sent to the model. - The type of the item. Always `mcp_call`. + - `ImageURL string` - - `const McpCallMcpCall McpCall = "mcp_call"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `Agent BetaResponseOutputItemMcpCallAgent` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - The agent that produced this item. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `AgentName string` + - `Mode Explicit` - The canonical name of the agent that produced this item. + The breakpoint mode. Always `explicit`. - - `ApprovalRequestID string` + - `const ExplicitExplicit Explicit = "explicit"` - 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. + - `type BetaResponseInputFile struct{…}` - - `Error string` + A file input to the model. - The error from the tool call, if any. + - `Type InputFile` - - `Output string` + The type of the input item. Always `input_file`. - The output from the tool call. + - `const InputFileInputFile InputFile = "input_file"` - - `Status string` + - `Detail BetaResponseInputFileDetail` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + - `FileData string` - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + The content of the file to be sent to the model. - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `FileID string` - A list of tools available on an MCP server. + The ID of the file to be sent to the model. - - `ID string` + - `FileURL string` - The unique ID of the list. + The URL of the file to be sent to the model. - - `ServerLabel string` + - `Filename string` - The label of the MCP server. + The name of the file to be sent to the model. - - `Tools []BetaResponseOutputItemMcpListToolsTool` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - The tools available on the server. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `InputSchema any` + - `Mode Explicit` - The JSON schema describing the tool's input. + The breakpoint mode. Always `explicit`. - - `Name string` + - `const ExplicitExplicit Explicit = "explicit"` - The name of the tool. + - `Status BetaResponseFunctionToolCallOutputItemStatus` - - `Annotations any` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Additional annotations about the tool. + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `Description string` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - The description of the tool. + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `Type McpListTools` + - `Type FunctionCallOutput` - The type of the item. Always `mcp_list_tools`. + The type of the function tool call output. Always `function_call_output`. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` The agent that produced this item. @@ -86193,2267 +99938,2201 @@ func main() { The canonical name of the agent that produced this item. - - `Error string` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - Error message if the server could not list tools. + The execution context that produced this tool call. - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - A request for human approval of a tool invocation. + - `Type Direct` - - `ID string` + The caller type. Always `direct`. - The unique ID of the approval request. + - `const DirectDirect Direct = "direct"` - - `Arguments string` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - A JSON string of arguments for the tool. + - `CallerID string` - - `Name string` + The call ID of the program item that produced this tool call. - The name of the tool to run. + - `Type Program` - - `ServerLabel string` + The caller type. Always `program`. - The label of the MCP server making the request. + - `const ProgramProgram Program = "program"` - - `Type McpApprovalRequest` + - `CreatedBy string` - The type of the item. Always `mcp_approval_request`. + The identifier of the actor that created the item. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `type BetaResponseOutputItemAgentMessage struct{…}` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `ID string` - The agent that produced this item. + The unique ID of the agent message. - - `AgentName string` + - `Author string` - The canonical name of the agent that produced this item. + The sending agent identity. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - A response to an MCP approval request. + Encrypted content sent between agents. - - `ID string` + - `type BetaResponseInputText struct{…}` - The unique ID of the approval response + A text input to the model. - - `ApprovalRequestID string` + - `type BetaResponseOutputText struct{…}` - The ID of the approval request being answered. + A text output from the model. - - `Approve bool` + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - Whether the request was approved. + A text content. - - `Type McpApprovalResponse` + - `Text string` - The type of the item. Always `mcp_approval_response`. + - `Type Text` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `const TextText Text = "text"` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - The agent that produced this item. + A summary text from the model. - - `AgentName string` + - `Text string` - The canonical name of the agent that produced this item. + A summary of the reasoning output from the model so far. - - `Reason string` + - `Type SummaryText` - Optional reason for the decision. + The type of the object. Always `summary_text`. - - `type BetaResponseCustomToolCall struct{…}` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - A call to a custom tool created by the model. + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + Reasoning text from the model. - The output of a custom tool call from your code, being sent back to the model. + - `Text string` - - `ID string` + The reasoning text from the model. - The unique ID of the custom tool call output item. + - `Type ReasoningText` - - `Status string` + The type of the reasoning text. Always `reasoning_text`. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `type BetaResponseOutputRefusal struct{…}` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + A refusal from the model. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `type BetaResponseInputImage struct{…}` - - `CreatedBy string` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The identifier of the actor that created the item. + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - - `ParallelToolCalls bool` + A screenshot of a computer. - Whether to allow the model to run tool calls in parallel. + - `Detail string` - - `Temperature float64` + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - - `ToolChoice BetaResponseToolChoiceUnion` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `type BetaToolChoiceOptions string` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - Controls which (if any) tool is called by the model. + - `FileID string` - `none` means the model will not call any tool and instead generates a message. + The identifier of an uploaded file that contains the screenshot. - `auto` means the model can pick between generating a message or calling one or - more tools. + - `ImageURL string` - `required` means the model must call one or more tools. + The URL of the screenshot image. - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + - `Type ComputerScreenshot` - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `type BetaToolChoiceAllowed struct{…}` + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - Constrains the tools available to the model to a pre-defined set. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Mode BetaToolChoiceAllowedMode` + - `Mode Explicit` - Constrains the tools available to the model to a pre-defined set. + The breakpoint mode. Always `explicit`. - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `const ExplicitExplicit Explicit = "explicit"` - `required` requires the model to call one or more of the allowed tools. + - `type BetaResponseInputFile struct{…}` - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + A file input to the model. - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - - `Tools []map[string, any]` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - A list of tool definitions that the model should be allowed to call. + - `EncryptedContent string` - For the Responses API, the list of tool definitions might look like: + Opaque encrypted content. - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `Type EncryptedContent` - - `Type AllowedTools` + The type of the input item. Always `encrypted_content`. - Allowed tool configuration type. Always `allowed_tools`. + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `Recipient string` - - `type BetaToolChoiceTypes struct{…}` + The destination agent identity. - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `Type AgentMessage` - - `Type BetaToolChoiceTypesType` + The type of the item. Always `agent_message`. - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - Allowed values are: + - `Agent BetaResponseOutputItemAgentMessageAgent` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + The agent that produced this item. - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + - `AgentName string` - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + The canonical name of the agent that produced this item. - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `ID string` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + The unique ID of the multi-agent call item. - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `Action string` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + The multi-agent action to execute. - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - - `type BetaToolChoiceFunction struct{…}` + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - Use this option to force the model to call a specific function. + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - - `Name string` + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - The name of the function to call. + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - - `Type Function` + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - For function calling, the type is always `function`. + - `Arguments string` - - `const FunctionFunction Function = "function"` + The JSON string of arguments generated for the action. - - `type BetaToolChoiceMcp struct{…}` + - `CallID string` - Use this option to force the model to call a specific tool on a remote MCP server. + The unique ID linking this call to its output. - - `ServerLabel string` + - `Type MultiAgentCall` - The label of the MCP server to use. + The type of the multi-agent call. Always `multi_agent_call`. - - `Type Mcp` + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - For MCP tools, the type is always `mcp`. + - `Agent BetaResponseOutputItemMultiAgentCallAgent` - - `const McpMcp Mcp = "mcp"` + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the tool to call on the server. + The canonical name of the agent that produced this item. - - `type BetaToolChoiceCustom struct{…}` + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - Use this option to force the model to call a specific custom tool. + - `ID string` - - `Name string` + The unique ID of the multi-agent call output item. - The name of the custom tool to call. + - `Action string` - - `Type Custom` + The multi-agent action that produced this result. - For custom tool calling, the type is always `custom`. + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const CustomCustom Custom = "custom"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `Type ProgrammaticToolCalling` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - The tool to call. Always `programmatic_tool_calling`. + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - - `type BetaToolChoiceApplyPatch struct{…}` + - `CallID string` - Forces the model to call the apply_patch tool when executing a tool call. + The unique ID of the multi-agent call. - - `Type ApplyPatch` + - `Output []BetaResponseOutputText` - The tool to call. Always `apply_patch`. + Text output returned by the multi-agent action. - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `type BetaToolChoiceShell struct{…}` + The annotations of the text output. - Forces the model to call the shell tool when a tool call is required. + - `Text string` - - `Type Shell` + The text output from the model. - The tool to call. Always `shell`. + - `Type OutputText` - - `const ShellShell Shell = "shell"` + The type of the output text. Always `output_text`. - - `Tools []BetaToolUnion` + - `Logprobs []BetaResponseOutputTextLogprob` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + - `Type MultiAgentCallOutput` - We support the following categories of tools: + The type of the multi-agent result. Always `multi_agent_call_output`. - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `type BetaFunctionTool struct{…}` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The agent that produced this item. - - `type BetaFileSearchTool struct{…}` + - `AgentName string` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The canonical name of the agent that produced this item. - - `type BetaComputerTool struct{…}` + - `type BetaResponseFunctionWebSearch struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `type BetaComputerUsePreviewTool struct{…}` + - `ID string` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The unique ID of the web search tool call. - - `type BetaWebSearchTool struct{…}` + - `Action BetaResponseFunctionWebSearchActionUnion` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + 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 BetaToolMcp struct{…}` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + Action type "search" - Performs a web search query. - - `type BetaToolCodeInterpreter struct{…}` + - `Type Search` - A tool that runs Python code to help generate a response to a prompt. + The action type. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const SearchSearch Search = "search"` - - `type BetaToolImageGeneration struct{…}` + - `Queries []string` - A tool that generates images using the GPT image models. + The search queries. - - `type BetaToolLocalShell struct{…}` + - `Query string` - A tool that allows the model to execute shell commands in a local environment. + The search query. - - `type BetaFunctionShellTool struct{…}` + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - A tool that allows the model to execute shell commands. + The sources used in the search. - - `type BetaCustomTool struct{…}` + - `Type URL` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The type of source. Always `url`. - - `type BetaNamespaceTool struct{…}` + - `const URLURL URL = "url"` - Groups function/custom tools under a shared namespace. + - `URL string` - - `type BetaToolSearchTool struct{…}` + The URL of the source. - Hosted or BYOT tool search configuration for deferred tools. + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `type BetaWebSearchPreviewTool struct{…}` + Action type "open_page" - Opens a specific URL from search results. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Type OpenPage` - - `type BetaApplyPatchTool struct{…}` + The action type. - Allows the assistant to create, delete, or update files using unified diffs. + - `const OpenPageOpenPage OpenPage = "open_page"` - - `TopP float64` + - `URL string` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + The URL opened by the model. - We generally recommend altering this or `temperature` but not both. + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - - `Background bool` + Action type "find_in_page": Searches for a pattern within a loaded page. - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + - `Pattern string` - - `CompletedAt float64` + The pattern or text to search for within the page. - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. + - `Type FindInPage` - - `Conversation BetaResponseConversation` + The action type. - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `ID string` + - `URL string` - The unique ID of the conversation that this response was associated with. + The URL of the page searched for the pattern. - - `MaxOutputTokens int64` + - `Status BetaResponseFunctionWebSearchStatus` - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + The status of the web search tool call. - - `MaxToolCalls int64` + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - `Moderation BetaResponseModeration` + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - Moderation results for the response input and output, if moderated completions were requested. + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - `Input BetaResponseModerationInputUnion` + - `Type WebSearchCall` - Moderation for the response input. + The type of the web search tool call. Always `web_search_call`. - - `type BetaResponseModerationInputModerationResult struct{…}` + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - A moderation result produced for the response input or output. + - `Agent BetaResponseFunctionWebSearchAgent` - - `Categories map[string, bool]` + The agent that produced this item. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `AgentName string` - - `CategoryAppliedInputTypes map[string, []string]` + The canonical name of the agent that produced this item. - Which modalities of input are reflected by the score for each category. + - `type BetaResponseComputerToolCall struct{…}` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + - `ID string` - - `CategoryScores map[string, float64]` + The unique ID of the computer call. - A dictionary of moderation categories to scores. + - `CallID string` - - `Flagged bool` + An identifier used when responding to the tool call with output. - A boolean indicating whether the content was flagged by any category. + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `Model string` + The pending safety checks for the computer call. - The moderation model that produced this result. + - `ID string` - - `Type ModerationResult` + The ID of the pending safety check. - The object type, which was always `moderation_result` for successful moderation results. + - `Code string` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + The type of the pending safety check. - - `type BetaResponseModerationInputError struct{…}` + - `Message string` - An error produced while attempting moderation for the response input or output. + Details about the pending safety check. - - `Code string` + - `Status BetaResponseComputerToolCallStatus` - The error code. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Message string` + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - The error message. + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - - `Type Error` + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - The object type, which was always `error` for moderation failures. + - `Type BetaResponseComputerToolCallType` - - `const ErrorError Error = "error"` + The type of the computer call. Always `computer_call`. - - `Output BetaResponseModerationOutputUnion` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - Moderation for the response output. + - `Action BetaComputerActionUnion` - - `type BetaResponseModerationOutputModerationResult struct{…}` + A click action. - A moderation result produced for the response input or output. + - `type BetaComputerActionClick struct{…}` - - `Categories map[string, bool]` + A click action. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `Button string` - - `CategoryAppliedInputTypes map[string, []string]` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - Which modalities of input are reflected by the score for each category. + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `CategoryScores map[string, float64]` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - A dictionary of moderation categories to scores. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `Flagged bool` + - `Type Click` - A boolean indicating whether the content was flagged by any category. + Specifies the event type. For a click action, this property is always `click`. - - `Model string` + - `const ClickClick Click = "click"` - The moderation model that produced this result. + - `X int64` - - `Type ModerationResult` + The x-coordinate where the click occurred. - The object type, which was always `moderation_result` for successful moderation results. + - `Y int64` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + The y-coordinate where the click occurred. - - `type BetaResponseModerationOutputError struct{…}` + - `Keys []string` - An error produced while attempting moderation for the response input or output. + The keys being held while clicking. - - `Code string` + - `type BetaComputerActionDoubleClick struct{…}` - The error code. + A double click action. - - `Message string` + - `Keys []string` - The error message. + The keys being held while double-clicking. - - `Type Error` + - `Type DoubleClick` - The object type, which was always `error` for moderation failures. + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `const ErrorError Error = "error"` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `PreviousResponseID string` + - `X int64` - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + The x-coordinate where the double click occurred. - - `Prompt BetaResponsePrompt` + - `Y int64` - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + The y-coordinate where the double click occurred. - - `ID string` + - `type BetaComputerActionDrag struct{…}` - The unique identifier of the prompt template to use. + A drag action. - - `Variables map[string, BetaResponsePromptVariableUnion]` + - `Path []BetaComputerActionDragPath` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `string` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `type BetaResponseInputText struct{…}` + - `X int64` - A text input to the model. + The x-coordinate. - - `type BetaResponseInputImage struct{…}` + - `Y int64` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The y-coordinate. - - `type BetaResponseInputFile struct{…}` + - `Type Drag` - A file input to the model. + Specifies the event type. For a drag action, this property is always set to `drag`. - - `Version string` + - `const DragDrag Drag = "drag"` - Optional version of the prompt template. + - `Keys []string` - - `PromptCacheKey string` + The keys being held while dragging the mouse. - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + - `type BetaComputerActionKeypress struct{…}` - - `PromptCacheOptions BetaResponsePromptCacheOptions` + A collection of keypresses the model would like to perform. - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + - `Keys []string` - - `Mode string` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - Whether implicit prompt-cache breakpoints were enabled. + - `Type Keypress` - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + - `const KeypressKeypress Keypress = "keypress"` + + - `type BetaComputerActionMove struct{…}` - - `Ttl string` + A mouse move action. - The minimum lifetime applied to each cache breakpoint. + - `Type Move` - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + Specifies the event type. For a move action, this property is always set to `move`. - - `PromptCacheRetention BetaResponsePromptCacheRetention` + - `const MoveMove Move = "move"` - Deprecated. Use `prompt_cache_options.ttl` instead. + - `X int64` - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + The x-coordinate to move to. - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + - `Y int64` - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + The y-coordinate to move to. - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `Keys []string` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + The keys being held while moving the mouse. - - `Reasoning BetaResponseReasoning` + - `type BetaComputerActionScreenshot struct{…}` - **gpt-5 and o-series models only** + A screenshot action. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `Type Screenshot` - - `Context string` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + - `type BetaComputerActionScroll struct{…}` - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + A scroll action. - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + - `ScrollX int64` - - `Effort string` + The horizontal scroll distance. - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `ScrollY int64` - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + The vertical scroll distance. - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `Type Scroll` - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + - `const ScrollScroll Scroll = "scroll"` - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + - `X int64` - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + The x-coordinate where the scroll occurred. - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + - `Y int64` - - `GenerateSummary string` + The y-coordinate where the scroll occurred. - **Deprecated:** use `summary` instead. + - `Keys []string` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + The keys being held while scrolling. - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + - `type BetaComputerActionType struct{…}` - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + An action to type in text. - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + - `Text string` - - `Mode string` + The text to type. - Controls the reasoning execution mode for the request. + - `Type Type` - When returned on a response, this is the effective execution mode. + Specifies the event type. For a type action, this property is always set to `type`. - - `string` + - `const TypeType Type = "type"` - - `string` + - `type BetaComputerActionWait struct{…}` - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + A wait action. - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + - `Type Wait` - - `Summary string` + Specifies the event type. For a wait action, this property is always set to `wait`. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `const WaitWait Wait = "wait"` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `Actions BetaComputerActionList` - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + - `type BetaComputerActionClick struct{…}` - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + A click action. - - `SafetyIdentifier string` + - `type BetaComputerActionDoubleClick struct{…}` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + A double click action. - - `ServiceTier BetaResponseServiceTier` + - `type BetaComputerActionDrag struct{…}` - Specifies the processing type used for serving the request. + A drag action. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `type BetaComputerActionKeypress struct{…}` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + A collection of keypresses the model would like to perform. - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `type BetaComputerActionMove struct{…}` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + A mouse move action. - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + - `type BetaComputerActionScreenshot struct{…}` - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + A screenshot action. - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + - `type BetaComputerActionScroll struct{…}` - - `Status BetaResponseStatus` + A scroll action. - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `type BetaComputerActionType struct{…}` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + An action to type in text. - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `type BetaComputerActionWait struct{…}` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + A wait action. - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + - `Agent BetaResponseComputerToolCallAgent` - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + The agent that produced this item. - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + - `AgentName string` - - `Text BetaResponseTextConfig` + The canonical name of the agent that produced this item. - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `type BetaResponseComputerToolCallOutputItem struct{…}` - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `ID string` - - `Format BetaResponseFormatTextConfigUnion` + The unique ID of the computer call tool output. - An object specifying the format that the model must output. + - `CallID string` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The ID of the computer tool call that produced the output. - The default format is `{ "type": "text" }` with no additional options. + - `Output BetaResponseComputerToolCallOutputScreenshot` - **Not recommended for gpt-4o and newer models:** + A computer screenshot image used with the computer use tool. - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `Type ComputerScreenshot` - - `type BetaResponseFormatTextConfigText struct{…}` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - Default response format. Used to generate text responses. + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `Type Text` + - `FileID string` - The type of response format being defined. Always `text`. + The identifier of an uploaded file that contains the screenshot. - - `const TextText Text = "text"` + - `ImageURL string` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + The URL of the screenshot image. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `Name string` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - - `Schema map[string, any]` + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - - `Type JSONSchema` + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - The type of response format being defined. Always `json_schema`. + - `Type ComputerCallOutput` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The type of the computer tool call output. Always `computer_call_output`. - - `Description string` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `Strict bool` + The safety checks reported by the API that have been acknowledged by the + developer. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `ID string` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + The ID of the pending safety check. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `Code string` - - `Type JSONObject` + The type of the pending safety check. - The type of response format being defined. Always `json_object`. + - `Message string` - - `const JSONObjectJSONObject JSONObject = "json_object"` + Details about the pending safety check. - - `Verbosity BetaResponseTextConfigVerbosity` + - `Agent BetaResponseComputerToolCallOutputItemAgent` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + The agent that produced this item. - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + - `AgentName string` - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + The canonical name of the agent that produced this item. - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + - `CreatedBy string` - - `TopLogprobs int64` + The identifier of the actor that created the item. - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + - `type BetaResponseReasoningItem struct{…}` - - `Truncation BetaResponseTruncation` + 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](https://platform.openai.com/docs/guides/conversation-state). - The truncation strategy to use for the model response. + - `ID string` - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + The unique identifier of the reasoning content. - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + - `Summary []BetaResponseReasoningItemSummary` - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + Reasoning summary content. - - `Usage BetaResponseUsage` + - `Text string` - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + A summary of the reasoning output from the model so far. - - `InputTokens int64` + - `Type SummaryText` - The number of input tokens. + The type of the object. Always `summary_text`. - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - A detailed breakdown of the input tokens. + - `Type Reasoning` - - `CacheWriteTokens int64` + The type of the object. Always `reasoning`. - The number of input tokens that were written to the cache. + - `const ReasoningReasoning Reasoning = "reasoning"` - - `CachedTokens int64` + - `Agent BetaResponseReasoningItemAgent` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + The agent that produced this item. - - `OutputTokens int64` + - `AgentName string` - The number of output tokens. + The canonical name of the agent that produced this item. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `Content []BetaResponseReasoningItemContent` - A detailed breakdown of the output tokens. + Reasoning text content. - - `ReasoningTokens int64` + - `Text string` - The number of reasoning tokens. + The reasoning text from the model. - - `TotalTokens int64` + - `Type ReasoningText` - The total number of tokens used. + The type of the reasoning text. Always `reasoning_text`. - - `User string` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `EncryptedContent string` - - `SequenceNumber int64` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - The sequence number of this event. + - `Status BetaResponseReasoningItemStatus` - - `Type ResponseInProgress` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The type of the event. Always `response.in_progress`. + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - `const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `Agent BetaResponseInProgressEventAgent` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - The agent that owns this multi-agent streaming event. + - `type BetaResponseOutputItemProgram struct{…}` - - `AgentName string` + - `ID string` - The canonical name of the agent that produced this item. + The unique ID of the program item. -### Beta Response Includable + - `CallID string` -- `type BetaResponseIncludable string` + The stable call ID of the program item. - Specify additional output data to include in the model response. Currently supported values are: + - `Code string` - - `web_search_call.results`: Include the search results of the web search tool call. - - `web_search_call.action.sources`: Include the sources of the web search tool call. - - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - - `computer_call_output.output.image_url`: Include image urls from the computer call output. - - `file_search_call.results`: Include the search results of the file search tool call. - - `message.input_image.image_url`: Include image urls from the input message. - - `message.output_text.logprobs`: Include logprobs with assistant messages. - - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). + The JavaScript source executed by programmatic tool calling. - - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` + - `Fingerprint string` - - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` + Opaque program replay fingerprint that must be round-tripped. - - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` + - `Type Program` - - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` + The type of the item. Always `program`. - - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` + - `Agent BetaResponseOutputItemProgramAgent` - - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` + The agent that produced this item. - - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` + - `AgentName string` -### Beta Response Incomplete Event + The canonical name of the agent that produced this item. -- `type BetaResponseIncompleteEvent struct{…}` + - `type BetaResponseOutputItemProgramOutput struct{…}` - An event that is emitted when a response finishes as incomplete. + - `ID string` - - `Response BetaResponse` + The unique ID of the program output item. - The response that was incomplete. + - `CallID string` - - `ID string` + The call ID of the program item. - Unique identifier for this Response. + - `Result string` - - `CreatedAt float64` + The result produced by the program item. - Unix timestamp (in seconds) of when this Response was created. + - `Status string` - - `Error BetaResponseError` + The terminal status of the program output item. - An error object returned when the model fails to generate a Response. + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - - `Code BetaResponseErrorCode` + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - The error code for the response. + - `Type ProgramOutput` - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + The type of the item. Always `program_output`. - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + - `Agent BetaResponseOutputItemProgramOutputAgent` - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + The agent that produced this item. - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `AgentName string` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + The canonical name of the agent that produced this item. - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + - `type BetaResponseToolSearchCall struct{…}` - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + - `ID string` - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + The unique ID of the tool search call item. - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + - `Arguments any` - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + Arguments used for the tool search call. - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + - `CallID string` - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + The unique ID of the tool search call generated by the model. - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + - `Execution BetaResponseToolSearchCallExecution` - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + Whether tool search was executed by the server or by the client. - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `Status BetaResponseToolSearchCallStatus` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + The status of the tool search call item that was recorded. - - `Message string` + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - A human-readable description of the error. + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - `IncompleteDetails BetaResponseIncompleteDetails` + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - Details about why the response is incomplete. + - `Type ToolSearchCall` - - `Reason string` + The type of the item. Always `tool_search_call`. - The reason why the response is incomplete. + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + - `Agent BetaResponseToolSearchCallAgent` - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + The agent that produced this item. - - `Instructions BetaResponseInstructionsUnion` + - `AgentName string` - A system (or developer) message inserted into the model's context. + The canonical name of the agent that produced this item. - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + - `CreatedBy string` - - `string` + The identifier of the actor that created the item. - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + - `type BetaResponseToolSearchOutputItem struct{…}` - A list of one or many input items to the model, containing - different content types. + - `ID string` - - `type BetaEasyInputMessage struct{…}` + The unique ID of the tool search output item. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `CallID string` - - `Content BetaEasyInputMessageContentUnion` + The unique ID of the tool search call generated by the model. - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `Execution BetaResponseToolSearchOutputItemExecution` - - `string` + Whether tool search was executed by the server or by the client. - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - A list of one or many input items to the model, containing different content - types. + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - - `type BetaResponseInputText struct{…}` + - `Status BetaResponseToolSearchOutputItemStatus` - A text input to the model. + The status of the tool search output item that was recorded. - - `Text string` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - The text input to the model. + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - `Type InputText` + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - The type of the input item. Always `input_text`. + - `Tools []BetaToolUnion` - - `const InputTextInputText InputText = "input_text"` + The loaded tool definitions returned by tool search. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `type BetaFunctionTool struct{…}` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Mode Explicit` + - `Name string` - The breakpoint mode. Always `explicit`. + The name of the function to call. - - `const ExplicitExplicit Explicit = "explicit"` + - `Parameters map[string, any]` - - `type BetaResponseInputImage struct{…}` + A JSON schema object describing the parameters of the function. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Strict bool` - - `Detail BetaResponseInputImageDetail` + Whether strict parameter validation is enforced for this function tool. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Type Function` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + The type of the function tool. Always `function`. - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `const FunctionFunction Function = "function"` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `AllowedCallers []string` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + The tool invocation context(s). - - `Type InputImage` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - The type of the input item. Always `input_image`. + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - - `const InputImageInputImage InputImage = "input_image"` + - `DeferLoading bool` - - `FileID string` + Whether this function is deferred and loaded via tool search. - The ID of the file to be sent to the model. + - `Description string` - - `ImageURL string` + A description of the function. Used by the model to determine whether or not to call the function. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `OutputSchema map[string, any]` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + A JSON schema object describing the JSON value encoded in string outputs for this function. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaFileSearchTool struct{…}` - - `Mode Explicit` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The breakpoint mode. Always `explicit`. + - `Type FileSearch` - - `const ExplicitExplicit Explicit = "explicit"` + The type of the file search tool. Always `file_search`. - - `type BetaResponseInputFile struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - A file input to the model. + - `VectorStoreIDs []string` - - `Type InputFile` + The IDs of the vector stores to search. - The type of the input item. Always `input_file`. + - `Filters BetaFileSearchToolFiltersUnion` - - `const InputFileInputFile InputFile = "input_file"` + A filter to apply. - - `Detail BetaResponseInputFileDetail` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `Key string` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + The key to compare against the value. - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `Type string` - - `FileData string` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - The content of the file to be sent to the model. + - `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 - - `FileID string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - The ID of the file to be sent to the model. + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - `FileURL string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - The URL of the file to be sent to the model. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - `Filename string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - The name of the file to be sent to the model. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `Mode Explicit` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - The breakpoint mode. Always `explicit`. + The value to compare against the attribute key; supports string, number, or boolean types. - - `const ExplicitExplicit Explicit = "explicit"` + - `string` - - `Role BetaEasyInputMessageRole` + - `float64` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + - `bool` - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + - `string` - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + - `float64` - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `Phase BetaEasyInputMessagePhase` + Combine multiple filters using `and` or `or`. - 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. + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `Type BetaEasyInputMessageType` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - The type of the message input. Always `message`. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + - `Key string` - - `type BetaResponseInputItemMessage struct{…}` + The key to compare against the value. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `Type string` - - `Content BetaResponseInputMessageContentList` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - A list of one or many input items to the model, containing different content - types. + - `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 - - `Role string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - The role of the message input. One of `user`, `system`, or `developer`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `Agent BetaResponseInputItemMessageAgent` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - The agent that produced this item. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - `AgentName string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - The canonical name of the agent that produced this item. + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - `Status string` + The value to compare against the attribute key; supports string, number, or boolean types. - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `string` - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + - `float64` - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + - `bool` - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `Type string` + - `string` - The type of the message input. Always set to `message`. + - `float64` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + - `Type string` - - `type BetaResponseOutputMessage struct{…}` + Type of operation: `and` or `or`. - An output message from the model. + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `ID string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - The unique ID of the output message. + - `MaxNumResults int64` - - `Content []BetaResponseOutputMessageContentUnion` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - The content of the output message. + - `RankingOptions BetaFileSearchToolRankingOptions` - - `type BetaResponseOutputText struct{…}` + Ranking options for search. - A text output from the model. + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - The annotations of the text output. + - `EmbeddingWeight float64` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + The weight of the embedding in the reciprocal ranking fusion. - A citation to a file. + - `TextWeight float64` - - `FileID string` + The weight of the text in the reciprocal ranking fusion. - The ID of the file. + - `Ranker string` - - `Filename string` + The ranker to use for the file search. - The filename of the file cited. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `Index int64` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - The index of the file in the list of files. + - `ScoreThreshold float64` - - `Type FileCitation` + 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. - The type of the file citation. Always `file_citation`. + - `type BetaComputerTool struct{…}` - - `const FileCitationFileCitation FileCitation = "file_citation"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `Type Computer` - A citation for a web resource used to generate a model response. + The type of the computer tool. Always `computer`. - - `EndIndex int64` + - `const ComputerComputer Computer = "computer"` - The index of the last character of the URL citation in the message. + - `type BetaComputerUsePreviewTool struct{…}` - - `StartIndex int64` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The index of the first character of the URL citation in the message. + - `DisplayHeight int64` - - `Title string` + The height of the computer display. - The title of the web resource. + - `DisplayWidth int64` - - `Type URLCitation` + The width of the computer display. - The type of the URL citation. Always `url_citation`. + - `Environment BetaComputerUsePreviewToolEnvironment` - - `const URLCitationURLCitation URLCitation = "url_citation"` + The type of computer environment to control. - - `URL string` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - The URL of the web resource. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - A citation for a container file used to generate a model response. + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `ContainerID string` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - The ID of the container file. + - `Type ComputerUsePreview` - - `EndIndex int64` + The type of the computer use tool. Always `computer_use_preview`. - The index of the last character of the container file citation in the message. + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - - `FileID string` + - `type BetaWebSearchTool struct{…}` - The ID of the file. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Filename string` + - `Type BetaWebSearchToolType` - The filename of the container file cited. + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `StartIndex int64` + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - The index of the first character of the container file citation in the message. + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - - `Type ContainerFileCitation` + - `Filters BetaWebSearchToolFilters` - The type of the container file citation. Always `container_file_citation`. + Filters for the search. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `AllowedDomains []string` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - A path to a file. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `FileID string` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - The ID of the file. + 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. - - `Index int64` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - The index of the file in the list of files. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `Type FilePath` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - The type of the file path. Always `file_path`. + - `UserLocation BetaWebSearchToolUserLocation` - - `const FilePathFilePath FilePath = "file_path"` + The approximate location of the user. - - `Text string` + - `City string` - The text output from the model. + Free text input for the city of the user, e.g. `San Francisco`. - - `Type OutputText` + - `Country string` - The type of the output text. Always `output_text`. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const OutputTextOutputText OutputText = "output_text"` + - `Region string` - - `Logprobs []BetaResponseOutputTextLogprob` + Free text input for the region of the user, e.g. `California`. - - `Token string` + - `Timezone string` - - `Bytes []int64` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `Logprob float64` + - `Type string` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + The type of location approximation. Always `approximate`. - - `Token string` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `Bytes []int64` + - `type BetaToolMcp struct{…}` - - `Logprob float64` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `type BetaResponseOutputRefusal struct{…}` + - `ServerLabel string` - A refusal from the model. + A label for this MCP server, used to identify it in tool calls. - - `Refusal string` + - `Type Mcp` - The refusal explanation from the model. + The type of the MCP tool. Always `mcp`. - - `Type Refusal` + - `const McpMcp Mcp = "mcp"` - The type of the refusal. Always `refusal`. + - `AllowedCallers []string` - - `const RefusalRefusal Refusal = "refusal"` + The tool invocation context(s). - - `Role Assistant` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - The role of the output message. Always `assistant`. + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `const AssistantAssistant Assistant = "assistant"` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `Status BetaResponseOutputMessageStatus` + List of allowed tool names or a filter object. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + A string array of allowed tool names - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + A filter object to specify which tools are allowed. - - `Type Message` + - `ReadOnly bool` - The type of the output message. Always `message`. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const MessageMessage Message = "message"` + - `ToolNames []string` - - `Agent BetaResponseOutputMessageAgent` + List of allowed tool names. - The agent that produced this item. + - `Authorization string` - - `AgentName 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. - The canonical name of the agent that produced this item. + - `ConnectorID string` - - `Phase BetaResponseOutputMessagePhase` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - 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. + Currently supported `connector_id` values are: - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - 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` - - `type BetaResponseFileSearchToolCall struct{…}` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `ID string` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - The unique ID of the file search tool call. + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - - `Queries []string` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - The queries used to search for files. + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `Status BetaResponseFileSearchToolCallStatus` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + - `DeferLoading bool` - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + Whether this MCP tool is deferred and discovered via tool search. - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + - `Headers map[string, string]` - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `Type FileSearchCall` + Specify which of the MCP server's tools require approval. - The type of the file search tool call. Always `file_search_call`. + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `Agent BetaResponseFileSearchToolCallAgent` + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - The agent that produced this item. + A filter object to specify which tools are allowed. - - `AgentName string` + - `ReadOnly bool` - The canonical name of the agent that produced this item. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Results []BetaResponseFileSearchToolCallResult` + - `ToolNames []string` - The results of the file search tool call. + List of allowed tool names. - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - 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. + A filter object to specify which tools are allowed. - - `string` + - `ReadOnly bool` - - `float64` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `bool` + - `ToolNames []string` - - `FileID string` + List of allowed tool names. - The unique ID of the file. + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `Filename 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. - The name of the file. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - - `Score float64` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - The relevance score of the file - a value between 0 and 1. + - `ServerDescription string` - - `Text string` + Optional description of the MCP server, used to provide more context. - The text that was retrieved from the file. + - `ServerURL string` - - `type BetaResponseComputerToolCall struct{…}` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `TunnelID string` - - `ID 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. - The unique ID of the computer call. + - `type BetaToolCodeInterpreter struct{…}` - - `CallID string` + A tool that runs Python code to help generate a response to a prompt. - An identifier used when responding to the tool call with output. + - `Container BetaToolCodeInterpreterContainerUnion` - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + 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. - The pending safety checks for the computer call. + - `string` - - `ID string` + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - The ID of the pending safety check. + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `Code string` + - `Type Auto` - The type of the pending safety check. + Always `auto`. - - `Message string` + - `const AutoAuto Auto = "auto"` - Details about the pending safety check. + - `FileIDs []string` - - `Status BetaResponseComputerToolCallStatus` + An optional list of uploaded files to make available to your code. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `MemoryLimit string` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + The memory limit for the code interpreter container. - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `Type BetaResponseComputerToolCallType` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - The type of the computer call. Always `computer_call`. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - - `Action BetaComputerActionUnion` + Network access policy for the container. - A click action. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `type BetaComputerActionClick struct{…}` + - `Type Disabled` - A click action. + Disable outbound network access. Always `disabled`. - - `Button string` + - `const DisabledDisabled Disabled = "disabled"` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `AllowedDomains []string` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + A list of allowed domains when type is `allowlist`. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `Type Allowlist` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + Allow outbound network access only to specified domains. Always `allowlist`. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `Type Click` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - Specifies the event type. For a click action, this property is always `click`. + Optional domain-scoped secrets for allowlisted domains. - - `const ClickClick Click = "click"` + - `Domain string` - - `X int64` + The domain associated with the secret. - The x-coordinate where the click occurred. + - `Name string` - - `Y int64` + The name of the secret to inject for the domain. - The y-coordinate where the click occurred. + - `Value string` - - `Keys []string` + The secret value to inject for the domain. - The keys being held while clicking. + - `Type CodeInterpreter` - - `type BetaComputerActionDoubleClick struct{…}` + The type of the code interpreter tool. Always `code_interpreter`. - A double click action. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Keys []string` + - `AllowedCallers []string` - The keys being held while double-clicking. + The tool invocation context(s). - - `Type DoubleClick` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `X int64` + - `Type ProgrammaticToolCalling` - The x-coordinate where the double click occurred. + The type of the tool. Always `programmatic_tool_calling`. - - `Y int64` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - The y-coordinate where the double click occurred. + - `type BetaToolImageGeneration struct{…}` - - `type BetaComputerActionDrag struct{…}` + A tool that generates images using the GPT image models. - A drag action. + - `Type ImageGeneration` - - `Path []BetaComputerActionDragPath` + The type of the image generation tool. Always `image_generation`. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `Action string` - - `X int64` + Whether to generate a new image or edit an existing image. Default: `auto`. - The x-coordinate. + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - - `Y int64` + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - The y-coordinate. + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - - `Type Drag` + - `Background string` - Specifies the event type. For a drag action, this property is always set to `drag`. + 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. - - `const DragDrag Drag = "drag"` + `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. - - `Keys []string` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - The keys being held while dragging the mouse. + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `type BetaComputerActionKeypress struct{…}` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - A collection of keypresses the model would like to perform. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `Keys []string` + - `InputFidelity string` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + 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`. - - `Type Keypress` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - - `const KeypressKeypress Keypress = "keypress"` + - `InputImageMask BetaToolImageGenerationInputImageMask` - - `type BetaComputerActionMove struct{…}` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - A mouse move action. + - `FileID string` - - `Type Move` + File ID for the mask image. - Specifies the event type. For a move action, this property is always set to `move`. + - `ImageURL string` - - `const MoveMove Move = "move"` + Base64-encoded mask image. - - `X int64` + - `Model string` - The x-coordinate to move to. + The image generation model to use. Default: `gpt-image-1`. - - `Y int64` + - `string` - The y-coordinate to move to. + - `string` - - `Keys []string` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - The keys being held while moving the mouse. + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `type BetaComputerActionScreenshot struct{…}` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - A screenshot action. + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `Type Screenshot` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `Moderation string` - - `type BetaComputerActionScroll struct{…}` + Moderation level for the generated image. Default: `auto`. - A scroll action. + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `ScrollX int64` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - The horizontal scroll distance. + - `OutputCompression int64` - - `ScrollY int64` + Compression level for the output image. Default: 100. - The vertical scroll distance. + - `OutputFormat string` - - `Type Scroll` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `const ScrollScroll Scroll = "scroll"` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `X int64` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - The x-coordinate where the scroll occurred. + - `PartialImages int64` - - `Y int64` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The y-coordinate where the scroll occurred. + - `Quality string` - - `Keys []string` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - The keys being held while scrolling. + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `type BetaComputerActionType struct{…}` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - An action to type in text. + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `Text string` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - The text to type. + - `Size string` - - `Type Type` + 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`. - Specifies the event type. For a type action, this property is always set to `type`. + - `string` - - `const TypeType Type = "type"` + - `string` - - `type BetaComputerActionWait struct{…}` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - A wait action. + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `Type Wait` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - Specifies the event type. For a wait action, this property is always set to `wait`. + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - - `const WaitWait Wait = "wait"` + - `type BetaToolLocalShell struct{…}` - - `Actions BetaComputerActionList` + A tool that allows the model to execute shell commands in a local environment. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `Type LocalShell` - - `type BetaComputerActionClick struct{…}` + The type of the local shell tool. Always `local_shell`. - A click action. + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `type BetaComputerActionDoubleClick struct{…}` + - `type BetaFunctionShellTool struct{…}` - A double click action. + A tool that allows the model to execute shell commands. - - `type BetaComputerActionDrag struct{…}` + - `Type Shell` - A drag action. + The type of the shell tool. Always `shell`. - - `type BetaComputerActionKeypress struct{…}` + - `const ShellShell Shell = "shell"` - A collection of keypresses the model would like to perform. + - `AllowedCallers []string` - - `type BetaComputerActionMove struct{…}` + The tool invocation context(s). - A mouse move action. + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - `type BetaComputerActionScreenshot struct{…}` + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - A screenshot action. + - `Environment BetaFunctionShellToolEnvironmentUnion` - - `type BetaComputerActionScroll struct{…}` + - `type BetaContainerAuto struct{…}` - A scroll action. + - `Type ContainerAuto` - - `type BetaComputerActionType struct{…}` + Automatically creates a container for this request - An action to type in text. + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `type BetaComputerActionWait struct{…}` + - `FileIDs []string` - A wait action. + An optional list of uploaded files to make available to your code. - - `Agent BetaResponseComputerToolCallAgent` + - `MemoryLimit BetaContainerAutoMemoryLimit` - The agent that produced this item. + The memory limit for the container. - - `AgentName string` + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - The canonical name of the agent that produced this item. + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `type BetaResponseInputItemComputerCallOutput struct{…}` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - The output of a computer tool call. + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `CallID string` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - The ID of the computer tool call that produced the output. + Network access policy for the container. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - A computer screenshot image used with the computer use tool. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `Type ComputerScreenshot` + - `Skills []BetaContainerAutoSkillUnion` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + An optional list of skills referenced by id or inline data. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `type BetaSkillReference struct{…}` - - `FileID string` + - `SkillID string` - The identifier of an uploaded file that contains the screenshot. + The ID of the referenced skill. - - `ImageURL string` + - `Type SkillReference` - The URL of the screenshot image. + References a skill created with the /v1/skills endpoint. - - `Type ComputerCallOutput` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - The type of the computer tool call output. Always `computer_call_output`. + - `Version string` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `ID string` + - `type BetaInlineSkill struct{…}` - The ID of the computer tool call output. + - `Description string` - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + The description of the skill. - The safety checks reported by the API that have been acknowledged by the developer. + - `Name string` - - `ID string` + The name of the skill. - The ID of the pending safety check. + - `Source BetaInlineSkillSource` - - `Code string` + Inline skill payload - The type of the pending safety check. + - `Data string` - - `Message string` + Base64-encoded skill zip bundle. - Details about the pending safety check. + - `MediaType ApplicationZip` - - `Agent BetaResponseInputItemComputerCallOutputAgent` + The media type of the inline skill payload. Must be `application/zip`. - The agent that produced this item. + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `AgentName string` + - `Type Base64` - The canonical name of the agent that produced this item. + The type of the inline skill source. Must be `base64`. - - `Status string` + - `const Base64Base64 Base64 = "base64"` - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + - `Type Inline` - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + Defines an inline skill for this request. - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `const InlineInline Inline = "inline"` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + - `type BetaLocalEnvironment struct{…}` - - `type BetaResponseFunctionWebSearch struct{…}` + - `Type Local` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + Use a local computer environment. - - `ID string` + - `const LocalLocal Local = "local"` - The unique ID of the web search tool call. + - `Skills []BetaLocalSkill` - - `Action BetaResponseFunctionWebSearchActionUnion` + An optional list of skills. - 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). + - `Description string` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + The description of the skill. - Action type "search" - Performs a web search query. + - `Name string` - - `Type Search` + The name of the skill. - The action type. + - `Path string` - - `const SearchSearch Search = "search"` + The path to the directory containing the skill. - - `Queries []string` + - `type BetaContainerReference struct{…}` - The search queries. + - `ContainerID string` - - `Query string` + The ID of the referenced container. - The search query. + - `Type ContainerReference` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + References a container created with the /v1/containers endpoint - The sources used in the search. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `Type URL` + - `type BetaCustomTool struct{…}` - The type of source. Always `url`. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const URLURL URL = "url"` + - `Name string` - - `URL string` + The name of the custom tool, used to identify it in tool calls. - The URL of the source. + - `Type Custom` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + The type of the custom tool. Always `custom`. - Action type "open_page" - Opens a specific URL from search results. + - `const CustomCustom Custom = "custom"` - - `Type OpenPage` + - `AllowedCallers []string` - The action type. + The tool invocation context(s). - - `const OpenPageOpenPage OpenPage = "open_page"` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `URL string` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - The URL opened by the model. + - `DeferLoading bool` - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + Whether this tool should be deferred and discovered via tool search. - Action type "find_in_page": Searches for a pattern within a loaded page. + - `Description string` - - `Pattern string` + Optional description of the custom tool, used to provide more context. - The pattern or text to search for within the page. + - `Format BetaCustomToolFormatUnion` - - `Type FindInPage` + The input format for the custom tool. Default is unconstrained text. - The action type. + - `type BetaCustomToolFormatText struct{…}` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + Unconstrained free-form text. - - `URL string` + - `Type Text` - The URL of the page searched for the pattern. + Unconstrained text format. Always `text`. - - `Status BetaResponseFunctionWebSearchStatus` + - `const TextText Text = "text"` - The status of the web search tool call. + - `type BetaCustomToolFormatGrammar struct{…}` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + A grammar defined by the user. - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + - `Definition string` - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + The grammar definition. - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `Syntax string` - - `Type WebSearchCall` + The syntax of the grammar definition. One of `lark` or `regex`. - The type of the web search tool call. Always `web_search_call`. + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `Agent BetaResponseFunctionWebSearchAgent` + - `Type Grammar` - The agent that produced this item. + Grammar format. Always `grammar`. - - `AgentName string` + - `const GrammarGrammar Grammar = "grammar"` - The canonical name of the agent that produced this item. + - `type BetaNamespaceTool struct{…}` - - `type BetaResponseFunctionToolCall struct{…}` + Groups function/custom tools under a shared namespace. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `Description string` - - `Arguments string` + A description of the namespace shown to the model. - A JSON string of the arguments to pass to the function. + - `Name string` - - `CallID string` + The namespace name used in tool calls (for example, `crm`). - The unique ID of the function tool call generated by the model. + - `Tools []BetaNamespaceToolToolUnion` - - `Name string` + The function/custom tools available inside this namespace. - The name of the function to run. + - `type BetaNamespaceToolToolFunction struct{…}` - - `Type FunctionCall` + - `Name string` - The type of the function tool call. Always `function_call`. + - `Type Function` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + - `const FunctionFunction Function = "function"` - - `ID string` + - `AllowedCallers []string` - The unique ID of the function tool call. + The tool invocation context(s). - - `Agent BetaResponseFunctionToolCallAgent` + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - The agent that produced this item. + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `AgentName string` + - `DeferLoading bool` - The canonical name of the agent that produced this item. + Whether this function should be deferred and discovered via tool search. - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `Description string` - The execution context that produced this tool call. + - `OutputSchema map[string, any]` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `Type Direct` + - `Parameters any` - - `const DirectDirect Direct = "direct"` + - `Strict bool` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `CallerID string` + - `type BetaCustomTool struct{…}` - The call ID of the program item that produced this tool call. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Type Program` + - `Type Namespace` - - `const ProgramProgram Program = "program"` + The type of the tool. Always `namespace`. - - `Namespace string` + - `const NamespaceNamespace Namespace = "namespace"` - The namespace of the function to run. + - `type BetaToolSearchTool struct{…}` - - `Status BetaResponseFunctionToolCallStatus` + Hosted or BYOT tool search configuration for deferred tools. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Type ToolSearch` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + The type of the tool. Always `tool_search`. - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `Description string` - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + Description shown to the model for a client-executed tool search tool. - The output of a function tool call. + - `Execution BetaToolSearchToolExecution` - - `CallID string` + Whether tool search is executed by the server or by the client. - The unique ID of the function tool call generated by the model. + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - Text, image, or file output of the function tool call. + - `Parameters any` - - `string` + Parameter schema for a client-executed tool search tool. - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `type BetaWebSearchPreviewTool struct{…}` - An array of content outputs (text, image, file) for the function tool call. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `type BetaResponseInputTextContent struct{…}` + - `Type BetaWebSearchPreviewToolType` - A text input to the model. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `Text string` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - The text input to the model. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `Type InputText` + - `SearchContentTypes []string` - The type of the input item. Always `input_text`. + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `const InputTextInputText InputText = "input_text"` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + 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. - - `Mode Explicit` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - The breakpoint mode. Always `explicit`. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - `type BetaResponseInputImageContent struct{…}` + - `UserLocation BetaWebSearchPreviewToolUserLocation` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + The user's location. - - `Type InputImage` + - `Type Approximate` - The type of the input item. Always `input_image`. + The type of location approximation. Always `approximate`. - - `const InputImageInputImage InputImage = "input_image"` + - `const ApproximateApproximate Approximate = "approximate"` - - `Detail BetaResponseInputImageContentDetail` + - `City string` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + Free text input for the city of the user, e.g. `San Francisco`. - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `Country string` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + - `Region string` - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + Free text input for the region of the user, e.g. `California`. - - `FileID string` + - `Timezone string` - The ID of the file to be sent to the model. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `ImageURL string` + - `type BetaApplyPatchTool struct{…}` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + Allows the assistant to create, delete, or update files using unified diffs. - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `Type ApplyPatch` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The type of the tool. Always `apply_patch`. - - `Mode Explicit` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - The breakpoint mode. Always `explicit`. + - `AllowedCallers []string` - - `const ExplicitExplicit Explicit = "explicit"` + The tool invocation context(s). - - `type BetaResponseInputFileContent struct{…}` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - A file input to the model. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `Type InputFile` + - `Type ToolSearchOutput` - The type of the input item. Always `input_file`. + The type of the item. Always `tool_search_output`. - - `const InputFileInputFile InputFile = "input_file"` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `Detail BetaResponseInputFileContentDetail` + - `Agent BetaResponseToolSearchOutputItemAgent` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + The agent that produced this item. - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `AgentName string` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + The canonical name of the agent that produced this item. - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + - `CreatedBy string` - - `FileData string` + The identifier of the actor that created the item. - The base64-encoded data of the file to be sent to the model. + - `type BetaResponseOutputItemAdditionalTools struct{…}` - - `FileID string` + - `ID string` - The ID of the file to be sent to the model. + The unique ID of the additional tools item. - - `FileURL string` + - `Role string` - The URL of the file to be sent to the model. + The role that provided the additional tools. - - `Filename string` + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - The name of the file to be sent to the model. + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - - `Mode Explicit` + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - The breakpoint mode. Always `explicit`. + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - - `Type FunctionCallOutput` + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - The type of the function tool call output. Always `function_call_output`. + - `Tools []BetaToolUnion` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + The additional tool definitions made available at this item. - - `ID string` + - `type BetaFunctionTool struct{…}` - The unique ID of the function tool call output. Populated when this item is returned via API. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + - `type BetaFileSearchTool struct{…}` - The agent that produced this item. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `AgentName string` + - `type BetaComputerTool struct{…}` - The canonical name of the agent that produced this item. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `type BetaComputerUsePreviewTool struct{…}` - The execution context that produced this tool call. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + - `type BetaWebSearchTool struct{…}` - - `Type Direct` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The caller type. Always `direct`. + - `type BetaToolMcp struct{…}` - - `const DirectDirect Direct = "direct"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + - `type BetaToolCodeInterpreter struct{…}` - - `CallerID string` + A tool that runs Python code to help generate a response to a prompt. - The call ID of the program item that produced this tool call. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Type Program` + - `type BetaToolImageGeneration struct{…}` - The caller type. Always `program`. + A tool that generates images using the GPT image models. - - `const ProgramProgram Program = "program"` + - `type BetaToolLocalShell struct{…}` - - `Status string` + A tool that allows the model to execute shell commands in a local environment. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + - `type BetaFunctionShellTool struct{…}` - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + A tool that allows the model to execute shell commands. - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + - `type BetaCustomTool struct{…}` - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `type BetaResponseInputItemAgentMessage struct{…}` + - `type BetaNamespaceTool struct{…}` - A message routed between agents. + Groups function/custom tools under a shared namespace. - - `Author string` + - `type BetaToolSearchTool struct{…}` - The sending agent identity. + Hosted or BYOT tool search configuration for deferred tools. - - `Content []BetaResponseInputItemAgentMessageContentUnion` + - `type BetaWebSearchPreviewTool struct{…}` - Plaintext, image, or encrypted content sent between agents. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `type BetaResponseInputTextContent struct{…}` + - `type BetaApplyPatchTool struct{…}` - A text input to the model. + Allows the assistant to create, delete, or update files using unified diffs. - - `type BetaResponseInputImageContent struct{…}` + - `Type AdditionalTools` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + The type of the item. Always `additional_tools`. - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `Agent BetaResponseOutputItemAdditionalToolsAgent` - - `EncryptedContent string` + The agent that produced this item. - Opaque encrypted content. + - `AgentName string` - - `Type EncryptedContent` + The canonical name of the agent that produced this item. - The type of the input item. Always `encrypted_content`. + - `type BetaResponseCompactionItem struct{…}` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `Recipient string` + - `ID string` - The destination agent identity. + The unique ID of the compaction item. - - `Type AgentMessage` + - `EncryptedContent string` - The item type. Always `agent_message`. + The encrypted content that was produced by compaction. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `Type Compaction` - - `ID string` + The type of the item. Always `compaction`. - The unique ID of this agent message item. + - `const CompactionCompaction Compaction = "compaction"` - - `Agent BetaResponseInputItemAgentMessageAgent` + - `Agent BetaResponseCompactionItemAgent` The agent that produced this item. @@ -88461,43 +102140,41 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCall struct{…}` - - - `Action string` + - `CreatedBy string` - The multi-agent action that was executed. + The identifier of the actor that created the item. - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + An image generation request made by the model. - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + - `ID string` - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + The unique ID of the image generation call. - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `Result string` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + The generated image encoded in base64. - - `Arguments string` + - `Status string` - The action arguments as a JSON string. + The status of the image generation call. - - `CallID string` + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - The unique ID linking this call to its output. + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - `Type MultiAgentCall` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - The item type. Always `multi_agent_call`. + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `Type ImageGenerationCall` - - `ID string` + The type of the image generation call. Always `image_generation_call`. - The unique ID of this multi-agent call. + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseInputItemMultiAgentCallAgent` + - `Agent BetaResponseOutputItemImageGenerationCallAgent` The agent that produced this item. @@ -88505,129 +102182,142 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `Action string` + A tool call to run code. - The multi-agent action that produced this result. + - `ID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + The unique ID of the code interpreter tool call. - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `Code string` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + The code to run, or null if not available. - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `ContainerID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + The ID of the container used to run the code. - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `CallID string` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - The unique ID of the multi-agent call. + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + The logs output from the code interpreter. - Text output returned by the multi-agent action. + - `Logs string` - - `Text string` + The logs output from the code interpreter. - The text content. + - `Type Logs` - - `Type OutputText` + The type of the output. Always `logs`. - The content type. Always `output_text`. + - `const LogsLogs Logs = "logs"` - - `const OutputTextOutputText OutputText = "output_text"` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + The image output from the code interpreter. - Citations associated with the text content. + - `Type Image` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + The type of the output. Always `image`. - - `FileID string` + - `const ImageImage Image = "image"` - The ID of the file. + - `URL string` - - `Filename string` + The URL of the image output from the code interpreter. - The filename of the file cited. + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `Index int64` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - The index of the file in the list of files. + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `Type FileCitation` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - The citation type. Always `file_citation`. + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `EndIndex int64` + - `Type CodeInterpreterCall` - The index of the last character of the citation in the message. + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `StartIndex int64` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - The index of the first character of the citation in the message. + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `Title string` + The agent that produced this item. - The title of the cited resource. + - `AgentName string` - - `Type URLCitation` + The canonical name of the agent that produced this item. - The citation type. Always `url_citation`. + - `type BetaResponseOutputItemLocalShellCall struct{…}` - - `const URLCitationURLCitation URLCitation = "url_citation"` + A tool call to run a command on the local shell. - - `URL string` + - `ID string` - The URL of the cited resource. + The unique ID of the local shell call. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + - `Action BetaResponseOutputItemLocalShellCallAction` - - `ContainerID string` + Execute a shell command on the server. - The ID of the container. + - `Command []string` - - `EndIndex int64` + The command to run. - The index of the last character of the citation in the message. + - `Env map[string, string]` - - `FileID string` + Environment variables to set for the command. - The ID of the container file. + - `Type Exec` - - `Filename string` + The type of the local shell action. Always `exec`. - The filename of the container file cited. + - `const ExecExec Exec = "exec"` - - `StartIndex int64` + - `TimeoutMs int64` - The index of the first character of the citation in the message. + Optional timeout in milliseconds for the command. - - `Type ContainerFileCitation` + - `User string` - The citation type. Always `container_file_citation`. + Optional user to run the command as. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `WorkingDirectory string` - - `Type MultiAgentCallOutput` + Optional working directory to run the command in. - The item type. Always `multi_agent_call_output`. + - `CallID string` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + The unique ID of the local shell tool call generated by the model. - - `ID string` + - `Status string` - The unique ID of this multi-agent call output. + The status of the local shell call. - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + + - `Type LocalShellCall` + + The type of the local shell call. Always `local_shell_call`. + + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + + - `Agent BetaResponseOutputItemLocalShellCallAgent` The agent that produced this item. @@ -88635,23 +102325,25 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemToolSearchCall struct{…}` + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - `Arguments any` + The output of a local shell tool call. - The arguments supplied to the tool search call. + - `ID string` - - `Type ToolSearchCall` + The unique ID of the local shell tool call generated by the model. - The item type. Always `tool_search_call`. + - `Output string` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + A JSON string of the output of the local shell tool call. - - `ID string` + - `Type LocalShellCallOutput` - The unique ID of this tool search call. + The type of the local shell tool call output. Always `local_shell_call_output`. - - `Agent BetaResponseInputItemToolSearchCallAgent` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` The agent that produced this item. @@ -88659,1260 +102351,1230 @@ func main() { The canonical name of the agent that produced this item. - - `CallID string` + - `Status string` - The unique ID of the tool search call generated by the model. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `Execution string` + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - Whether tool search was executed by the server or by the client. + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + - `type BetaResponseFunctionShellToolCall struct{…}` - - `Status string` + A tool call that executes one or more shell commands in a managed environment. - The status of the tool search call. + - `ID string` - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + The unique ID of the shell tool call. Populated when this item is returned via API. - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + - `Action BetaResponseFunctionShellToolCallAction` - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + The shell commands and limits that describe how to run the tool call. - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + - `Commands []string` - - `Tools []BetaToolUnion` + - `MaxOutputLength int64` - The loaded tool definitions returned by the tool search output. + Optional maximum number of characters to return from each command. - - `type BetaFunctionTool struct{…}` + - `TimeoutMs int64` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + Optional timeout in milliseconds for the commands. - - `Name string` + - `CallID string` - The name of the function to call. + The unique ID of the shell tool call generated by the model. - - `Parameters map[string, any]` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - A JSON schema object describing the parameters of the function. + Represents the use of a local environment to perform shell actions. - - `Strict bool` + - `type BetaResponseLocalEnvironment struct{…}` - Whether strict parameter validation is enforced for this function tool. + Represents the use of a local environment to perform shell actions. - - `Type Function` + - `Type Local` - The type of the function tool. Always `function`. + The environment type. Always `local`. - - `const FunctionFunction Function = "function"` + - `const LocalLocal Local = "local"` - - `AllowedCallers []string` + - `type BetaResponseContainerReference struct{…}` - The tool invocation context(s). + Represents a container created with /v1/containers. - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `ContainerID string` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `Type ContainerReference` - - `DeferLoading bool` + The environment type. Always `container_reference`. - Whether this function is deferred and loaded via tool search. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `Description string` + - `Status BetaResponseFunctionShellToolCallStatus` - A description of the function. Used by the model to determine whether or not to call the function. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `OutputSchema map[string, any]` + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - A JSON schema object describing the JSON value encoded in string outputs for this function. + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - - `type BetaFileSearchTool struct{…}` + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `Type ShellCall` - - `Type FileSearch` + The type of the item. Always `shell_call`. - The type of the file search tool. Always `file_search`. + - `const ShellCallShellCall ShellCall = "shell_call"` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `Agent BetaResponseFunctionShellToolCallAgent` - - `VectorStoreIDs []string` + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseFunctionShellToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` - The IDs of the vector stores to search. + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - - `Filters BetaFileSearchToolFiltersUnion` + - `CallerID string` - A filter to apply. + The call ID of the program item that produced this tool call. - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `Type Program` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `const ProgramProgram Program = "program"` - - `Key string` + - `CreatedBy string` - The key to compare against the value. + The ID of the entity that created this tool call. - - `Type string` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The output of a shell tool call that was emitted. - - `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 + - `ID string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + The unique ID of the shell call output. Populated when this item is returned via API. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `CallID string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + The unique ID of the shell tool call generated by the model. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `MaxOutputLength int64` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + An array of shell call output contents - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - The value to compare against the attribute key; supports string, number, or boolean types. + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - - `string` + Indicates that the shell call exceeded its configured time limit. - - `float64` + - `Type Timeout` - - `bool` + The outcome type. Always `timeout`. - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - Combine multiple filters using `and` or `or`. + Indicates that the shell commands finished and returned an exit code. - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + - `ExitCode int64` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + Exit code from the shell process. - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `Type Exit` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + The outcome type. Always `exit`. - - `Key string` + - `const ExitExit Exit = "exit"` - The key to compare against the value. + - `Stderr string` - - `Type string` + The standard error output that was captured. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `Stdout string` - - `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 + The standard output that was captured. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `CreatedBy string` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + The identifier of the actor that created the item. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `Type ShellCallOutput` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + The type of the shell call output. Always `shell_call_output`. - The value to compare against the attribute key; supports string, number, or boolean types. + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `string` + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - - `float64` + The agent that produced this item. - - `bool` + - `AgentName string` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + The canonical name of the agent that produced this item. - - `Type string` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - Type of operation: `and` or `or`. + The execution context that produced this tool call. - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + - `Type Direct` - - `MaxNumResults int64` + - `const DirectDirect Direct = "direct"` - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - - `RankingOptions BetaFileSearchToolRankingOptions` + - `CallerID string` - Ranking options for search. + The call ID of the program item that produced this tool call. - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `Type Program` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + - `const ProgramProgram Program = "program"` - - `EmbeddingWeight float64` + - `CreatedBy string` - The weight of the embedding in the reciprocal ranking fusion. + The identifier of the actor that created the item. - - `TextWeight float64` + - `type BetaResponseApplyPatchToolCall struct{…}` - The weight of the text in the reciprocal ranking fusion. + A tool call that applies file diffs by creating, deleting, or updating files. - - `Ranker string` + - `ID string` - The ranker to use for the file search. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + - `CallID string` - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + The unique ID of the apply patch tool call generated by the model. - - `ScoreThreshold float64` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - 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. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `type BetaComputerTool struct{…}` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + Instruction describing how to create a file via the apply_patch tool. - - `Type Computer` + - `Diff string` - The type of the computer tool. Always `computer`. + Diff to apply. - - `const ComputerComputer Computer = "computer"` + - `Path string` - - `type BetaComputerUsePreviewTool struct{…}` + Path of the file to create. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Type CreateFile` - - `DisplayHeight int64` + Create a new file with the provided diff. - The height of the computer display. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `DisplayWidth int64` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - The width of the computer display. + Instruction describing how to delete a file via the apply_patch tool. - - `Environment BetaComputerUsePreviewToolEnvironment` + - `Path string` - The type of computer environment to control. + Path of the file to delete. - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `Type DeleteFile` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + Delete the specified file. - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + Instruction describing how to update a file via the apply_patch tool. - - `Type ComputerUsePreview` + - `Diff string` - The type of the computer use tool. Always `computer_use_preview`. + Diff to apply. - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `Path string` - - `type BetaWebSearchTool struct{…}` + Path of the file to update. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Type UpdateFile` - - `Type BetaWebSearchToolType` + Update an existing file with the provided diff. - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `Status BetaResponseApplyPatchToolCallStatus` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `Filters BetaWebSearchToolFilters` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - Filters for the search. + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - `AllowedDomains []string` + - `Type ApplyPatchCall` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + The type of the item. Always `apply_patch_call`. - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + - `Agent BetaResponseApplyPatchToolCallAgent` - 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. + The agent that produced this item. - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `AgentName string` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + The canonical name of the agent that produced this item. - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - `UserLocation BetaWebSearchToolUserLocation` + The execution context that produced this tool call. - The approximate location of the user. + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `City string` + - `Type Direct` - Free text input for the city of the user, e.g. `San Francisco`. + - `const DirectDirect Direct = "direct"` - - `Country string` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `CallerID string` - - `Region string` + The call ID of the program item that produced this tool call. - Free text input for the region of the user, e.g. `California`. + - `Type Program` - - `Timezone string` + - `const ProgramProgram Program = "program"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `CreatedBy string` - - `Type string` + The ID of the entity that created this tool call. - The type of location approximation. Always `approximate`. + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + The output emitted by an apply patch tool call. - - `type BetaToolMcp struct{…}` + - `ID string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `ServerLabel string` + - `CallID string` - A label for this MCP server, used to identify it in tool calls. + The unique ID of the apply patch tool call generated by the model. - - `Type Mcp` + - `Status BetaResponseApplyPatchToolCallOutputStatus` - The type of the MCP tool. Always `mcp`. + The status of the apply patch tool call output. One of `completed` or `failed`. - - `const McpMcp Mcp = "mcp"` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `AllowedCallers []string` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - The tool invocation context(s). + - `Type ApplyPatchCallOutput` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + The type of the item. Always `apply_patch_call_output`. - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - List of allowed tool names or a filter object. + The agent that produced this item. - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `AgentName string` - A string array of allowed tool names + The canonical name of the agent that produced this item. - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - A filter object to specify which tools are allowed. + The execution context that produced this tool call. - - `ReadOnly bool` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Type Direct` - - `ToolNames []string` + - `const DirectDirect Direct = "direct"` - List of allowed tool names. + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - `Authorization string` + - `CallerID 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. + The call ID of the program item that produced this tool call. - - `ConnectorID string` + - `Type Program` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `const ProgramProgram Program = "program"` - Currently supported `connector_id` values are: + - `CreatedBy string` - - 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` + The ID of the entity that created this tool call output. - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + - `Output string` - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + Optional textual output returned by the apply patch tool. - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `type BetaResponseOutputItemMcpCall struct{…}` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + An invocation of a tool on an MCP server. - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `ID string` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + The unique ID of the tool call. - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `Arguments string` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + A JSON string of the arguments passed to the tool. - - `DeferLoading bool` + - `Name string` - Whether this MCP tool is deferred and discovered via tool search. + The name of the tool that was run. - - `Headers map[string, string]` + - `ServerLabel string` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + The label of the MCP server running the tool. - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `Type McpCall` - Specify which of the MCP server's tools require approval. + The type of the item. Always `mcp_call`. - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + - `const McpCallMcpCall McpCall = "mcp_call"` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `Agent BetaResponseOutputItemMcpCallAgent` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + The agent that produced this item. - A filter object to specify which tools are allowed. + - `AgentName string` - - `ReadOnly bool` + The canonical name of the agent that produced this item. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `ApprovalRequestID string` - - `ToolNames []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. - List of allowed tool names. + - `Error string` - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + The error from the tool call, if any. - A filter object to specify which tools are allowed. + - `Output string` - - `ReadOnly bool` + The output from the tool call. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Status string` - - `ToolNames []string` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - List of allowed tool names. + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - 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 BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - `ServerDescription string` + - `type BetaResponseOutputItemMcpListTools struct{…}` - Optional description of the MCP server, used to provide more context. + A list of tools available on an MCP server. - - `ServerURL string` + - `ID string` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + The unique ID of the list. - - `TunnelID string` + - `ServerLabel 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. + The label of the MCP server. - - `type BetaToolCodeInterpreter struct{…}` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - A tool that runs Python code to help generate a response to a prompt. + The tools available on the server. - - `Container BetaToolCodeInterpreterContainerUnion` + - `InputSchema any` - 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. + The JSON schema describing the tool's input. - - `string` + - `Name string` - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + The name of the tool. - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `Annotations any` - - `Type Auto` + Additional annotations about the tool. - Always `auto`. + - `Description string` - - `const AutoAuto Auto = "auto"` + The description of the tool. - - `FileIDs []string` + - `Type McpListTools` - An optional list of uploaded files to make available to your code. + The type of the item. Always `mcp_list_tools`. - - `MemoryLimit string` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - The memory limit for the code interpreter container. + - `Agent BetaResponseOutputItemMcpListToolsAgent` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + The agent that produced this item. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `AgentName string` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + The canonical name of the agent that produced this item. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `Error string` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + Error message if the server could not list tools. - Network access policy for the container. + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + A request for human approval of a tool invocation. - - `Type Disabled` + - `ID string` - Disable outbound network access. Always `disabled`. + The unique ID of the approval request. - - `const DisabledDisabled Disabled = "disabled"` + - `Arguments string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + A JSON string of arguments for the tool. - - `AllowedDomains []string` + - `Name string` - A list of allowed domains when type is `allowlist`. + The name of the tool to run. - - `Type Allowlist` + - `ServerLabel string` - Allow outbound network access only to specified domains. Always `allowlist`. + The label of the MCP server making the request. - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `Type McpApprovalRequest` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + The type of the item. Always `mcp_approval_request`. - Optional domain-scoped secrets for allowlisted domains. + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Domain string` + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` - The domain associated with the secret. + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the secret to inject for the domain. + The canonical name of the agent that produced this item. - - `Value string` + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - The secret value to inject for the domain. + A response to an MCP approval request. - - `Type CodeInterpreter` + - `ID string` - The type of the code interpreter tool. Always `code_interpreter`. + The unique ID of the approval response - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `ApprovalRequestID string` - - `AllowedCallers []string` + The ID of the approval request being answered. - The tool invocation context(s). + - `Approve bool` - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + Whether the request was approved. - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + - `Type McpApprovalResponse` - - `type BetaToolProgrammaticToolCalling struct{…}` + The type of the item. Always `mcp_approval_response`. - - `Type ProgrammaticToolCalling` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - The type of the tool. Always `programmatic_tool_calling`. + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + The agent that produced this item. - - `type BetaToolImageGeneration struct{…}` + - `AgentName string` - A tool that generates images using the GPT image models. + The canonical name of the agent that produced this item. - - `Type ImageGeneration` + - `Reason string` - The type of the image generation tool. Always `image_generation`. + Optional reason for the decision. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `type BetaResponseCustomToolCall struct{…}` - - `Action string` + A call to a custom tool created by the model. - Whether to generate a new image or edit an existing image. Default: `auto`. + - `CallID string` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + An identifier used to map this custom tool call to a tool call output. - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `Input string` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + The input for the custom tool call generated by the model. - - `Background string` + - `Name 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. + The name of the custom tool being called. - `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. + - `Type CustomToolCall` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + The type of the custom tool call. Always `custom_tool_call`. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + - `ID string` - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + The unique ID of the custom tool call in the OpenAI platform. - - `InputFidelity string` + - `Agent BetaResponseCustomToolCallAgent` - 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`. + The agent that produced this item. - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + - `AgentName string` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + The canonical name of the agent that produced this item. - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `Caller BetaResponseCustomToolCallCallerUnion` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + The execution context that produced this tool call. - - `FileID string` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - File ID for the mask image. + - `Type Direct` - - `ImageURL string` + - `const DirectDirect Direct = "direct"` - Base64-encoded mask image. + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `Model string` + - `CallerID string` - The image generation model to use. Default: `gpt-image-1`. + The call ID of the program item that produced this tool call. - - `string` + - `Type Program` - - `string` + - `const ProgramProgram Program = "program"` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + - `Namespace string` - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + The namespace of the custom tool being called. - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + The output of a custom tool call from your code, being sent back to the model. - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + - `ID string` - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + The unique ID of the custom tool call output item. - - `Moderation string` + - `Status string` - Moderation level for the generated image. Default: `auto`. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - - `OutputCompression int64` + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - Compression level for the output image. Default: 100. + - `CreatedBy string` - - `OutputFormat string` + The identifier of the actor that created the item. - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. +### Beta Response Output Item Added Event - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` +- `type BetaResponseOutputItemAddedEvent struct{…}` - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + Emitted when a new output item is added. - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + - `Item BetaResponseOutputItemUnion` - - `PartialImages int64` + The output item that was added. - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `type BetaResponseOutputMessage struct{…}` - - `Quality string` + An output message from the model. - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `ID string` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + The unique ID of the output message. - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + - `Content []BetaResponseOutputMessageContentUnion` - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + The content of the output message. - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + - `type BetaResponseOutputText struct{…}` - - `Size string` + A text output from the model. - 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`. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `string` + The annotations of the text output. - - `string` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + A citation to a file. - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + - `FileID string` - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + The ID of the file. - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + - `Filename string` - - `type BetaToolLocalShell struct{…}` + The filename of the file cited. - A tool that allows the model to execute shell commands in a local environment. + - `Index int64` - - `Type LocalShell` + The index of the file in the list of files. - The type of the local shell tool. Always `local_shell`. + - `Type FileCitation` - - `const LocalShellLocalShell LocalShell = "local_shell"` + The type of the file citation. Always `file_citation`. - - `type BetaFunctionShellTool struct{…}` + - `const FileCitationFileCitation FileCitation = "file_citation"` - A tool that allows the model to execute shell commands. + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - - `Type Shell` + A citation for a web resource used to generate a model response. - The type of the shell tool. Always `shell`. + - `EndIndex int64` - - `const ShellShell Shell = "shell"` + The index of the last character of the URL citation in the message. - - `AllowedCallers []string` + - `StartIndex int64` - The tool invocation context(s). + The index of the first character of the URL citation in the message. - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + - `Title string` - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + The title of the web resource. - - `Environment BetaFunctionShellToolEnvironmentUnion` + - `Type URLCitation` - - `type BetaContainerAuto struct{…}` + The type of the URL citation. Always `url_citation`. - - `Type ContainerAuto` + - `const URLCitationURLCitation URLCitation = "url_citation"` - Automatically creates a container for this request + - `URL string` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + The URL of the web resource. - - `FileIDs []string` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - An optional list of uploaded files to make available to your code. + A citation for a container file used to generate a model response. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `ContainerID string` - The memory limit for the container. + The ID of the container file. - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `EndIndex int64` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The index of the last character of the container file citation in the message. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `FileID string` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + The ID of the file. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `Filename string` - Network access policy for the container. + The filename of the container file cited. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `StartIndex int64` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The index of the first character of the container file citation in the message. - - `Skills []BetaContainerAutoSkillUnion` + - `Type ContainerFileCitation` - An optional list of skills referenced by id or inline data. + The type of the container file citation. Always `container_file_citation`. - - `type BetaSkillReference struct{…}` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `SkillID string` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - The ID of the referenced skill. + A path to a file. - - `Type SkillReference` + - `FileID string` - References a skill created with the /v1/skills endpoint. + The ID of the file. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `Index int64` - - `Version string` + The index of the file in the list of files. - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `Type FilePath` - - `type BetaInlineSkill struct{…}` + The type of the file path. Always `file_path`. - - `Description string` + - `const FilePathFilePath FilePath = "file_path"` - The description of the skill. + - `Text string` - - `Name string` + The text output from the model. - The name of the skill. + - `Type OutputText` - - `Source BetaInlineSkillSource` + The type of the output text. Always `output_text`. - Inline skill payload + - `const OutputTextOutputText OutputText = "output_text"` - - `Data string` + - `Logprobs []BetaResponseOutputTextLogprob` - Base64-encoded skill zip bundle. + - `Token string` - - `MediaType ApplicationZip` + - `Bytes []int64` - The media type of the inline skill payload. Must be `application/zip`. + - `Logprob float64` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - - `Type Base64` + - `Token string` - The type of the inline skill source. Must be `base64`. + - `Bytes []int64` - - `const Base64Base64 Base64 = "base64"` + - `Logprob float64` - - `Type Inline` + - `type BetaResponseOutputRefusal struct{…}` - Defines an inline skill for this request. + A refusal from the model. - - `const InlineInline Inline = "inline"` + - `Refusal string` - - `type BetaLocalEnvironment struct{…}` + The refusal explanation from the model. - - `Type Local` + - `Type Refusal` - Use a local computer environment. + The type of the refusal. Always `refusal`. - - `const LocalLocal Local = "local"` + - `const RefusalRefusal Refusal = "refusal"` - - `Skills []BetaLocalSkill` + - `Role Assistant` - An optional list of skills. + The role of the output message. Always `assistant`. - - `Description string` + - `const AssistantAssistant Assistant = "assistant"` - The description of the skill. + - `Status BetaResponseOutputMessageStatus` - - `Name string` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - The name of the skill. + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `Path string` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - The path to the directory containing the skill. + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `type BetaContainerReference struct{…}` + - `Type Message` - - `ContainerID string` + The type of the output message. Always `message`. - The ID of the referenced container. + - `const MessageMessage Message = "message"` - - `Type ContainerReference` + - `Agent BetaResponseOutputMessageAgent` - References a container created with the /v1/containers endpoint + The agent that produced this item. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `AgentName string` - - `type BetaCustomTool struct{…}` + The canonical name of the agent that produced this item. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Phase BetaResponseOutputMessagePhase` - - `Name string` + 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. - The name of the custom tool, used to identify it in tool calls. + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `Type Custom` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - The type of the custom tool. Always `custom`. + - `type BetaResponseFileSearchToolCall struct{…}` - - `const CustomCustom Custom = "custom"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `AllowedCallers []string` + - `ID string` - The tool invocation context(s). + The unique ID of the file search tool call. - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `Queries []string` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + The queries used to search for files. - - `DeferLoading bool` + - `Status BetaResponseFileSearchToolCallStatus` - Whether this tool should be deferred and discovered via tool search. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `Description string` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - Optional description of the custom tool, used to provide more context. + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `Format BetaCustomToolFormatUnion` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - The input format for the custom tool. Default is unconstrained text. + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `type BetaCustomToolFormatText struct{…}` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - Unconstrained free-form text. + - `Type FileSearchCall` - - `Type Text` + The type of the file search tool call. Always `file_search_call`. - Unconstrained text format. Always `text`. + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - - `const TextText Text = "text"` + - `Agent BetaResponseFileSearchToolCallAgent` - - `type BetaCustomToolFormatGrammar struct{…}` + The agent that produced this item. - A grammar defined by the user. + - `AgentName string` - - `Definition string` + The canonical name of the agent that produced this item. - The grammar definition. + - `Results []BetaResponseFileSearchToolCallResult` - - `Syntax string` + The results of the file search tool call. - The syntax of the grammar definition. One of `lark` or `regex`. + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + 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. - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `string` - - `Type Grammar` + - `float64` - Grammar format. Always `grammar`. + - `bool` - - `const GrammarGrammar Grammar = "grammar"` + - `FileID string` - - `type BetaNamespaceTool struct{…}` + The unique ID of the file. - Groups function/custom tools under a shared namespace. + - `Filename string` - - `Description string` + The name of the file. - A description of the namespace shown to the model. + - `Score float64` - - `Name string` + The relevance score of the file - a value between 0 and 1. - The namespace name used in tool calls (for example, `crm`). + - `Text string` - - `Tools []BetaNamespaceToolToolUnion` + The text that was retrieved from the file. - The function/custom tools available inside this namespace. + - `type BetaResponseFunctionToolCall struct{…}` - - `type BetaNamespaceToolToolFunction struct{…}` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `Name string` + - `Arguments string` - - `Type Function` + A JSON string of the arguments to pass to the function. - - `const FunctionFunction Function = "function"` + - `CallID string` - - `AllowedCallers []string` + The unique ID of the function tool call generated by the model. - The tool invocation context(s). + - `Name string` - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + The name of the function to run. - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `Type FunctionCall` - - `DeferLoading bool` + The type of the function tool call. Always `function_call`. - Whether this function should be deferred and discovered via tool search. + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `Description string` + - `ID string` - - `OutputSchema map[string, any]` + The unique ID of the function tool call. - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `Agent BetaResponseFunctionToolCallAgent` - - `Parameters any` + The agent that produced this item. - - `Strict bool` + - `AgentName string` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + The canonical name of the agent that produced this item. - - `type BetaCustomTool struct{…}` + - `Caller BetaResponseFunctionToolCallCallerUnion` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The execution context that produced this tool call. - - `Type Namespace` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - The type of the tool. Always `namespace`. + - `Type Direct` - - `const NamespaceNamespace Namespace = "namespace"` + - `const DirectDirect Direct = "direct"` - - `type BetaToolSearchTool struct{…}` + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - Hosted or BYOT tool search configuration for deferred tools. + - `CallerID string` - - `Type ToolSearch` + The call ID of the program item that produced this tool call. - The type of the tool. Always `tool_search`. + - `Type Program` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `const ProgramProgram Program = "program"` - - `Description string` + - `Namespace string` - Description shown to the model for a client-executed tool search tool. + The namespace of the function to run. - - `Execution BetaToolSearchToolExecution` + - `Status BetaResponseFunctionToolCallStatus` - Whether tool search is executed by the server or by the client. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `Parameters any` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - Parameter schema for a client-executed tool search tool. + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `type BetaWebSearchPreviewTool struct{…}` + - `ID string` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The unique ID of the function call tool output. - - `Type BetaWebSearchPreviewToolType` + - `CallID string` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + The unique ID of the function tool call generated by the model. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + The output from the function call generated by your code. + Can be a string or an list of output content. - - `SearchContentTypes []string` + - `string` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + Text, image, or file output of the function call. - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `type BetaResponseInputText struct{…}` - 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. + A text input to the model. - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `Text string` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + The text input to the model. - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `Type InputText` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + The type of the input item. Always `input_text`. - The user's location. + - `const InputTextInputText InputText = "input_text"` - - `Type Approximate` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - The type of location approximation. Always `approximate`. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const ApproximateApproximate Approximate = "approximate"` + - `Mode Explicit` - - `City string` + The breakpoint mode. Always `explicit`. - Free text input for the city of the user, e.g. `San Francisco`. + - `const ExplicitExplicit Explicit = "explicit"` - - `Country string` + - `type BetaResponseInputImage struct{…}` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Region string` + - `Detail BetaResponseInputImageDetail` - Free text input for the region of the user, e.g. `California`. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `Timezone string` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `type BetaApplyPatchTool struct{…}` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - Allows the assistant to create, delete, or update files using unified diffs. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `Type ApplyPatch` + - `Type InputImage` - The type of the tool. Always `apply_patch`. + The type of the input item. Always `input_image`. - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `const InputImageInputImage InputImage = "input_image"` - - `AllowedCallers []string` + - `FileID string` - The tool invocation context(s). + The ID of the file to be sent to the model. - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `ImageURL string` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `Type ToolSearchOutput` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - The item type. Always `tool_search_output`. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `Mode Explicit` - - `ID string` + The breakpoint mode. Always `explicit`. - The unique ID of this tool search output. + - `const ExplicitExplicit Explicit = "explicit"` - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - `type BetaResponseInputFile struct{…}` - The agent that produced this item. + A file input to the model. - - `AgentName string` + - `Type InputFile` - The canonical name of the agent that produced this item. + The type of the input item. Always `input_file`. - - `CallID string` + - `const InputFileInputFile InputFile = "input_file"` - The unique ID of the tool search call generated by the model. + - `Detail BetaResponseInputFileDetail` - - `Execution BetaResponseToolSearchOutputItemParamExecution` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - Whether tool search was executed by the server or by the client. + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `Status BetaResponseToolSearchOutputItemParamStatus` + - `FileData string` - The status of the tool search output. + The content of the file to be sent to the model. - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + - `FileID string` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + The ID of the file to be sent to the model. - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `FileURL string` - - `type BetaResponseInputItemAdditionalTools struct{…}` + The URL of the file to be sent to the model. - - `Role Developer` + - `Filename string` - The role that provided the additional tools. Only `developer` is supported. + The name of the file to be sent to the model. - - `const DeveloperDeveloper Developer = "developer"` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `Tools []BetaToolUnion` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A list of additional tools made available at this item. + - `Mode Explicit` - - `type BetaFunctionTool struct{…}` + The breakpoint mode. Always `explicit`. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaFileSearchTool struct{…}` + - `Status BetaResponseFunctionToolCallOutputItemStatus` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `type BetaComputerTool struct{…}` + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Type FunctionCallOutput` - - `type BetaWebSearchTool struct{…}` + The type of the function tool call output. Always `function_call_output`. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `type BetaToolMcp struct{…}` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The agent that produced this item. - - `type BetaToolCodeInterpreter struct{…}` + - `AgentName string` - A tool that runs Python code to help generate a response to a prompt. + The canonical name of the agent that produced this item. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - `type BetaToolImageGeneration struct{…}` + The execution context that produced this tool call. - A tool that generates images using the GPT image models. + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - `type BetaToolLocalShell struct{…}` + - `Type Direct` - A tool that allows the model to execute shell commands in a local environment. + The caller type. Always `direct`. - - `type BetaFunctionShellTool struct{…}` + - `const DirectDirect Direct = "direct"` - A tool that allows the model to execute shell commands. + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - - `type BetaCustomTool struct{…}` + - `CallerID string` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The call ID of the program item that produced this tool call. - - `type BetaNamespaceTool struct{…}` + - `Type Program` - Groups function/custom tools under a shared namespace. + The caller type. Always `program`. - - `type BetaToolSearchTool struct{…}` + - `const ProgramProgram Program = "program"` - Hosted or BYOT tool search configuration for deferred tools. + - `CreatedBy string` - - `type BetaWebSearchPreviewTool struct{…}` + The identifier of the actor that created the item. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `type BetaResponseOutputItemAgentMessage struct{…}` - - `type BetaApplyPatchTool struct{…}` + - `ID string` - Allows the assistant to create, delete, or update files using unified diffs. + The unique ID of the agent message. - - `Type AdditionalTools` + - `Author string` - The item type. Always `additional_tools`. + The sending agent identity. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - - `ID string` + Encrypted content sent between agents. - The unique ID of this additional tools item. + - `type BetaResponseInputText struct{…}` - - `Agent BetaResponseInputItemAdditionalToolsAgent` + A text input to the model. - The agent that produced this item. + - `type BetaResponseOutputText struct{…}` - - `AgentName string` + A text output from the model. - The canonical name of the agent that produced this item. + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - - `type BetaResponseReasoningItem struct{…}` + A text content. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `Text string` - - `ID string` + - `Type Text` - The unique identifier of the reasoning content. + - `const TextText Text = "text"` - - `Summary []BetaResponseReasoningItemSummary` + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - Reasoning summary content. + A summary text from the model. - `Text string` @@ -89924,23 +103586,9 @@ func main() { - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `Type Reasoning` - - The type of the object. Always `reasoning`. - - - `const ReasoningReasoning Reasoning = "reasoning"` - - - `Agent BetaResponseReasoningItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Content []BetaResponseReasoningItemContent` + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - Reasoning text content. + Reasoning text from the model. - `Text string` @@ -89952,79 +103600,83 @@ func main() { - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `EncryptedContent string` + - `type BetaResponseOutputRefusal struct{…}` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + A refusal from the model. - - `Status BetaResponseReasoningItemStatus` + - `type BetaResponseInputImage struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + A screenshot of a computer. - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + - `Detail string` - - `type BetaResponseCompactionItemParamResp struct{…}` + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - - `EncryptedContent string` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - The encrypted content of the compaction summary. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `Type Compaction` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - The type of the item. Always `compaction`. + - `FileID string` - - `const CompactionCompaction Compaction = "compaction"` + The identifier of an uploaded file that contains the screenshot. - - `ID string` + - `ImageURL string` - The ID of the compaction item. + The URL of the screenshot image. - - `Agent BetaResponseCompactionItemParamAgentResp` + - `Type ComputerScreenshot` - The agent that produced this item. + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `AgentName string` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - The canonical name of the agent that produced this item. + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - - `type BetaResponseInputItemImageGenerationCall struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - An image generation request made by the model. + - `Mode Explicit` - - `ID string` + The breakpoint mode. Always `explicit`. - The unique ID of the image generation call. + - `const ExplicitExplicit Explicit = "explicit"` - - `Result string` + - `type BetaResponseInputFile struct{…}` - The generated image encoded in base64. + A file input to the model. - - `Status string` + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - The status of the image generation call. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `EncryptedContent string` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + Opaque encrypted content. - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + - `Type EncryptedContent` - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + The type of the input item. Always `encrypted_content`. - - `Type ImageGenerationCall` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - The type of the image generation call. Always `image_generation_call`. + - `Recipient string` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + The destination agent identity. - - `Agent BetaResponseInputItemImageGenerationCallAgent` + - `Type AgentMessage` + + The type of the item. Always `agent_message`. + + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + + - `Agent BetaResponseOutputItemAgentMessageAgent` The agent that produced this item. @@ -90032,654 +103684,673 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCall struct{…}` - - A tool call to run code. + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - `ID string` - The unique ID of the code interpreter tool call. + The unique ID of the multi-agent call item. - - `Code string` + - `Action string` - The code to run, or null if not available. + The multi-agent action to execute. - - `ContainerID string` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - The ID of the container used to run the code. + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - The logs output from the code interpreter. + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - - `Logs string` + - `Arguments string` - The logs output from the code interpreter. + The JSON string of arguments generated for the action. - - `Type Logs` + - `CallID string` - The type of the output. Always `logs`. + The unique ID linking this call to its output. - - `const LogsLogs Logs = "logs"` + - `Type MultiAgentCall` - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + The type of the multi-agent call. Always `multi_agent_call`. - The image output from the code interpreter. + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `Type Image` + - `Agent BetaResponseOutputItemMultiAgentCallAgent` - The type of the output. Always `image`. + The agent that produced this item. - - `const ImageImage Image = "image"` + - `AgentName string` - - `URL string` + The canonical name of the agent that produced this item. - The URL of the image output from the code interpreter. + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - - `Status BetaResponseCodeInterpreterToolCallStatus` + - `ID string` - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + The unique ID of the multi-agent call output item. - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + - `Action string` - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + The multi-agent action that produced this result. - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `Type CodeInterpreterCall` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - - `Agent BetaResponseCodeInterpreterToolCallAgent` + - `CallID string` - The agent that produced this item. + The unique ID of the multi-agent call. - - `AgentName string` + - `Output []BetaResponseOutputText` - The canonical name of the agent that produced this item. + Text output returned by the multi-agent action. - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - A tool call to run a command on the local shell. + The annotations of the text output. - - `ID string` + - `Text string` - The unique ID of the local shell call. + The text output from the model. - - `Action BetaResponseInputItemLocalShellCallAction` + - `Type OutputText` - Execute a shell command on the server. + The type of the output text. Always `output_text`. - - `Command []string` + - `Logprobs []BetaResponseOutputTextLogprob` - The command to run. + - `Type MultiAgentCallOutput` - - `Env map[string, string]` + The type of the multi-agent result. Always `multi_agent_call_output`. - Environment variables to set for the command. + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `Type Exec` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` - The type of the local shell action. Always `exec`. + The agent that produced this item. - - `const ExecExec Exec = "exec"` + - `AgentName string` - - `TimeoutMs int64` + The canonical name of the agent that produced this item. - Optional timeout in milliseconds for the command. + - `type BetaResponseFunctionWebSearch struct{…}` - - `User string` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - Optional user to run the command as. + - `ID string` - - `WorkingDirectory string` + The unique ID of the web search tool call. - Optional working directory to run the command in. + - `Action BetaResponseFunctionWebSearchActionUnion` - - `CallID string` + 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). - The unique ID of the local shell tool call generated by the model. + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - - `Status string` + Action type "search" - Performs a web search query. - The status of the local shell call. + - `Type Search` - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + The action type. - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + - `const SearchSearch Search = "search"` - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `Queries []string` - - `Type LocalShellCall` + The search queries. - The type of the local shell call. Always `local_shell_call`. + - `Query string` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + The search query. - - `Agent BetaResponseInputItemLocalShellCallAgent` + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - The agent that produced this item. + The sources used in the search. - - `AgentName string` + - `Type URL` - The canonical name of the agent that produced this item. + The type of source. Always `url`. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `const URLURL URL = "url"` - The output of a local shell tool call. + - `URL string` - - `ID string` + The URL of the source. - The unique ID of the local shell tool call generated by the model. + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `Output string` + Action type "open_page" - Opens a specific URL from search results. - A JSON string of the output of the local shell tool call. + - `Type OpenPage` - - `Type LocalShellCallOutput` + The action type. - The type of the local shell tool call output. Always `local_shell_call_output`. + - `const OpenPageOpenPage OpenPage = "open_page"` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `URL string` - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + The URL opened by the model. - The agent that produced this item. + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - - `AgentName string` + Action type "find_in_page": Searches for a pattern within a loaded page. - The canonical name of the agent that produced this item. + - `Pattern string` - - `Status string` + The pattern or text to search for within the page. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `Type FindInPage` - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + The action type. - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `URL string` - - `type BetaResponseInputItemShellCall struct{…}` + The URL of the page searched for the pattern. - A tool representing a request to execute one or more shell commands. + - `Status BetaResponseFunctionWebSearchStatus` - - `Action BetaResponseInputItemShellCallAction` + The status of the web search tool call. - The shell commands and limits that describe how to run the tool call. + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - - `Commands []string` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - Ordered shell commands for the execution environment to run. + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - - `MaxOutputLength int64` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + - `Type WebSearchCall` - - `TimeoutMs int64` + The type of the web search tool call. Always `web_search_call`. - Maximum wall-clock time in milliseconds to allow the shell commands to run. + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `CallID string` + - `Agent BetaResponseFunctionWebSearchAgent` - The unique ID of the shell tool call generated by the model. + The agent that produced this item. - - `Type ShellCall` + - `AgentName string` - The type of the item. Always `shell_call`. + The canonical name of the agent that produced this item. - - `const ShellCallShellCall ShellCall = "shell_call"` + - `type BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - `ID string` - The unique ID of the shell tool call. Populated when this item is returned via API. + The unique ID of the computer call. - - `Agent BetaResponseInputItemShellCallAgent` + - `CallID string` - The agent that produced this item. + An identifier used when responding to the tool call with output. - - `AgentName string` + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - The canonical name of the agent that produced this item. + The pending safety checks for the computer call. - - `Caller BetaResponseInputItemShellCallCallerUnion` + - `ID string` - The execution context that produced this tool call. + The ID of the pending safety check. - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + - `Code string` - - `Type Direct` + The type of the pending safety check. - The caller type. Always `direct`. + - `Message string` - - `const DirectDirect Direct = "direct"` + Details about the pending safety check. - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `Status BetaResponseComputerToolCallStatus` - - `CallerID string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The call ID of the program item that produced this tool call. + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `Type Program` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - The caller type. Always `program`. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `const ProgramProgram Program = "program"` + - `Type BetaResponseComputerToolCallType` - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + The type of the computer call. Always `computer_call`. - The environment to execute the shell commands in. + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `type BetaLocalEnvironment struct{…}` + - `Action BetaComputerActionUnion` - - `type BetaContainerReference struct{…}` + A click action. - - `Status string` + - `type BetaComputerActionClick struct{…}` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + A click action. - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + - `Button string` - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - The streamed output items emitted by a shell tool call. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `CallID string` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - The unique ID of the shell tool call generated by the model. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `Output []BetaResponseFunctionShellCallOutputContent` + - `Type Click` - Captured chunks of stdout and stderr output, along with their associated outcomes. + Specifies the event type. For a click action, this property is always `click`. - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + - `const ClickClick Click = "click"` - The exit or timeout outcome associated with this shell call. + - `X int64` - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + The x-coordinate where the click occurred. - Indicates that the shell call exceeded its configured time limit. + - `Y int64` - - `Type Timeout` + The y-coordinate where the click occurred. - The outcome type. Always `timeout`. + - `Keys []string` - - `const TimeoutTimeout Timeout = "timeout"` + The keys being held while clicking. - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + - `type BetaComputerActionDoubleClick struct{…}` - Indicates that the shell commands finished and returned an exit code. + A double click action. - - `ExitCode int64` + - `Keys []string` - The exit code returned by the shell process. + The keys being held while double-clicking. - - `Type Exit` + - `Type DoubleClick` - The outcome type. Always `exit`. + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `const ExitExit Exit = "exit"` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `Stderr string` + - `X int64` - Captured stderr output for the shell call. + The x-coordinate where the double click occurred. - - `Stdout string` + - `Y int64` - Captured stdout output for the shell call. + The y-coordinate where the double click occurred. - - `Type ShellCallOutput` + - `type BetaComputerActionDrag struct{…}` - The type of the item. Always `shell_call_output`. + A drag action. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `Path []BetaComputerActionDragPath` - - `ID string` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - The unique ID of the shell tool call output. Populated when this item is returned via API. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `X int64` - The agent that produced this item. + The x-coordinate. - - `AgentName string` + - `Y int64` - The canonical name of the agent that produced this item. + The y-coordinate. - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + - `Type Drag` - The execution context that produced this tool call. + Specifies the event type. For a drag action, this property is always set to `drag`. - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + - `const DragDrag Drag = "drag"` - - `Type Direct` + - `Keys []string` - The caller type. Always `direct`. + The keys being held while dragging the mouse. - - `const DirectDirect Direct = "direct"` + - `type BetaComputerActionKeypress struct{…}` - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + A collection of keypresses the model would like to perform. - - `CallerID string` + - `Keys []string` - The call ID of the program item that produced this tool call. + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `Type Program` + - `Type Keypress` - The caller type. Always `program`. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `const ProgramProgram Program = "program"` + - `const KeypressKeypress Keypress = "keypress"` - - `MaxOutputLength int64` + - `type BetaComputerActionMove struct{…}` - The maximum number of UTF-8 characters captured for this shell call's combined output. + A mouse move action. - - `Status string` + - `Type Move` - The status of the shell call output. + Specifies the event type. For a move action, this property is always set to `move`. - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + - `const MoveMove Move = "move"` - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + - `X int64` - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + The x-coordinate to move to. - - `type BetaResponseInputItemApplyPatchCall struct{…}` + - `Y int64` - A tool call representing a request to create, delete, or update files using diff patches. + The y-coordinate to move to. - - `CallID string` + - `Keys []string` - The unique ID of the apply patch tool call generated by the model. + The keys being held while moving the mouse. - - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + - `type BetaComputerActionScreenshot struct{…}` - The specific create, delete, or update instruction for the apply_patch tool call. + A screenshot action. - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + - `Type Screenshot` - Instruction for creating a new file via the apply_patch tool. + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `Diff string` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - Unified diff content to apply when creating the file. + - `type BetaComputerActionScroll struct{…}` - - `Path string` + A scroll action. - Path of the file to create relative to the workspace root. + - `ScrollX int64` - - `Type CreateFile` + The horizontal scroll distance. - The operation type. Always `create_file`. + - `ScrollY int64` - - `const CreateFileCreateFile CreateFile = "create_file"` + The vertical scroll distance. - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + - `Type Scroll` - Instruction for deleting an existing file via the apply_patch tool. + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `Path string` + - `const ScrollScroll Scroll = "scroll"` - Path of the file to delete relative to the workspace root. + - `X int64` - - `Type DeleteFile` + The x-coordinate where the scroll occurred. - The operation type. Always `delete_file`. + - `Y int64` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + The y-coordinate where the scroll occurred. - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + - `Keys []string` - Instruction for updating an existing file via the apply_patch tool. + The keys being held while scrolling. - - `Diff string` + - `type BetaComputerActionType struct{…}` - Unified diff content to apply to the existing file. + An action to type in text. - - `Path string` + - `Text string` - Path of the file to update relative to the workspace root. + The text to type. - - `Type UpdateFile` + - `Type Type` - The operation type. Always `update_file`. + Specifies the event type. For a type action, this property is always set to `type`. - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `const TypeType Type = "type"` - - `Status string` + - `type BetaComputerActionWait struct{…}` - The status of the apply patch tool call. One of `in_progress` or `completed`. + A wait action. - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + - `Type Wait` - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + Specifies the event type. For a wait action, this property is always set to `wait`. - - `Type ApplyPatchCall` + - `const WaitWait Wait = "wait"` - The type of the item. Always `apply_patch_call`. + - `Actions BetaComputerActionList` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `ID string` + - `type BetaComputerActionClick struct{…}` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + A click action. - - `Agent BetaResponseInputItemApplyPatchCallAgent` + - `type BetaComputerActionDoubleClick struct{…}` - The agent that produced this item. + A double click action. - - `AgentName string` + - `type BetaComputerActionDrag struct{…}` - The canonical name of the agent that produced this item. + A drag action. - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + - `type BetaComputerActionKeypress struct{…}` - The execution context that produced this tool call. + A collection of keypresses the model would like to perform. - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + - `type BetaComputerActionMove struct{…}` - - `Type Direct` + A mouse move action. - The caller type. Always `direct`. + - `type BetaComputerActionScreenshot struct{…}` - - `const DirectDirect Direct = "direct"` + A screenshot action. - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `type BetaComputerActionScroll struct{…}` - - `CallerID string` + A scroll action. - The call ID of the program item that produced this tool call. + - `type BetaComputerActionType struct{…}` - - `Type Program` + An action to type in text. - The caller type. Always `program`. + - `type BetaComputerActionWait struct{…}` - - `const ProgramProgram Program = "program"` + A wait action. - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `Agent BetaResponseComputerToolCallAgent` - The streamed output emitted by an apply patch tool call. + The agent that produced this item. - - `CallID string` + - `AgentName string` - The unique ID of the apply patch tool call generated by the model. + The canonical name of the agent that produced this item. - - `Status string` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `ID string` - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + The unique ID of the computer call tool output. - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + - `CallID string` - - `Type ApplyPatchCallOutput` + The ID of the computer tool call that produced the output. - The type of the item. Always `apply_patch_call_output`. + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + A computer screenshot image used with the computer use tool. - - `ID string` + - `Type ComputerScreenshot` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - The agent that produced this item. + - `FileID string` - - `AgentName string` + The identifier of an uploaded file that contains the screenshot. - The canonical name of the agent that produced this item. + - `ImageURL string` - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + The URL of the screenshot image. - The execution context that produced this tool call. + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `Type Direct` + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - The caller type. Always `direct`. + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - - `const DirectDirect Direct = "direct"` + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - `CallerID string` + - `Type ComputerCallOutput` - The call ID of the program item that produced this tool call. + The type of the computer tool call output. Always `computer_call_output`. - - `Type Program` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - The caller type. Always `program`. + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `const ProgramProgram Program = "program"` + The safety checks reported by the API that have been acknowledged by the + developer. - - `Output string` + - `ID string` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + The ID of the pending safety check. - - `type BetaResponseInputItemMcpListTools struct{…}` + - `Code string` - A list of tools available on an MCP server. + The type of the pending safety check. - - `ID string` + - `Message string` - The unique ID of the list. + Details about the pending safety check. - - `ServerLabel string` + - `Agent BetaResponseComputerToolCallOutputItemAgent` - The label of the MCP server. + The agent that produced this item. - - `Tools []BetaResponseInputItemMcpListToolsTool` + - `AgentName string` - The tools available on the server. + The canonical name of the agent that produced this item. - - `InputSchema any` + - `CreatedBy string` - The JSON schema describing the tool's input. + The identifier of the actor that created the item. - - `Name string` + - `type BetaResponseReasoningItem struct{…}` - The name of the tool. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `Annotations any` + - `ID string` - Additional annotations about the tool. + The unique identifier of the reasoning content. - - `Description string` + - `Summary []BetaResponseReasoningItemSummary` - The description of the tool. + Reasoning summary content. - - `Type McpListTools` + - `Text string` - The type of the item. Always `mcp_list_tools`. + A summary of the reasoning output from the model so far. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `Type SummaryText` - - `Agent BetaResponseInputItemMcpListToolsAgent` + The type of the object. Always `summary_text`. - The agent that produced this item. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `AgentName string` + - `Type Reasoning` - The canonical name of the agent that produced this item. + The type of the object. Always `reasoning`. - - `Error string` + - `const ReasoningReasoning Reasoning = "reasoning"` - Error message if the server could not list tools. + - `Agent BetaResponseReasoningItemAgent` - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + The agent that produced this item. - A request for human approval of a tool invocation. + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - The unique ID of the approval request. + - `Content []BetaResponseReasoningItemContent` - - `Arguments string` + Reasoning text content. - A JSON string of arguments for the tool. + - `Text string` - - `Name string` + The reasoning text from the model. - The name of the tool to run. + - `Type ReasoningText` - - `ServerLabel string` + The type of the reasoning text. Always `reasoning_text`. - The label of the MCP server making the request. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `Type McpApprovalRequest` + - `EncryptedContent string` - The type of the item. Always `mcp_approval_request`. + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `Status BetaResponseReasoningItemStatus` - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The agent that produced this item. + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - `AgentName string` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - The canonical name of the agent that produced this item. + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - `type BetaResponseOutputItemProgram struct{…}` - A response to an MCP approval request. + - `ID string` - - `ApprovalRequestID string` + The unique ID of the program item. - The ID of the approval request being answered. + - `CallID string` - - `Approve bool` + The stable call ID of the program item. - Whether the request was approved. + - `Code string` - - `Type McpApprovalResponse` + The JavaScript source executed by programmatic tool calling. - The type of the item. Always `mcp_approval_response`. + - `Fingerprint string` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + Opaque program replay fingerprint that must be round-tripped. - - `ID string` + - `Type Program` - The unique ID of the approval response + The type of the item. Always `program`. - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseOutputItemProgramAgent` The agent that produced this item. @@ -90687,37 +104358,35 @@ func main() { The canonical name of the agent that produced this item. - - `Reason string` - - Optional reason for the decision. + - `type BetaResponseOutputItemProgramOutput struct{…}` - - `type BetaResponseInputItemMcpCall struct{…}` + - `ID string` - An invocation of a tool on an MCP server. + The unique ID of the program output item. - - `ID string` + - `CallID string` - The unique ID of the tool call. + The call ID of the program item. - - `Arguments string` + - `Result string` - A JSON string of the arguments passed to the tool. + The result produced by the program item. - - `Name string` + - `Status string` - The name of the tool that was run. + The terminal status of the program output item. - - `ServerLabel string` + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - The label of the MCP server running the tool. + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - `Type McpCall` + - `Type ProgramOutput` - The type of the item. Always `mcp_call`. + The type of the item. Always `program_output`. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `Agent BetaResponseInputItemMcpCallAgent` + - `Agent BetaResponseOutputItemProgramOutputAgent` The agent that produced this item. @@ -90725,1142 +104394,1173 @@ func main() { The canonical name of the agent that produced this item. - - `ApprovalRequestID string` + - `type BetaResponseToolSearchCall struct{…}` - 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. + - `ID string` - - `Error string` + The unique ID of the tool search call item. - The error from the tool call, if any. + - `Arguments any` - - `Output string` + Arguments used for the tool search call. - The output from the tool call. + - `CallID string` - - `Status string` + The unique ID of the tool search call generated by the model. - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `Execution BetaResponseToolSearchCallExecution` - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + Whether tool search was executed by the server or by the client. - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + - `Status BetaResponseToolSearchCallStatus` - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + The status of the tool search call item that was recorded. - - `type BetaResponseCustomToolCallOutput struct{…}` + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - The output of a custom tool call from your code, being sent back to the model. + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - `CallID string` + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - The call ID, used to map this custom tool call output to a custom tool call. + - `Type ToolSearchCall` - - `Output BetaResponseCustomToolCallOutputOutputUnion` + The type of the item. Always `tool_search_call`. - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `string` + - `Agent BetaResponseToolSearchCallAgent` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + The agent that produced this item. - Text, image, or file output of the custom tool call. + - `AgentName string` - - `type BetaResponseInputText struct{…}` + The canonical name of the agent that produced this item. - A text input to the model. + - `CreatedBy string` - - `type BetaResponseInputImage struct{…}` + The identifier of the actor that created the item. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `type BetaResponseToolSearchOutputItem struct{…}` - - `type BetaResponseInputFile struct{…}` + - `ID string` - A file input to the model. + The unique ID of the tool search output item. - - `Type CustomToolCallOutput` + - `CallID string` + + The unique ID of the tool search call generated by the model. + + - `Execution BetaResponseToolSearchOutputItemExecution` + + Whether tool search was executed by the server or by the client. - The type of the custom tool call output. Always `custom_tool_call_output`. + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - - `ID string` + - `Status BetaResponseToolSearchOutputItemStatus` - The unique ID of the custom tool call output in the OpenAI platform. + The status of the tool search output item that was recorded. - - `Agent BetaResponseCustomToolCallOutputAgent` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - The agent that produced this item. + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - `AgentName string` + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - The canonical name of the agent that produced this item. + - `Tools []BetaToolUnion` - - `Caller BetaResponseCustomToolCallOutputCallerUnion` + The loaded tool definitions returned by tool search. - The execution context that produced this tool call. + - `type BetaFunctionTool struct{…}` - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Type Direct` + - `Name string` - The caller type. Always `direct`. + The name of the function to call. - - `const DirectDirect Direct = "direct"` + - `Parameters map[string, any]` - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + A JSON schema object describing the parameters of the function. - - `CallerID string` + - `Strict bool` - The call ID of the program item that produced this tool call. + Whether strict parameter validation is enforced for this function tool. - - `Type Program` + - `Type Function` - The caller type. Always `program`. + The type of the function tool. Always `function`. - - `const ProgramProgram Program = "program"` + - `const FunctionFunction Function = "function"` - - `type BetaResponseCustomToolCall struct{…}` + - `AllowedCallers []string` - A call to a custom tool created by the model. + The tool invocation context(s). - - `CallID string` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - An identifier used to map this custom tool call to a tool call output. + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - - `Input string` + - `DeferLoading bool` - The input for the custom tool call generated by the model. + Whether this function is deferred and loaded via tool search. - - `Name string` + - `Description string` - The name of the custom tool being called. + A description of the function. Used by the model to determine whether or not to call the function. - - `Type CustomToolCall` + - `OutputSchema map[string, any]` - The type of the custom tool call. Always `custom_tool_call`. + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `type BetaFileSearchTool struct{…}` - - `ID string` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The unique ID of the custom tool call in the OpenAI platform. + - `Type FileSearch` - - `Agent BetaResponseCustomToolCallAgent` + The type of the file search tool. Always `file_search`. - The agent that produced this item. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `AgentName string` + - `VectorStoreIDs []string` - The canonical name of the agent that produced this item. + The IDs of the vector stores to search. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `Filters BetaFileSearchToolFiltersUnion` - The execution context that produced this tool call. + A filter to apply. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `Type Direct` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const DirectDirect Direct = "direct"` + - `Key string` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + The key to compare against the value. - - `CallerID string` + - `Type string` - The call ID of the program item that produced this tool call. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `Type Program` + - `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 ProgramProgram Program = "program"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `Namespace string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - The namespace of the custom tool being called. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - Compacts the current context. Must be the final input item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Type CompactionTrigger` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The type of the item. Always `compaction_trigger`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `Agent BetaResponseInputItemCompactionTriggerAgent` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - The agent that produced this item. + The value to compare against the attribute key; supports string, number, or boolean types. - - `AgentName string` + - `string` - The canonical name of the agent that produced this item. + - `float64` - - `type BetaResponseInputItemItemReference struct{…}` + - `bool` - An internal identifier for an item to reference. + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `ID string` + - `string` - The ID of the item to reference. + - `float64` - - `Agent BetaResponseInputItemItemReferenceAgent` + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - The agent that produced this item. + Combine multiple filters using `and` or `or`. - - `AgentName string` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - The canonical name of the agent that produced this item. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `Type string` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - The type of item to reference. Always `item_reference`. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + - `Key string` - - `type BetaResponseInputItemProgram struct{…}` + The key to compare against the value. - - `ID string` + - `Type string` - The unique ID of this program item. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `CallID string` + - `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 - The stable call ID of the program item. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `Code string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - The JavaScript source executed by programmatic tool calling. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `Fingerprint string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - Opaque program replay fingerprint that must be round-tripped. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `Type Program` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - The item type. Always `program`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - `const ProgramProgram Program = "program"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `Agent BetaResponseInputItemProgramAgent` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - The agent that produced this item. + The value to compare against the attribute key; supports string, number, or boolean types. - - `AgentName string` + - `string` - The canonical name of the agent that produced this item. + - `float64` - - `type BetaResponseInputItemProgramOutput struct{…}` + - `bool` - - `ID string` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - The unique ID of this program output item. + - `string` - - `CallID string` + - `float64` - The call ID of the program item. + - `Type string` - - `Result string` + Type of operation: `and` or `or`. - The result produced by the program item. + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `Status string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - The terminal status of the program output. + - `MaxNumResults int64` - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + - `RankingOptions BetaFileSearchToolRankingOptions` - - `Type ProgramOutput` + Ranking options for search. - The item type. Always `program_output`. + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `Agent BetaResponseInputItemProgramOutputAgent` + - `EmbeddingWeight float64` - The agent that produced this item. + The weight of the embedding in the reciprocal ranking fusion. - - `AgentName string` + - `TextWeight float64` - The canonical name of the agent that produced this item. + The weight of the text in the reciprocal ranking fusion. - - `Metadata map[string, string]` + - `Ranker string` - 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. + The ranker to use for the file search. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `Model BetaResponseModel` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `ScoreThreshold float64` - - `type BetaResponseModel string` + 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. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `type BetaComputerTool struct{…}` - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + - `Type Computer` - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + The type of the computer tool. Always `computer`. - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + - `const ComputerComputer Computer = "computer"` - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + - `DisplayHeight int64` - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + The height of the computer display. - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + - `DisplayWidth int64` - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + The width of the computer display. - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + - `Environment BetaComputerUsePreviewToolEnvironment` - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + The type of computer environment to control. - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + - `Type ComputerUsePreview` - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + The type of the computer use tool. Always `computer_use_preview`. - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + - `type BetaWebSearchTool struct{…}` - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + - `Type BetaWebSearchToolType` - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + - `Filters BetaWebSearchToolFilters` - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + Filters for the search. - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + - `AllowedDomains []string` - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + 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 BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + - `UserLocation BetaWebSearchToolUserLocation` - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + The approximate location of the user. - - `const BetaResponseModelO1 BetaResponseModel = "o1"` + - `City string` - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + Free text input for the city of the user, e.g. `San Francisco`. - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + - `Country string` - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + - `Region string` - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + Free text input for the region of the user, e.g. `California`. - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + - `Timezone string` - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + - `Type string` - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + The type of location approximation. Always `approximate`. - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + - `type BetaToolMcp struct{…}` - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + - `ServerLabel string` - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + A label for this MCP server, used to identify it in tool calls. - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `Type Mcp` - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + The type of the MCP tool. Always `mcp`. - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + - `const McpMcp Mcp = "mcp"` - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + - `AllowedCallers []string` - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + The tool invocation context(s). - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + List of allowed tool names or a filter object. - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + A string array of allowed tool names - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + A filter object to specify which tools are allowed. - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + - `ReadOnly bool` - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + - `ToolNames []string` - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + List of allowed tool names. - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + - `Authorization string` - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + 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. - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + - `ConnectorID string` - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + Currently supported `connector_id` values are: - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + - 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 BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + - `DeferLoading bool` - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + Whether this MCP tool is deferred and discovered via tool search. - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + - `Headers map[string, string]` - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + Specify which of the MCP server's tools require approval. - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + A filter object to specify which tools are allowed. - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + - `ReadOnly bool` - - `string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Object Response` + - `ToolNames []string` - The object type of this resource - always set to `response`. + List of allowed tool names. - - `const ResponseResponse Response = "response"` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - - `Output []BetaResponseOutputItemUnion` + A filter object to specify which tools are allowed. - An array of content items generated by the model. + - `ReadOnly bool` - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `type BetaResponseOutputMessage struct{…}` + - `ToolNames []string` - An output message from the model. + List of allowed tool names. - - `type BetaResponseFileSearchToolCall struct{…}` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + 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. - - `type BetaResponseFunctionToolCall struct{…}` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `ServerDescription string` - - `ID string` + Optional description of the MCP server, used to provide more context. - The unique ID of the function call tool output. + - `ServerURL string` - - `CallID string` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - The unique ID of the function tool call generated by the model. + - `TunnelID string` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + 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. - The output from the function call generated by your code. - Can be a string or an list of output content. + - `type BetaToolCodeInterpreter struct{…}` - - `string` + A tool that runs Python code to help generate a response to a prompt. - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `Container BetaToolCodeInterpreterContainerUnion` - Text, image, or file output of the function call. + 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. - - `type BetaResponseInputText struct{…}` + - `string` - A text input to the model. + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `type BetaResponseInputImage struct{…}` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Type Auto` - - `type BetaResponseInputFile struct{…}` + Always `auto`. - A file input to the model. + - `const AutoAuto Auto = "auto"` - - `Status BetaResponseFunctionToolCallOutputItemStatus` + - `FileIDs []string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + An optional list of uploaded files to make available to your code. - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + - `MemoryLimit string` - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + The memory limit for the code interpreter container. - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - - `Type FunctionCallOutput` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - The type of the function tool call output. Always `function_call_output`. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - The agent that produced this item. + Network access policy for the container. - - `AgentName string` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The canonical name of the agent that produced this item. + - `Type Disabled` - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + Disable outbound network access. Always `disabled`. - The execution context that produced this tool call. + - `const DisabledDisabled Disabled = "disabled"` - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `Type Direct` + - `AllowedDomains []string` - The caller type. Always `direct`. + A list of allowed domains when type is `allowlist`. - - `const DirectDirect Direct = "direct"` + - `Type Allowlist` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + Allow outbound network access only to specified domains. Always `allowlist`. - - `CallerID string` + - `const AllowlistAllowlist Allowlist = "allowlist"` - The call ID of the program item that produced this tool call. + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `Type Program` + Optional domain-scoped secrets for allowlisted domains. - The caller type. Always `program`. + - `Domain string` - - `const ProgramProgram Program = "program"` + The domain associated with the secret. - - `CreatedBy string` + - `Name string` - The identifier of the actor that created the item. + The name of the secret to inject for the domain. - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `Value string` - - `ID string` + The secret value to inject for the domain. - The unique ID of the agent message. + - `Type CodeInterpreter` - - `Author string` + The type of the code interpreter tool. Always `code_interpreter`. - The sending agent identity. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + - `AllowedCallers []string` - Encrypted content sent between agents. + The tool invocation context(s). - - `type BetaResponseInputText struct{…}` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - A text input to the model. + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `type BetaResponseOutputText struct{…}` + - `type BetaToolProgrammaticToolCalling struct{…}` - A text output from the model. + - `Type ProgrammaticToolCalling` - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + The type of the tool. Always `programmatic_tool_calling`. - A text content. + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `Text string` + - `type BetaToolImageGeneration struct{…}` - - `Type Text` + A tool that generates images using the GPT image models. - - `const TextText Text = "text"` + - `Type ImageGeneration` - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + The type of the image generation tool. Always `image_generation`. - A summary text from the model. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `Text string` + - `Action string` - A summary of the reasoning output from the model so far. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `Type SummaryText` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - The type of the object. Always `summary_text`. + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `Background string` - Reasoning text from the model. + 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. - - `Text string` + `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. - The reasoning text from the model. + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - - `Type ReasoningText` + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - The type of the reasoning text. Always `reasoning_text`. + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `type BetaResponseOutputRefusal struct{…}` + - `InputFidelity string` - A refusal from the model. + 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`. - - `type BetaResponseInputImage struct{…}` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + - `InputImageMask BetaToolImageGenerationInputImageMask` - A screenshot of a computer. + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `Detail string` + - `FileID string` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + File ID for the mask image. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `ImageURL string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + Base64-encoded mask image. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `Model string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + The image generation model to use. Default: `gpt-image-1`. - - `FileID string` + - `string` - The identifier of an uploaded file that contains the screenshot. + - `string` - - `ImageURL string` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - The URL of the screenshot image. + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `Type ComputerScreenshot` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Moderation string` - - `Mode Explicit` + Moderation level for the generated image. Default: `auto`. - The breakpoint mode. Always `explicit`. + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - - `type BetaResponseInputFile struct{…}` + - `OutputCompression int64` - A file input to the model. + Compression level for the output image. Default: 100. - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + - `OutputFormat string` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `EncryptedContent string` + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - Opaque encrypted content. + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `Type EncryptedContent` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - The type of the input item. Always `encrypted_content`. + - `PartialImages int64` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `Recipient string` + - `Quality string` - The destination agent identity. + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `Type AgentMessage` + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - The type of the item. Always `agent_message`. + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `Agent BetaResponseOutputItemAgentMessageAgent` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - The agent that produced this item. + - `Size string` - - `AgentName 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`. - The canonical name of the agent that produced this item. + - `string` - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + - `string` - - `ID string` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - The unique ID of the multi-agent call item. + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `Action string` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - The multi-agent action to execute. + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + - `type BetaToolLocalShell struct{…}` - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + A tool that allows the model to execute shell commands in a local environment. - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + - `Type LocalShell` - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + The type of the local shell tool. Always `local_shell`. - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + - `type BetaFunctionShellTool struct{…}` - - `Arguments string` + A tool that allows the model to execute shell commands. - The JSON string of arguments generated for the action. + - `Type Shell` - - `CallID string` + The type of the shell tool. Always `shell`. - The unique ID linking this call to its output. + - `const ShellShell Shell = "shell"` - - `Type MultiAgentCall` + - `AllowedCallers []string` - The type of the multi-agent call. Always `multi_agent_call`. + The tool invocation context(s). - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - The agent that produced this item. + - `Environment BetaFunctionShellToolEnvironmentUnion` - - `AgentName string` + - `type BetaContainerAuto struct{…}` - The canonical name of the agent that produced this item. + - `Type ContainerAuto` - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + Automatically creates a container for this request - - `ID string` + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - The unique ID of the multi-agent call output item. + - `FileIDs []string` - - `Action string` + An optional list of uploaded files to make available to your code. - The multi-agent action that produced this result. + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + The memory limit for the container. - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - `CallID string` + Network access policy for the container. - The unique ID of the multi-agent call. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `Output []BetaResponseOutputText` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - Text output returned by the multi-agent action. + - `Skills []BetaContainerAutoSkillUnion` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + An optional list of skills referenced by id or inline data. - The annotations of the text output. + - `type BetaSkillReference struct{…}` - - `Text string` + - `SkillID string` - The text output from the model. + The ID of the referenced skill. - - `Type OutputText` + - `Type SkillReference` - The type of the output text. Always `output_text`. + References a skill created with the /v1/skills endpoint. - - `Logprobs []BetaResponseOutputTextLogprob` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `Type MultiAgentCallOutput` + - `Version string` - The type of the multi-agent result. Always `multi_agent_call_output`. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `type BetaInlineSkill struct{…}` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `Description string` - The agent that produced this item. + The description of the skill. - - `AgentName string` + - `Name string` - The canonical name of the agent that produced this item. + The name of the skill. - - `type BetaResponseFunctionWebSearch struct{…}` + - `Source BetaInlineSkillSource` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + Inline skill payload - - `type BetaResponseComputerToolCall struct{…}` + - `Data string` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + Base64-encoded skill zip bundle. - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `MediaType ApplicationZip` - - `ID string` + The media type of the inline skill payload. Must be `application/zip`. - The unique ID of the computer call tool output. + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `CallID string` + - `Type Base64` - The ID of the computer tool call that produced the output. + The type of the inline skill source. Must be `base64`. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `const Base64Base64 Base64 = "base64"` - A computer screenshot image used with the computer use tool. + - `Type Inline` - - `Status BetaResponseComputerToolCallOutputItemStatus` + Defines an inline skill for this request. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `const InlineInline Inline = "inline"` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `type BetaLocalEnvironment struct{…}` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `Type Local` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + Use a local computer environment. - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `const LocalLocal Local = "local"` - - `Type ComputerCallOutput` + - `Skills []BetaLocalSkill` - The type of the computer tool call output. Always `computer_call_output`. + An optional list of skills. - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `Description string` - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + The description of the skill. - The safety checks reported by the API that have been acknowledged by the - developer. + - `Name string` - - `ID string` + The name of the skill. - The ID of the pending safety check. + - `Path string` - - `Code string` + The path to the directory containing the skill. - The type of the pending safety check. + - `type BetaContainerReference struct{…}` - - `Message string` + - `ContainerID string` - Details about the pending safety check. + The ID of the referenced container. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `Type ContainerReference` - The agent that produced this item. + References a container created with the /v1/containers endpoint - - `AgentName string` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - The canonical name of the agent that produced this item. + - `type BetaCustomTool struct{…}` - - `CreatedBy string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The identifier of the actor that created the item. + - `Name string` - - `type BetaResponseReasoningItem struct{…}` + The name of the custom tool, used to identify it in tool calls. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `Type Custom` - - `type BetaResponseOutputItemProgram struct{…}` + The type of the custom tool. Always `custom`. - - `ID string` + - `const CustomCustom Custom = "custom"` - The unique ID of the program item. + - `AllowedCallers []string` - - `CallID string` + The tool invocation context(s). - The stable call ID of the program item. + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `Code string` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - The JavaScript source executed by programmatic tool calling. + - `DeferLoading bool` - - `Fingerprint string` + Whether this tool should be deferred and discovered via tool search. - Opaque program replay fingerprint that must be round-tripped. + - `Description string` - - `Type Program` + Optional description of the custom tool, used to provide more context. - The type of the item. Always `program`. + - `Format BetaCustomToolFormatUnion` - - `const ProgramProgram Program = "program"` + The input format for the custom tool. Default is unconstrained text. - - `Agent BetaResponseOutputItemProgramAgent` + - `type BetaCustomToolFormatText struct{…}` - The agent that produced this item. + Unconstrained free-form text. - - `AgentName string` + - `Type Text` - The canonical name of the agent that produced this item. + Unconstrained text format. Always `text`. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `const TextText Text = "text"` - - `ID string` + - `type BetaCustomToolFormatGrammar struct{…}` - The unique ID of the program output item. + A grammar defined by the user. - - `CallID string` + - `Definition string` - The call ID of the program item. + The grammar definition. - - `Result string` + - `Syntax string` - The result produced by the program item. + The syntax of the grammar definition. One of `lark` or `regex`. - - `Status string` + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - The terminal status of the program output item. + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + - `Type Grammar` - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + Grammar format. Always `grammar`. - - `Type ProgramOutput` + - `const GrammarGrammar Grammar = "grammar"` - The type of the item. Always `program_output`. + - `type BetaNamespaceTool struct{…}` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + Groups function/custom tools under a shared namespace. - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `Description string` - The agent that produced this item. + A description of the namespace shown to the model. - - `AgentName string` + - `Name string` - The canonical name of the agent that produced this item. + The namespace name used in tool calls (for example, `crm`). - - `type BetaResponseToolSearchCall struct{…}` + - `Tools []BetaNamespaceToolToolUnion` - - `ID string` + The function/custom tools available inside this namespace. - The unique ID of the tool search call item. + - `type BetaNamespaceToolToolFunction struct{…}` - - `Arguments any` + - `Name string` - Arguments used for the tool search call. + - `Type Function` - - `CallID string` + - `const FunctionFunction Function = "function"` - The unique ID of the tool search call generated by the model. + - `AllowedCallers []string` - - `Execution BetaResponseToolSearchCallExecution` + The tool invocation context(s). - Whether tool search was executed by the server or by the client. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `DeferLoading bool` - - `Status BetaResponseToolSearchCallStatus` + Whether this function should be deferred and discovered via tool search. - The status of the tool search call item that was recorded. + - `Description string` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + - `OutputSchema map[string, any]` - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + - `Parameters any` - - `Type ToolSearchCall` + - `Strict bool` - The type of the item. Always `tool_search_call`. + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `type BetaCustomTool struct{…}` - - `Agent BetaResponseToolSearchCallAgent` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The agent that produced this item. + - `Type Namespace` - - `AgentName string` + The type of the tool. Always `namespace`. - The canonical name of the agent that produced this item. + - `const NamespaceNamespace Namespace = "namespace"` - - `CreatedBy string` + - `type BetaToolSearchTool struct{…}` - The identifier of the actor that created the item. + Hosted or BYOT tool search configuration for deferred tools. - - `type BetaResponseToolSearchOutputItem struct{…}` + - `Type ToolSearch` - - `ID string` + The type of the tool. Always `tool_search`. - The unique ID of the tool search output item. + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `CallID string` + - `Description string` - The unique ID of the tool search call generated by the model. + Description shown to the model for a client-executed tool search tool. - - `Execution BetaResponseToolSearchOutputItemExecution` + - `Execution BetaToolSearchToolExecution` - Whether tool search was executed by the server or by the client. + Whether tool search is executed by the server or by the client. - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `Status BetaResponseToolSearchOutputItemStatus` + - `Parameters any` - The status of the tool search output item that was recorded. + Parameter schema for a client-executed tool search tool. - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + - `Type BetaWebSearchPreviewToolType` - - `Tools []BetaToolUnion` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The loaded tool definitions returned by tool search. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `type BetaFunctionTool struct{…}` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `SearchContentTypes []string` - - `type BetaFileSearchTool struct{…}` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `type BetaComputerTool struct{…}` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + 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. - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `type BetaWebSearchTool struct{…}` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `type BetaToolMcp struct{…}` + The user's location. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Type Approximate` - - `type BetaToolCodeInterpreter struct{…}` + The type of location approximation. Always `approximate`. - A tool that runs Python code to help generate a response to a prompt. + - `const ApproximateApproximate Approximate = "approximate"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `City string` - - `type BetaToolImageGeneration struct{…}` + Free text input for the city of the user, e.g. `San Francisco`. - A tool that generates images using the GPT image models. + - `Country string` - - `type BetaToolLocalShell struct{…}` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - A tool that allows the model to execute shell commands in a local environment. + - `Region string` - - `type BetaFunctionShellTool struct{…}` + Free text input for the region of the user, e.g. `California`. - A tool that allows the model to execute shell commands. + - `Timezone string` - - `type BetaCustomTool struct{…}` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `type BetaApplyPatchTool struct{…}` - - `type BetaNamespaceTool struct{…}` + Allows the assistant to create, delete, or update files using unified diffs. - Groups function/custom tools under a shared namespace. + - `Type ApplyPatch` - - `type BetaToolSearchTool struct{…}` + The type of the tool. Always `apply_patch`. - Hosted or BYOT tool search configuration for deferred tools. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `type BetaWebSearchPreviewTool struct{…}` + - `AllowedCallers []string` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The tool invocation context(s). - - `type BetaApplyPatchTool struct{…}` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - Allows the assistant to create, delete, or update files using unified diffs. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - `Type ToolSearchOutput` @@ -92060,6 +105760,79 @@ func main() { 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 []BetaResponseCodeInterpreterToolCallOutputUnion` + + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. + + - `type BetaResponseCodeInterpreterToolCallOutputLogs 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 BetaResponseCodeInterpreterToolCallOutputImage 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 BetaResponseCodeInterpreterToolCallStatus` + + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + + - `Type CodeInterpreterCall` + + The type of the code interpreter tool call. Always `code_interpreter_call`. + + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + + - `Agent BetaResponseCodeInterpreterToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + - `type BetaResponseOutputItemLocalShellCall struct{…}` A tool call to run a command on the local shell. @@ -92368,1395 +106141,473 @@ func main() { - `CreatedBy string` - The identifier of the actor that created the item. - - - `type BetaResponseApplyPatchToolCall 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 BetaResponseApplyPatchToolCallOperationUnion` - - One of the create_file, delete_file, or update_file operations applied via apply_patch. - - - `type BetaResponseApplyPatchToolCallOperationCreateFile 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 BetaResponseApplyPatchToolCallOperationDeleteFile 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 BetaResponseApplyPatchToolCallOperationUpdateFile 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 BetaResponseApplyPatchToolCallStatus` - - The status of the apply patch tool call. One of `in_progress` or `completed`. - - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - - `Type ApplyPatchCall` - - The type of the item. Always `apply_patch_call`. - - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - - `Agent BetaResponseApplyPatchToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - - `Type Direct` - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - - `const ProgramProgram Program = "program"` - - - `CreatedBy string` - - The ID of the entity that created this tool call. - - - `type BetaResponseApplyPatchToolCallOutput 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 BetaResponseApplyPatchToolCallOutputStatus` - - The status of the apply patch tool call output. One of `completed` or `failed`. - - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - - - `Type ApplyPatchCallOutput` - - The type of the item. Always `apply_patch_call_output`. - - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - - `Type Direct` - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - - `const ProgramProgram Program = "program"` - - - `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 BetaResponseOutputItemMcpCall 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"` - - - `Agent BetaResponseOutputItemMcpCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `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 BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - - `type BetaResponseOutputItemMcpListTools 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 []BetaResponseOutputItemMcpListToolsTool` - - 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"` - - - `Agent BetaResponseOutputItemMcpListToolsAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Error string` - - Error message if the server could not list tools. - - - `type BetaResponseOutputItemMcpApprovalRequest 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"` - - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseOutputItemMcpApprovalResponse 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"` - - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Reason string` - - Optional reason for the decision. - - - `type BetaResponseCustomToolCall struct{…}` - - A call to a custom tool created by the model. - - - `type BetaResponseCustomToolCallOutputItem 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 BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `ParallelToolCalls bool` - - Whether to allow the model to run tool calls in parallel. - - - `Temperature float64` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. - - - `ToolChoice BetaResponseToolChoiceUnion` - - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. - - - `type BetaToolChoiceOptions string` - - Controls which (if any) tool is called by the model. - - `none` means the model will not call any tool and instead generates a message. - - `auto` means the model can pick between generating a message or calling one or - more tools. - - `required` means the model must call one or more tools. - - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - - - `type BetaToolChoiceAllowed struct{…}` - - Constrains the tools available to the model to a pre-defined set. - - - `Mode BetaToolChoiceAllowedMode` - - Constrains the tools available to the model to a pre-defined set. - - `auto` allows the model to pick from among the allowed tools and generate a - message. - - `required` requires the model to call one or more of the allowed tools. - - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - - - `Tools []map[string, any]` - - A list of tool definitions that the model should be allowed to call. - - For the Responses API, the list of tool definitions might look like: - - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` - - - `Type AllowedTools` - - Allowed tool configuration type. Always `allowed_tools`. - - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - - `type BetaToolChoiceTypes struct{…}` - - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - - - `Type BetaToolChoiceTypesType` - - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - Allowed values are: - - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` - - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - - - `type BetaToolChoiceFunction struct{…}` - - Use this option to force the model to call a specific function. - - - `Name string` - - The name of the function to call. - - - `Type Function` - - For function calling, the type is always `function`. - - - `const FunctionFunction Function = "function"` - - - `type BetaToolChoiceMcp struct{…}` - - Use this option to force the model to call a specific tool on a remote MCP server. - - - `ServerLabel string` - - The label of the MCP server to use. - - - `Type Mcp` - - For MCP tools, the type is always `mcp`. - - - `const McpMcp Mcp = "mcp"` - - - `Name string` - - The name of the tool to call on the server. - - - `type BetaToolChoiceCustom struct{…}` - - Use this option to force the model to call a specific custom tool. - - - `Name string` - - The name of the custom tool to call. - - - `Type Custom` - - For custom tool calling, the type is always `custom`. - - - `const CustomCustom Custom = "custom"` - - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - - - `Type ProgrammaticToolCalling` - - The tool to call. Always `programmatic_tool_calling`. - - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - - `type BetaToolChoiceApplyPatch struct{…}` - - Forces the model to call the apply_patch tool when executing a tool call. - - - `Type ApplyPatch` - - The tool to call. Always `apply_patch`. - - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - - `type BetaToolChoiceShell struct{…}` - - Forces the model to call the shell tool when a tool call is required. - - - `Type Shell` - - The tool to call. Always `shell`. - - - `const ShellShell Shell = "shell"` - - - `Tools []BetaToolUnion` - - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. - - We support the following categories of tools: - - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. - - - `type BetaFunctionTool struct{…}` - - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - - `type BetaFileSearchTool struct{…}` - - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - - `type BetaComputerTool struct{…}` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type BetaComputerUsePreviewTool struct{…}` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type BetaWebSearchTool struct{…}` - - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `type BetaToolMcp struct{…}` - - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - - `type BetaToolCodeInterpreter struct{…}` - - A tool that runs Python code to help generate a response to a prompt. - - - `type BetaToolProgrammaticToolCalling struct{…}` - - - `type BetaToolImageGeneration struct{…}` - - A tool that generates images using the GPT image models. - - - `type BetaToolLocalShell struct{…}` - - A tool that allows the model to execute shell commands in a local environment. - - - `type BetaFunctionShellTool struct{…}` - - A tool that allows the model to execute shell commands. - - - `type BetaCustomTool struct{…}` - - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - - `type BetaNamespaceTool struct{…}` - - Groups function/custom tools under a shared namespace. - - - `type BetaToolSearchTool struct{…}` - - Hosted or BYOT tool search configuration for deferred tools. - - - `type BetaWebSearchPreviewTool struct{…}` - - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `type BetaApplyPatchTool struct{…}` - - Allows the assistant to create, delete, or update files using unified diffs. - - - `TopP float64` - - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. - - We generally recommend altering this or `temperature` but not both. - - - `Background bool` - - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). - - - `CompletedAt float64` - - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. - - - `Conversation BetaResponseConversation` - - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - - - `ID string` - - The unique ID of the conversation that this response was associated with. - - - `MaxOutputTokens int64` - - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - - - `MaxToolCalls int64` - - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - - `Moderation BetaResponseModeration` - - Moderation results for the response input and output, if moderated completions were requested. - - - `Input BetaResponseModerationInputUnion` - - Moderation for the response input. - - - `type BetaResponseModerationInputModerationResult struct{…}` - - A moderation result produced for the response input or output. - - - `Categories map[string, bool]` - - A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - - `CategoryAppliedInputTypes map[string, []string]` - - Which modalities of input are reflected by the score for each category. - - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` - - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` - - - `CategoryScores map[string, float64]` - - A dictionary of moderation categories to scores. - - - `Flagged bool` - - A boolean indicating whether the content was flagged by any category. - - - `Model string` - - The moderation model that produced this result. - - - `Type ModerationResult` - - The object type, which was always `moderation_result` for successful moderation results. - - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - - `type BetaResponseModerationInputError struct{…}` - - An error produced while attempting moderation for the response input or output. - - - `Code string` - - The error code. - - - `Message string` - - The error message. - - - `Type Error` - - The object type, which was always `error` for moderation failures. - - - `const ErrorError Error = "error"` - - - `Output BetaResponseModerationOutputUnion` - - Moderation for the response output. - - - `type BetaResponseModerationOutputModerationResult struct{…}` - - A moderation result produced for the response input or output. - - - `Categories map[string, bool]` - - A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - - `CategoryAppliedInputTypes map[string, []string]` - - Which modalities of input are reflected by the score for each category. - - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` - - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` - - - `CategoryScores map[string, float64]` - - A dictionary of moderation categories to scores. - - - `Flagged bool` - - A boolean indicating whether the content was flagged by any category. - - - `Model string` - - The moderation model that produced this result. - - - `Type ModerationResult` - - The object type, which was always `moderation_result` for successful moderation results. - - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - - `type BetaResponseModerationOutputError struct{…}` - - An error produced while attempting moderation for the response input or output. - - - `Code string` - - The error code. - - - `Message string` - - The error message. - - - `Type Error` - - The object type, which was always `error` for moderation failures. - - - `const ErrorError Error = "error"` - - - `PreviousResponseID string` - - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - - - `Prompt BetaResponsePrompt` - - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - - - `ID string` - - The unique identifier of the prompt template to use. - - - `Variables map[string, BetaResponsePromptVariableUnion]` - - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. - - - `string` - - - `type BetaResponseInputText struct{…}` - - A text input to the model. - - - `type BetaResponseInputImage struct{…}` - - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - - `type BetaResponseInputFile struct{…}` - - A file input to the model. - - - `Version string` - - Optional version of the prompt template. - - - `PromptCacheKey string` - - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - - - `PromptCacheOptions BetaResponsePromptCacheOptions` - - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - - `Mode string` - - Whether implicit prompt-cache breakpoints were enabled. + The identifier of the actor that created the item. - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `type BetaResponseApplyPatchToolCall struct{…}` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + A tool call that applies file diffs by creating, deleting, or updating files. - - `Ttl string` + - `ID string` - The minimum lifetime applied to each cache breakpoint. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + - `CallID string` - - `PromptCacheRetention BetaResponsePromptCacheRetention` + The unique ID of the apply patch tool call generated by the model. - Deprecated. Use `prompt_cache_options.ttl` instead. + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + Instruction describing how to create a file via the apply_patch tool. - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `Diff string` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + Diff to apply. - - `Reasoning BetaResponseReasoning` + - `Path string` - **gpt-5 and o-series models only** + Path of the file to create. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `Type CreateFile` - - `Context string` + Create a new file with the provided diff. - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + Instruction describing how to delete a file via the apply_patch tool. - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + - `Path string` - - `Effort string` + Path of the file to delete. - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `Type DeleteFile` - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + Delete the specified file. - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + Instruction describing how to update a file via the apply_patch tool. - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + - `Diff string` - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + Diff to apply. - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + - `Path string` - - `GenerateSummary string` + Path of the file to update. - **Deprecated:** use `summary` instead. + - `Type UpdateFile` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + Update an existing file with the provided diff. - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + - `Status BetaResponseApplyPatchToolCallStatus` - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `Mode string` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - Controls the reasoning execution mode for the request. + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - When returned on a response, this is the effective execution mode. + - `Type ApplyPatchCall` - - `string` + The type of the item. Always `apply_patch_call`. - - `string` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + - `Agent BetaResponseApplyPatchToolCallAgent` - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + The agent that produced this item. - - `Summary string` + - `AgentName string` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + The canonical name of the agent that produced this item. - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + The execution context that produced this tool call. - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + - `Type Direct` - - `SafetyIdentifier string` + - `const DirectDirect Direct = "direct"` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `ServiceTier BetaResponseServiceTier` + - `CallerID string` - Specifies the processing type used for serving the request. + The call ID of the program item that produced this tool call. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `Type Program` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + - `const ProgramProgram Program = "program"` - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `CreatedBy string` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + The ID of the entity that created this tool call. - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + The output emitted by an apply patch tool call. - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + - `ID string` - - `Status BetaResponseStatus` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `CallID string` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + The unique ID of the apply patch tool call generated by the model. - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `Status BetaResponseApplyPatchToolCallOutputStatus` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + The status of the apply patch tool call output. One of `completed` or `failed`. - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + - `Type ApplyPatchCallOutput` - - `Text BetaResponseTextConfig` + The type of the item. Always `apply_patch_call_output`. - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - `Format BetaResponseFormatTextConfigUnion` + The agent that produced this item. - An object specifying the format that the model must output. + - `AgentName string` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The canonical name of the agent that produced this item. - The default format is `{ "type": "text" }` with no additional options. + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - **Not recommended for gpt-4o and newer models:** + The execution context that produced this tool call. - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - `type BetaResponseFormatTextConfigText struct{…}` + - `Type Direct` - Default response format. Used to generate text responses. + - `const DirectDirect Direct = "direct"` - - `Type Text` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - The type of response format being defined. Always `text`. + - `CallerID string` - - `const TextText Text = "text"` + The call ID of the program item that produced this tool call. - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + - `Type Program` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const ProgramProgram Program = "program"` - - `Name string` + - `CreatedBy string` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + The ID of the entity that created this tool call output. - - `Schema map[string, any]` + - `Output string` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + Optional textual output returned by the apply patch tool. - - `Type JSONSchema` + - `type BetaResponseOutputItemMcpCall struct{…}` - The type of response format being defined. Always `json_schema`. + An invocation of a tool on an MCP server. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `ID string` - - `Description string` + The unique ID of the tool call. - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `Arguments string` - - `Strict bool` + A JSON string of the arguments passed to the tool. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Name string` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + The name of the tool that was run. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `ServerLabel string` - - `Type JSONObject` + The label of the MCP server running the tool. - The type of response format being defined. Always `json_object`. + - `Type McpCall` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The type of the item. Always `mcp_call`. - - `Verbosity BetaResponseTextConfigVerbosity` + - `const McpCallMcpCall McpCall = "mcp_call"` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + - `Agent BetaResponseOutputItemMcpCallAgent` - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + The agent that produced this item. - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + - `AgentName string` - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + The canonical name of the agent that produced this item. - - `TopLogprobs int64` + - `ApprovalRequestID string` - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + 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. - - `Truncation BetaResponseTruncation` + - `Error string` - The truncation strategy to use for the model response. + The error from the tool call, if any. - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `Output string` - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + The output from the tool call. - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + - `Status string` - - `Usage BetaResponseUsage` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - `InputTokens int64` + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - The number of input tokens. + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - A detailed breakdown of the input tokens. + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - `CacheWriteTokens int64` + - `type BetaResponseOutputItemMcpListTools struct{…}` - The number of input tokens that were written to the cache. + A list of tools available on an MCP server. - - `CachedTokens int64` + - `ID string` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + The unique ID of the list. - - `OutputTokens int64` + - `ServerLabel string` - The number of output tokens. + The label of the MCP server. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - A detailed breakdown of the output tokens. + The tools available on the server. - - `ReasoningTokens int64` + - `InputSchema any` - The number of reasoning tokens. + The JSON schema describing the tool's input. - - `TotalTokens int64` + - `Name string` - The total number of tokens used. + The name of the tool. - - `User string` + - `Annotations any` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + Additional annotations about the tool. - - `SequenceNumber int64` + - `Description string` - The sequence number of this event. + The description of the tool. - - `Type ResponseIncomplete` + - `Type McpListTools` - The type of the event. Always `response.incomplete`. + The type of the item. Always `mcp_list_tools`. - - `const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Agent BetaResponseIncompleteEventAgent` + - `Agent BetaResponseOutputItemMcpListToolsAgent` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response Input - -- `type BetaResponseInput []BetaResponseInputItemUnion` - - A list of one or many input items to the model, containing - different content types. - - - `type BetaEasyInputMessage struct{…}` + - `Error string` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + Error message if the server could not list tools. - - `Content BetaEasyInputMessageContentUnion` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + A request for human approval of a tool invocation. - - `string` + - `ID string` - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + The unique ID of the approval request. - A list of one or many input items to the model, containing different content - types. + - `Arguments string` - - `type BetaResponseInputText struct{…}` + A JSON string of arguments for the tool. - A text input to the model. + - `Name string` - - `Text string` + The name of the tool to run. - The text input to the model. + - `ServerLabel string` - - `Type InputText` + The label of the MCP server making the request. - The type of the input item. Always `input_text`. + - `Type McpApprovalRequest` - - `const InputTextInputText InputText = "input_text"` + The type of the item. Always `mcp_approval_request`. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` - - `Mode Explicit` + The agent that produced this item. - The breakpoint mode. Always `explicit`. + - `AgentName string` - - `const ExplicitExplicit Explicit = "explicit"` + The canonical name of the agent that produced this item. - - `type BetaResponseInputImage struct{…}` + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + A response to an MCP approval request. - - `Detail BetaResponseInputImageDetail` + - `ID string` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The unique ID of the approval response - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `ApprovalRequestID string` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + The ID of the approval request being answered. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `Approve bool` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + Whether the request was approved. - - `Type InputImage` + - `Type McpApprovalResponse` - The type of the input item. Always `input_image`. + The type of the item. Always `mcp_approval_response`. - - `const InputImageInputImage InputImage = "input_image"` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `FileID string` + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - The ID of the file to be sent to the model. + The agent that produced this item. - - `ImageURL string` + - `AgentName string` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + The canonical name of the agent that produced this item. - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `Reason string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Optional reason for the decision. - - `Mode Explicit` + - `type BetaResponseCustomToolCall struct{…}` - The breakpoint mode. Always `explicit`. + A call to a custom tool created by the model. - - `const ExplicitExplicit Explicit = "explicit"` + - `CallID string` - - `type BetaResponseInputFile struct{…}` + An identifier used to map this custom tool call to a tool call output. - A file input to the model. + - `Input string` - - `Type InputFile` + The input for the custom tool call generated by the model. - The type of the input item. Always `input_file`. + - `Name string` - - `const InputFileInputFile InputFile = "input_file"` + The name of the custom tool being called. - - `Detail BetaResponseInputFileDetail` + - `Type CustomToolCall` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + The type of the custom tool call. Always `custom_tool_call`. - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `ID string` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + The unique ID of the custom tool call in the OpenAI platform. - - `FileData string` + - `Agent BetaResponseCustomToolCallAgent` - The content of the file to be sent to the model. + The agent that produced this item. - - `FileID string` + - `AgentName string` - The ID of the file to be sent to the model. + The canonical name of the agent that produced this item. - - `FileURL string` + - `Caller BetaResponseCustomToolCallCallerUnion` - The URL of the file to be sent to the model. + The execution context that produced this tool call. - - `Filename string` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - The name of the file to be sent to the model. + - `Type Direct` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `const DirectDirect Direct = "direct"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `Mode Explicit` + - `CallerID string` - The breakpoint mode. Always `explicit`. + The call ID of the program item that produced this tool call. - - `const ExplicitExplicit Explicit = "explicit"` + - `Type Program` - - `Role BetaEasyInputMessageRole` + - `const ProgramProgram Program = "program"` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + - `Namespace string` - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + The namespace of the custom tool being called. - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + The output of a custom tool call from your code, being sent back to the model. - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `ID string` - - `Phase BetaEasyInputMessagePhase` + The unique ID of the custom tool call output item. - 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. + - `Status string` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Type BetaEasyInputMessageType` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - The type of the message input. Always `message`. + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `type BetaResponseInputItemMessage struct{…}` + - `CreatedBy string` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + The identifier of the actor that created the item. - - `Content BetaResponseInputMessageContentList` + - `OutputIndex int64` - A list of one or many input items to the model, containing different content - types. + The index of the output item that was added. - - `Role string` + - `SequenceNumber int64` - The role of the message input. One of `user`, `system`, or `developer`. + The sequence number of this event. - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + - `Type ResponseOutputItemAdded` - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + The type of the event. Always `response.output_item.added`. - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + - `const ResponseOutputItemAddedResponseOutputItemAdded ResponseOutputItemAdded = "response.output_item.added"` - - `Agent BetaResponseInputItemMessageAgent` + - `Agent BetaResponseOutputItemAddedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Status string` - - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` +### Beta Response Output Item Done Event - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` +- `type BetaResponseOutputItemDoneEvent struct{…}` - - `Type string` + Emitted when an output item is marked done. - The type of the message input. Always set to `message`. + - `Item BetaResponseOutputItemUnion` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + The output item that was marked done. - `type BetaResponseOutputMessage struct{…}` @@ -93953,6 +106804,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -94029,314 +106882,343 @@ func main() { The text that was retrieved from the file. - - `type BetaResponseComputerToolCall struct{…}` + - `type BetaResponseFunctionToolCall struct{…}` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `ID string` + - `Arguments string` - The unique ID of the computer call. + A JSON string of the arguments to pass to the function. - `CallID string` - An identifier used when responding to the tool call with output. + The unique ID of the function tool call generated by the model. - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + - `Name string` - The pending safety checks for the computer call. + The name of the function to run. + + - `Type FunctionCall` + + The type of the function tool call. Always `function_call`. + + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - `ID string` - The ID of the pending safety check. + The unique ID of the function tool call. - - `Code string` + - `Agent BetaResponseFunctionToolCallAgent` - The type of the pending safety check. + The agent that produced this item. - - `Message string` + - `AgentName string` - Details about the pending safety check. + The canonical name of the agent that produced this item. - - `Status BetaResponseComputerToolCallStatus` + - `Caller BetaResponseFunctionToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `Namespace string` + + The namespace of the function to run. + + - `Status BetaResponseFunctionToolCallStatus` The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `Type BetaResponseComputerToolCallType` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - The type of the computer call. Always `computer_call`. + - `ID string` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + The unique ID of the function call tool output. - - `Action BetaComputerActionUnion` + - `CallID string` - A click action. + The unique ID of the function tool call generated by the model. - - `type BetaComputerActionClick struct{…}` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - A click action. + The output from the function call generated by your code. + Can be a string or an list of output content. - - `Button string` + - `string` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + Text, image, or file output of the function call. - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `type BetaResponseInputText struct{…}` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + A text input to the model. - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `Text string` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + The text input to the model. - - `Type Click` + - `Type InputText` - Specifies the event type. For a click action, this property is always `click`. + The type of the input item. Always `input_text`. - - `const ClickClick Click = "click"` + - `const InputTextInputText InputText = "input_text"` - - `X int64` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - The x-coordinate where the click occurred. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Y int64` + - `Mode Explicit` - The y-coordinate where the click occurred. + The breakpoint mode. Always `explicit`. - - `Keys []string` + - `const ExplicitExplicit Explicit = "explicit"` - The keys being held while clicking. + - `type BetaResponseInputImage struct{…}` - - `type BetaComputerActionDoubleClick struct{…}` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - A double click action. + - `Detail BetaResponseInputImageDetail` - - `Keys []string` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The keys being held while double-clicking. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `Type DoubleClick` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `X int64` + - `Type InputImage` - The x-coordinate where the double click occurred. + The type of the input item. Always `input_image`. - - `Y int64` + - `const InputImageInputImage InputImage = "input_image"` - The y-coordinate where the double click occurred. + - `FileID string` - - `type BetaComputerActionDrag struct{…}` + The ID of the file to be sent to the model. - A drag action. + - `ImageURL string` - - `Path []BetaComputerActionDragPath` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `X int64` + - `Mode Explicit` - The x-coordinate. + The breakpoint mode. Always `explicit`. - - `Y int64` + - `const ExplicitExplicit Explicit = "explicit"` - The y-coordinate. + - `type BetaResponseInputFile struct{…}` - - `Type Drag` + A file input to the model. - Specifies the event type. For a drag action, this property is always set to `drag`. + - `Type InputFile` - - `const DragDrag Drag = "drag"` + The type of the input item. Always `input_file`. - - `Keys []string` + - `const InputFileInputFile InputFile = "input_file"` - The keys being held while dragging the mouse. + - `Detail BetaResponseInputFileDetail` - - `type BetaComputerActionKeypress struct{…}` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - A collection of keypresses the model would like to perform. + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `Keys []string` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `Type Keypress` + - `FileData string` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + The content of the file to be sent to the model. - - `const KeypressKeypress Keypress = "keypress"` + - `FileID string` - - `type BetaComputerActionMove struct{…}` + The ID of the file to be sent to the model. - A mouse move action. + - `FileURL string` - - `Type Move` + The URL of the file to be sent to the model. - Specifies the event type. For a move action, this property is always set to `move`. + - `Filename string` - - `const MoveMove Move = "move"` + The name of the file to be sent to the model. - - `X int64` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - The x-coordinate to move to. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Y int64` + - `Mode Explicit` - The y-coordinate to move to. + The breakpoint mode. Always `explicit`. - - `Keys []string` + - `const ExplicitExplicit Explicit = "explicit"` - The keys being held while moving the mouse. + - `Status BetaResponseFunctionToolCallOutputItemStatus` - - `type BetaComputerActionScreenshot struct{…}` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - A screenshot action. + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `Type Screenshot` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `Type FunctionCallOutput` - - `type BetaComputerActionScroll struct{…}` + The type of the function tool call output. Always `function_call_output`. - A scroll action. + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `ScrollX int64` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - The horizontal scroll distance. + The agent that produced this item. - - `ScrollY int64` + - `AgentName string` - The vertical scroll distance. + The canonical name of the agent that produced this item. - - `Type Scroll` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + The execution context that produced this tool call. - - `const ScrollScroll Scroll = "scroll"` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - `X int64` + - `Type Direct` - The x-coordinate where the scroll occurred. + The caller type. Always `direct`. - - `Y int64` + - `const DirectDirect Direct = "direct"` - The y-coordinate where the scroll occurred. + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - - `Keys []string` + - `CallerID string` - The keys being held while scrolling. + The call ID of the program item that produced this tool call. - - `type BetaComputerActionType struct{…}` + - `Type Program` - An action to type in text. + The caller type. Always `program`. - - `Text string` + - `const ProgramProgram Program = "program"` - The text to type. + - `CreatedBy string` - - `Type Type` + The identifier of the actor that created the item. - Specifies the event type. For a type action, this property is always set to `type`. + - `type BetaResponseOutputItemAgentMessage struct{…}` - - `const TypeType Type = "type"` + - `ID string` - - `type BetaComputerActionWait struct{…}` + The unique ID of the agent message. - A wait action. + - `Author string` - - `Type Wait` + The sending agent identity. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - - `const WaitWait Wait = "wait"` + Encrypted content sent between agents. - - `Actions BetaComputerActionList` + - `type BetaResponseInputText struct{…}` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + A text input to the model. - - `type BetaComputerActionClick struct{…}` + - `type BetaResponseOutputText struct{…}` - A click action. + A text output from the model. - - `type BetaComputerActionDoubleClick struct{…}` + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - A double click action. + A text content. - - `type BetaComputerActionDrag struct{…}` + - `Text string` - A drag action. + - `Type Text` - - `type BetaComputerActionKeypress struct{…}` + - `const TextText Text = "text"` - A collection of keypresses the model would like to perform. + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - - `type BetaComputerActionMove struct{…}` + A summary text from the model. - A mouse move action. + - `Text string` - - `type BetaComputerActionScreenshot struct{…}` + A summary of the reasoning output from the model so far. - A screenshot action. + - `Type SummaryText` - - `type BetaComputerActionScroll struct{…}` + The type of the object. Always `summary_text`. - A scroll action. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `type BetaComputerActionType struct{…}` + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - An action to type in text. + Reasoning text from the model. - - `type BetaComputerActionWait struct{…}` + - `Text string` - A wait action. + The reasoning text from the model. - - `Agent BetaResponseComputerToolCallAgent` + - `Type ReasoningText` - The agent that produced this item. + The type of the reasoning text. Always `reasoning_text`. - - `AgentName string` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - The canonical name of the agent that produced this item. + - `type BetaResponseOutputRefusal struct{…}` - - `type BetaResponseInputItemComputerCallOutput struct{…}` + A refusal from the model. - The output of a computer tool call. + - `type BetaResponseInputImage struct{…}` - - `CallID string` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The ID of the computer tool call that produced the output. + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - - `Output BetaResponseComputerToolCallOutputScreenshot` + A screenshot of a computer. - A computer screenshot image used with the computer use tool. + - `Detail string` - - `Type ComputerScreenshot` + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - `FileID string` @@ -94346,33 +107228,95 @@ func main() { The URL of the screenshot image. - - `Type ComputerCallOutput` + - `Type ComputerScreenshot` - The type of the computer tool call output. Always `computer_call_output`. + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `ID string` + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - The ID of the computer tool call output. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + - `Mode Explicit` - The safety checks reported by the API that have been acknowledged by the developer. + The breakpoint mode. Always `explicit`. + + - `const ExplicitExplicit Explicit = "explicit"` + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + + Opaque encrypted content that Responses API decrypts inside trusted model execution. + + - `EncryptedContent string` + + Opaque encrypted content. + + - `Type EncryptedContent` + + The type of the input item. Always `encrypted_content`. + + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + + - `Recipient string` + + The destination agent identity. + + - `Type AgentMessage` + + The type of the item. Always `agent_message`. + + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + + - `Agent BetaResponseOutputItemAgentMessageAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - `ID string` - The ID of the pending safety check. + The unique ID of the multi-agent call item. - - `Code string` + - `Action string` - The type of the pending safety check. + The multi-agent action to execute. - - `Message string` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - Details about the pending safety check. + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - `Agent BetaResponseInputItemComputerCallOutputAgent` + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + + - `Arguments string` + + The JSON string of arguments generated for the action. + + - `CallID string` + + The unique ID linking this call to its output. + + - `Type MultiAgentCall` + + The type of the multi-agent call. Always `multi_agent_call`. + + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + + - `Agent BetaResponseOutputItemMultiAgentCallAgent` The agent that produced this item. @@ -94380,15 +107324,63 @@ func main() { The canonical name of the agent that produced this item. - - `Status string` + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + - `ID string` - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + The unique ID of the multi-agent call output item. - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `Action string` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + The multi-agent action that produced this result. + + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + + - `CallID string` + + The unique ID of the multi-agent call. + + - `Output []BetaResponseOutputText` + + Text output returned by the multi-agent action. + + - `Annotations []BetaResponseOutputTextAnnotationUnion` + + The annotations of the text output. + + - `Text string` + + The text output from the model. + + - `Type OutputText` + + The type of the output text. Always `output_text`. + + - `Logprobs []BetaResponseOutputTextLogprob` + + - `Type MultiAgentCallOutput` + + The type of the multi-agent result. Always `multi_agent_call_output`. + + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. - `type BetaResponseFunctionWebSearch struct{…}` @@ -94494,349 +107486,362 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseFunctionToolCall struct{…}` + - `type BetaResponseComputerToolCall struct{…}` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `Arguments string` + - `ID string` - A JSON string of the arguments to pass to the function. + The unique ID of the computer call. - `CallID string` - The unique ID of the function tool call generated by the model. + An identifier used when responding to the tool call with output. - - `Name string` + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - The name of the function to run. + The pending safety checks for the computer call. - - `Type FunctionCall` + - `ID string` - The type of the function tool call. Always `function_call`. + The ID of the pending safety check. - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + - `Code string` - - `ID string` + The type of the pending safety check. - The unique ID of the function tool call. + - `Message string` - - `Agent BetaResponseFunctionToolCallAgent` + Details about the pending safety check. - The agent that produced this item. + - `Status BetaResponseComputerToolCallStatus` - - `AgentName string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The canonical name of the agent that produced this item. + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - The execution context that produced this tool call. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `Type BetaResponseComputerToolCallType` - - `Type Direct` + The type of the computer call. Always `computer_call`. - - `const DirectDirect Direct = "direct"` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `Action BetaComputerActionUnion` - - `CallerID string` + A click action. - The call ID of the program item that produced this tool call. + - `type BetaComputerActionClick struct{…}` - - `Type Program` + A click action. - - `const ProgramProgram Program = "program"` + - `Button string` - - `Namespace string` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - The namespace of the function to run. + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `Status BetaResponseFunctionToolCallStatus` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `Type Click` - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + Specifies the event type. For a click action, this property is always `click`. - The output of a function tool call. + - `const ClickClick Click = "click"` - - `CallID string` + - `X int64` - The unique ID of the function tool call generated by the model. + The x-coordinate where the click occurred. - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + - `Y int64` - Text, image, or file output of the function tool call. + The y-coordinate where the click occurred. - - `string` + - `Keys []string` - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + The keys being held while clicking. - An array of content outputs (text, image, file) for the function tool call. + - `type BetaComputerActionDoubleClick struct{…}` - - `type BetaResponseInputTextContent struct{…}` + A double click action. - A text input to the model. + - `Keys []string` - - `Text string` + The keys being held while double-clicking. - The text input to the model. + - `Type DoubleClick` - - `Type InputText` + Specifies the event type. For a double click action, this property is always set to `double_click`. - The type of the input item. Always `input_text`. + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `const InputTextInputText InputText = "input_text"` + - `X int64` - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + The x-coordinate where the double click occurred. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Y int64` - - `Mode Explicit` + The y-coordinate where the double click occurred. - The breakpoint mode. Always `explicit`. + - `type BetaComputerActionDrag struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + A drag action. - - `type BetaResponseInputImageContent struct{…}` + - `Path []BetaComputerActionDragPath` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `Type InputImage` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - The type of the input item. Always `input_image`. + - `X int64` - - `const InputImageInputImage InputImage = "input_image"` + The x-coordinate. - - `Detail BetaResponseInputImageContentDetail` + - `Y int64` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The y-coordinate. - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `Type Drag` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + Specifies the event type. For a drag action, this property is always set to `drag`. - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + - `const DragDrag Drag = "drag"` - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `Keys []string` - - `FileID string` + The keys being held while dragging the mouse. - The ID of the file to be sent to the model. + - `type BetaComputerActionKeypress struct{…}` - - `ImageURL string` + A collection of keypresses the model would like to perform. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `Keys []string` - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Type Keypress` - - `Mode Explicit` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - The breakpoint mode. Always `explicit`. + - `const KeypressKeypress Keypress = "keypress"` - - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaComputerActionMove struct{…}` - - `type BetaResponseInputFileContent struct{…}` + A mouse move action. - A file input to the model. + - `Type Move` - - `Type InputFile` + Specifies the event type. For a move action, this property is always set to `move`. - The type of the input item. Always `input_file`. + - `const MoveMove Move = "move"` - - `const InputFileInputFile InputFile = "input_file"` + - `X int64` - - `Detail BetaResponseInputFileContentDetail` + The x-coordinate to move to. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Y int64` - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + The y-coordinate to move to. - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + - `Keys []string` - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + The keys being held while moving the mouse. - - `FileData string` + - `type BetaComputerActionScreenshot struct{…}` - The base64-encoded data of the file to be sent to the model. + A screenshot action. - - `FileID string` + - `Type Screenshot` - The ID of the file to be sent to the model. + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `FileURL string` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - The URL of the file to be sent to the model. + - `type BetaComputerActionScroll struct{…}` - - `Filename string` + A scroll action. - The name of the file to be sent to the model. + - `ScrollX int64` - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + The horizontal scroll distance. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `ScrollY int64` - - `Mode Explicit` + The vertical scroll distance. - The breakpoint mode. Always `explicit`. + - `Type Scroll` - - `const ExplicitExplicit Explicit = "explicit"` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `Type FunctionCallOutput` + - `const ScrollScroll Scroll = "scroll"` - The type of the function tool call output. Always `function_call_output`. + - `X int64` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + The x-coordinate where the scroll occurred. - - `ID string` + - `Y int64` - The unique ID of the function tool call output. Populated when this item is returned via API. + The y-coordinate where the scroll occurred. - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + - `Keys []string` - The agent that produced this item. + The keys being held while scrolling. - - `AgentName string` + - `type BetaComputerActionType struct{…}` - The canonical name of the agent that produced this item. + An action to type in text. - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `Text string` - The execution context that produced this tool call. + The text to type. - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + - `Type Type` - - `Type Direct` + Specifies the event type. For a type action, this property is always set to `type`. - The caller type. Always `direct`. + - `const TypeType Type = "type"` - - `const DirectDirect Direct = "direct"` + - `type BetaComputerActionWait struct{…}` - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + A wait action. - - `CallerID string` + - `Type Wait` - The call ID of the program item that produced this tool call. + Specifies the event type. For a wait action, this property is always set to `wait`. - - `Type Program` + - `const WaitWait Wait = "wait"` - The caller type. Always `program`. + - `Actions BetaComputerActionList` - - `const ProgramProgram Program = "program"` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `Status string` + - `type BetaComputerActionClick struct{…}` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + A click action. - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + - `type BetaComputerActionDoubleClick struct{…}` - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + A double click action. - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + - `type BetaComputerActionDrag struct{…}` - - `type BetaResponseInputItemAgentMessage struct{…}` + A drag action. - A message routed between agents. + - `type BetaComputerActionKeypress struct{…}` - - `Author string` + A collection of keypresses the model would like to perform. - The sending agent identity. + - `type BetaComputerActionMove struct{…}` - - `Content []BetaResponseInputItemAgentMessageContentUnion` + A mouse move action. - Plaintext, image, or encrypted content sent between agents. + - `type BetaComputerActionScreenshot struct{…}` - - `type BetaResponseInputTextContent struct{…}` + A screenshot action. - A text input to the model. + - `type BetaComputerActionScroll struct{…}` - - `type BetaResponseInputImageContent struct{…}` + A scroll action. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + - `type BetaComputerActionType struct{…}` - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + An action to type in text. - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `type BetaComputerActionWait struct{…}` - - `EncryptedContent string` + A wait action. - Opaque encrypted content. + - `Agent BetaResponseComputerToolCallAgent` - - `Type EncryptedContent` + The agent that produced this item. - The type of the input item. Always `encrypted_content`. + - `AgentName string` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + The canonical name of the agent that produced this item. - - `Recipient string` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - The destination agent identity. + - `ID string` - - `Type AgentMessage` + The unique ID of the computer call tool output. - The item type. Always `agent_message`. + - `CallID string` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + The ID of the computer tool call that produced the output. - - `ID string` + - `Output BetaResponseComputerToolCallOutputScreenshot` - The unique ID of this agent message item. + A computer screenshot image used with the computer use tool. - - `Agent BetaResponseInputItemAgentMessageAgent` + - `Type ComputerScreenshot` - The agent that produced this item. + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `AgentName string` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - The canonical name of the agent that produced this item. + - `FileID string` - - `type BetaResponseInputItemMultiAgentCall struct{…}` + The identifier of an uploaded file that contains the screenshot. - - `Action string` + - `ImageURL string` - The multi-agent action that was executed. + The URL of the screenshot image. - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - `Arguments string` + - `Type ComputerCallOutput` - The action arguments as a JSON string. + The type of the computer tool call output. Always `computer_call_output`. - - `CallID string` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - The unique ID linking this call to its output. + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `Type MultiAgentCall` + The safety checks reported by the API that have been acknowledged by the + developer. - The item type. Always `multi_agent_call`. + - `ID string` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + The ID of the pending safety check. - - `ID string` + - `Code string` - The unique ID of this multi-agent call. + The type of the pending safety check. - - `Agent BetaResponseInputItemMultiAgentCallAgent` + - `Message string` + + Details about the pending safety check. + + - `Agent BetaResponseComputerToolCallOutputItemAgent` The agent that produced this item. @@ -94844,129 +107849,140 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `CreatedBy string` - - `Action string` + The identifier of the actor that created the item. - The multi-agent action that produced this result. + - `type BetaResponseReasoningItem struct{…}` - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + 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](https://platform.openai.com/docs/guides/conversation-state). - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `ID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + The unique identifier of the reasoning content. - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `Summary []BetaResponseReasoningItemSummary` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + Reasoning summary content. - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + - `Text string` - - `CallID string` + A summary of the reasoning output from the model so far. - The unique ID of the multi-agent call. + - `Type SummaryText` - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + The type of the object. Always `summary_text`. - Text output returned by the multi-agent action. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `Text string` + - `Type Reasoning` - The text content. + The type of the object. Always `reasoning`. - - `Type OutputText` + - `const ReasoningReasoning Reasoning = "reasoning"` - The content type. Always `output_text`. + - `Agent BetaResponseReasoningItemAgent` - - `const OutputTextOutputText OutputText = "output_text"` + The agent that produced this item. - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + - `AgentName string` - Citations associated with the text content. + The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + - `Content []BetaResponseReasoningItemContent` - - `FileID string` + Reasoning text content. - The ID of the file. + - `Text string` - - `Filename string` + The reasoning text from the model. - The filename of the file cited. + - `Type ReasoningText` - - `Index int64` + The type of the reasoning text. Always `reasoning_text`. - The index of the file in the list of files. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `Type FileCitation` + - `EncryptedContent string` - The citation type. Always `file_citation`. + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `Status BetaResponseReasoningItemStatus` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `EndIndex int64` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - The index of the last character of the citation in the message. + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `StartIndex int64` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - The index of the first character of the citation in the message. + - `type BetaResponseOutputItemProgram struct{…}` - - `Title string` + - `ID string` - The title of the cited resource. + The unique ID of the program item. - - `Type URLCitation` + - `CallID string` - The citation type. Always `url_citation`. + The stable call ID of the program item. - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Code string` - - `URL string` + The JavaScript source executed by programmatic tool calling. - The URL of the cited resource. + - `Fingerprint string` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + Opaque program replay fingerprint that must be round-tripped. - - `ContainerID string` + - `Type Program` - The ID of the container. + The type of the item. Always `program`. - - `EndIndex int64` + - `const ProgramProgram Program = "program"` - The index of the last character of the citation in the message. + - `Agent BetaResponseOutputItemProgramAgent` - - `FileID string` + The agent that produced this item. - The ID of the container file. + - `AgentName string` - - `Filename string` + The canonical name of the agent that produced this item. - The filename of the container file cited. + - `type BetaResponseOutputItemProgramOutput struct{…}` - - `StartIndex int64` + - `ID string` - The index of the first character of the citation in the message. + The unique ID of the program output item. - - `Type ContainerFileCitation` + - `CallID string` - The citation type. Always `container_file_citation`. + The call ID of the program item. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `Result string` - - `Type MultiAgentCallOutput` + The result produced by the program item. - The item type. Always `multi_agent_call_output`. + - `Status string` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + The terminal status of the program output item. - - `ID string` + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - The unique ID of this multi-agent call output. + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + - `Type ProgramOutput` + + The type of the item. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseOutputItemProgramOutputAgent` The agent that produced this item. @@ -94974,23 +107990,45 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemToolSearchCall struct{…}` + - `type BetaResponseToolSearchCall struct{…}` + + - `ID string` + + The unique ID of the tool search call item. - `Arguments any` - The arguments supplied to the tool search call. + Arguments used for the tool search call. - - `Type ToolSearchCall` + - `CallID string` - The item type. Always `tool_search_call`. + The unique ID of the tool search call generated by the model. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `Execution BetaResponseToolSearchCallExecution` - - `ID string` + Whether tool search was executed by the server or by the client. - The unique ID of this tool search call. + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - `Agent BetaResponseInputItemToolSearchCallAgent` + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + + - `Status BetaResponseToolSearchCallStatus` + + The status of the tool search call item that was recorded. + + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + + - `Type ToolSearchCall` + + The type of the item. Always `tool_search_call`. + + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + + - `Agent BetaResponseToolSearchCallAgent` The agent that produced this item. @@ -94998,33 +108036,41 @@ func main() { The canonical name of the agent that produced this item. + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseToolSearchOutputItem 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 string` + - `Execution BetaResponseToolSearchOutputItemExecution` Whether tool search was executed by the server or by the client. - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - `Status string` + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - The status of the tool search call. + - `Status BetaResponseToolSearchOutputItemStatus` - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + The status of the tool search output item that was recorded. - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - `Tools []BetaToolUnion` - The loaded tool definitions returned by the tool search output. + The loaded tool definitions returned by tool search. - `type BetaFunctionTool struct{…}` @@ -95133,7 +108179,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -95190,7 +108240,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -96106,15 +109160,11 @@ func main() { - `Type ToolSearchOutput` - The item type. Always `tool_search_output`. + The type of the item. Always `tool_search_output`. - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `ID string` - - The unique ID of this tool search output. - - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - `Agent BetaResponseToolSearchOutputItemAgent` The agent that produced this item. @@ -96122,39 +109172,39 @@ func main() { The canonical name of the agent that produced this item. - - `CallID string` + - `CreatedBy string` - The unique ID of the tool search call generated by the model. + The identifier of the actor that created the item. - - `Execution BetaResponseToolSearchOutputItemParamExecution` + - `type BetaResponseOutputItemAdditionalTools struct{…}` - Whether tool search was executed by the server or by the client. + - `ID string` - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + The unique ID of the additional tools item. - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + - `Role string` - - `Status BetaResponseToolSearchOutputItemParamStatus` + The role that provided the additional tools. - The status of the tool search output. + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - `Role Developer` + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - The role that provided the additional tools. Only `developer` is supported. + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - - `const DeveloperDeveloper Developer = "developer"` + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - `Tools []BetaToolUnion` - A list of additional tools made available at this item. + The additional tool definitions made available at this item. - `type BetaFunctionTool struct{…}` @@ -96222,15 +109272,11 @@ func main() { - `Type AdditionalTools` - The item type. Always `additional_tools`. + The type of the item. Always `additional_tools`. - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `ID string` - - The unique ID of this additional tools item. - - - `Agent BetaResponseInputItemAdditionalToolsAgent` + - `Agent BetaResponseOutputItemAdditionalToolsAgent` The agent that produced this item. @@ -96238,82 +109284,17 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseReasoningItem struct{…}` + - `type BetaResponseCompactionItem 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](https://platform.openai.com/docs/guides/conversation-state). + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - `ID string` - The unique identifier of the reasoning content. - - - `Summary []BetaResponseReasoningItemSummary` - - 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"` - - - `Agent BetaResponseReasoningItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Content []BetaResponseReasoningItemContent` - - 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 BetaResponseReasoningItemStatus` - - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - - `type BetaResponseCompactionItemParamResp struct{…}` - - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The unique ID of the compaction item. - `EncryptedContent string` - The encrypted content of the compaction summary. + The encrypted content that was produced by compaction. - `Type Compaction` @@ -96321,11 +109302,7 @@ func main() { - `const CompactionCompaction Compaction = "compaction"` - - `ID string` - - The ID of the compaction item. - - - `Agent BetaResponseCompactionItemParamAgentResp` + - `Agent BetaResponseCompactionItemAgent` The agent that produced this item. @@ -96333,7 +109310,11 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemImageGenerationCall struct{…}` + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemImageGenerationCall struct{…}` An image generation request made by the model. @@ -96349,13 +109330,13 @@ func main() { The status of the image generation call. - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - `Type ImageGenerationCall` @@ -96363,7 +109344,7 @@ func main() { - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseInputItemImageGenerationCallAgent` + - `Agent BetaResponseOutputItemImageGenerationCallAgent` The agent that produced this item. @@ -96448,7 +109429,7 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `type BetaResponseOutputItemLocalShellCall struct{…}` A tool call to run a command on the local shell. @@ -96456,7 +109437,7 @@ func main() { The unique ID of the local shell call. - - `Action BetaResponseInputItemLocalShellCallAction` + - `Action BetaResponseOutputItemLocalShellCallAction` Execute a shell command on the server. @@ -96494,11 +109475,11 @@ func main() { The status of the local shell call. - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - `Type LocalShellCall` @@ -96506,7 +109487,7 @@ func main() { - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `Agent BetaResponseInputItemLocalShellCallAgent` + - `Agent BetaResponseOutputItemLocalShellCallAgent` The agent that produced this item. @@ -96514,7 +109495,7 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` The output of a local shell tool call. @@ -96532,7 +109513,7 @@ func main() { - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` The agent that produced this item. @@ -96544,47 +109525,81 @@ func main() { The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - - `type BetaResponseInputItemShellCall struct{…}` + - `type BetaResponseFunctionShellToolCall struct{…}` - A tool representing a request to execute one or more shell commands. + A tool call that executes one or more shell commands in a managed environment. - - `Action BetaResponseInputItemShellCallAction` + - `ID string` + + The unique ID of the shell tool call. Populated when this item is returned via API. + + - `Action BetaResponseFunctionShellToolCallAction` The shell commands and limits that describe how to run the tool call. - `Commands []string` - Ordered shell commands for the execution environment to run. - - `MaxOutputLength int64` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + Optional maximum number of characters to return from each command. - `TimeoutMs int64` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + Optional timeout in milliseconds for the commands. - `CallID string` The unique ID of the shell tool call generated by the model. + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + + Represents the use of a local environment to perform shell actions. + + - `type BetaResponseLocalEnvironment struct{…}` + + Represents the use of a local environment to perform shell actions. + + - `Type Local` + + The environment type. Always `local`. + + - `const LocalLocal Local = "local"` + + - `type BetaResponseContainerReference struct{…}` + + Represents a container created with /v1/containers. + + - `ContainerID string` + + - `Type ContainerReference` + + The environment type. Always `container_reference`. + + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + + - `Status BetaResponseFunctionShellToolCallStatus` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `Type ShellCall` The type of the item. Always `shell_call`. - `const ShellCallShellCall ShellCall = "shell_call"` - - `ID string` - - The unique ID of the shell tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemShellCallAgent` + - `Agent BetaResponseFunctionShellToolCallAgent` The agent that produced this item. @@ -96592,19 +109607,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemShellCallCallerUnion` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - `CallerID string` @@ -96612,45 +109625,37 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - The environment to execute the shell commands in. - - - `type BetaLocalEnvironment struct{…}` - - - `type BetaContainerReference struct{…}` - - - `Status string` - - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `CreatedBy string` - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + The ID of the entity that created this tool call. - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + The output of a shell tool call that was emitted. - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `ID string` - The streamed output items emitted by a shell tool call. + 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. - - `Output []BetaResponseFunctionShellCallOutputContent` + - `MaxOutputLength int64` - Captured chunks of stdout and stderr output, along with their associated outcomes. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - The exit or timeout outcome associated with this shell call. + An array of shell call output contents - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` Indicates that the shell call exceeded its configured time limit. @@ -96660,13 +109665,13 @@ func main() { - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` Indicates that the shell commands finished and returned an exit code. - `ExitCode int64` - The exit code returned by the shell process. + Exit code from the shell process. - `Type Exit` @@ -96676,23 +109681,33 @@ func main() { - `Stderr string` - Captured stderr output for the shell call. + The standard error output that was captured. - `Stdout string` - Captured stdout output for the shell call. + The standard output that was captured. - - `Type ShellCallOutput` + - `CreatedBy string` - The type of the item. Always `shell_call_output`. + The identifier of the actor that created the item. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `ID string` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + + - `Type ShellCallOutput` + + The type of the shell call output. Always `shell_call_output`. + + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + + - `Agent BetaResponseFunctionShellToolCallOutputAgent` The agent that produced this item. @@ -96700,19 +109715,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - `CallerID string` @@ -96720,93 +109733,85 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `MaxOutputLength int64` - - The maximum number of UTF-8 characters captured for this shell call's combined output. - - - `Status string` - - The status of the shell call output. + - `CreatedBy string` - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + The identifier of the actor that created the item. - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + - `type BetaResponseApplyPatchToolCall struct{…}` - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + A tool call that applies file diffs by creating, deleting, or updating files. - - `type BetaResponseInputItemApplyPatchCall struct{…}` + - `ID string` - A tool call representing a request to create, delete, or update files using diff patches. + 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 BetaResponseInputItemApplyPatchCallOperationUnion` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - The specific create, delete, or update instruction for the apply_patch tool call. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - Instruction for creating a new file via the apply_patch tool. + Instruction describing how to create a file via the apply_patch tool. - `Diff string` - Unified diff content to apply when creating the file. + Diff to apply. - `Path string` - Path of the file to create relative to the workspace root. + Path of the file to create. - `Type CreateFile` - The operation type. Always `create_file`. + Create a new file with the provided diff. - `const CreateFileCreateFile CreateFile = "create_file"` - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - Instruction for deleting an existing file via the apply_patch tool. + Instruction describing how to delete a file via the apply_patch tool. - `Path string` - Path of the file to delete relative to the workspace root. + Path of the file to delete. - `Type DeleteFile` - The operation type. Always `delete_file`. + Delete the specified file. - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - Instruction for updating an existing file via the apply_patch tool. + Instruction describing how to update a file via the apply_patch tool. - `Diff string` - Unified diff content to apply to the existing file. + Diff to apply. - `Path string` - Path of the file to update relative to the workspace root. + Path of the file to update. - `Type UpdateFile` - The operation type. Always `update_file`. + Update an existing file with the provided diff. - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Status string` + - `Status BetaResponseApplyPatchToolCallStatus` The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - `Type ApplyPatchCall` @@ -96814,11 +109819,7 @@ func main() { - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `ID string` - - The unique ID of the apply patch tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemApplyPatchCallAgent` + - `Agent BetaResponseApplyPatchToolCallAgent` The agent that produced this item. @@ -96826,19 +109827,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - `CallerID string` @@ -96846,25 +109845,31 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `CreatedBy string` - The streamed output emitted by an apply patch tool call. + The ID of the entity that created this tool call. + + - `type BetaResponseApplyPatchToolCallOutput 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 string` + - `Status BetaResponseApplyPatchToolCallOutputStatus` The status of the apply patch tool call output. One of `completed` or `failed`. - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - `Type ApplyPatchCallOutput` @@ -96872,11 +109877,7 @@ func main() { - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `ID string` - - The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` The agent that produced this item. @@ -96884,19 +109885,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - `CallerID string` @@ -96904,15 +109903,78 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` + - `CreatedBy string` + + The ID of the entity that created this tool call output. + - `Output string` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + Optional textual output returned by the apply patch tool. - - `type BetaResponseInputItemMcpListTools struct{…}` + - `type BetaResponseOutputItemMcpCall 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"` + + - `Agent BetaResponseOutputItemMcpCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `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 BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + + - `type BetaResponseOutputItemMcpListTools struct{…}` A list of tools available on an MCP server. @@ -96924,7 +109986,7 @@ func main() { The label of the MCP server. - - `Tools []BetaResponseInputItemMcpListToolsTool` + - `Tools []BetaResponseOutputItemMcpListToolsTool` The tools available on the server. @@ -96950,7 +110012,7 @@ func main() { - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Agent BetaResponseInputItemMcpListToolsAgent` + - `Agent BetaResponseOutputItemMcpListToolsAgent` The agent that produced this item. @@ -96962,7 +110024,7 @@ func main() { Error message if the server could not list tools. - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` A request for human approval of a tool invocation. @@ -96988,7 +110050,7 @@ func main() { - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` The agent that produced this item. @@ -96996,10 +110058,14 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - `type BetaResponseOutputItemMcpApprovalResponse 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. @@ -97014,11 +110080,7 @@ func main() { - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `ID string` - - The unique ID of the approval response - - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` The agent that produced this item. @@ -97030,33 +110092,33 @@ func main() { Optional reason for the decision. - - `type BetaResponseInputItemMcpCall struct{…}` + - `type BetaResponseCustomToolCall struct{…}` - An invocation of a tool on an MCP server. + A call to a custom tool created by the model. - - `ID string` + - `CallID string` - The unique ID of the tool call. + An identifier used to map this custom tool call to a tool call output. - - `Arguments string` + - `Input string` - A JSON string of the arguments passed to the tool. + The input for the custom tool call generated by the model. - `Name string` - The name of the tool that was run. + The name of the custom tool being called. - - `ServerLabel string` + - `Type CustomToolCall` - The label of the MCP server running the tool. + The type of the custom tool call. Always `custom_tool_call`. - - `Type McpCall` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - The type of the item. Always `mcp_call`. + - `ID string` - - `const McpCallMcpCall McpCall = "mcp_call"` + The unique ID of the custom tool call in the OpenAI platform. - - `Agent BetaResponseInputItemMcpCallAgent` + - `Agent BetaResponseCustomToolCallAgent` The agent that produced this item. @@ -97064,265 +110126,257 @@ func main() { The canonical name of the agent that produced this item. - - `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. + - `Caller BetaResponseCustomToolCallCallerUnion` - - `Error string` + The execution context that produced this tool call. - The error from the tool call, if any. + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - `Output string` + - `Type Direct` - The output from the tool call. + - `const DirectDirect Direct = "direct"` - - `Status string` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `CallerID string` - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + The call ID of the program item that produced this tool call. - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + - `Type Program` - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + - `Namespace string` - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + The namespace of the custom tool being called. - - `type BetaResponseCustomToolCallOutput struct{…}` + - `type BetaResponseCustomToolCallOutputItem struct{…}` The output of a custom tool call from your code, being sent back to the model. - - `CallID string` - - The call ID, used to map this custom tool call output to a custom tool call. - - - `Output BetaResponseCustomToolCallOutputOutputUnion` + - `ID string` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + The unique ID of the custom tool call output item. - - `string` + - `Status string` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Text, image, or file output of the custom tool call. + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `type BetaResponseInputText struct{…}` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - A text input to the model. + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `type BetaResponseInputImage struct{…}` + - `CreatedBy string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The identifier of the actor that created the item. - - `type BetaResponseInputFile struct{…}` + - `OutputIndex int64` - A file input to the model. + The index of the output item that was marked done. - - `Type CustomToolCallOutput` + - `SequenceNumber int64` - The type of the custom tool call output. Always `custom_tool_call_output`. + The sequence number of this event. - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `Type ResponseOutputItemDone` - - `ID string` + The type of the event. Always `response.output_item.done`. - The unique ID of the custom tool call output in the OpenAI platform. + - `const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"` - - `Agent BetaResponseCustomToolCallOutputAgent` + - `Agent BetaResponseOutputItemDoneEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - The execution context that produced this tool call. +### Beta Response Output Message - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` +- `type BetaResponseOutputMessage struct{…}` - - `Type Direct` + An output message from the model. - The caller type. Always `direct`. + - `ID string` - - `const DirectDirect Direct = "direct"` + The unique ID of the output message. - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `Content []BetaResponseOutputMessageContentUnion` - - `CallerID string` + The content of the output message. - The call ID of the program item that produced this tool call. + - `type BetaResponseOutputText struct{…}` - - `Type Program` + A text output from the model. - The caller type. Always `program`. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `const ProgramProgram Program = "program"` + The annotations of the text output. - - `type BetaResponseCustomToolCall struct{…}` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - A call to a custom tool created by the model. + A citation to a file. - - `CallID string` + - `FileID string` - An identifier used to map this custom tool call to a tool call output. + The ID of the file. - - `Input string` + - `Filename string` - The input for the custom tool call generated by the model. + The filename of the file cited. - - `Name string` + - `Index int64` - The name of the custom tool being called. + The index of the file in the list of files. - - `Type CustomToolCall` + - `Type FileCitation` - The type of the custom tool call. Always `custom_tool_call`. + The type of the file citation. Always `file_citation`. - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `ID string` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - The unique ID of the custom tool call in the OpenAI platform. + A citation for a web resource used to generate a model response. - - `Agent BetaResponseCustomToolCallAgent` + - `EndIndex int64` - The agent that produced this item. + The index of the last character of the URL citation in the message. - - `AgentName string` + - `StartIndex int64` - The canonical name of the agent that produced this item. + The index of the first character of the URL citation in the message. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `Title string` - The execution context that produced this tool call. + The title of the web resource. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `Type URLCitation` - - `Type Direct` + The type of the URL citation. Always `url_citation`. - - `const DirectDirect Direct = "direct"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `URL string` - - `CallerID string` + The URL of the web resource. - The call ID of the program item that produced this tool call. + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `Type Program` + A citation for a container file used to generate a model response. - - `const ProgramProgram Program = "program"` + - `ContainerID string` - - `Namespace string` + The ID of the container file. - The namespace of the custom tool being called. + - `EndIndex int64` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + The index of the last character of the container file citation in the message. - Compacts the current context. Must be the final input item. + - `FileID string` - - `Type CompactionTrigger` + The ID of the file. - The type of the item. Always `compaction_trigger`. + - `Filename string` - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + The filename of the container file cited. - - `Agent BetaResponseInputItemCompactionTriggerAgent` + - `StartIndex int64` - The agent that produced this item. + The index of the first character of the container file citation in the message. - - `AgentName string` + - `Type ContainerFileCitation` - The canonical name of the agent that produced this item. + The type of the container file citation. Always `container_file_citation`. - - `type BetaResponseInputItemItemReference struct{…}` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - An internal identifier for an item to reference. + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - - `ID string` + A path to a file. - The ID of the item to reference. + - `FileID string` - - `Agent BetaResponseInputItemItemReferenceAgent` + The ID of the file. - The agent that produced this item. + - `Index int64` - - `AgentName string` + The index of the file in the list of files. - The canonical name of the agent that produced this item. + - `Type FilePath` - - `Type string` + The type of the file path. Always `file_path`. - The type of item to reference. Always `item_reference`. + - `const FilePathFilePath FilePath = "file_path"` - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + - `Text string` - - `type BetaResponseInputItemProgram struct{…}` + The text output from the model. - - `ID string` + - `Type OutputText` - The unique ID of this program item. + The type of the output text. Always `output_text`. - - `CallID string` + - `const OutputTextOutputText OutputText = "output_text"` - The stable call ID of the program item. + - `Logprobs []BetaResponseOutputTextLogprob` - - `Code string` + - `Token string` - The JavaScript source executed by programmatic tool calling. + - `Bytes []int64` - - `Fingerprint string` + - `Logprob float64` - Opaque program replay fingerprint that must be round-tripped. + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - - `Type Program` + - `Token string` - The item type. Always `program`. + - `Bytes []int64` - - `const ProgramProgram Program = "program"` + - `Logprob float64` - - `Agent BetaResponseInputItemProgramAgent` + - `type BetaResponseOutputRefusal struct{…}` - The agent that produced this item. + A refusal from the model. - - `AgentName string` + - `Refusal string` - The canonical name of the agent that produced this item. + The refusal explanation from the model. - - `type BetaResponseInputItemProgramOutput struct{…}` + - `Type Refusal` - - `ID string` + The type of the refusal. Always `refusal`. - The unique ID of this program output item. + - `const RefusalRefusal Refusal = "refusal"` - - `CallID string` + - `Role Assistant` - The call ID of the program item. + The role of the output message. Always `assistant`. - - `Result string` + - `const AssistantAssistant Assistant = "assistant"` - The result produced by the program item. + - `Status BetaResponseOutputMessageStatus` - - `Status string` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - The terminal status of the program output. + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `Type ProgramOutput` + - `Type Message` - The item type. Always `program_output`. + The type of the output message. Always `message`. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `const MessageMessage Message = "message"` - - `Agent BetaResponseInputItemProgramOutputAgent` + - `Agent BetaResponseOutputMessageAgent` The agent that produced this item. @@ -97330,236 +110384,242 @@ func main() { The canonical name of the agent that produced this item. -### Beta Response Input Audio + - `Phase BetaResponseOutputMessagePhase` -- `type BetaResponseInputAudio struct{…}` + 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. - An audio input to the model. + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `InputAudio BetaResponseInputAudioInputAudio` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - - `Data string` +### Beta Response Output Refusal - Base64-encoded audio data. +- `type BetaResponseOutputRefusal struct{…}` - - `Format string` + A refusal from the model. - The format of the audio data. Currently supported formats are `mp3` and - `wav`. + - `Refusal string` - - `const BetaResponseInputAudioInputAudioFormatMP3 BetaResponseInputAudioInputAudioFormat = "mp3"` + The refusal explanation from the model. - - `const BetaResponseInputAudioInputAudioFormatWAV BetaResponseInputAudioInputAudioFormat = "wav"` + - `Type Refusal` - - `Type InputAudio` + The type of the refusal. Always `refusal`. - The type of the input item. Always `input_audio`. + - `const RefusalRefusal Refusal = "refusal"` - - `const InputAudioInputAudio InputAudio = "input_audio"` +### Beta Response Output Text -### Beta Response Input Content +- `type BetaResponseOutputText struct{…}` -- `type BetaResponseInputContentUnion interface{…}` + A text output from the model. - A text input to the model. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `type BetaResponseInputText struct{…}` + The annotations of the text output. - A text input to the model. + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `Text string` + A citation to a file. - The text input to the model. + - `FileID string` - - `Type InputText` + The ID of the file. - The type of the input item. Always `input_text`. + - `Filename string` - - `const InputTextInputText InputText = "input_text"` + The filename of the file cited. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `Index int64` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The index of the file in the list of files. - - `Mode Explicit` + - `Type FileCitation` - The breakpoint mode. Always `explicit`. + The type of the file citation. Always `file_citation`. - - `const ExplicitExplicit Explicit = "explicit"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `type BetaResponseInputImage struct{…}` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + A citation for a web resource used to generate a model response. - - `Detail BetaResponseInputImageDetail` + - `EndIndex int64` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The index of the last character of the URL citation in the message. - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `StartIndex int64` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + The index of the first character of the URL citation in the message. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `Title string` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + The title of the web resource. - - `Type InputImage` + - `Type URLCitation` - The type of the input item. Always `input_image`. + The type of the URL citation. Always `url_citation`. - - `const InputImageInputImage InputImage = "input_image"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `FileID string` + - `URL string` - The ID of the file to be sent to the model. + The URL of the web resource. - - `ImageURL string` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + A citation for a container file used to generate a model response. - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `ContainerID string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The ID of the container file. - - `Mode Explicit` + - `EndIndex int64` - The breakpoint mode. Always `explicit`. + The index of the last character of the container file citation in the message. - - `const ExplicitExplicit Explicit = "explicit"` + - `FileID string` - - `type BetaResponseInputFile struct{…}` + The ID of the file. - A file input to the model. + - `Filename string` - - `Type InputFile` + The filename of the container file cited. - The type of the input item. Always `input_file`. + - `StartIndex int64` - - `const InputFileInputFile InputFile = "input_file"` + The index of the first character of the container file citation in the message. - - `Detail BetaResponseInputFileDetail` + - `Type ContainerFileCitation` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + The type of the container file citation. Always `container_file_citation`. - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + A path to a file. - - `FileData string` + - `FileID string` - The content of the file to be sent to the model. + The ID of the file. - - `FileID string` + - `Index int64` - The ID of the file to be sent to the model. + The index of the file in the list of files. - - `FileURL string` + - `Type FilePath` - The URL of the file to be sent to the model. + The type of the file path. Always `file_path`. - - `Filename string` + - `const FilePathFilePath FilePath = "file_path"` - The name of the file to be sent to the model. + - `Text string` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + The text output from the model. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Type OutputText` - - `Mode Explicit` + The type of the output text. Always `output_text`. - The breakpoint mode. Always `explicit`. + - `const OutputTextOutputText OutputText = "output_text"` - - `const ExplicitExplicit Explicit = "explicit"` + - `Logprobs []BetaResponseOutputTextLogprob` -### Beta Response Input File + - `Token string` -- `type BetaResponseInputFile struct{…}` + - `Bytes []int64` - A file input to the model. + - `Logprob float64` - - `Type InputFile` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - The type of the input item. Always `input_file`. + - `Token string` - - `const InputFileInputFile InputFile = "input_file"` + - `Bytes []int64` - - `Detail BetaResponseInputFileDetail` + - `Logprob float64` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. +### Beta Response Output Text Annotation Added Event - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` +- `type BetaResponseOutputTextAnnotationAddedEvent struct{…}` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + Emitted when an annotation is added to output text content. - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `Annotation any` - - `FileData string` + The annotation object being added. (See annotation schema for details.) - The content of the file to be sent to the model. + - `AnnotationIndex int64` - - `FileID string` + The index of the annotation within the content part. - The ID of the file to be sent to the model. + - `ContentIndex int64` - - `FileURL string` + The index of the content part within the output item. - The URL of the file to be sent to the model. + - `ItemID string` - - `Filename string` + The unique identifier of the item to which the annotation is being added. - The name of the file to be sent to the model. + - `OutputIndex int64` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + The index of the output item in the response's output array. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `SequenceNumber int64` - - `Mode Explicit` + The sequence number of this event. - The breakpoint mode. Always `explicit`. + - `Type ResponseOutputTextAnnotationAdded` - - `const ExplicitExplicit Explicit = "explicit"` + The type of the event. Always 'response.output_text.annotation.added'. -### Beta Response Input File Content + - `const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"` -- `type BetaResponseInputFileContent struct{…}` + - `Agent BetaResponseOutputTextAnnotationAddedEventAgent` - A file input to the model. + The agent that owns this multi-agent streaming event. - - `Type InputFile` + - `AgentName string` - The type of the input item. Always `input_file`. + The canonical name of the agent that produced this item. - - `const InputFileInputFile InputFile = "input_file"` +### Beta Response Prompt - - `Detail BetaResponseInputFileContentDetail` +- `type BetaResponsePrompt struct{…}` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `ID string` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + The unique identifier of the prompt template to use. - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + - `Variables map[string, BetaResponsePromptVariableUnion]` - - `FileData string` + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - The base64-encoded data of the file to be sent to the model. + - `string` - - `FileID string` + - `type BetaResponseInputText struct{…}` - The ID of the file to be sent to the model. + A text input to the model. - - `FileURL string` + - `Text string` - The URL of the file to be sent to the model. + The text input to the model. - - `Filename string` + - `Type InputText` - The name of the file to be sent to the model. + The type of the input item. Always `input_text`. - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `const InputTextInputText InputText = "input_text"` + + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -97569,9 +110629,7 @@ func main() { - `const ExplicitExplicit Explicit = "explicit"` -### Beta Response Input Image - -- `type BetaResponseInputImage struct{…}` + - `type BetaResponseInputImage struct{…}` An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). @@ -97611,39 +110669,43 @@ func main() { - `const ExplicitExplicit Explicit = "explicit"` -### Beta Response Input Image Content + - `type BetaResponseInputFile struct{…}` -- `type BetaResponseInputImageContent struct{…}` + A file input to the model. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + - `Type InputFile` - - `Type InputImage` + The type of the input item. Always `input_file`. - The type of the input item. Always `input_image`. + - `const InputFileInputFile InputFile = "input_file"` - - `const InputImageInputImage InputImage = "input_image"` + - `Detail BetaResponseInputFileDetail` - - `Detail BetaResponseInputImageContentDetail` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + - `FileData string` - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + The content of the file to be sent to the model. - `FileID string` The ID of the file to be sent to the model. - - `ImageURL string` + - `FileURL string` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + The URL of the file to be sent to the model. - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `Filename string` + + The name of the file to be sent to the model. + + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -97653,15 +110715,104 @@ func main() { - `const ExplicitExplicit Explicit = "explicit"` -### Beta Response Input Item + - `Version string` -- `type BetaResponseInputItemUnion interface{…}` + Optional version of the prompt template. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. +### Beta Response Queued Event + +- `type BetaResponseQueuedEvent struct{…}` + + Emitted when a response is queued and waiting to be processed. + + - `Response BetaResponse` + + The full response object that is queued. + + - `ID string` + + Unique identifier for this Response. + + - `CreatedAt float64` + + Unix timestamp (in seconds) of when this Response was created. + + - `Error BetaResponseError` + + An error object returned when the model fails to generate a Response. + + - `Code BetaResponseErrorCode` + + The error code for the response. + + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + + - `Message string` + + A human-readable description of the error. + + - `IncompleteDetails BetaResponseIncompleteDetails` + + Details about why the response is incomplete. + + - `Reason string` + + The reason why the response is incomplete. + + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + + - `Instructions BetaResponseInstructionsUnion` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + + - `string` + + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + + A list of one or many input items to the model, containing + different content types. - `type BetaEasyInputMessage struct{…}` @@ -97814,6 +110965,8 @@ func main() { - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + - `Type BetaEasyInputMessageType` The type of the message input. Always `message`. @@ -98061,6 +111214,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -99241,7 +112396,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -99298,7 +112457,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -101016,1097 +114179,117 @@ func main() { - `const ProgramProgram Program = "program"` - - `Output string` - - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - - `type BetaResponseInputItemMcpListTools 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 []BetaResponseInputItemMcpListToolsTool` - - 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"` - - - `Agent BetaResponseInputItemMcpListToolsAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Error string` - - Error message if the server could not list tools. - - - `type BetaResponseInputItemMcpApprovalRequest 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"` - - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - - A response to an MCP approval request. - - - `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"` - - - `ID string` - - The unique ID of the approval response - - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Reason string` - - Optional reason for the decision. - - - `type BetaResponseInputItemMcpCall 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"` - - - `Agent BetaResponseInputItemMcpCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `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 BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - - `type BetaResponseCustomToolCallOutput struct{…}` - - The output of a custom tool call from your code, being sent back to the model. - - - `CallID string` - - The call ID, used to map this custom tool call output to a custom tool call. - - - `Output BetaResponseCustomToolCallOutputOutputUnion` - - The output from the custom tool call generated by your code. - Can be a string or an list of output content. - - - `string` - - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - - Text, image, or file output of the custom tool call. - - - `type BetaResponseInputText struct{…}` - - A text input to the model. - - - `type BetaResponseInputImage struct{…}` - - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - - `type BetaResponseInputFile struct{…}` - - A file input to the model. - - - `Type CustomToolCallOutput` - - The type of the custom tool call output. Always `custom_tool_call_output`. - - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - - - `ID string` - - The unique ID of the custom tool call output in the OpenAI platform. - - - `Agent BetaResponseCustomToolCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - The caller type. Always `program`. - - - `const ProgramProgram Program = "program"` - - - `type BetaResponseCustomToolCall struct{…}` - - A call to a custom tool created by the model. - - - `CallID string` - - An identifier used to map this custom tool call to a tool call output. - - - `Input string` - - The input for the custom tool call generated by the model. - - - `Name string` - - The name of the custom tool being called. - - - `Type CustomToolCall` - - The type of the custom tool call. Always `custom_tool_call`. - - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - - `ID string` - - The unique ID of the custom tool call in the OpenAI platform. - - - `Agent BetaResponseCustomToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseCustomToolCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - - `Type Direct` - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - - `const ProgramProgram Program = "program"` - - - `Namespace string` - - The namespace of the custom tool being called. - - - `type BetaResponseInputItemCompactionTrigger struct{…}` - - Compacts the current context. Must be the final input item. - - - `Type CompactionTrigger` - - The type of the item. Always `compaction_trigger`. - - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - - `Agent BetaResponseInputItemCompactionTriggerAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseInputItemItemReference struct{…}` - - An internal identifier for an item to reference. - - - `ID string` - - The ID of the item to reference. - - - `Agent BetaResponseInputItemItemReferenceAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Type string` - - The type of item to reference. Always `item_reference`. - - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - - - `type BetaResponseInputItemProgram struct{…}` - - - `ID string` - - The unique ID of this program item. - - - `CallID string` - - The stable call ID of the program item. - - - `Code string` - - The JavaScript source executed by programmatic tool calling. - - - `Fingerprint string` - - Opaque program replay fingerprint that must be round-tripped. - - - `Type Program` - - The item type. Always `program`. - - - `const ProgramProgram Program = "program"` - - - `Agent BetaResponseInputItemProgramAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseInputItemProgramOutput struct{…}` - - - `ID string` - - The unique ID of this program output item. - - - `CallID string` - - The call ID of the program item. - - - `Result string` - - The result produced by the program item. - - - `Status string` - - The terminal status of the program output. - - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - - - `Type ProgramOutput` - - The item type. Always `program_output`. - - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - - `Agent BetaResponseInputItemProgramOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - -### Beta Response Input Message Content List - -- `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - A list of one or many input items to the model, containing different content - types. - - - `type BetaResponseInputText 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"` - - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `type BetaResponseInputImage struct{…}` - - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - - `Detail BetaResponseInputImageDetail` - - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. - - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `type BetaResponseInputFile struct{…}` - - A file input to the model. - - - `Type InputFile` - - The type of the input item. Always `input_file`. - - - `const InputFileInputFile InputFile = "input_file"` - - - `Detail BetaResponseInputFileDetail` - - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. - - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - -### Beta Response Input Message Item - -- `type BetaResponseInputMessageItem struct{…}` - - - `ID string` - - The unique ID of the message input. - - - `Content BetaResponseInputMessageContentList` - - A list of one or many input items to the model, containing different content - types. - - - `type BetaResponseInputText 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"` - - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `type BetaResponseInputImage struct{…}` - - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - - `Detail BetaResponseInputImageDetail` - - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. - - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `type BetaResponseInputFile struct{…}` - - A file input to the model. - - - `Type InputFile` - - The type of the input item. Always `input_file`. - - - `const InputFileInputFile InputFile = "input_file"` - - - `Detail BetaResponseInputFileDetail` - - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. - - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `Role BetaResponseInputMessageItemRole` - - The role of the message input. One of `user`, `system`, or `developer`. - - - `const BetaResponseInputMessageItemRoleUser BetaResponseInputMessageItemRole = "user"` - - - `const BetaResponseInputMessageItemRoleSystem BetaResponseInputMessageItemRole = "system"` - - - `const BetaResponseInputMessageItemRoleDeveloper BetaResponseInputMessageItemRole = "developer"` - - - `Type Message` - - The type of the message input. Always set to `message`. - - - `const MessageMessage Message = "message"` - - - `Agent BetaResponseInputMessageItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Status BetaResponseInputMessageItemStatus` - - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseInputMessageItemStatusInProgress BetaResponseInputMessageItemStatus = "in_progress"` - - - `const BetaResponseInputMessageItemStatusCompleted BetaResponseInputMessageItemStatus = "completed"` - - - `const BetaResponseInputMessageItemStatusIncomplete BetaResponseInputMessageItemStatus = "incomplete"` - -### Beta Response Input Text - -- `type BetaResponseInputText 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"` - - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - -### Beta Response Input Text Content - -- `type BetaResponseInputTextContent 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"` - - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - -### Beta Response Item - -- `type BetaResponseItemUnion interface{…}` - - Content item used to generate a response. - - - `type BetaResponseInputMessageItem struct{…}` - - - `ID string` - - The unique ID of the message input. - - - `Content BetaResponseInputMessageContentList` - - A list of one or many input items to the model, containing different content - types. - - - `type BetaResponseInputText 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"` - - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `type BetaResponseInputImage struct{…}` - - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - - `Detail BetaResponseInputImageDetail` - - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "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. - - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `type BetaResponseInputFile struct{…}` - - A file input to the model. - - - `Type InputFile` - - The type of the input item. Always `input_file`. - - - `const InputFileInputFile InputFile = "input_file"` - - - `Detail BetaResponseInputFileDetail` - - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "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. - - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `Role BetaResponseInputMessageItemRole` - - The role of the message input. One of `user`, `system`, or `developer`. - - - `const BetaResponseInputMessageItemRoleUser BetaResponseInputMessageItemRole = "user"` - - - `const BetaResponseInputMessageItemRoleSystem BetaResponseInputMessageItemRole = "system"` - - - `const BetaResponseInputMessageItemRoleDeveloper BetaResponseInputMessageItemRole = "developer"` - - - `Type Message` - - The type of the message input. Always set to `message`. - - - `const MessageMessage Message = "message"` - - - `Agent BetaResponseInputMessageItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Status BetaResponseInputMessageItemStatus` - - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseInputMessageItemStatusInProgress BetaResponseInputMessageItemStatus = "in_progress"` - - - `const BetaResponseInputMessageItemStatusCompleted BetaResponseInputMessageItemStatus = "completed"` - - - `const BetaResponseInputMessageItemStatusIncomplete BetaResponseInputMessageItemStatus = "incomplete"` - - - `type BetaResponseOutputMessage struct{…}` - - An output message from the model. - - - `ID string` - - The unique ID of the output message. - - - `Content []BetaResponseOutputMessageContentUnion` - - The content of the output message. - - - `type BetaResponseOutputText struct{…}` - - A text output from the model. - - - `Annotations []BetaResponseOutputTextAnnotationUnion` - - The annotations of the text output. - - - `type BetaResponseOutputTextAnnotationFileCitation 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 BetaResponseOutputTextAnnotationURLCitation 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 BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `Output string` - A citation for a container file used to generate a model response. + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - `ContainerID string` + - `type BetaResponseInputItemMcpListTools struct{…}` - The ID of the container file. + A list of tools available on an MCP server. - - `EndIndex int64` + - `ID string` - The index of the last character of the container file citation in the message. + The unique ID of the list. - - `FileID string` + - `ServerLabel string` - The ID of the file. + The label of the MCP server. - - `Filename string` + - `Tools []BetaResponseInputItemMcpListToolsTool` - The filename of the container file cited. + The tools available on the server. - - `StartIndex int64` + - `InputSchema any` - The index of the first character of the container file citation in the message. + The JSON schema describing the tool's input. - - `Type ContainerFileCitation` + - `Name string` - The type of the container file citation. Always `container_file_citation`. + The name of the tool. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `Annotations any` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + Additional annotations about the tool. - A path to a file. + - `Description string` - - `FileID string` + The description of the tool. - The ID of the file. + - `Type McpListTools` - - `Index int64` + The type of the item. Always `mcp_list_tools`. - The index of the file in the list of files. + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Type FilePath` + - `Agent BetaResponseInputItemMcpListToolsAgent` - The type of the file path. Always `file_path`. + The agent that produced this item. - - `const FilePathFilePath FilePath = "file_path"` + - `AgentName string` - - `Text string` + The canonical name of the agent that produced this item. - The text output from the model. + - `Error string` - - `Type OutputText` + Error message if the server could not list tools. - The type of the output text. Always `output_text`. + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - - `const OutputTextOutputText OutputText = "output_text"` + A request for human approval of a tool invocation. - - `Logprobs []BetaResponseOutputTextLogprob` + - `ID string` - - `Token string` + The unique ID of the approval request. - - `Bytes []int64` + - `Arguments string` - - `Logprob float64` + A JSON string of arguments for the tool. - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `Name string` - - `Token string` + The name of the tool to run. - - `Bytes []int64` + - `ServerLabel string` - - `Logprob float64` + The label of the MCP server making the request. - - `type BetaResponseOutputRefusal struct{…}` + - `Type McpApprovalRequest` - A refusal from the model. + The type of the item. Always `mcp_approval_request`. - - `Refusal string` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - The refusal explanation from the model. + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - - `Type Refusal` + The agent that produced this item. - The type of the refusal. Always `refusal`. + - `AgentName string` - - `const RefusalRefusal Refusal = "refusal"` + The canonical name of the agent that produced this item. - - `Role Assistant` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - The role of the output message. Always `assistant`. + A response to an MCP approval request. - - `const AssistantAssistant Assistant = "assistant"` + - `ApprovalRequestID string` - - `Status BetaResponseOutputMessageStatus` + The ID of the approval request being answered. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `Approve bool` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + Whether the request was approved. - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `Type McpApprovalResponse` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + The type of the item. Always `mcp_approval_response`. - - `Type Message` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - The type of the output message. Always `message`. + - `ID string` - - `const MessageMessage Message = "message"` + The unique ID of the approval response - - `Agent BetaResponseOutputMessageAgent` + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` The agent that produced this item. @@ -102114,49 +114297,37 @@ func main() { The canonical name of the agent that produced this item. - - `Phase BetaResponseOutputMessagePhase` - - 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. + - `Reason string` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + Optional reason for the decision. - - `type BetaResponseFileSearchToolCall struct{…}` + - `type BetaResponseInputItemMcpCall struct{…}` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + An invocation of a tool on an MCP server. - `ID string` - The unique ID of the file search tool call. - - - `Queries []string` - - The queries used to search for files. - - - `Status BetaResponseFileSearchToolCallStatus` + The unique ID of the tool call. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `Arguments string` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + A JSON string of the arguments passed to the tool. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `Name string` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + The name of the tool that was run. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `ServerLabel string` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + The label of the MCP server running the tool. - - `Type FileSearchCall` + - `Type McpCall` - The type of the file search tool call. Always `file_search_call`. + The type of the item. Always `mcp_call`. - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `const McpCallMcpCall McpCall = "mcp_call"` - - `Agent BetaResponseFileSearchToolCallAgent` + - `Agent BetaResponseInputItemMcpCallAgent` The agent that produced this item. @@ -102164,534 +114335,517 @@ func main() { The canonical name of the agent that produced this item. - - `Results []BetaResponseFileSearchToolCallResult` - - The results of the file search tool call. - - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - - 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` + - `ApprovalRequestID string` - - `float64` + 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. - - `bool` + - `Error string` - - `FileID string` + The error from the tool call, if any. - The unique ID of the file. + - `Output string` - - `Filename string` + The output from the tool call. - The name of the file. + - `Status string` - - `Score float64` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - The relevance score of the file - a value between 0 and 1. + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - `Text string` + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - The text that was retrieved from the file. + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - - `type BetaResponseComputerToolCall struct{…}` + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `ID string` + - `type BetaResponseCustomToolCallOutput struct{…}` - The unique ID of the computer call. + The output of a custom tool call from your code, being sent back to the model. - `CallID string` - An identifier used when responding to the tool call with output. - - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - The pending safety checks for the computer call. - - - `ID string` - - The ID of the pending safety check. + The call ID, used to map this custom tool call output to a custom tool call. - - `Code string` + - `Output BetaResponseCustomToolCallOutputOutputUnion` - The type of the pending safety check. + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `Message string` + - `string` - Details about the pending safety check. + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - - `Status BetaResponseComputerToolCallStatus` + Text, image, or file output of the custom tool call. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type BetaResponseInputText struct{…}` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + A text input to the model. - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `type BetaResponseInputImage struct{…}` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Type BetaResponseComputerToolCallType` + - `type BetaResponseInputFile struct{…}` - The type of the computer call. Always `computer_call`. + A file input to the model. - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `Type CustomToolCallOutput` - - `Action BetaComputerActionUnion` + The type of the custom tool call output. Always `custom_tool_call_output`. - A click action. + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - - `type BetaComputerActionClick struct{…}` + - `ID string` - A click action. + The unique ID of the custom tool call output in the OpenAI platform. - - `Button string` + - `Agent BetaResponseCustomToolCallOutputAgent` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + The agent that produced this item. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `AgentName string` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + The canonical name of the agent that produced this item. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + The execution context that produced this tool call. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - - `Type Click` + - `Type Direct` - Specifies the event type. For a click action, this property is always `click`. + The caller type. Always `direct`. - - `const ClickClick Click = "click"` + - `const DirectDirect Direct = "direct"` - - `X int64` + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - The x-coordinate where the click occurred. + - `CallerID string` - - `Y int64` + The call ID of the program item that produced this tool call. - The y-coordinate where the click occurred. + - `Type Program` - - `Keys []string` + The caller type. Always `program`. - The keys being held while clicking. + - `const ProgramProgram Program = "program"` - - `type BetaComputerActionDoubleClick struct{…}` + - `type BetaResponseCustomToolCall struct{…}` - A double click action. + A call to a custom tool created by the model. - - `Keys []string` + - `CallID string` - The keys being held while double-clicking. + An identifier used to map this custom tool call to a tool call output. - - `Type DoubleClick` + - `Input string` - Specifies the event type. For a double click action, this property is always set to `double_click`. + The input for the custom tool call generated by the model. - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `Name string` - - `X int64` + The name of the custom tool being called. - The x-coordinate where the double click occurred. + - `Type CustomToolCall` - - `Y int64` + The type of the custom tool call. Always `custom_tool_call`. - The y-coordinate where the double click occurred. + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `type BetaComputerActionDrag struct{…}` + - `ID string` - A drag action. + The unique ID of the custom tool call in the OpenAI platform. - - `Path []BetaComputerActionDragPath` + - `Agent BetaResponseCustomToolCallAgent` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + The agent that produced this item. - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `AgentName string` - - `X int64` + The canonical name of the agent that produced this item. - The x-coordinate. + - `Caller BetaResponseCustomToolCallCallerUnion` - - `Y int64` + The execution context that produced this tool call. - The y-coordinate. + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - `Type Drag` + - `Type Direct` - Specifies the event type. For a drag action, this property is always set to `drag`. + - `const DirectDirect Direct = "direct"` - - `const DragDrag Drag = "drag"` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `Keys []string` + - `CallerID string` - The keys being held while dragging the mouse. + The call ID of the program item that produced this tool call. - - `type BetaComputerActionKeypress struct{…}` + - `Type Program` - A collection of keypresses the model would like to perform. + - `const ProgramProgram Program = "program"` - - `Keys []string` + - `Namespace string` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + The namespace of the custom tool being called. - - `Type Keypress` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + Compacts the current context. Must be the final input item. - - `const KeypressKeypress Keypress = "keypress"` + - `Type CompactionTrigger` - - `type BetaComputerActionMove struct{…}` + The type of the item. Always `compaction_trigger`. - A mouse move action. + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `Type Move` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - Specifies the event type. For a move action, this property is always set to `move`. + The agent that produced this item. - - `const MoveMove Move = "move"` + - `AgentName string` - - `X int64` + The canonical name of the agent that produced this item. - The x-coordinate to move to. + - `type BetaResponseInputItemItemReference struct{…}` - - `Y int64` + An internal identifier for an item to reference. - The y-coordinate to move to. + - `ID string` - - `Keys []string` + The ID of the item to reference. - The keys being held while moving the mouse. + - `Agent BetaResponseInputItemItemReferenceAgent` - - `type BetaComputerActionScreenshot struct{…}` + The agent that produced this item. - A screenshot action. + - `AgentName string` - - `Type Screenshot` + The canonical name of the agent that produced this item. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `Type string` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + The type of item to reference. Always `item_reference`. - - `type BetaComputerActionScroll struct{…}` + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - A scroll action. + - `type BetaResponseInputItemProgram struct{…}` - - `ScrollX int64` + - `ID string` - The horizontal scroll distance. + The unique ID of this program item. - - `ScrollY int64` + - `CallID string` - The vertical scroll distance. + The stable call ID of the program item. - - `Type Scroll` + - `Code string` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + The JavaScript source executed by programmatic tool calling. - - `const ScrollScroll Scroll = "scroll"` + - `Fingerprint string` - - `X int64` + Opaque program replay fingerprint that must be round-tripped. - The x-coordinate where the scroll occurred. + - `Type Program` - - `Y int64` + The item type. Always `program`. - The y-coordinate where the scroll occurred. + - `const ProgramProgram Program = "program"` - - `Keys []string` + - `Agent BetaResponseInputItemProgramAgent` - The keys being held while scrolling. + The agent that produced this item. - - `type BetaComputerActionType struct{…}` + - `AgentName string` - An action to type in text. + The canonical name of the agent that produced this item. - - `Text string` + - `type BetaResponseInputItemProgramOutput struct{…}` - The text to type. + - `ID string` - - `Type Type` + The unique ID of this program output item. - Specifies the event type. For a type action, this property is always set to `type`. + - `CallID string` - - `const TypeType Type = "type"` + The call ID of the program item. - - `type BetaComputerActionWait struct{…}` + - `Result string` - A wait action. + The result produced by the program item. - - `Type Wait` + - `Status string` - Specifies the event type. For a wait action, this property is always set to `wait`. + The terminal status of the program output. - - `const WaitWait Wait = "wait"` + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `Actions BetaComputerActionList` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `Type ProgramOutput` - - `type BetaComputerActionClick struct{…}` + The item type. Always `program_output`. - A click action. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `type BetaComputerActionDoubleClick struct{…}` + - `Agent BetaResponseInputItemProgramOutputAgent` - A double click action. + The agent that produced this item. - - `type BetaComputerActionDrag struct{…}` + - `AgentName string` - A drag action. + The canonical name of the agent that produced this item. - - `type BetaComputerActionKeypress struct{…}` + - `Metadata map[string, string]` - A collection of keypresses the model would like to perform. + 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. - - `type BetaComputerActionMove struct{…}` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - A mouse move action. + - `Model BetaResponseModel` - - `type BetaComputerActionScreenshot struct{…}` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - A screenshot action. + - `type BetaResponseModel string` - - `type BetaComputerActionScroll struct{…}` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - A scroll action. + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - - `type BetaComputerActionType struct{…}` + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - An action to type in text. + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - - `type BetaComputerActionWait struct{…}` + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - A wait action. + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - - `Agent BetaResponseComputerToolCallAgent` + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - The agent that produced this item. + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - - `AgentName string` + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - - `ID string` + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - The unique ID of the computer call tool output. + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - - `CallID string` + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - The ID of the computer tool call that produced the output. + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - A computer screenshot image used with the computer use tool. + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - - `Type ComputerScreenshot` + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - - `FileID string` + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - The identifier of an uploaded file that contains the screenshot. + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - - `ImageURL string` + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - The URL of the screenshot image. + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - - `Type ComputerCallOutput` + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - The type of the computer tool call output. Always `computer_call_output`. + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - The safety checks reported by the API that have been acknowledged by the - developer. + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - - `ID string` + - `const BetaResponseModelO3 BetaResponseModel = "o3"` - The ID of the pending safety check. + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - - `Code string` + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - The type of the pending safety check. + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - - `Message string` + - `const BetaResponseModelO1 BetaResponseModel = "o1"` - Details about the pending safety check. + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - The agent that produced this item. + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - - `AgentName string` + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - `CreatedBy string` + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - The identifier of the actor that created the item. + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - - `type BetaResponseFunctionWebSearch struct{…}` + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - - `ID string` + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - The unique ID of the web search tool call. + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - - `Action BetaResponseFunctionWebSearchActionUnion` + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - 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). + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - Action type "search" - Performs a web search query. + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - `Type Search` + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - The action type. + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - - `const SearchSearch Search = "search"` + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - - `Queries []string` + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - The search queries. + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - - `Query string` + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - The search query. + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` - The sources used in the search. + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - - `Type URL` + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - The type of source. Always `url`. + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - - `const URLURL URL = "url"` + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - - `URL string` + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - The URL of the source. + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - Action type "open_page" - Opens a specific URL from search results. + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - - `Type OpenPage` + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - The action type. + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - - `const OpenPageOpenPage OpenPage = "open_page"` + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - - `URL string` + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - The URL opened by the model. + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - Action type "find_in_page": Searches for a pattern within a loaded page. + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - - `Pattern string` + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - The pattern or text to search for within the page. + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - - `Type FindInPage` + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - The action type. + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - - `URL string` + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - The URL of the page searched for the pattern. + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - - `Status BetaResponseFunctionWebSearchStatus` + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - The status of the web search tool call. + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - - `Type WebSearchCall` + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - The type of the web search tool call. Always `web_search_call`. + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - - `Agent BetaResponseFunctionWebSearchAgent` + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - The agent that produced this item. + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - - `AgentName string` + - `string` - The canonical name of the agent that produced this item. + - `Object Response` - - `type BetaResponseFunctionToolCallItem struct{…}` + The object type of this resource - always set to `response`. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const ResponseResponse Response = "response"` - - `ID string` + - `Output []BetaResponseOutputItemUnion` - The unique ID of the function tool call. + An array of content items generated by the model. - - `Status string` + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type BetaResponseOutputMessage struct{…}` - - `const BetaResponseFunctionToolCallItemStatusInProgress BetaResponseFunctionToolCallItemStatus = "in_progress"` + An output message from the model. - - `const BetaResponseFunctionToolCallItemStatusCompleted BetaResponseFunctionToolCallItemStatus = "completed"` + - `type BetaResponseFileSearchToolCall struct{…}` - - `const BetaResponseFunctionToolCallItemStatusIncomplete BetaResponseFunctionToolCallItemStatus = "incomplete"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `CreatedBy string` + - `type BetaResponseFunctionToolCall struct{…}` - The identifier of the actor that created the item. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - `type BetaResponseFunctionToolCallOutputItem struct{…}` @@ -102779,7 +114933,7 @@ func main() { The identifier of the actor that created the item. - - `type BetaResponseItemAgentMessage struct{…}` + - `type BetaResponseOutputItemAgentMessage struct{…}` - `ID string` @@ -102789,7 +114943,7 @@ func main() { The sending agent identity. - - `Content []BetaResponseItemAgentMessageContentUnion` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` Encrypted content sent between agents. @@ -102801,7 +114955,7 @@ func main() { A text output from the model. - - `type BetaResponseItemAgentMessageContentText struct{…}` + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` A text content. @@ -102811,7 +114965,7 @@ func main() { - `const TextText Text = "text"` - - `type BetaResponseItemAgentMessageContentSummaryText struct{…}` + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` A summary text from the model. @@ -102825,7 +114979,7 @@ func main() { - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `type BetaResponseItemAgentMessageContentReasoningText struct{…}` + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` Reasoning text from the model. @@ -102847,7 +115001,7 @@ func main() { An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `type BetaResponseItemAgentMessageContentComputerScreenshot struct{…}` + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` A screenshot of a computer. @@ -102855,13 +115009,13 @@ func main() { The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailLow BetaResponseItemAgentMessageContentComputerScreenshotDetail = "low"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseItemAgentMessageContentComputerScreenshotDetail = "high"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseItemAgentMessageContentComputerScreenshotDetail = "original"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - `FileID string` @@ -102877,7 +115031,7 @@ func main() { - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `PromptCacheBreakpoint BetaResponseItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. @@ -102891,7 +115045,7 @@ func main() { A file input to the model. - - `type BetaResponseItemAgentMessageContentEncryptedContent struct{…}` + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` Opaque encrypted content that Responses API decrypts inside trusted model execution. @@ -102915,7 +115069,7 @@ func main() { - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `Agent BetaResponseItemAgentMessageAgent` + - `Agent BetaResponseOutputItemAgentMessageAgent` The agent that produced this item. @@ -102923,7 +115077,7 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseItemMultiAgentCall struct{…}` + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - `ID string` @@ -102933,17 +115087,17 @@ func main() { The multi-agent action to execute. - - `const BetaResponseItemMultiAgentCallActionSpawnAgent BetaResponseItemMultiAgentCallAction = "spawn_agent"` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - - `const BetaResponseItemMultiAgentCallActionInterruptAgent BetaResponseItemMultiAgentCallAction = "interrupt_agent"` + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - `const BetaResponseItemMultiAgentCallActionListAgents BetaResponseItemMultiAgentCallAction = "list_agents"` + - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - - `const BetaResponseItemMultiAgentCallActionSendMessage BetaResponseItemMultiAgentCallAction = "send_message"` + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `const BetaResponseItemMultiAgentCallActionFollowupTask BetaResponseItemMultiAgentCallAction = "followup_task"` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - - `const BetaResponseItemMultiAgentCallActionWaitAgent BetaResponseItemMultiAgentCallAction = "wait_agent"` + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - `Arguments string` @@ -102959,7 +115113,7 @@ func main() { - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `Agent BetaResponseItemMultiAgentCallAgent` + - `Agent BetaResponseOutputItemMultiAgentCallAgent` The agent that produced this item. @@ -102967,7 +115121,7 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseItemMultiAgentCallOutput struct{…}` + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - `ID string` @@ -102977,17 +115131,17 @@ func main() { The multi-agent action that produced this result. - - `const BetaResponseItemMultiAgentCallOutputActionSpawnAgent BetaResponseItemMultiAgentCallOutputAction = "spawn_agent"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaResponseItemMultiAgentCallOutputActionInterruptAgent BetaResponseItemMultiAgentCallOutputAction = "interrupt_agent"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `const BetaResponseItemMultiAgentCallOutputActionListAgents BetaResponseItemMultiAgentCallOutputAction = "list_agents"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `const BetaResponseItemMultiAgentCallOutputActionSendMessage BetaResponseItemMultiAgentCallOutputAction = "send_message"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - - `const BetaResponseItemMultiAgentCallOutputActionFollowupTask BetaResponseItemMultiAgentCallOutputAction = "followup_task"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - `const BetaResponseItemMultiAgentCallOutputActionWaitAgent BetaResponseItemMultiAgentCallOutputAction = "wait_agent"` + - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - `CallID string` @@ -103017,7 +115171,154 @@ func main() { - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `Agent BetaResponseItemMultiAgentCallOutputAgent` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseFunctionWebSearch struct{…}` + + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + + - `type BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + + - `type BetaResponseComputerToolCallOutputItem 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 BetaResponseComputerToolCallOutputScreenshot` + + A computer screenshot image used with the computer use tool. + + - `Status BetaResponseComputerToolCallOutputItemStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + + - `Type ComputerCallOutput` + + The type of the computer tool call output. Always `computer_call_output`. + + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + + 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. + + - `Agent BetaResponseComputerToolCallOutputItemAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + + - `type BetaResponseOutputItemProgram struct{…}` + + - `ID string` + + The unique ID of the program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The type of the item. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseOutputItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseOutputItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of the program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output item. + + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The type of the item. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseOutputItemProgramOutputAgent` The agent that produced this item. @@ -103111,1127 +115412,1152 @@ func main() { Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Name string` + - `type BetaFileSearchTool struct{…}` - The name of the function to call. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Parameters map[string, any]` + - `type BetaComputerTool struct{…}` - A JSON schema object describing the parameters of the function. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Strict bool` + - `type BetaComputerUsePreviewTool struct{…}` - Whether strict parameter validation is enforced for this function tool. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Type Function` + - `type BetaWebSearchTool struct{…}` - The type of the function tool. Always `function`. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const FunctionFunction Function = "function"` + - `type BetaToolMcp struct{…}` - - `AllowedCallers []string` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The tool invocation context(s). + - `type BetaToolCodeInterpreter struct{…}` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + A tool that runs Python code to help generate a response to a prompt. - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `DeferLoading bool` + - `type BetaToolImageGeneration struct{…}` - Whether this function is deferred and loaded via tool search. + A tool that generates images using the GPT image models. - - `Description string` + - `type BetaToolLocalShell struct{…}` - A description of the function. Used by the model to determine whether or not to call the function. + A tool that allows the model to execute shell commands in a local environment. - - `OutputSchema map[string, any]` + - `type BetaFunctionShellTool struct{…}` - A JSON schema object describing the JSON value encoded in string outputs for this function. + A tool that allows the model to execute shell commands. - - `type BetaFileSearchTool struct{…}` + - `type BetaCustomTool struct{…}` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Type FileSearch` + - `type BetaNamespaceTool struct{…}` - The type of the file search tool. Always `file_search`. + Groups function/custom tools under a shared namespace. - - `const FileSearchFileSearch FileSearch = "file_search"` + - `type BetaToolSearchTool struct{…}` - - `VectorStoreIDs []string` + Hosted or BYOT tool search configuration for deferred tools. - The IDs of the vector stores to search. + - `type BetaWebSearchPreviewTool struct{…}` - - `Filters BetaFileSearchToolFiltersUnion` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - A filter to apply. + - `type BetaApplyPatchTool struct{…}` - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + Allows the assistant to create, delete, or update files using unified diffs. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `Type ToolSearchOutput` - - `Key string` + The type of the item. Always `tool_search_output`. - The key to compare against the value. + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `Type string` + - `Agent BetaResponseToolSearchOutputItemAgent` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The agent that produced this item. - - `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 + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseOutputItemAdditionalTools struct{…}` + + - `ID string` + + The unique ID of the additional tools item. + + - `Role string` + + The role that provided the additional tools. + + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + + - `Tools []BetaToolUnion` + + The additional tool definitions made available at this item. + + - `type BetaFunctionTool struct{…}` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `type BetaFileSearchTool struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + - `type BetaComputerTool struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + - `type BetaWebSearchTool struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + - `type BetaToolMcp struct{…}` - The value to compare against the attribute key; supports string, number, or boolean types. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `string` + - `type BetaToolCodeInterpreter struct{…}` - - `float64` + A tool that runs Python code to help generate a response to a prompt. - - `bool` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaToolImageGeneration struct{…}` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + A tool that generates images using the GPT image models. - Combine multiple filters using `and` or `or`. + - `type BetaToolLocalShell struct{…}` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + A tool that allows the model to execute shell commands in a local environment. - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `type BetaFunctionShellTool struct{…}` - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + A tool that allows the model to execute shell commands. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `type BetaCustomTool struct{…}` - - `Key string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The key to compare against the value. + - `type BetaNamespaceTool struct{…}` - - `Type string` + Groups function/custom tools under a shared namespace. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `type BetaToolSearchTool struct{…}` - - `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 + Hosted or BYOT tool search configuration for deferred tools. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `type BetaApplyPatchTool struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + Allows the assistant to create, delete, or update files using unified diffs. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `Type AdditionalTools` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + The type of the item. Always `additional_tools`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `Agent BetaResponseOutputItemAdditionalToolsAgent` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + The agent that produced this item. - The value to compare against the attribute key; supports string, number, or boolean types. + - `AgentName string` - - `string` + The canonical name of the agent that produced this item. - - `float64` + - `type BetaResponseCompactionItem struct{…}` - - `bool` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `ID string` - - `Type string` + The unique ID of the compaction item. - Type of operation: `and` or `or`. + - `EncryptedContent string` - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + The encrypted content that was produced by compaction. - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + - `Type Compaction` - - `MaxNumResults int64` + The type of the item. Always `compaction`. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `const CompactionCompaction Compaction = "compaction"` - - `RankingOptions BetaFileSearchToolRankingOptions` + - `Agent BetaResponseCompactionItemAgent` - Ranking options for search. + The agent that produced this item. - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `AgentName string` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + The canonical name of the agent that produced this item. - - `EmbeddingWeight float64` + - `CreatedBy string` - The weight of the embedding in the reciprocal ranking fusion. + The identifier of the actor that created the item. - - `TextWeight float64` + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - The weight of the text in the reciprocal ranking fusion. + An image generation request made by the model. - - `Ranker string` + - `ID string` - The ranker to use for the file search. + The unique ID of the image generation call. - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + - `Result string` - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + The generated image encoded in base64. - - `ScoreThreshold float64` + - `Status string` - 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. + The status of the image generation call. - - `type BetaComputerTool struct{…}` + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - `Type Computer` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - The type of the computer tool. Always `computer`. + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - - `const ComputerComputer Computer = "computer"` + - `Type ImageGenerationCall` - - `type BetaComputerUsePreviewTool struct{…}` + The type of the image generation call. Always `image_generation_call`. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `DisplayHeight int64` + - `Agent BetaResponseOutputItemImageGenerationCallAgent` - The height of the computer display. + The agent that produced this item. - - `DisplayWidth int64` + - `AgentName string` - The width of the computer display. + The canonical name of the agent that produced this item. - - `Environment BetaComputerUsePreviewToolEnvironment` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - The type of computer environment to control. + A tool call to run code. - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `type BetaResponseOutputItemLocalShellCall struct{…}` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + A tool call to run a command on the local shell. - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `ID string` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + The unique ID of the local shell call. - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + - `Action BetaResponseOutputItemLocalShellCallAction` - - `Type ComputerUsePreview` + Execute a shell command on the server. - The type of the computer use tool. Always `computer_use_preview`. + - `Command []string` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + The command to run. - - `type BetaWebSearchTool struct{…}` + - `Env map[string, string]` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + Environment variables to set for the command. - - `Type BetaWebSearchToolType` + - `Type Exec` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + The type of the local shell action. Always `exec`. - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `const ExecExec Exec = "exec"` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `TimeoutMs int64` - - `Filters BetaWebSearchToolFilters` + Optional timeout in milliseconds for the command. - Filters for the search. + - `User string` - - `AllowedDomains []string` + Optional user to run the command as. - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `WorkingDirectory string` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + Optional working directory to run the command in. - - `SearchContextSize BetaWebSearchToolSearchContextSize` + - `CallID string` - 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. + The unique ID of the local shell tool call generated by the model. - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `Status string` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + The status of the local shell call. - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `UserLocation BetaWebSearchToolUserLocation` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - The approximate location of the user. + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - - `City string` + - `Type LocalShellCall` - Free text input for the city of the user, e.g. `San Francisco`. + The type of the local shell call. Always `local_shell_call`. - - `Country string` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `Agent BetaResponseOutputItemLocalShellCallAgent` - - `Region string` + The agent that produced this item. - Free text input for the region of the user, e.g. `California`. + - `AgentName string` - - `Timezone string` + The canonical name of the agent that produced this item. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - `Type string` + The output of a local shell tool call. - The type of location approximation. Always `approximate`. + - `ID string` - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + The unique ID of the local shell tool call generated by the model. - - `type BetaToolMcp struct{…}` + - `Output string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + A JSON string of the output of the local shell tool call. - - `ServerLabel string` + - `Type LocalShellCallOutput` - A label for this MCP server, used to identify it in tool calls. + The type of the local shell tool call output. Always `local_shell_call_output`. - - `Type Mcp` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - The type of the MCP tool. Always `mcp`. + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` - - `const McpMcp Mcp = "mcp"` + The agent that produced this item. - - `AllowedCallers []string` + - `AgentName string` - The tool invocation context(s). + The canonical name of the agent that produced this item. - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + - `Status string` - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - List of allowed tool names or a filter object. + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - A string array of allowed tool names + - `type BetaResponseFunctionShellToolCall struct{…}` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + A tool call that executes one or more shell commands in a managed environment. - A filter object to specify which tools are allowed. + - `ID string` - - `ReadOnly bool` + The unique ID of the shell tool call. Populated when this item is returned via API. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Action BetaResponseFunctionShellToolCallAction` - - `ToolNames []string` + The shell commands and limits that describe how to run the tool call. - List of allowed tool names. + - `Commands []string` - - `Authorization string` + - `MaxOutputLength int64` - 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. + Optional maximum number of characters to return from each command. - - `ConnectorID string` + - `TimeoutMs int64` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + Optional timeout in milliseconds for the commands. - Currently supported `connector_id` values are: + - `CallID string` - - 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` + The unique ID of the shell tool call generated by the model. - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + Represents the use of a local environment to perform shell actions. - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `type BetaResponseLocalEnvironment struct{…}` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + Represents the use of a local environment to perform shell actions. - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `Type Local` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + The environment type. Always `local`. - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `const LocalLocal Local = "local"` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + - `type BetaResponseContainerReference struct{…}` - - `DeferLoading bool` + Represents a container created with /v1/containers. - Whether this MCP tool is deferred and discovered via tool search. + - `ContainerID string` - - `Headers map[string, string]` + - `Type ContainerReference` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + The environment type. Always `container_reference`. - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - Specify which of the MCP server's tools require approval. + - `Status BetaResponseFunctionShellToolCallStatus` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - A filter object to specify which tools are allowed. + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `ReadOnly bool` + - `Type ShellCall` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The type of the item. Always `shell_call`. - - `ToolNames []string` + - `const ShellCallShellCall ShellCall = "shell_call"` - List of allowed tool names. + - `Agent BetaResponseFunctionShellToolCallAgent` - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + The agent that produced this item. - A filter object to specify which tools are allowed. + - `AgentName string` - - `ReadOnly bool` + The canonical name of the agent that produced this item. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - - `ToolNames []string` + The execution context that produced this tool call. - List of allowed tool names. + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `Type Direct` - 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 DirectDirect Direct = "direct"` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + - `CallerID string` - - `ServerDescription string` + The call ID of the program item that produced this tool call. - Optional description of the MCP server, used to provide more context. + - `Type Program` - - `ServerURL string` + - `const ProgramProgram Program = "program"` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `CreatedBy string` - - `TunnelID string` + The ID of the entity that created this tool call. - 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 BetaResponseFunctionShellToolCallOutput struct{…}` - - `type BetaToolCodeInterpreter struct{…}` + The output of a shell tool call that was emitted. - A tool that runs Python code to help generate a response to a prompt. + - `ID string` - - `Container BetaToolCodeInterpreterContainerUnion` + The unique ID of the shell call output. Populated when this item is returned via API. - 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. + - `CallID string` - - `string` + The unique ID of the shell tool call generated by the model. - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + - `MaxOutputLength int64` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `Type Auto` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - Always `auto`. + An array of shell call output contents - - `const AutoAuto Auto = "auto"` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - - `FileIDs []string` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - An optional list of uploaded files to make available to your code. + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - - `MemoryLimit string` + Indicates that the shell call exceeded its configured time limit. - The memory limit for the code interpreter container. + - `Type Timeout` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + The outcome type. Always `timeout`. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `const TimeoutTimeout Timeout = "timeout"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + Indicates that the shell commands finished and returned an exit code. - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `ExitCode int64` - Network access policy for the container. + Exit code from the shell process. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `Type Exit` - - `Type Disabled` + The outcome type. Always `exit`. - Disable outbound network access. Always `disabled`. + - `const ExitExit Exit = "exit"` - - `const DisabledDisabled Disabled = "disabled"` + - `Stderr string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The standard error output that was captured. - - `AllowedDomains []string` + - `Stdout string` - A list of allowed domains when type is `allowlist`. + The standard output that was captured. - - `Type Allowlist` + - `CreatedBy string` - Allow outbound network access only to specified domains. Always `allowlist`. + The identifier of the actor that created the item. - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - Optional domain-scoped secrets for allowlisted domains. + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `Domain string` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - The domain associated with the secret. + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - - `Name string` + - `Type ShellCallOutput` - The name of the secret to inject for the domain. + The type of the shell call output. Always `shell_call_output`. - - `Value string` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - The secret value to inject for the domain. + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - - `Type CodeInterpreter` + The agent that produced this item. - The type of the code interpreter tool. Always `code_interpreter`. + - `AgentName string` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + The canonical name of the agent that produced this item. - - `AllowedCallers []string` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - The tool invocation context(s). + The execution context that produced this tool call. - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + - `Type Direct` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const DirectDirect Direct = "direct"` - - `Type ProgrammaticToolCalling` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - The type of the tool. Always `programmatic_tool_calling`. + - `CallerID string` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + The call ID of the program item that produced this tool call. - - `type BetaToolImageGeneration struct{…}` + - `Type Program` - A tool that generates images using the GPT image models. + - `const ProgramProgram Program = "program"` - - `Type ImageGeneration` + - `CreatedBy string` - The type of the image generation tool. Always `image_generation`. + The identifier of the actor that created the item. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `type BetaResponseApplyPatchToolCall struct{…}` - - `Action string` + A tool call that applies file diffs by creating, deleting, or updating files. - Whether to generate a new image or edit an existing image. Default: `auto`. + - `ID string` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `CallID string` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + The unique ID of the apply patch tool call generated by the model. - - `Background string` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - 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. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - `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. + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + Instruction describing how to create a file via the apply_patch tool. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `Diff string` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + Diff to apply. - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `Path string` - - `InputFidelity string` + Path of the file to create. - 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`. + - `Type CreateFile` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + Create a new file with the provided diff. - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + - `const CreateFileCreateFile CreateFile = "create_file"` - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + Instruction describing how to delete a file via the apply_patch tool. - - `FileID string` + - `Path string` - File ID for the mask image. + Path of the file to delete. - - `ImageURL string` + - `Type DeleteFile` - Base64-encoded mask image. + Delete the specified file. - - `Model string` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - The image generation model to use. Default: `gpt-image-1`. + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `string` + Instruction describing how to update a file via the apply_patch tool. - - `string` + - `Diff string` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + Diff to apply. - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `Path string` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + Path of the file to update. - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `Type UpdateFile` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + Update an existing file with the provided diff. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Moderation string` + - `Status BetaResponseApplyPatchToolCallStatus` - Moderation level for the generated image. Default: `auto`. + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - `OutputCompression int64` + - `Type ApplyPatchCall` - Compression level for the output image. Default: 100. + The type of the item. Always `apply_patch_call`. - - `OutputFormat string` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `Agent BetaResponseApplyPatchToolCallAgent` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + The agent that produced this item. - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + - `AgentName string` - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + The canonical name of the agent that produced this item. - - `PartialImages int64` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + The execution context that produced this tool call. - - `Quality string` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `Type Direct` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `const DirectDirect Direct = "direct"` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `CallerID string` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The call ID of the program item that produced this tool call. - - `Size string` + - `Type Program` - 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`. + - `const ProgramProgram Program = "program"` - - `string` + - `CreatedBy string` - - `string` + The ID of the entity that created this tool call. - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + The output emitted by an apply patch tool call. - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `ID string` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `type BetaToolLocalShell struct{…}` + - `CallID string` - A tool that allows the model to execute shell commands in a local environment. + The unique ID of the apply patch tool call generated by the model. - - `Type LocalShell` + - `Status BetaResponseApplyPatchToolCallOutputStatus` - The type of the local shell tool. Always `local_shell`. + The status of the apply patch tool call output. One of `completed` or `failed`. - - `const LocalShellLocalShell LocalShell = "local_shell"` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `type BetaFunctionShellTool struct{…}` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - A tool that allows the model to execute shell commands. + - `Type ApplyPatchCallOutput` - - `Type Shell` + The type of the item. Always `apply_patch_call_output`. - The type of the shell tool. Always `shell`. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `const ShellShell Shell = "shell"` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - `AllowedCallers []string` + The agent that produced this item. - The tool invocation context(s). + - `AgentName string` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + The canonical name of the agent that produced this item. - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - `Environment BetaFunctionShellToolEnvironmentUnion` + The execution context that produced this tool call. - - `type BetaContainerAuto struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - `Type ContainerAuto` + - `Type Direct` - Automatically creates a container for this request + - `const DirectDirect Direct = "direct"` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - `FileIDs []string` + - `CallerID string` - An optional list of uploaded files to make available to your code. + The call ID of the program item that produced this tool call. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `Type Program` - The memory limit for the container. + - `const ProgramProgram Program = "program"` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `CreatedBy string` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The ID of the entity that created this tool call output. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `Output string` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + Optional textual output returned by the apply patch tool. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `type BetaResponseOutputItemMcpCall struct{…}` - Network access policy for the container. + An invocation of a tool on an MCP server. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `ID string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The unique ID of the tool call. - - `Skills []BetaContainerAutoSkillUnion` + - `Arguments string` - An optional list of skills referenced by id or inline data. + A JSON string of the arguments passed to the tool. - - `type BetaSkillReference struct{…}` + - `Name string` - - `SkillID string` + The name of the tool that was run. - The ID of the referenced skill. + - `ServerLabel string` - - `Type SkillReference` + The label of the MCP server running the tool. - References a skill created with the /v1/skills endpoint. + - `Type McpCall` - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + The type of the item. Always `mcp_call`. - - `Version string` + - `const McpCallMcpCall McpCall = "mcp_call"` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `Agent BetaResponseOutputItemMcpCallAgent` - - `type BetaInlineSkill struct{…}` + The agent that produced this item. - - `Description string` + - `AgentName string` - The description of the skill. + The canonical name of the agent that produced this item. - - `Name string` + - `ApprovalRequestID string` - The name of the skill. + 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. - - `Source BetaInlineSkillSource` + - `Error string` - Inline skill payload + The error from the tool call, if any. - - `Data string` + - `Output string` - Base64-encoded skill zip bundle. + The output from the tool call. - - `MediaType ApplicationZip` + - `Status string` - The media type of the inline skill payload. Must be `application/zip`. + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - `Type Base64` + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - The type of the inline skill source. Must be `base64`. + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `const Base64Base64 Base64 = "base64"` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - `Type Inline` + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - Defines an inline skill for this request. + - `type BetaResponseOutputItemMcpListTools struct{…}` - - `const InlineInline Inline = "inline"` + A list of tools available on an MCP server. - - `type BetaLocalEnvironment struct{…}` + - `ID string` - - `Type Local` + The unique ID of the list. - Use a local computer environment. + - `ServerLabel string` - - `const LocalLocal Local = "local"` + The label of the MCP server. - - `Skills []BetaLocalSkill` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - An optional list of skills. + The tools available on the server. - - `Description string` + - `InputSchema any` - The description of the skill. + The JSON schema describing the tool's input. - `Name string` - The name of the skill. - - - `Path string` + The name of the tool. - The path to the directory containing the skill. + - `Annotations any` - - `type BetaContainerReference struct{…}` + Additional annotations about the tool. - - `ContainerID string` + - `Description string` - The ID of the referenced container. + The description of the tool. - - `Type ContainerReference` + - `Type McpListTools` - References a container created with the /v1/containers endpoint + The type of the item. Always `mcp_list_tools`. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `type BetaCustomTool struct{…}` + - `Agent BetaResponseOutputItemMcpListToolsAgent` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the custom tool, used to identify it in tool calls. + The canonical name of the agent that produced this item. - - `Type Custom` + - `Error string` - The type of the custom tool. Always `custom`. + Error message if the server could not list tools. - - `const CustomCustom Custom = "custom"` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - `AllowedCallers []string` + A request for human approval of a tool invocation. - The tool invocation context(s). + - `ID string` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + The unique ID of the approval request. - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + - `Arguments string` - - `DeferLoading bool` + A JSON string of arguments for the tool. - Whether this tool should be deferred and discovered via tool search. + - `Name string` - - `Description string` + The name of the tool to run. - Optional description of the custom tool, used to provide more context. + - `ServerLabel string` - - `Format BetaCustomToolFormatUnion` + The label of the MCP server making the request. - The input format for the custom tool. Default is unconstrained text. + - `Type McpApprovalRequest` - - `type BetaCustomToolFormatText struct{…}` + The type of the item. Always `mcp_approval_request`. - Unconstrained free-form text. + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Type Text` + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` - Unconstrained text format. Always `text`. + The agent that produced this item. - - `const TextText Text = "text"` + - `AgentName string` - - `type BetaCustomToolFormatGrammar struct{…}` + The canonical name of the agent that produced this item. - A grammar defined by the user. + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - - `Definition string` + A response to an MCP approval request. - The grammar definition. + - `ID string` - - `Syntax string` + The unique ID of the approval response - The syntax of the grammar definition. One of `lark` or `regex`. + - `ApprovalRequestID string` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + The ID of the approval request being answered. - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `Approve bool` - - `Type Grammar` + Whether the request was approved. - Grammar format. Always `grammar`. + - `Type McpApprovalResponse` - - `const GrammarGrammar Grammar = "grammar"` + The type of the item. Always `mcp_approval_response`. - - `type BetaNamespaceTool struct{…}` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - Groups function/custom tools under a shared namespace. + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - - `Description string` + The agent that produced this item. - A description of the namespace shown to the model. + - `AgentName string` - - `Name string` + The canonical name of the agent that produced this item. - The namespace name used in tool calls (for example, `crm`). + - `Reason string` - - `Tools []BetaNamespaceToolToolUnion` + Optional reason for the decision. - The function/custom tools available inside this namespace. + - `type BetaResponseCustomToolCall struct{…}` - - `type BetaNamespaceToolToolFunction struct{…}` + A call to a custom tool created by the model. - - `Name string` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - - `Type Function` + The output of a custom tool call from your code, being sent back to the model. - - `const FunctionFunction Function = "function"` + - `ID string` - - `AllowedCallers []string` + The unique ID of the custom tool call output item. - The tool invocation context(s). + - `Status string` - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `DeferLoading bool` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - Whether this function should be deferred and discovered via tool search. + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `Description string` + - `CreatedBy string` - - `OutputSchema map[string, any]` + The identifier of the actor that created the item. - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `ParallelToolCalls bool` - - `Parameters any` + Whether to allow the model to run tool calls in parallel. - - `Strict bool` + - `Temperature float64` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - - `type BetaCustomTool struct{…}` + - `ToolChoice BetaResponseToolChoiceUnion` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - - `Type Namespace` + - `type BetaToolChoiceOptions string` - The type of the tool. Always `namespace`. + Controls which (if any) tool is called by the model. - - `const NamespaceNamespace Namespace = "namespace"` + `none` means the model will not call any tool and instead generates a message. - - `type BetaToolSearchTool struct{…}` + `auto` means the model can pick between generating a message or calling one or + more tools. - Hosted or BYOT tool search configuration for deferred tools. + `required` means the model must call one or more tools. - - `Type ToolSearch` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - The type of the tool. Always `tool_search`. + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - - `Description string` + - `type BetaToolChoiceAllowed struct{…}` - Description shown to the model for a client-executed tool search tool. + Constrains the tools available to the model to a pre-defined set. - - `Execution BetaToolSearchToolExecution` + - `Mode BetaToolChoiceAllowedMode` - Whether tool search is executed by the server or by the client. + Constrains the tools available to the model to a pre-defined set. - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + `auto` allows the model to pick from among the allowed tools and generate a + message. - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + `required` requires the model to call one or more of the allowed tools. - - `Parameters any` + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - Parameter schema for a client-executed tool search tool. + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - - `type BetaWebSearchPreviewTool struct{…}` + - `Tools []map[string, any]` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + A list of tool definitions that the model should be allowed to call. - - `Type BetaWebSearchPreviewToolType` + For the Responses API, the list of tool definitions might look like: - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `Type AllowedTools` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + Allowed tool configuration type. Always `allowed_tools`. - - `SearchContentTypes []string` + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `type BetaToolChoiceTypes struct{…}` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `Type BetaToolChoiceTypesType` - 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. + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + Allowed values are: - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - The user's location. + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `Type Approximate` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - The type of location approximation. Always `approximate`. + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - - `const ApproximateApproximate Approximate = "approximate"` + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - - `City string` + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - Free text input for the city of the user, e.g. `San Francisco`. + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - - `Country string` + - `type BetaToolChoiceFunction struct{…}` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + Use this option to force the model to call a specific function. - - `Region string` + - `Name string` - Free text input for the region of the user, e.g. `California`. + The name of the function to call. - - `Timezone string` + - `Type Function` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + For function calling, the type is always `function`. - - `type BetaApplyPatchTool struct{…}` + - `const FunctionFunction Function = "function"` - Allows the assistant to create, delete, or update files using unified diffs. + - `type BetaToolChoiceMcp struct{…}` - - `Type ApplyPatch` + Use this option to force the model to call a specific tool on a remote MCP server. - The type of the tool. Always `apply_patch`. + - `ServerLabel string` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + The label of the MCP server to use. - - `AllowedCallers []string` + - `Type Mcp` - The tool invocation context(s). + For MCP tools, the type is always `mcp`. - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `const McpMcp Mcp = "mcp"` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `Name string` - - `Type ToolSearchOutput` + The name of the tool to call on the server. - The type of the item. Always `tool_search_output`. + - `type BetaToolChoiceCustom struct{…}` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + Use this option to force the model to call a specific custom tool. - - `Agent BetaResponseToolSearchOutputItemAgent` + - `Name string` - The agent that produced this item. + The name of the custom tool to call. - - `AgentName string` + - `Type Custom` - The canonical name of the agent that produced this item. + For custom tool calling, the type is always `custom`. - - `CreatedBy string` + - `const CustomCustom Custom = "custom"` - The identifier of the actor that created the item. + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - - `type BetaResponseItemAdditionalTools struct{…}` + - `Type ProgrammaticToolCalling` - - `ID string` + The tool to call. Always `programmatic_tool_calling`. - The unique ID of the additional tools item. + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `Role string` + - `type BetaToolChoiceApplyPatch struct{…}` - The role that provided the additional tools. + Forces the model to call the apply_patch tool when executing a tool call. - - `const BetaResponseItemAdditionalToolsRoleUnknown BetaResponseItemAdditionalToolsRole = "unknown"` + - `Type ApplyPatch` - - `const BetaResponseItemAdditionalToolsRoleUser BetaResponseItemAdditionalToolsRole = "user"` + The tool to call. Always `apply_patch`. - - `const BetaResponseItemAdditionalToolsRoleAssistant BetaResponseItemAdditionalToolsRole = "assistant"` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `const BetaResponseItemAdditionalToolsRoleSystem BetaResponseItemAdditionalToolsRole = "system"` + - `type BetaToolChoiceShell struct{…}` - - `const BetaResponseItemAdditionalToolsRoleCritic BetaResponseItemAdditionalToolsRole = "critic"` + Forces the model to call the shell tool when a tool call is required. - - `const BetaResponseItemAdditionalToolsRoleDiscriminator BetaResponseItemAdditionalToolsRole = "discriminator"` + - `Type Shell` - - `const BetaResponseItemAdditionalToolsRoleDeveloper BetaResponseItemAdditionalToolsRole = "developer"` + The tool to call. Always `shell`. - - `const BetaResponseItemAdditionalToolsRoleTool BetaResponseItemAdditionalToolsRole = "tool"` + - `const ShellShell Shell = "shell"` - `Tools []BetaToolUnion` - The additional tool definitions made available at this item. + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. - `type BetaFunctionTool struct{…}` @@ -104297,473 +116623,575 @@ func main() { Allows the assistant to create, delete, or update files using unified diffs. - - `Type AdditionalTools` + - `TopP float64` - The type of the item. Always `additional_tools`. + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + We generally recommend altering this or `temperature` but not both. - - `Agent BetaResponseItemAdditionalToolsAgent` + - `Background bool` - The agent that produced this item. + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). - - `AgentName string` + - `CompletedAt float64` - The canonical name of the agent that produced this item. + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - - `type BetaResponseReasoningItem struct{…}` + - `Conversation BetaResponseConversation` - 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](https://platform.openai.com/docs/guides/conversation-state). + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - `ID string` - The unique identifier of the reasoning content. + The unique ID of the conversation that this response was associated with. - - `Summary []BetaResponseReasoningItemSummary` + - `MaxOutputTokens int64` - Reasoning summary content. + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - - `Text string` + - `MaxToolCalls int64` - A summary of the reasoning output from the model so far. + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `Type SummaryText` + - `Moderation BetaResponseModeration` - The type of the object. Always `summary_text`. + Moderation results for the response input and output, if moderated completions were requested. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `Input BetaResponseModerationInputUnion` - - `Type Reasoning` + Moderation for the response input. - The type of the object. Always `reasoning`. + - `type BetaResponseModerationInputModerationResult struct{…}` - - `const ReasoningReasoning Reasoning = "reasoning"` + A moderation result produced for the response input or output. - - `Agent BetaResponseReasoningItemAgent` + - `Categories map[string, bool]` - The agent that produced this item. + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `AgentName string` + - `CategoryAppliedInputTypes map[string, []string]` - The canonical name of the agent that produced this item. + Which modalities of input are reflected by the score for each category. - - `Content []BetaResponseReasoningItemContent` + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` - Reasoning text content. + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` - - `Text string` + - `CategoryScores map[string, float64]` - The reasoning text from the model. + A dictionary of moderation categories to scores. - - `Type ReasoningText` + - `Flagged bool` - The type of the reasoning text. Always `reasoning_text`. + A boolean indicating whether the content was flagged by any category. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Model string` - - `EncryptedContent string` + The moderation model that produced this result. - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `Type ModerationResult` - - `Status BetaResponseReasoningItemStatus` + The object type, which was always `moderation_result` for successful moderation results. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `type BetaResponseModerationInputError struct{…}` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + An error produced while attempting moderation for the response input or output. - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + - `Code string` - - `type BetaResponseItemProgram struct{…}` + The error code. - - `ID string` + - `Message string` - The unique ID of the program item. + The error message. - - `CallID string` + - `Type Error` - The stable call ID of the program item. + The object type, which was always `error` for moderation failures. - - `Code string` + - `const ErrorError Error = "error"` - The JavaScript source executed by programmatic tool calling. + - `Output BetaResponseModerationOutputUnion` - - `Fingerprint string` + Moderation for the response output. - Opaque program replay fingerprint that must be round-tripped. + - `type BetaResponseModerationOutputModerationResult struct{…}` - - `Type Program` + A moderation result produced for the response input or output. - The type of the item. Always `program`. + - `Categories map[string, bool]` - - `const ProgramProgram Program = "program"` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `Agent BetaResponseItemProgramAgent` + - `CategoryAppliedInputTypes map[string, []string]` - The agent that produced this item. + Which modalities of input are reflected by the score for each category. - - `AgentName string` + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` - The canonical name of the agent that produced this item. + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` - - `type BetaResponseItemProgramOutput struct{…}` + - `CategoryScores map[string, float64]` - - `ID string` + A dictionary of moderation categories to scores. - The unique ID of the program output item. + - `Flagged bool` - - `CallID string` + A boolean indicating whether the content was flagged by any category. - The call ID of the program item. + - `Model string` - - `Result string` + The moderation model that produced this result. - The result produced by the program item. + - `Type ModerationResult` - - `Status string` + The object type, which was always `moderation_result` for successful moderation results. - The terminal status of the program output item. + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `const BetaResponseItemProgramOutputStatusCompleted BetaResponseItemProgramOutputStatus = "completed"` + - `type BetaResponseModerationOutputError struct{…}` - - `const BetaResponseItemProgramOutputStatusIncomplete BetaResponseItemProgramOutputStatus = "incomplete"` + An error produced while attempting moderation for the response input or output. - - `Type ProgramOutput` + - `Code string` - The type of the item. Always `program_output`. + The error code. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `Message string` - - `Agent BetaResponseItemProgramOutputAgent` + The error message. - The agent that produced this item. + - `Type Error` - - `AgentName string` + The object type, which was always `error` for moderation failures. - The canonical name of the agent that produced this item. + - `const ErrorError Error = "error"` - - `type BetaResponseCompactionItem struct{…}` + - `PreviousResponseID string` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + + - `Prompt BetaResponsePrompt` + + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - `ID string` - The unique ID of the compaction item. + The unique identifier of the prompt template to use. - - `EncryptedContent string` + - `Variables map[string, BetaResponsePromptVariableUnion]` - The encrypted content that was produced by compaction. + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - - `Type Compaction` + - `string` - The type of the item. Always `compaction`. + - `type BetaResponseInputText struct{…}` - - `const CompactionCompaction Compaction = "compaction"` + A text input to the model. - - `Agent BetaResponseCompactionItemAgent` + - `type BetaResponseInputImage struct{…}` - The agent that produced this item. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `AgentName string` + - `type BetaResponseInputFile struct{…}` - The canonical name of the agent that produced this item. + A file input to the model. - - `CreatedBy string` + - `Version string` - The identifier of the actor that created the item. + Optional version of the prompt template. - - `type BetaResponseItemImageGenerationCall struct{…}` + - `PromptCacheKey string` - An image generation request made by the model. + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - - `ID string` + - `PromptCacheOptions BetaResponsePromptCacheOptions` - The unique ID of the image generation call. + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - `Result string` + - `Mode string` - The generated image encoded in base64. + Whether implicit prompt-cache breakpoints were enabled. - - `Status string` + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` - The status of the image generation call. + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` - - `const BetaResponseItemImageGenerationCallStatusInProgress BetaResponseItemImageGenerationCallStatus = "in_progress"` + - `Ttl string` - - `const BetaResponseItemImageGenerationCallStatusCompleted BetaResponseItemImageGenerationCallStatus = "completed"` + The minimum lifetime applied to each cache breakpoint. - - `const BetaResponseItemImageGenerationCallStatusGenerating BetaResponseItemImageGenerationCallStatus = "generating"` + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` - - `const BetaResponseItemImageGenerationCallStatusFailed BetaResponseItemImageGenerationCallStatus = "failed"` + - `PromptCacheRetention BetaResponsePromptCacheRetention` - - `Type ImageGenerationCall` + Deprecated. Use `prompt_cache_options.ttl` instead. - The type of the image generation call. Always `image_generation_call`. + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - - `Agent BetaResponseItemImageGenerationCallAgent` + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - The agent that produced this item. + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` - - `AgentName string` + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` - The canonical name of the agent that produced this item. + - `Reasoning BetaResponseReasoning` - - `type BetaResponseCodeInterpreterToolCall struct{…}` + **gpt-5 and o-series models only** - A tool call to run code. + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - - `ID string` + - `Context string` - The unique ID of the code interpreter tool call. + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - - `Code string` + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` - The code to run, or null if not available. + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` - - `ContainerID string` + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` - The ID of the container used to run the code. + - `Effort string` - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` - The logs output from the code interpreter. + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` - - `Logs string` + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` - The logs output from the code interpreter. + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` - - `Type Logs` + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` - The type of the output. Always `logs`. + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` - - `const LogsLogs Logs = "logs"` + - `GenerateSummary string` - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + **Deprecated:** use `summary` instead. - The image output from the code interpreter. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `Type Image` + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` - The type of the output. Always `image`. + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` - - `const ImageImage Image = "image"` + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` - - `URL string` + - `Mode string` - The URL of the image output from the code interpreter. + Controls the reasoning execution mode for the request. - - `Status BetaResponseCodeInterpreterToolCallStatus` + When returned on a response, this is the effective execution mode. - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `string` - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + - `string` - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + - `Summary string` - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `Type CodeInterpreterCall` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` - - `Agent BetaResponseCodeInterpreterToolCallAgent` + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` - The agent that produced this item. + - `SafetyIdentifier string` - - `AgentName string` + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - The canonical name of the agent that produced this item. + - `ServiceTier BetaResponseServiceTier` - - `type BetaResponseItemLocalShellCall struct{…}` + Specifies the processing type used for serving the request. - A tool call to run a command on the local shell. + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - - `ID string` + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - The unique ID of the local shell call. + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` - - `Action BetaResponseItemLocalShellCallAction` + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` - Execute a shell command on the server. + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` - - `Command []string` + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` - The command to run. + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` - - `Env map[string, string]` + - `Status BetaResponseStatus` - Environment variables to set for the command. + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. - - `Type Exec` + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` - The type of the local shell action. Always `exec`. + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` - - `const ExecExec Exec = "exec"` + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` - - `TimeoutMs int64` + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` - Optional timeout in milliseconds for the command. + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` - - `User string` + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` - Optional user to run the command as. + - `Text BetaResponseTextConfig` - - `WorkingDirectory string` + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - Optional working directory to run the command in. + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - - `CallID string` + - `Format BetaResponseFormatTextConfigUnion` - The unique ID of the local shell tool call generated by the model. + An object specifying the format that the model must output. - - `Status string` + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The status of the local shell call. + The default format is `{ "type": "text" }` with no additional options. - - `const BetaResponseItemLocalShellCallStatusInProgress BetaResponseItemLocalShellCallStatus = "in_progress"` + **Not recommended for gpt-4o and newer models:** - - `const BetaResponseItemLocalShellCallStatusCompleted BetaResponseItemLocalShellCallStatus = "completed"` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - - `const BetaResponseItemLocalShellCallStatusIncomplete BetaResponseItemLocalShellCallStatus = "incomplete"` + - `type BetaResponseFormatTextConfigText struct{…}` - - `Type LocalShellCall` + Default response format. Used to generate text responses. - The type of the local shell call. Always `local_shell_call`. + - `Type Text` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + The type of response format being defined. Always `text`. - - `Agent BetaResponseItemLocalShellCallAgent` + - `const TextText Text = "text"` - The agent that produced this item. + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - - `AgentName string` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The canonical name of the agent that produced this item. + - `Name string` - - `type BetaResponseItemLocalShellCallOutput struct{…}` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The output of a local shell tool call. + - `Schema map[string, any]` - - `ID string` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - The unique ID of the local shell tool call generated by the model. + - `Type JSONSchema` - - `Output string` + The type of response format being defined. Always `json_schema`. - A JSON string of the output of the local shell tool call. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `Type LocalShellCallOutput` + - `Description string` - The type of the local shell tool call output. Always `local_shell_call_output`. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `Strict bool` - - `Agent BetaResponseItemLocalShellCallOutputAgent` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The agent that produced this item. + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - - `AgentName string` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - The canonical name of the agent that produced this item. + - `Type JSONObject` - - `Status string` + The type of response format being defined. Always `json_object`. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `const BetaResponseItemLocalShellCallOutputStatusInProgress BetaResponseItemLocalShellCallOutputStatus = "in_progress"` + - `Verbosity BetaResponseTextConfigVerbosity` - - `const BetaResponseItemLocalShellCallOutputStatusCompleted BetaResponseItemLocalShellCallOutputStatus = "completed"` + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - - `const BetaResponseItemLocalShellCallOutputStatusIncomplete BetaResponseItemLocalShellCallOutputStatus = "incomplete"` + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - - `type BetaResponseFunctionShellToolCall struct{…}` + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - A tool call that executes one or more shell commands in a managed environment. + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - - `ID string` + - `TopLogprobs int64` - The unique ID of the shell tool call. Populated when this item is returned via API. + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - - `Action BetaResponseFunctionShellToolCallAction` + - `Truncation BetaResponseTruncation` - The shell commands and limits that describe how to run the tool call. + The truncation strategy to use for the model response. - - `Commands []string` + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `MaxOutputLength int64` + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` - Optional maximum number of characters to return from each command. + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` - - `TimeoutMs int64` + - `Usage BetaResponseUsage` - Optional timeout in milliseconds for the commands. + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - - `CallID string` + - `InputTokens int64` - The unique ID of the shell tool call generated by the model. + The number of input tokens. - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - Represents the use of a local environment to perform shell actions. + A detailed breakdown of the input tokens. - - `type BetaResponseLocalEnvironment struct{…}` + - `CacheWriteTokens int64` - Represents the use of a local environment to perform shell actions. + The number of input tokens that were written to the cache. - - `Type Local` + - `CachedTokens int64` - The environment type. Always `local`. + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - - `const LocalLocal Local = "local"` + - `OutputTokens int64` - - `type BetaResponseContainerReference struct{…}` + The number of output tokens. - Represents a container created with /v1/containers. + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - - `ContainerID string` + A detailed breakdown of the output tokens. - - `Type ContainerReference` + - `ReasoningTokens int64` - The environment type. Always `container_reference`. + The number of reasoning tokens. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `TotalTokens int64` - - `Status BetaResponseFunctionShellToolCallStatus` + The total number of tokens used. - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `User string` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `SequenceNumber int64` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + The sequence number for this event. - - `Type ShellCall` + - `Type ResponseQueued` - The type of the item. Always `shell_call`. + The type of the event. Always 'response.queued'. - - `const ShellCallShellCall ShellCall = "shell_call"` + - `const ResponseQueuedResponseQueued ResponseQueued = "response.queued"` - - `Agent BetaResponseFunctionShellToolCallAgent` + - `Agent BetaResponseQueuedEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Reasoning Item + +- `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + + - `ID string` + + The unique identifier of the reasoning content. + + - `Summary []BetaResponseReasoningItemSummary` + + 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"` + + - `Agent BetaResponseReasoningItemAgent` The agent that produced this item. @@ -104771,838 +117199,959 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `Content []BetaResponseReasoningItemContent` - The execution context that produced this tool call. + Reasoning text content. - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `Text string` - - `Type Direct` + The reasoning text from the model. - - `const DirectDirect Direct = "direct"` + - `Type ReasoningText` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + The type of the reasoning text. Always `reasoning_text`. - - `CallerID string` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - The call ID of the program item that produced this tool call. + - `EncryptedContent string` - - `Type Program` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `const ProgramProgram Program = "program"` + - `Status BetaResponseReasoningItemStatus` - - `CreatedBy string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The ID of the entity that created this tool call. + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - The output of a shell tool call that was emitted. + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `ID string` +### Beta Response Reasoning Summary Part Added Event - The unique ID of the shell call output. Populated when this item is returned via API. +- `type BetaResponseReasoningSummaryPartAddedEvent struct{…}` - - `CallID string` + Emitted when a new reasoning summary part is added. - The unique ID of the shell tool call generated by the model. + - `ItemID string` - - `MaxOutputLength int64` + The ID of the item this summary part is associated with. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `OutputIndex int64` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + The index of the output item this summary part is associated with. - An array of shell call output contents + - `Part BetaResponseReasoningSummaryPartAddedEventPart` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + The summary part that was added. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Text string` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + The text of the summary part. - Indicates that the shell call exceeded its configured time limit. + - `Type SummaryText` - - `Type Timeout` + The type of the summary part. Always `summary_text`. - The outcome type. Always `timeout`. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `const TimeoutTimeout Timeout = "timeout"` + - `SequenceNumber int64` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + The sequence number of this event. - Indicates that the shell commands finished and returned an exit code. + - `SummaryIndex int64` - - `ExitCode int64` + The index of the summary part within the reasoning summary. - Exit code from the shell process. + - `Type ResponseReasoningSummaryPartAdded` - - `Type Exit` + The type of the event. Always `response.reasoning_summary_part.added`. - The outcome type. Always `exit`. + - `const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"` - - `const ExitExit Exit = "exit"` + - `Agent BetaResponseReasoningSummaryPartAddedEventAgent` - - `Stderr string` + The agent that owns this multi-agent streaming event. - The standard error output that was captured. + - `AgentName string` - - `Stdout string` + The canonical name of the agent that produced this item. - The standard output that was captured. +### Beta Response Reasoning Summary Part Done Event - - `CreatedBy string` +- `type BetaResponseReasoningSummaryPartDoneEvent struct{…}` - The identifier of the actor that created the item. + Emitted when a reasoning summary part is completed. - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `ItemID string` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + The ID of the item this summary part is associated with. - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `OutputIndex int64` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + The index of the output item this summary part is associated with. - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + - `Part BetaResponseReasoningSummaryPartDoneEventPart` - - `Type ShellCallOutput` + The completed summary part. - The type of the shell call output. Always `shell_call_output`. + - `Text string` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + The text of the summary part. - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `Type SummaryText` - The agent that produced this item. + The type of the summary part. Always `summary_text`. + + - `const SummaryTextSummaryText SummaryText = "summary_text"` + + - `SequenceNumber int64` + + The sequence number of this event. + + - `SummaryIndex int64` + + The index of the summary part within the reasoning summary. + + - `Type ResponseReasoningSummaryPartDone` + + The type of the event. Always `response.reasoning_summary_part.done`. + + - `const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"` + + - `Agent BetaResponseReasoningSummaryPartDoneEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `Status BetaResponseReasoningSummaryPartDoneEventStatus` - The execution context that produced this tool call. + The completion status of the summary part. Omitted when the part completed + normally and set to `incomplete` when generation was interrupted. - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `const BetaResponseReasoningSummaryPartDoneEventStatusIncomplete BetaResponseReasoningSummaryPartDoneEventStatus = "incomplete"` - - `Type Direct` +### Beta Response Reasoning Summary Text Delta Event - - `const DirectDirect Direct = "direct"` +- `type BetaResponseReasoningSummaryTextDeltaEvent struct{…}` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + Emitted when a delta is added to a reasoning summary text. - - `CallerID string` + - `Delta string` - The call ID of the program item that produced this tool call. + The text delta that was added to the summary. - - `Type Program` + - `ItemID string` - - `const ProgramProgram Program = "program"` + The ID of the item this summary text delta is associated with. - - `CreatedBy string` + - `OutputIndex int64` - The identifier of the actor that created the item. + The index of the output item this summary text delta is associated with. - - `type BetaResponseApplyPatchToolCall struct{…}` + - `SequenceNumber int64` - A tool call that applies file diffs by creating, deleting, or updating files. + The sequence number of this event. - - `ID string` + - `SummaryIndex int64` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + The index of the summary part within the reasoning summary. - - `CallID string` + - `Type ResponseReasoningSummaryTextDelta` - The unique ID of the apply patch tool call generated by the model. + The type of the event. Always `response.reasoning_summary_text.delta`. - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `Agent BetaResponseReasoningSummaryTextDeltaEventAgent` - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + The agent that owns this multi-agent streaming event. - Instruction describing how to create a file via the apply_patch tool. + - `AgentName string` - - `Diff string` + The canonical name of the agent that produced this item. - Diff to apply. +### Beta Response Reasoning Summary Text Done Event - - `Path string` +- `type BetaResponseReasoningSummaryTextDoneEvent struct{…}` - Path of the file to create. + Emitted when a reasoning summary text is completed. - - `Type CreateFile` + - `ItemID string` - Create a new file with the provided diff. + The ID of the item this summary text is associated with. - - `const CreateFileCreateFile CreateFile = "create_file"` + - `OutputIndex int64` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + The index of the output item this summary text is associated with. - Instruction describing how to delete a file via the apply_patch tool. + - `SequenceNumber int64` - - `Path string` + The sequence number of this event. - Path of the file to delete. + - `SummaryIndex int64` - - `Type DeleteFile` + The index of the summary part within the reasoning summary. - Delete the specified file. + - `Text string` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + The full text of the completed reasoning summary. - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `Type ResponseReasoningSummaryTextDone` - Instruction describing how to update a file via the apply_patch tool. + The type of the event. Always `response.reasoning_summary_text.done`. - - `Diff string` + - `const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"` - Diff to apply. + - `Agent BetaResponseReasoningSummaryTextDoneEventAgent` - - `Path string` + The agent that owns this multi-agent streaming event. - Path of the file to update. + - `AgentName string` - - `Type UpdateFile` + The canonical name of the agent that produced this item. - Update an existing file with the provided diff. +### Beta Response Reasoning Text Delta Event - - `const UpdateFileUpdateFile UpdateFile = "update_file"` +- `type BetaResponseReasoningTextDeltaEvent struct{…}` - - `Status BetaResponseApplyPatchToolCallStatus` + Emitted when a delta is added to a reasoning text. - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `ContentIndex int64` - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + The index of the reasoning content part this delta is associated with. - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + - `Delta string` - - `Type ApplyPatchCall` + The text delta that was added to the reasoning content. - The type of the item. Always `apply_patch_call`. + - `ItemID string` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + The ID of the item this reasoning text delta is associated with. - - `Agent BetaResponseApplyPatchToolCallAgent` + - `OutputIndex int64` - The agent that produced this item. + The index of the output item this reasoning text delta is associated with. + + - `SequenceNumber int64` + + The sequence number of this event. + + - `Type ResponseReasoningTextDelta` + + The type of the event. Always `response.reasoning_text.delta`. + + - `const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"` + + - `Agent BetaResponseReasoningTextDeltaEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` +### Beta Response Reasoning Text Done Event - The execution context that produced this tool call. +- `type BetaResponseReasoningTextDoneEvent struct{…}` - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + Emitted when a reasoning text is completed. - - `Type Direct` + - `ContentIndex int64` - - `const DirectDirect Direct = "direct"` + The index of the reasoning content part. - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `ItemID string` - - `CallerID string` + The ID of the item this reasoning text is associated with. - The call ID of the program item that produced this tool call. + - `OutputIndex int64` - - `Type Program` + The index of the output item this reasoning text is associated with. - - `const ProgramProgram Program = "program"` + - `SequenceNumber int64` - - `CreatedBy string` + The sequence number of this event. - The ID of the entity that created this tool call. + - `Text string` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + The full text of the completed reasoning content. - The output emitted by an apply patch tool call. + - `Type ResponseReasoningTextDone` - - `ID string` + The type of the event. Always `response.reasoning_text.done`. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"` - - `CallID string` + - `Agent BetaResponseReasoningTextDoneEventAgent` - The unique ID of the apply patch tool call generated by the model. + The agent that owns this multi-agent streaming event. - - `Status BetaResponseApplyPatchToolCallOutputStatus` + - `AgentName string` - The status of the apply patch tool call output. One of `completed` or `failed`. + The canonical name of the agent that produced this item. - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` +### Beta Response Refusal Delta Event - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` +- `type BetaResponseRefusalDeltaEvent struct{…}` - - `Type ApplyPatchCallOutput` + Emitted when there is a partial refusal text. - The type of the item. Always `apply_patch_call_output`. + - `ContentIndex int64` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + The index of the content part that the refusal text is added to. - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `Delta string` - The agent that produced this item. + The refusal text that is added. + + - `ItemID string` + + The ID of the output item that the refusal text is added to. + + - `OutputIndex int64` + + The index of the output item that the refusal text is added to. + + - `SequenceNumber int64` + + The sequence number of this event. + + - `Type ResponseRefusalDelta` + + The type of the event. Always `response.refusal.delta`. + + - `const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"` + + - `Agent BetaResponseRefusalDeltaEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` +### Beta Response Refusal Done Event - The execution context that produced this tool call. +- `type BetaResponseRefusalDoneEvent struct{…}` - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + Emitted when refusal text is finalized. - - `Type Direct` + - `ContentIndex int64` - - `const DirectDirect Direct = "direct"` + The index of the content part that the refusal text is finalized. - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + - `ItemID string` - - `CallerID string` + The ID of the output item that the refusal text is finalized. - The call ID of the program item that produced this tool call. + - `OutputIndex int64` - - `Type Program` + The index of the output item that the refusal text is finalized. - - `const ProgramProgram Program = "program"` + - `Refusal string` - - `CreatedBy string` + The refusal text that is finalized. - The ID of the entity that created this tool call output. + - `SequenceNumber int64` + + The sequence number of this event. + + - `Type ResponseRefusalDone` + + The type of the event. Always `response.refusal.done`. + + - `const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"` + + - `Agent BetaResponseRefusalDoneEventAgent` + + The agent that owns this multi-agent streaming event. + + - `AgentName string` + + The canonical name of the agent that produced this item. + +### Beta Response Status + +- `type BetaResponseStatus string` + + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + +### Beta Response Stream Event + +- `type BetaResponseStreamEventUnion interface{…}` + + Emitted when there is a partial audio response. + + - `type BetaResponseAudioDeltaEvent struct{…}` + + Emitted when there is a partial audio response. + + - `Delta string` + + A chunk of Base64 encoded response audio bytes. - - `Output string` + - `SequenceNumber int64` - Optional textual output returned by the apply patch tool. + A sequence number for this chunk of the stream response. - - `type BetaResponseItemMcpListTools struct{…}` + - `Type ResponseAudioDelta` - A list of tools available on an MCP server. + The type of the event. Always `response.audio.delta`. - - `ID string` + - `const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"` - The unique ID of the list. + - `Agent BetaResponseAudioDeltaEventAgent` - - `ServerLabel string` + The agent that owns this multi-agent streaming event. - The label of the MCP server. + - `AgentName string` - - `Tools []BetaResponseItemMcpListToolsTool` + The canonical name of the agent that produced this item. - The tools available on the server. + - `type BetaResponseAudioDoneEvent struct{…}` - - `InputSchema any` + Emitted when the audio response is complete. - The JSON schema describing the tool's input. + - `SequenceNumber int64` - - `Name string` + The sequence number of the delta. - The name of the tool. + - `Type ResponseAudioDone` - - `Annotations any` + The type of the event. Always `response.audio.done`. - Additional annotations about the tool. + - `const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"` - - `Description string` + - `Agent BetaResponseAudioDoneEventAgent` - The description of the tool. + The agent that owns this multi-agent streaming event. - - `Type McpListTools` + - `AgentName string` - The type of the item. Always `mcp_list_tools`. + The canonical name of the agent that produced this item. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `type BetaResponseAudioTranscriptDeltaEvent struct{…}` - - `Agent BetaResponseItemMcpListToolsAgent` + Emitted when there is a partial transcript of audio. - The agent that produced this item. + - `Delta string` - - `AgentName string` + The partial transcript of the audio response. - The canonical name of the agent that produced this item. + - `SequenceNumber int64` - - `Error string` + The sequence number of this event. - Error message if the server could not list tools. + - `Type ResponseAudioTranscriptDelta` - - `type BetaResponseItemMcpApprovalRequest struct{…}` + The type of the event. Always `response.audio.transcript.delta`. - A request for human approval of a tool invocation. + - `const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"` - - `ID string` + - `Agent BetaResponseAudioTranscriptDeltaEventAgent` - The unique ID of the approval request. + The agent that owns this multi-agent streaming event. - - `Arguments string` + - `AgentName string` - A JSON string of arguments for the tool. + The canonical name of the agent that produced this item. - - `Name string` + - `type BetaResponseAudioTranscriptDoneEvent struct{…}` - The name of the tool to run. + Emitted when the full audio transcript is completed. - - `ServerLabel string` + - `SequenceNumber int64` - The label of the MCP server making the request. + The sequence number of this event. - - `Type McpApprovalRequest` + - `Type ResponseAudioTranscriptDone` - The type of the item. Always `mcp_approval_request`. + The type of the event. Always `response.audio.transcript.done`. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"` - - `Agent BetaResponseItemMcpApprovalRequestAgent` + - `Agent BetaResponseAudioTranscriptDoneEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseItemMcpApprovalResponse struct{…}` + - `type BetaResponseCodeInterpreterCallCodeDeltaEvent struct{…}` - A response to an MCP approval request. + Emitted when a partial code snippet is streamed by the code interpreter. - - `ID string` + - `Delta string` - The unique ID of the approval response + The partial code snippet being streamed by the code interpreter. - - `ApprovalRequestID string` + - `ItemID string` - The ID of the approval request being answered. + The unique identifier of the code interpreter tool call item. - - `Approve bool` + - `OutputIndex int64` - Whether the request was approved. + The index of the output item in the response for which the code is being streamed. - - `Type McpApprovalResponse` + - `SequenceNumber int64` - The type of the item. Always `mcp_approval_response`. + The sequence number of this event, used to order streaming events. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `Type ResponseCodeInterpreterCallCodeDelta` - - `Agent BetaResponseItemMcpApprovalResponseAgent` + The type of the event. Always `response.code_interpreter_call_code.delta`. - The agent that produced this item. + - `const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"` - - `AgentName string` + - `Agent BetaResponseCodeInterpreterCallCodeDeltaEventAgent` - The canonical name of the agent that produced this item. + The agent that owns this multi-agent streaming event. - - `Reason string` + - `AgentName string` - Optional reason for the decision. + The canonical name of the agent that produced this item. - - `type BetaResponseItemMcpCall struct{…}` + - `type BetaResponseCodeInterpreterCallCodeDoneEvent struct{…}` - An invocation of a tool on an MCP server. + Emitted when the code snippet is finalized by the code interpreter. - - `ID string` + - `Code string` - The unique ID of the tool call. + The final code snippet output by the code interpreter. - - `Arguments string` + - `ItemID string` - A JSON string of the arguments passed to the tool. + The unique identifier of the code interpreter tool call item. - - `Name string` + - `OutputIndex int64` - The name of the tool that was run. + The index of the output item in the response for which the code is finalized. - - `ServerLabel string` + - `SequenceNumber int64` - The label of the MCP server running the tool. + The sequence number of this event, used to order streaming events. - - `Type McpCall` + - `Type ResponseCodeInterpreterCallCodeDone` - The type of the item. Always `mcp_call`. + The type of the event. Always `response.code_interpreter_call_code.done`. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"` - - `Agent BetaResponseItemMcpCallAgent` + - `Agent BetaResponseCodeInterpreterCallCodeDoneEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `ApprovalRequestID string` + - `type BetaResponseCodeInterpreterCallCompletedEvent struct{…}` - 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. + Emitted when the code interpreter call is completed. - - `Error string` + - `ItemID string` - The error from the tool call, if any. + The unique identifier of the code interpreter tool call item. - - `Output string` + - `OutputIndex int64` - The output from the tool call. + The index of the output item in the response for which the code interpreter call is completed. - - `Status string` + - `SequenceNumber int64` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + The sequence number of this event, used to order streaming events. - - `const BetaResponseItemMcpCallStatusInProgress BetaResponseItemMcpCallStatus = "in_progress"` + - `Type ResponseCodeInterpreterCallCompleted` - - `const BetaResponseItemMcpCallStatusCompleted BetaResponseItemMcpCallStatus = "completed"` + The type of the event. Always `response.code_interpreter_call.completed`. - - `const BetaResponseItemMcpCallStatusIncomplete BetaResponseItemMcpCallStatus = "incomplete"` + - `const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"` - - `const BetaResponseItemMcpCallStatusCalling BetaResponseItemMcpCallStatus = "calling"` + - `Agent BetaResponseCodeInterpreterCallCompletedEventAgent` - - `const BetaResponseItemMcpCallStatusFailed BetaResponseItemMcpCallStatus = "failed"` + The agent that owns this multi-agent streaming event. - - `type BetaResponseCustomToolCallItem struct{…}` + - `AgentName string` - A call to a custom tool created by the model. + The canonical name of the agent that produced this item. - - `ID string` + - `type BetaResponseCodeInterpreterCallInProgressEvent struct{…}` - The unique ID of the custom tool call item. + Emitted when a code interpreter call is in progress. - - `Status string` + - `ItemID string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The unique identifier of the code interpreter tool call item. - - `const BetaResponseCustomToolCallItemStatusInProgress BetaResponseCustomToolCallItemStatus = "in_progress"` + - `OutputIndex int64` - - `const BetaResponseCustomToolCallItemStatusCompleted BetaResponseCustomToolCallItemStatus = "completed"` + The index of the output item in the response for which the code interpreter call is in progress. - - `const BetaResponseCustomToolCallItemStatusIncomplete BetaResponseCustomToolCallItemStatus = "incomplete"` + - `SequenceNumber int64` - - `CreatedBy string` + The sequence number of this event, used to order streaming events. - The identifier of the actor that created the item. + - `Type ResponseCodeInterpreterCallInProgress` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + The type of the event. Always `response.code_interpreter_call.in_progress`. - The output of a custom tool call from your code, being sent back to the model. + - `const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"` - - `ID string` + - `Agent BetaResponseCodeInterpreterCallInProgressEventAgent` - The unique ID of the custom tool call output item. + The agent that owns this multi-agent streaming event. - - `Status string` + - `AgentName string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The canonical name of the agent that produced this item. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `type BetaResponseCodeInterpreterCallInterpretingEvent struct{…}` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + Emitted when the code interpreter is actively interpreting the code snippet. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `ItemID string` - - `CreatedBy string` + The unique identifier of the code interpreter tool call item. - The identifier of the actor that created the item. + - `OutputIndex int64` -### Beta Response Local Environment + The index of the output item in the response for which the code interpreter is interpreting code. -- `type BetaResponseLocalEnvironment struct{…}` + - `SequenceNumber int64` - Represents the use of a local environment to perform shell actions. + The sequence number of this event, used to order streaming events. - - `Type Local` + - `Type ResponseCodeInterpreterCallInterpreting` - The environment type. Always `local`. + The type of the event. Always `response.code_interpreter_call.interpreting`. - - `const LocalLocal Local = "local"` + - `const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"` -### Beta Response Mcp Call Arguments Delta Event + - `Agent BetaResponseCodeInterpreterCallInterpretingEventAgent` -- `type BetaResponseMcpCallArgumentsDeltaEvent struct{…}` + The agent that owns this multi-agent streaming event. - Emitted when there is a delta (partial update) to the arguments of an MCP tool call. + - `AgentName string` - - `Delta string` + The canonical name of the agent that produced this item. - A JSON string containing the partial update to the arguments for the MCP tool call. + - `type BetaResponseCompletedEvent struct{…}` - - `ItemID string` + Emitted when the model response is complete. - The unique identifier of the MCP tool call item being processed. + - `Response BetaResponse` - - `OutputIndex int64` + Properties of the completed response. - The index of the output item in the response's output array. + - `ID string` - - `SequenceNumber int64` + Unique identifier for this Response. - The sequence number of this event. + - `CreatedAt float64` - - `Type ResponseMcpCallArgumentsDelta` + Unix timestamp (in seconds) of when this Response was created. - The type of the event. Always 'response.mcp_call_arguments.delta'. + - `Error BetaResponseError` - - `const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"` + An error object returned when the model fails to generate a Response. - - `Agent BetaResponseMcpCallArgumentsDeltaEventAgent` + - `Code BetaResponseErrorCode` - The agent that owns this multi-agent streaming event. + The error code for the response. - - `AgentName string` + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` - The canonical name of the agent that produced this item. + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` -### Beta Response Mcp Call Arguments Done Event + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` -- `type BetaResponseMcpCallArgumentsDoneEvent struct{…}` + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` - Emitted when the arguments for an MCP tool call are finalized. + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` - - `Arguments string` + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` - A JSON string containing the finalized arguments for the MCP tool call. + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` - - `ItemID string` + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` - The unique identifier of the MCP tool call item being processed. + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` - - `OutputIndex int64` + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` - The index of the output item in the response's output array. + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` - - `SequenceNumber int64` + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` - The sequence number of this event. + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` - - `Type ResponseMcpCallArgumentsDone` + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` - The type of the event. Always 'response.mcp_call_arguments.done'. + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` - - `const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"` + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` - - `Agent BetaResponseMcpCallArgumentsDoneEventAgent` + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` - The agent that owns this multi-agent streaming event. + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` - - `AgentName string` + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` - The canonical name of the agent that produced this item. + - `Message string` -### Beta Response Mcp Call Completed Event + A human-readable description of the error. -- `type BetaResponseMcpCallCompletedEvent struct{…}` + - `IncompleteDetails BetaResponseIncompleteDetails` - Emitted when an MCP tool call has completed successfully. + Details about why the response is incomplete. - - `ItemID string` + - `Reason string` - The ID of the MCP tool call item that completed. + The reason why the response is incomplete. - - `OutputIndex int64` + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` - The index of the output item that completed. + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` - - `SequenceNumber int64` + - `Instructions BetaResponseInstructionsUnion` - The sequence number of this event. + A system (or developer) message inserted into the model's context. - - `Type ResponseMcpCallCompleted` + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. - The type of the event. Always 'response.mcp_call.completed'. + - `string` - - `const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"` + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` - - `Agent BetaResponseMcpCallCompletedEventAgent` + A list of one or many input items to the model, containing + different content types. - The agent that owns this multi-agent streaming event. + - `type BetaEasyInputMessage struct{…}` - - `AgentName string` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - The canonical name of the agent that produced this item. + - `Content BetaEasyInputMessageContentUnion` -### Beta Response Mcp Call Failed Event + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. -- `type BetaResponseMcpCallFailedEvent struct{…}` + - `string` - Emitted when an MCP tool call has failed. + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - `ItemID string` + A list of one or many input items to the model, containing different content + types. - The ID of the MCP tool call item that failed. + - `type BetaResponseInputText struct{…}` - - `OutputIndex int64` + A text input to the model. - The index of the output item that failed. + - `Text string` - - `SequenceNumber int64` + The text input to the model. - The sequence number of this event. + - `Type InputText` - - `Type ResponseMcpCallFailed` + The type of the input item. Always `input_text`. - The type of the event. Always 'response.mcp_call.failed'. + - `const InputTextInputText InputText = "input_text"` - - `const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"` + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `Agent BetaResponseMcpCallFailedEventAgent` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The agent that owns this multi-agent streaming event. + - `Mode Explicit` - - `AgentName string` + The breakpoint mode. Always `explicit`. - The canonical name of the agent that produced this item. + - `const ExplicitExplicit Explicit = "explicit"` -### Beta Response Mcp Call In Progress Event + - `type BetaResponseInputImage struct{…}` -- `type BetaResponseMcpCallInProgressEvent struct{…}` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - Emitted when an MCP tool call is in progress. + - `Detail BetaResponseInputImageDetail` - - `ItemID string` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The unique identifier of the MCP tool call item being processed. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `OutputIndex int64` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - The index of the output item in the response's output array. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `SequenceNumber int64` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - The sequence number of this event. + - `Type InputImage` - - `Type ResponseMcpCallInProgress` + The type of the input item. Always `input_image`. - The type of the event. Always 'response.mcp_call.in_progress'. + - `const InputImageInputImage InputImage = "input_image"` - - `const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"` + - `FileID string` - - `Agent BetaResponseMcpCallInProgressEventAgent` + The ID of the file to be sent to the model. - The agent that owns this multi-agent streaming event. + - `ImageURL string` - - `AgentName string` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - The canonical name of the agent that produced this item. + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` -### Beta Response Mcp List Tools Completed Event + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. -- `type BetaResponseMcpListToolsCompletedEvent struct{…}` + - `Mode Explicit` - Emitted when the list of available MCP tools has been successfully retrieved. + The breakpoint mode. Always `explicit`. - - `ItemID string` + - `const ExplicitExplicit Explicit = "explicit"` - The ID of the MCP tool call item that produced this output. + - `type BetaResponseInputFile struct{…}` - - `OutputIndex int64` + A file input to the model. - The index of the output item that was processed. + - `Type InputFile` - - `SequenceNumber int64` + The type of the input item. Always `input_file`. - The sequence number of this event. + - `const InputFileInputFile InputFile = "input_file"` - - `Type ResponseMcpListToolsCompleted` + - `Detail BetaResponseInputFileDetail` - The type of the event. Always 'response.mcp_list_tools.completed'. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `Agent BetaResponseMcpListToolsCompletedEventAgent` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - The agent that owns this multi-agent streaming event. + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `AgentName string` + - `FileData string` - The canonical name of the agent that produced this item. + The content of the file to be sent to the model. -### Beta Response Mcp List Tools Failed Event + - `FileID string` -- `type BetaResponseMcpListToolsFailedEvent struct{…}` + The ID of the file to be sent to the model. - Emitted when the attempt to list available MCP tools has failed. + - `FileURL string` - - `ItemID string` + The URL of the file to be sent to the model. - The ID of the MCP tool call item that failed. + - `Filename string` - - `OutputIndex int64` + The name of the file to be sent to the model. - The index of the output item that failed. + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `SequenceNumber int64` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The sequence number of this event. + - `Mode Explicit` - - `Type ResponseMcpListToolsFailed` + The breakpoint mode. Always `explicit`. - The type of the event. Always 'response.mcp_list_tools.failed'. + - `const ExplicitExplicit Explicit = "explicit"` - - `const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"` + - `Role BetaEasyInputMessageRole` - - `Agent BetaResponseMcpListToolsFailedEventAgent` + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - The agent that owns this multi-agent streaming event. + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - - `AgentName string` + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - The canonical name of the agent that produced this item. + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` -### Beta Response Mcp List Tools In Progress Event + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` -- `type BetaResponseMcpListToolsInProgressEvent struct{…}` + - `Phase BetaEasyInputMessagePhase` - Emitted when the system is in the process of retrieving the list of available MCP tools. + 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. - - `ItemID string` + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - The ID of the MCP tool call item that is being processed. + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - - `OutputIndex int64` + - `Type BetaEasyInputMessageType` - The index of the output item that is being processed. + The type of the message input. Always `message`. - - `SequenceNumber int64` + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - The sequence number of this event. + - `type BetaResponseInputItemMessage struct{…}` - - `Type ResponseMcpListToolsInProgress` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - The type of the event. Always 'response.mcp_list_tools.in_progress'. + - `Content BetaResponseInputMessageContentList` - - `const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"` + A list of one or many input items to the model, containing different content + types. - - `Agent BetaResponseMcpListToolsInProgressEventAgent` + - `Role string` - The agent that owns this multi-agent streaming event. + The role of the message input. One of `user`, `system`, or `developer`. - - `AgentName string` + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` - The canonical name of the agent that produced this item. + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` -### Beta Response Output Audio + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` -- `type BetaResponseOutputAudio struct{…}` + - `Agent BetaResponseInputItemMessageAgent` - An audio output from the model. + The agent that produced this item. - - `Data string` + - `AgentName string` - Base64-encoded audio data from the model. + The canonical name of the agent that produced this item. - - `Transcript string` + - `Status string` - The transcript of the audio data from the model. + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Type OutputAudio` + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - The type of the output audio. Always `output_audio`. + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - - `const OutputAudioOutputAudio OutputAudio = "output_audio"` + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` -### Beta Response Output Item + - `Type string` -- `type BetaResponseOutputItemUnion interface{…}` + The type of the message input. Always set to `message`. - An output message from the model. + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - `type BetaResponseOutputMessage struct{…}` @@ -105799,6 +118348,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -105875,343 +118426,314 @@ func main() { The text that was retrieved from the file. - - `type BetaResponseFunctionToolCall struct{…}` + - `type BetaResponseComputerToolCall struct{…}` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `Arguments string` + - `ID string` - A JSON string of the arguments to pass to the function. + The unique ID of the computer call. - `CallID string` - The unique ID of the function tool call generated by the model. - - - `Name string` - - The name of the function to run. - - - `Type FunctionCall` + An identifier used when responding to the tool call with output. - The type of the function tool call. Always `function_call`. + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + The pending safety checks for the computer call. - `ID string` - The unique ID of the function tool call. - - - `Agent BetaResponseFunctionToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseFunctionToolCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - - `Type Direct` - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. + The ID of the pending safety check. - - `Type Program` + - `Code string` - - `const ProgramProgram Program = "program"` + The type of the pending safety check. - - `Namespace string` + - `Message string` - The namespace of the function to run. + Details about the pending safety check. - - `Status BetaResponseFunctionToolCallStatus` + - `Status BetaResponseComputerToolCallStatus` The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - - `ID string` + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - The unique ID of the function call tool output. + - `Type BetaResponseComputerToolCallType` - - `CallID string` + The type of the computer call. Always `computer_call`. - The unique ID of the function tool call generated by the model. + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `Action BetaComputerActionUnion` - The output from the function call generated by your code. - Can be a string or an list of output content. + A click action. - - `string` + - `type BetaComputerActionClick struct{…}` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + A click action. - Text, image, or file output of the function call. + - `Button string` - - `type BetaResponseInputText struct{…}` + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - A text input to the model. + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `Text string` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - The text input to the model. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `Type InputText` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - The type of the input item. Always `input_text`. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `const InputTextInputText InputText = "input_text"` + - `Type Click` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + Specifies the event type. For a click action, this property is always `click`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const ClickClick Click = "click"` - - `Mode Explicit` + - `X int64` - The breakpoint mode. Always `explicit`. + The x-coordinate where the click occurred. - - `const ExplicitExplicit Explicit = "explicit"` + - `Y int64` - - `type BetaResponseInputImage struct{…}` + The y-coordinate where the click occurred. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Keys []string` - - `Detail BetaResponseInputImageDetail` + The keys being held while clicking. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `type BetaComputerActionDoubleClick struct{…}` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + A double click action. - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `Keys []string` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + The keys being held while double-clicking. - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `Type DoubleClick` - - `Type InputImage` + Specifies the event type. For a double click action, this property is always set to `double_click`. - The type of the input item. Always `input_image`. + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `const InputImageInputImage InputImage = "input_image"` + - `X int64` - - `FileID string` + The x-coordinate where the double click occurred. - The ID of the file to be sent to the model. + - `Y int64` - - `ImageURL string` + The y-coordinate where the double click occurred. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `type BetaComputerActionDrag struct{…}` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + A drag action. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Path []BetaComputerActionDragPath` - - `Mode Explicit` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - The breakpoint mode. Always `explicit`. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `const ExplicitExplicit Explicit = "explicit"` + - `X int64` - - `type BetaResponseInputFile struct{…}` + The x-coordinate. - A file input to the model. + - `Y int64` - - `Type InputFile` + The y-coordinate. - The type of the input item. Always `input_file`. + - `Type Drag` - - `const InputFileInputFile InputFile = "input_file"` + Specifies the event type. For a drag action, this property is always set to `drag`. - - `Detail BetaResponseInputFileDetail` + - `const DragDrag Drag = "drag"` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Keys []string` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + The keys being held while dragging the mouse. - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `type BetaComputerActionKeypress struct{…}` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + A collection of keypresses the model would like to perform. - - `FileData string` + - `Keys []string` - The content of the file to be sent to the model. + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `FileID string` + - `Type Keypress` - The ID of the file to be sent to the model. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `FileURL string` + - `const KeypressKeypress Keypress = "keypress"` - The URL of the file to be sent to the model. + - `type BetaComputerActionMove struct{…}` - - `Filename string` + A mouse move action. - The name of the file to be sent to the model. + - `Type Move` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + Specifies the event type. For a move action, this property is always set to `move`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const MoveMove Move = "move"` - - `Mode Explicit` + - `X int64` - The breakpoint mode. Always `explicit`. + The x-coordinate to move to. - - `const ExplicitExplicit Explicit = "explicit"` + - `Y int64` - - `Status BetaResponseFunctionToolCallOutputItemStatus` + The y-coordinate to move to. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Keys []string` - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + The keys being held while moving the mouse. - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + - `type BetaComputerActionScreenshot struct{…}` - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + A screenshot action. - - `Type FunctionCallOutput` + - `Type Screenshot` - The type of the function tool call output. Always `function_call_output`. + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `type BetaComputerActionScroll struct{…}` - The agent that produced this item. + A scroll action. - - `AgentName string` + - `ScrollX int64` - The canonical name of the agent that produced this item. + The horizontal scroll distance. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `ScrollY int64` - The execution context that produced this tool call. + The vertical scroll distance. - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `Type Scroll` - - `Type Direct` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - The caller type. Always `direct`. + - `const ScrollScroll Scroll = "scroll"` - - `const DirectDirect Direct = "direct"` + - `X int64` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + The x-coordinate where the scroll occurred. - - `CallerID string` + - `Y int64` - The call ID of the program item that produced this tool call. + The y-coordinate where the scroll occurred. - - `Type Program` + - `Keys []string` - The caller type. Always `program`. + The keys being held while scrolling. - - `const ProgramProgram Program = "program"` + - `type BetaComputerActionType struct{…}` - - `CreatedBy string` + An action to type in text. - The identifier of the actor that created the item. + - `Text string` - - `type BetaResponseOutputItemAgentMessage struct{…}` + The text to type. - - `ID string` + - `Type Type` - The unique ID of the agent message. + Specifies the event type. For a type action, this property is always set to `type`. - - `Author string` + - `const TypeType Type = "type"` - The sending agent identity. + - `type BetaComputerActionWait struct{…}` - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + A wait action. - Encrypted content sent between agents. + - `Type Wait` - - `type BetaResponseInputText struct{…}` + Specifies the event type. For a wait action, this property is always set to `wait`. - A text input to the model. + - `const WaitWait Wait = "wait"` - - `type BetaResponseOutputText struct{…}` + - `Actions BetaComputerActionList` - A text output from the model. + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + - `type BetaComputerActionClick struct{…}` - A text content. + A click action. - - `Text string` + - `type BetaComputerActionDoubleClick struct{…}` - - `Type Text` + A double click action. - - `const TextText Text = "text"` + - `type BetaComputerActionDrag struct{…}` - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + A drag action. - A summary text from the model. + - `type BetaComputerActionKeypress struct{…}` - - `Text string` + A collection of keypresses the model would like to perform. - A summary of the reasoning output from the model so far. + - `type BetaComputerActionMove struct{…}` - - `Type SummaryText` + A mouse move action. - The type of the object. Always `summary_text`. + - `type BetaComputerActionScreenshot struct{…}` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + A screenshot action. - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `type BetaComputerActionScroll struct{…}` - Reasoning text from the model. + A scroll action. - - `Text string` + - `type BetaComputerActionType struct{…}` - The reasoning text from the model. + An action to type in text. - - `Type ReasoningText` + - `type BetaComputerActionWait struct{…}` - The type of the reasoning text. Always `reasoning_text`. + A wait action. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Agent BetaResponseComputerToolCallAgent` - - `type BetaResponseOutputRefusal struct{…}` + The agent that produced this item. - A refusal from the model. + - `AgentName string` - - `type BetaResponseInputImage struct{…}` + The canonical name of the agent that produced this item. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `type BetaResponseInputItemComputerCallOutput struct{…}` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + The output of a computer tool call. - A screenshot of a computer. + - `CallID string` - - `Detail string` + The ID of the computer tool call that produced the output. - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + A computer screenshot image used with the computer use tool. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + - `Type ComputerScreenshot` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - `FileID string` @@ -106221,95 +118743,33 @@ func main() { The URL of the screenshot image. - - `Type ComputerScreenshot` - - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `Mode Explicit` - - The breakpoint mode. Always `explicit`. - - - `const ExplicitExplicit Explicit = "explicit"` - - - `type BetaResponseInputFile struct{…}` - - A file input to the model. - - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - - Opaque encrypted content that Responses API decrypts inside trusted model execution. - - - `EncryptedContent string` - - Opaque encrypted content. - - - `Type EncryptedContent` - - The type of the input item. Always `encrypted_content`. - - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - - `Recipient string` - - The destination agent identity. - - - `Type AgentMessage` - - The type of the item. Always `agent_message`. - - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - - `Agent BetaResponseOutputItemAgentMessageAgent` - - The agent that produced this item. - - - `AgentName string` + - `Type ComputerCallOutput` - The canonical name of the agent that produced this item. + The type of the computer tool call output. Always `computer_call_output`. - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - `ID string` - The unique ID of the multi-agent call item. - - - `Action string` - - The multi-agent action to execute. - - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + The ID of the computer tool call output. - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - - `Arguments string` + The safety checks reported by the API that have been acknowledged by the developer. - The JSON string of arguments generated for the action. + - `ID string` - - `CallID string` + The ID of the pending safety check. - The unique ID linking this call to its output. + - `Code string` - - `Type MultiAgentCall` + The type of the pending safety check. - The type of the multi-agent call. Always `multi_agent_call`. + - `Message string` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + Details about the pending safety check. - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + - `Agent BetaResponseInputItemComputerCallOutputAgent` The agent that produced this item. @@ -106317,63 +118777,15 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - - - `ID string` - - The unique ID of the multi-agent call output item. - - - `Action string` - - The multi-agent action that produced this result. - - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - - - `CallID string` - - The unique ID of the multi-agent call. - - - `Output []BetaResponseOutputText` - - Text output returned by the multi-agent action. - - - `Annotations []BetaResponseOutputTextAnnotationUnion` - - The annotations of the text output. - - - `Text string` - - The text output from the model. - - - `Type OutputText` - - The type of the output text. Always `output_text`. - - - `Logprobs []BetaResponseOutputTextLogprob` - - - `Type MultiAgentCallOutput` - - The type of the multi-agent result. Always `multi_agent_call_output`. - - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `Status string` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - The agent that produced this item. + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `AgentName string` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - The canonical name of the agent that produced this item. + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - `type BetaResponseFunctionWebSearch struct{…}` @@ -106479,362 +118891,349 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseComputerToolCall struct{…}` + - `type BetaResponseFunctionToolCall struct{…}` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `ID string` + - `Arguments string` - The unique ID of the computer call. + A JSON string of the arguments to pass to the function. - `CallID string` - An identifier used when responding to the tool call with output. - - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - The pending safety checks for the computer call. + The unique ID of the function tool call generated by the model. - - `ID string` + - `Name string` - The ID of the pending safety check. + The name of the function to run. - - `Code string` + - `Type FunctionCall` - The type of the pending safety check. + The type of the function tool call. Always `function_call`. - - `Message string` + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - Details about the pending safety check. + - `ID string` - - `Status BetaResponseComputerToolCallStatus` + The unique ID of the function tool call. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Agent BetaResponseFunctionToolCallAgent` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + The agent that produced this item. - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `AgentName string` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + The canonical name of the agent that produced this item. - - `Type BetaResponseComputerToolCallType` + - `Caller BetaResponseFunctionToolCallCallerUnion` - The type of the computer call. Always `computer_call`. + The execution context that produced this tool call. - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `Action BetaComputerActionUnion` + - `Type Direct` - A click action. + - `const DirectDirect Direct = "direct"` - - `type BetaComputerActionClick struct{…}` + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - A click action. + - `CallerID string` - - `Button string` + The call ID of the program item that produced this tool call. - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `Type Program` - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `const ProgramProgram Program = "program"` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `Namespace string` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + The namespace of the function to run. - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `Status BetaResponseFunctionToolCallStatus` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `Type Click` + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - Specifies the event type. For a click action, this property is always `click`. + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - - `const ClickClick Click = "click"` + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `X int64` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - The x-coordinate where the click occurred. + The output of a function tool call. - - `Y int64` + - `CallID string` - The y-coordinate where the click occurred. + The unique ID of the function tool call generated by the model. - - `Keys []string` + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - The keys being held while clicking. + Text, image, or file output of the function tool call. - - `type BetaComputerActionDoubleClick struct{…}` + - `string` - A double click action. + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `Keys []string` + An array of content outputs (text, image, file) for the function tool call. - The keys being held while double-clicking. + - `type BetaResponseInputTextContent struct{…}` - - `Type DoubleClick` + A text input to the model. - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `Text string` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + The text input to the model. - - `X int64` + - `Type InputText` - The x-coordinate where the double click occurred. + The type of the input item. Always `input_text`. - - `Y int64` + - `const InputTextInputText InputText = "input_text"` - The y-coordinate where the double click occurred. + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `type BetaComputerActionDrag struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A drag action. + - `Mode Explicit` - - `Path []BetaComputerActionDragPath` + The breakpoint mode. Always `explicit`. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `const ExplicitExplicit Explicit = "explicit"` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `type BetaResponseInputImageContent struct{…}` - - `X int64` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - The x-coordinate. + - `Type InputImage` - - `Y int64` + The type of the input item. Always `input_image`. - The y-coordinate. + - `const InputImageInputImage InputImage = "input_image"` - - `Type Drag` + - `Detail BetaResponseInputImageContentDetail` - Specifies the event type. For a drag action, this property is always set to `drag`. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const DragDrag Drag = "drag"` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - - `Keys []string` + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - The keys being held while dragging the mouse. + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - - `type BetaComputerActionKeypress struct{…}` + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - A collection of keypresses the model would like to perform. + - `FileID string` - - `Keys []string` + The ID of the file to be sent to the model. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `ImageURL string` - - `Type Keypress` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `const KeypressKeypress Keypress = "keypress"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `type BetaComputerActionMove struct{…}` + - `Mode Explicit` - A mouse move action. + The breakpoint mode. Always `explicit`. - - `Type Move` + - `const ExplicitExplicit Explicit = "explicit"` - Specifies the event type. For a move action, this property is always set to `move`. + - `type BetaResponseInputFileContent struct{…}` - - `const MoveMove Move = "move"` + A file input to the model. - - `X int64` + - `Type InputFile` - The x-coordinate to move to. + The type of the input item. Always `input_file`. - - `Y int64` + - `const InputFileInputFile InputFile = "input_file"` - The y-coordinate to move to. + - `Detail BetaResponseInputFileContentDetail` - - `Keys []string` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - The keys being held while moving the mouse. + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `type BetaComputerActionScreenshot struct{…}` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - A screenshot action. + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `Type Screenshot` + - `FileData string` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + The base64-encoded data of the file to be sent to the model. - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `FileID string` - - `type BetaComputerActionScroll struct{…}` + The ID of the file to be sent to the model. - A scroll action. + - `FileURL string` - - `ScrollX int64` + The URL of the file to be sent to the model. - The horizontal scroll distance. + - `Filename string` - - `ScrollY int64` + The name of the file to be sent to the model. - The vertical scroll distance. + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - - `Type Scroll` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `Mode Explicit` - - `const ScrollScroll Scroll = "scroll"` + The breakpoint mode. Always `explicit`. - - `X int64` + - `const ExplicitExplicit Explicit = "explicit"` - The x-coordinate where the scroll occurred. + - `Type FunctionCallOutput` - - `Y int64` + The type of the function tool call output. Always `function_call_output`. - The y-coordinate where the scroll occurred. + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `Keys []string` + - `ID string` - The keys being held while scrolling. + The unique ID of the function tool call output. Populated when this item is returned via API. - - `type BetaComputerActionType struct{…}` + - `Agent BetaResponseInputItemFunctionCallOutputAgent` - An action to type in text. + The agent that produced this item. - - `Text string` + - `AgentName string` - The text to type. + The canonical name of the agent that produced this item. - - `Type Type` + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - Specifies the event type. For a type action, this property is always set to `type`. + The execution context that produced this tool call. - - `const TypeType Type = "type"` + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - - `type BetaComputerActionWait struct{…}` + - `Type Direct` - A wait action. + The caller type. Always `direct`. - - `Type Wait` + - `const DirectDirect Direct = "direct"` - Specifies the event type. For a wait action, this property is always set to `wait`. + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - - `const WaitWait Wait = "wait"` + - `CallerID string` - - `Actions BetaComputerActionList` + The call ID of the program item that produced this tool call. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `Type Program` - - `type BetaComputerActionClick struct{…}` + The caller type. Always `program`. - A click action. + - `const ProgramProgram Program = "program"` - - `type BetaComputerActionDoubleClick struct{…}` + - `Status string` - A double click action. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `type BetaComputerActionDrag struct{…}` + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - A drag action. + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - - `type BetaComputerActionKeypress struct{…}` + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - A collection of keypresses the model would like to perform. + - `type BetaResponseInputItemAgentMessage struct{…}` - - `type BetaComputerActionMove struct{…}` + A message routed between agents. - A mouse move action. + - `Author string` - - `type BetaComputerActionScreenshot struct{…}` + The sending agent identity. - A screenshot action. + - `Content []BetaResponseInputItemAgentMessageContentUnion` - - `type BetaComputerActionScroll struct{…}` + Plaintext, image, or encrypted content sent between agents. - A scroll action. + - `type BetaResponseInputTextContent struct{…}` - - `type BetaComputerActionType struct{…}` + A text input to the model. - An action to type in text. + - `type BetaResponseInputImageContent struct{…}` - - `type BetaComputerActionWait struct{…}` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - A wait action. + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - - `Agent BetaResponseComputerToolCallAgent` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - The agent that produced this item. + - `EncryptedContent string` - - `AgentName string` + Opaque encrypted content. - The canonical name of the agent that produced this item. + - `Type EncryptedContent` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + The type of the input item. Always `encrypted_content`. - - `ID string` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - The unique ID of the computer call tool output. + - `Recipient string` - - `CallID string` + The destination agent identity. - The ID of the computer tool call that produced the output. + - `Type AgentMessage` - - `Output BetaResponseComputerToolCallOutputScreenshot` + The item type. Always `agent_message`. - A computer screenshot image used with the computer use tool. + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `Type ComputerScreenshot` + - `ID string` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + The unique ID of this agent message item. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `Agent BetaResponseInputItemAgentMessageAgent` - - `FileID string` + The agent that produced this item. - The identifier of an uploaded file that contains the screenshot. + - `AgentName string` - - `ImageURL string` + The canonical name of the agent that produced this item. - The URL of the screenshot image. + - `type BetaResponseInputItemMultiAgentCall struct{…}` - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `Action string` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + The multi-agent action that was executed. - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `Type ComputerCallOutput` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - The type of the computer tool call output. Always `computer_call_output`. + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `Arguments string` - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + The action arguments as a JSON string. - The safety checks reported by the API that have been acknowledged by the - developer. + - `CallID string` - - `ID string` + The unique ID linking this call to its output. - The ID of the pending safety check. + - `Type MultiAgentCall` - - `Code string` + The item type. Always `multi_agent_call`. - The type of the pending safety check. + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `Message string` + - `ID string` - Details about the pending safety check. + The unique ID of this multi-agent call. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `Agent BetaResponseInputItemMultiAgentCallAgent` The agent that produced this item. @@ -106842,140 +119241,129 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - - `ID string` + - `Action string` - The unique identifier of the reasoning content. + The multi-agent action that produced this result. - - `Summary []BetaResponseReasoningItemSummary` + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - Reasoning summary content. + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - - `Text string` + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - A summary of the reasoning output from the model so far. + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - - `Type SummaryText` + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - The type of the object. Always `summary_text`. + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `CallID string` - - `Type Reasoning` + The unique ID of the multi-agent call. - The type of the object. Always `reasoning`. + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `const ReasoningReasoning Reasoning = "reasoning"` + Text output returned by the multi-agent action. - - `Agent BetaResponseReasoningItemAgent` + - `Text string` - The agent that produced this item. + The text content. - - `AgentName string` + - `Type OutputText` - The canonical name of the agent that produced this item. + The content type. Always `output_text`. - - `Content []BetaResponseReasoningItemContent` + - `const OutputTextOutputText OutputText = "output_text"` - Reasoning text content. + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - `Text string` + Citations associated with the text content. - The reasoning text from the model. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `Type ReasoningText` + - `FileID string` - The type of the reasoning text. Always `reasoning_text`. + The ID of the file. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Filename string` - - `EncryptedContent string` + The filename of the file cited. - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `Index int64` - - `Status BetaResponseReasoningItemStatus` + The index of the file in the list of files. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Type FileCitation` - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + The citation type. Always `file_citation`. - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - - `type BetaResponseOutputItemProgram struct{…}` + - `EndIndex int64` - - `ID string` + The index of the last character of the citation in the message. - The unique ID of the program item. + - `StartIndex int64` - - `CallID string` + The index of the first character of the citation in the message. - The stable call ID of the program item. + - `Title string` - - `Code string` + The title of the cited resource. - The JavaScript source executed by programmatic tool calling. + - `Type URLCitation` - - `Fingerprint string` + The citation type. Always `url_citation`. - Opaque program replay fingerprint that must be round-tripped. + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `Type Program` + - `URL string` - The type of the item. Always `program`. + The URL of the cited resource. - - `const ProgramProgram Program = "program"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `Agent BetaResponseOutputItemProgramAgent` + - `ContainerID string` - The agent that produced this item. + The ID of the container. - - `AgentName string` + - `EndIndex int64` - The canonical name of the agent that produced this item. + The index of the last character of the citation in the message. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `FileID string` - - `ID string` + The ID of the container file. - The unique ID of the program output item. + - `Filename string` - - `CallID string` + The filename of the container file cited. - The call ID of the program item. + - `StartIndex int64` - - `Result string` + The index of the first character of the citation in the message. - The result produced by the program item. + - `Type ContainerFileCitation` - - `Status string` + The citation type. Always `container_file_citation`. - The terminal status of the program output item. + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + - `Type MultiAgentCallOutput` - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + The item type. Always `multi_agent_call_output`. - - `Type ProgramOutput` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - The type of the item. Always `program_output`. + - `ID string` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + The unique ID of this multi-agent call output. - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` The agent that produced this item. @@ -106983,45 +119371,23 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseToolSearchCall struct{…}` - - - `ID string` - - The unique ID of the tool search call item. + - `type BetaResponseInputItemToolSearchCall struct{…}` - `Arguments any` - Arguments used for the tool search call. - - - `CallID string` - - The unique ID of the tool search call generated by the model. - - - `Execution BetaResponseToolSearchCallExecution` - - Whether tool search was executed by the server or by the client. - - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - - `Status BetaResponseToolSearchCallStatus` - - The status of the tool search call item that was recorded. - - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + The arguments supplied to the tool search call. - `Type ToolSearchCall` - The type of the item. Always `tool_search_call`. + The item type. Always `tool_search_call`. - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `Agent BetaResponseToolSearchCallAgent` + - `ID string` + + The unique ID of this tool search call. + + - `Agent BetaResponseInputItemToolSearchCallAgent` The agent that produced this item. @@ -107029,41 +119395,33 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseToolSearchOutputItem 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 BetaResponseToolSearchOutputItemExecution` + - `Execution string` Whether tool search was executed by the server or by the client. - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - - `Status BetaResponseToolSearchOutputItemStatus` + - `Status string` - The status of the tool search output item that was recorded. + The status of the tool search call. - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - `Tools []BetaToolUnion` - The loaded tool definitions returned by tool search. + The loaded tool definitions returned by the tool search output. - `type BetaFunctionTool struct{…}` @@ -107172,7 +119530,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -107229,7 +119591,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -108145,11 +120511,15 @@ func main() { - `Type ToolSearchOutput` - The type of the item. Always `tool_search_output`. + The item type. Always `tool_search_output`. - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `Agent BetaResponseToolSearchOutputItemAgent` + - `ID string` + + The unique ID of this tool search output. + + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` The agent that produced this item. @@ -108157,39 +120527,39 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` + - `CallID string` - The identifier of the actor that created the item. + The unique ID of the tool search call generated by the model. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - - `ID string` + Whether tool search was executed by the server or by the client. - The unique ID of the additional tools item. + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - `Role string` + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - The role that provided the additional tools. + - `Status BetaResponseToolSearchOutputItemParamStatus` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + The status of the tool search output. - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + - `Role Developer` - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + The role that provided the additional tools. Only `developer` is supported. - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + - `const DeveloperDeveloper Developer = "developer"` - `Tools []BetaToolUnion` - The additional tool definitions made available at this item. + A list of additional tools made available at this item. - `type BetaFunctionTool struct{…}` @@ -108219,67 +120589,136 @@ func main() { - `type BetaToolCodeInterpreter struct{…}` - A tool that runs Python code to help generate a response to a prompt. + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` + + - `type BetaToolImageGeneration struct{…}` + + A tool that generates images using the GPT image models. + + - `type BetaToolLocalShell struct{…}` + + A tool that allows the model to execute shell commands in a local environment. + + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `type BetaCustomTool struct{…}` + + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + + - `type BetaNamespaceTool struct{…}` + + Groups function/custom tools under a shared namespace. + + - `type BetaToolSearchTool struct{…}` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type BetaWebSearchPreviewTool struct{…}` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type BetaApplyPatchTool struct{…}` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `Type AdditionalTools` + + The item type. Always `additional_tools`. + + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + + - `ID string` + + The unique ID of this additional tools item. + + - `Agent BetaResponseInputItemAdditionalToolsAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). + + - `ID string` + + The unique identifier of the reasoning content. + + - `Summary []BetaResponseReasoningItemSummary` + + Reasoning summary content. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `Text string` - - `type BetaToolImageGeneration struct{…}` + A summary of the reasoning output from the model so far. - A tool that generates images using the GPT image models. + - `Type SummaryText` - - `type BetaToolLocalShell struct{…}` + The type of the object. Always `summary_text`. - A tool that allows the model to execute shell commands in a local environment. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `type BetaFunctionShellTool struct{…}` + - `Type Reasoning` - A tool that allows the model to execute shell commands. + The type of the object. Always `reasoning`. - - `type BetaCustomTool struct{…}` + - `const ReasoningReasoning Reasoning = "reasoning"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Agent BetaResponseReasoningItemAgent` - - `type BetaNamespaceTool struct{…}` + The agent that produced this item. - Groups function/custom tools under a shared namespace. + - `AgentName string` - - `type BetaToolSearchTool struct{…}` + The canonical name of the agent that produced this item. - Hosted or BYOT tool search configuration for deferred tools. + - `Content []BetaResponseReasoningItemContent` - - `type BetaWebSearchPreviewTool struct{…}` + Reasoning text content. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Text string` - - `type BetaApplyPatchTool struct{…}` + The reasoning text from the model. - Allows the assistant to create, delete, or update files using unified diffs. + - `Type ReasoningText` - - `Type AdditionalTools` + The type of the reasoning text. Always `reasoning_text`. - The type of the item. Always `additional_tools`. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `EncryptedContent string` - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - The agent that produced this item. + - `Status BetaResponseReasoningItemStatus` - - `AgentName string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The canonical name of the agent that produced this item. + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - `type BetaResponseCompactionItem struct{…}` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `ID string` + - `type BetaResponseCompactionItemParamResp struct{…}` - The unique ID of the compaction item. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - `EncryptedContent string` - The encrypted content that was produced by compaction. + The encrypted content of the compaction summary. - `Type Compaction` @@ -108287,7 +120726,11 @@ func main() { - `const CompactionCompaction Compaction = "compaction"` - - `Agent BetaResponseCompactionItemAgent` + - `ID string` + + The ID of the compaction item. + + - `Agent BetaResponseCompactionItemParamAgentResp` The agent that produced this item. @@ -108295,11 +120738,7 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `type BetaResponseInputItemImageGenerationCall struct{…}` An image generation request made by the model. @@ -108315,13 +120754,13 @@ func main() { The status of the image generation call. - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - `Type ImageGenerationCall` @@ -108329,7 +120768,7 @@ func main() { - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `Agent BetaResponseInputItemImageGenerationCallAgent` The agent that produced this item. @@ -108414,7 +120853,7 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemLocalShellCall struct{…}` + - `type BetaResponseInputItemLocalShellCall struct{…}` A tool call to run a command on the local shell. @@ -108422,7 +120861,7 @@ func main() { The unique ID of the local shell call. - - `Action BetaResponseOutputItemLocalShellCallAction` + - `Action BetaResponseInputItemLocalShellCallAction` Execute a shell command on the server. @@ -108460,11 +120899,11 @@ func main() { The status of the local shell call. - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - `Type LocalShellCall` @@ -108472,7 +120911,7 @@ func main() { - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + - `Agent BetaResponseInputItemLocalShellCallAgent` The agent that produced this item. @@ -108480,7 +120919,7 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` The output of a local shell tool call. @@ -108498,7 +120937,7 @@ func main() { - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` The agent that produced this item. @@ -108510,81 +120949,47 @@ func main() { The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - - `type BetaResponseFunctionShellToolCall struct{…}` + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - A tool call that executes one or more shell commands in a managed environment. + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - - `ID string` + - `type BetaResponseInputItemShellCall struct{…}` - The unique ID of the shell tool call. Populated when this item is returned via API. + A tool representing a request to execute one or more shell commands. - - `Action BetaResponseFunctionShellToolCallAction` + - `Action BetaResponseInputItemShellCallAction` The shell commands and limits that describe how to run the tool call. - `Commands []string` + Ordered shell commands for the execution environment to run. + - `MaxOutputLength int64` - Optional maximum number of characters to return from each command. + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - `TimeoutMs int64` - Optional timeout in milliseconds for the commands. + Maximum wall-clock time in milliseconds to allow the shell commands to run. - `CallID string` The unique ID of the shell tool call generated by the model. - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - - Represents the use of a local environment to perform shell actions. - - - `type BetaResponseLocalEnvironment struct{…}` - - Represents the use of a local environment to perform shell actions. - - - `Type Local` - - The environment type. Always `local`. - - - `const LocalLocal Local = "local"` - - - `type BetaResponseContainerReference struct{…}` - - Represents a container created with /v1/containers. - - - `ContainerID string` - - - `Type ContainerReference` - - The environment type. Always `container_reference`. - - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - - `Status BetaResponseFunctionShellToolCallStatus` - - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `Type ShellCall` The type of the item. Always `shell_call`. - `const ShellCallShellCall ShellCall = "shell_call"` - - `Agent BetaResponseFunctionShellToolCallAgent` + - `ID string` + + The unique ID of the shell tool call. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemShellCallAgent` The agent that produced this item. @@ -108592,17 +120997,19 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `Caller BetaResponseInputItemShellCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - `Type Direct` + The caller type. Always `direct`. + - `const DirectDirect Direct = "direct"` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - `CallerID string` @@ -108610,37 +121017,45 @@ func main() { - `Type Program` + The caller type. Always `program`. + - `const ProgramProgram Program = "program"` - - `CreatedBy string` + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - The ID of the entity that created this tool call. + The environment to execute the shell commands in. - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `type BetaLocalEnvironment struct{…}` - The output of a shell tool call that was emitted. + - `type BetaContainerReference struct{…}` - - `ID string` + - `Status string` - The unique ID of the shell call output. Populated when this item is returned via API. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `CallID string` + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - The unique ID of the shell tool call generated by the model. + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - - `MaxOutputLength int64` + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + The streamed output items emitted by a shell tool call. - An array of shell call output contents + - `CallID string` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + The unique ID of the shell tool call generated by the model. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Output []BetaResponseFunctionShellCallOutputContent` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + Captured chunks of stdout and stderr output, along with their associated outcomes. + + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + + The exit or timeout outcome associated with this shell call. + + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` Indicates that the shell call exceeded its configured time limit. @@ -108650,13 +121065,13 @@ func main() { - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` Indicates that the shell commands finished and returned an exit code. - `ExitCode int64` - Exit code from the shell process. + The exit code returned by the shell process. - `Type Exit` @@ -108666,33 +121081,23 @@ func main() { - `Stderr string` - The standard error output that was captured. + Captured stderr output for the shell call. - `Stdout string` - The standard output that was captured. - - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `Status BetaResponseFunctionShellToolCallOutputStatus` - - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + Captured stdout output for the shell call. - `Type ShellCallOutput` - The type of the shell call output. Always `shell_call_output`. + The type of the item. Always `shell_call_output`. - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `ID string` + + The unique ID of the shell tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemShellCallOutputAgent` The agent that produced this item. @@ -108700,17 +121105,19 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - `Type Direct` + The caller type. Always `direct`. + - `const DirectDirect Direct = "direct"` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - `CallerID string` @@ -108718,85 +121125,93 @@ func main() { - `Type Program` + The caller type. Always `program`. + - `const ProgramProgram Program = "program"` - - `CreatedBy string` + - `MaxOutputLength int64` - The identifier of the actor that created the item. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `type BetaResponseApplyPatchToolCall struct{…}` + - `Status string` - A tool call that applies file diffs by creating, deleting, or updating files. + The status of the shell call output. - - `ID string` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + + - `type BetaResponseInputItemApplyPatchCall struct{…}` + + A tool call representing a request to create, delete, or update files using diff patches. - `CallID string` The unique ID of the apply patch tool call generated by the model. - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + The specific create, delete, or update instruction for the apply_patch tool call. - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - Instruction describing how to create a file via the apply_patch tool. + Instruction for creating a new file via the apply_patch tool. - `Diff string` - Diff to apply. + Unified diff content to apply when creating the file. - `Path string` - Path of the file to create. + Path of the file to create relative to the workspace root. - `Type CreateFile` - Create a new file with the provided diff. + The operation type. Always `create_file`. - `const CreateFileCreateFile CreateFile = "create_file"` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - Instruction describing how to delete a file via the apply_patch tool. + Instruction for deleting an existing file via the apply_patch tool. - `Path string` - Path of the file to delete. + Path of the file to delete relative to the workspace root. - `Type DeleteFile` - Delete the specified file. + The operation type. Always `delete_file`. - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - Instruction describing how to update a file via the apply_patch tool. + Instruction for updating an existing file via the apply_patch tool. - `Diff string` - Diff to apply. + Unified diff content to apply to the existing file. - `Path string` - Path of the file to update. + Path of the file to update relative to the workspace root. - `Type UpdateFile` - Update an existing file with the provided diff. + The operation type. Always `update_file`. - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Status BetaResponseApplyPatchToolCallStatus` + - `Status string` The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - `Type ApplyPatchCall` @@ -108804,7 +121219,11 @@ func main() { - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `Agent BetaResponseApplyPatchToolCallAgent` + - `ID string` + + The unique ID of the apply patch tool call. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemApplyPatchCallAgent` The agent that produced this item. @@ -108812,17 +121231,19 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - `Type Direct` + The caller type. Always `direct`. + - `const DirectDirect Direct = "direct"` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - `CallerID string` @@ -108830,31 +121251,25 @@ func main() { - `Type Program` - - `const ProgramProgram Program = "program"` - - - `CreatedBy string` - - The ID of the entity that created this tool call. - - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + The caller type. Always `program`. - The output emitted by an apply patch tool call. + - `const ProgramProgram Program = "program"` - - `ID string` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The streamed output emitted by an apply patch tool call. - `CallID string` The unique ID of the apply patch tool call generated by the model. - - `Status BetaResponseApplyPatchToolCallOutputStatus` + - `Status string` The status of the apply patch tool call output. One of `completed` or `failed`. - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - `Type ApplyPatchCallOutput` @@ -108862,7 +121277,11 @@ func main() { - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `ID string` + + The unique ID of the apply patch tool call output. Populated when this item is returned via API. + + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` The agent that produced this item. @@ -108870,17 +121289,19 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - `Type Direct` + The caller type. Always `direct`. + - `const DirectDirect Direct = "direct"` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - `CallerID string` @@ -108888,78 +121309,15 @@ func main() { - `Type Program` - - `const ProgramProgram Program = "program"` - - - `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 BetaResponseOutputItemMcpCall 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"` - - - `Agent BetaResponseOutputItemMcpCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `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 caller type. Always `program`. - The error from the tool call, if any. + - `const ProgramProgram Program = "program"` - `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 BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `type BetaResponseInputItemMcpListTools struct{…}` A list of tools available on an MCP server. @@ -108971,7 +121329,7 @@ func main() { The label of the MCP server. - - `Tools []BetaResponseOutputItemMcpListToolsTool` + - `Tools []BetaResponseInputItemMcpListToolsTool` The tools available on the server. @@ -108997,7 +121355,7 @@ func main() { - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `Agent BetaResponseInputItemMcpListToolsAgent` The agent that produced this item. @@ -109009,7 +121367,7 @@ func main() { Error message if the server could not list tools. - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` A request for human approval of a tool invocation. @@ -109035,7 +121393,7 @@ func main() { - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` The agent that produced this item. @@ -109043,14 +121401,10 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `type BetaResponseInputItemMcpApprovalResponse 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. @@ -109065,7 +121419,11 @@ func main() { - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + - `ID string` + + The unique ID of the approval response + + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` The agent that produced this item. @@ -109077,33 +121435,33 @@ func main() { Optional reason for the decision. - - `type BetaResponseCustomToolCall struct{…}` + - `type BetaResponseInputItemMcpCall struct{…}` - A call to a custom tool created by the model. + An invocation of a tool on an MCP server. - - `CallID string` + - `ID string` - An identifier used to map this custom tool call to a tool call output. + The unique ID of the tool call. - - `Input string` + - `Arguments string` - The input for the custom tool call generated by the model. + A JSON string of the arguments passed to the tool. - `Name string` - The name of the custom tool being called. + The name of the tool that was run. - - `Type CustomToolCall` + - `ServerLabel string` - The type of the custom tool call. Always `custom_tool_call`. + The label of the MCP server running the tool. - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `Type McpCall` - - `ID string` + The type of the item. Always `mcp_call`. - The unique ID of the custom tool call in the OpenAI platform. + - `const McpCallMcpCall McpCall = "mcp_call"` - - `Agent BetaResponseCustomToolCallAgent` + - `Agent BetaResponseInputItemMcpCallAgent` The agent that produced this item. @@ -109111,534 +121469,550 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `ApprovalRequestID string` - The execution context that produced this tool call. + 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. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `Error string` - - `Type Direct` + The error from the tool call, if any. - - `const DirectDirect Direct = "direct"` + - `Output string` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + The output from the tool call. - - `CallerID string` + - `Status string` - The call ID of the program item that produced this tool call. + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `Type Program` + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - `Namespace string` + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - The namespace of the custom tool being called. + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + + - `type BetaResponseCustomToolCallOutput struct{…}` The output of a custom tool call from your code, being sent back to the model. - - `ID string` + - `CallID string` - The unique ID of the custom tool call output item. + The call ID, used to map this custom tool call output to a custom tool call. - - `Status string` + - `Output BetaResponseCustomToolCallOutputOutputUnion` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `string` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + Text, image, or file output of the custom tool call. - - `CreatedBy string` + - `type BetaResponseInputText struct{…}` - The identifier of the actor that created the item. + A text input to the model. -### Beta Response Output Item Added Event + - `type BetaResponseInputImage struct{…}` -- `type BetaResponseOutputItemAddedEvent struct{…}` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - Emitted when a new output item is added. + - `type BetaResponseInputFile struct{…}` - - `Item BetaResponseOutputItemUnion` + A file input to the model. - The output item that was added. + - `Type CustomToolCallOutput` - - `type BetaResponseOutputMessage struct{…}` + The type of the custom tool call output. Always `custom_tool_call_output`. - An output message from the model. + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - `ID string` - The unique ID of the output message. + The unique ID of the custom tool call output in the OpenAI platform. - - `Content []BetaResponseOutputMessageContentUnion` + - `Agent BetaResponseCustomToolCallOutputAgent` - The content of the output message. + The agent that produced this item. - - `type BetaResponseOutputText struct{…}` + - `AgentName string` - A text output from the model. + The canonical name of the agent that produced this item. - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - The annotations of the text output. + The execution context that produced this tool call. - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - A citation to a file. + - `Type Direct` - - `FileID string` + The caller type. Always `direct`. - The ID of the file. + - `const DirectDirect Direct = "direct"` - - `Filename string` + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - The filename of the file cited. + - `CallerID string` - - `Index int64` + The call ID of the program item that produced this tool call. - The index of the file in the list of files. + - `Type Program` - - `Type FileCitation` + The caller type. Always `program`. - The type of the file citation. Always `file_citation`. + - `const ProgramProgram Program = "program"` - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `type BetaResponseCustomToolCall struct{…}` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + A call to a custom tool created by the model. - A citation for a web resource used to generate a model response. + - `CallID string` - - `EndIndex int64` + An identifier used to map this custom tool call to a tool call output. - The index of the last character of the URL citation in the message. + - `Input string` - - `StartIndex int64` + The input for the custom tool call generated by the model. - The index of the first character of the URL citation in the message. + - `Name string` - - `Title string` + The name of the custom tool being called. - The title of the web resource. + - `Type CustomToolCall` - - `Type URLCitation` + The type of the custom tool call. Always `custom_tool_call`. - The type of the URL citation. Always `url_citation`. + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `ID string` - - `URL string` + The unique ID of the custom tool call in the OpenAI platform. - The URL of the web resource. + - `Agent BetaResponseCustomToolCallAgent` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + The agent that produced this item. - A citation for a container file used to generate a model response. + - `AgentName string` - - `ContainerID string` + The canonical name of the agent that produced this item. - The ID of the container file. + - `Caller BetaResponseCustomToolCallCallerUnion` - - `EndIndex int64` + The execution context that produced this tool call. - The index of the last character of the container file citation in the message. + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - - `FileID string` + - `Type Direct` - The ID of the file. + - `const DirectDirect Direct = "direct"` - - `Filename string` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - The filename of the container file cited. + - `CallerID string` - - `StartIndex int64` + The call ID of the program item that produced this tool call. - The index of the first character of the container file citation in the message. + - `Type Program` - - `Type ContainerFileCitation` + - `const ProgramProgram Program = "program"` - The type of the container file citation. Always `container_file_citation`. + - `Namespace string` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + The namespace of the custom tool being called. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - A path to a file. + Compacts the current context. Must be the final input item. - - `FileID string` + - `Type CompactionTrigger` - The ID of the file. + The type of the item. Always `compaction_trigger`. - - `Index int64` + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - The index of the file in the list of files. + - `Agent BetaResponseInputItemCompactionTriggerAgent` - - `Type FilePath` + The agent that produced this item. - The type of the file path. Always `file_path`. + - `AgentName string` - - `const FilePathFilePath FilePath = "file_path"` + The canonical name of the agent that produced this item. - - `Text string` + - `type BetaResponseInputItemItemReference struct{…}` - The text output from the model. + An internal identifier for an item to reference. - - `Type OutputText` + - `ID string` - The type of the output text. Always `output_text`. + The ID of the item to reference. - - `const OutputTextOutputText OutputText = "output_text"` + - `Agent BetaResponseInputItemItemReferenceAgent` - - `Logprobs []BetaResponseOutputTextLogprob` + The agent that produced this item. - - `Token string` + - `AgentName string` - - `Bytes []int64` + The canonical name of the agent that produced this item. - - `Logprob float64` + - `Type string` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + The type of item to reference. Always `item_reference`. - - `Token string` + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - - `Bytes []int64` + - `type BetaResponseInputItemProgram struct{…}` - - `Logprob float64` + - `ID string` - - `type BetaResponseOutputRefusal struct{…}` + The unique ID of this program item. - A refusal from the model. + - `CallID string` - - `Refusal string` + The stable call ID of the program item. - The refusal explanation from the model. + - `Code string` - - `Type Refusal` + The JavaScript source executed by programmatic tool calling. - The type of the refusal. Always `refusal`. + - `Fingerprint string` - - `const RefusalRefusal Refusal = "refusal"` + Opaque program replay fingerprint that must be round-tripped. - - `Role Assistant` + - `Type Program` - The role of the output message. Always `assistant`. + The item type. Always `program`. - - `const AssistantAssistant Assistant = "assistant"` + - `const ProgramProgram Program = "program"` - - `Status BetaResponseOutputMessageStatus` + - `Agent BetaResponseInputItemProgramAgent` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + The agent that produced this item. - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + - `AgentName string` - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + The canonical name of the agent that produced this item. - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + - `type BetaResponseInputItemProgramOutput struct{…}` - - `Type Message` + - `ID string` - The type of the output message. Always `message`. + The unique ID of this program output item. - - `const MessageMessage Message = "message"` + - `CallID string` - - `Agent BetaResponseOutputMessageAgent` + The call ID of the program item. - The agent that produced this item. + - `Result string` - - `AgentName string` + The result produced by the program item. - The canonical name of the agent that produced this item. + - `Status string` - - `Phase BetaResponseOutputMessagePhase` + The terminal status of the program output. - 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 BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - - `type BetaResponseFileSearchToolCall struct{…}` + - `Type ProgramOutput` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The item type. Always `program_output`. - - `ID string` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - The unique ID of the file search tool call. + - `Agent BetaResponseInputItemProgramOutputAgent` - - `Queries []string` + The agent that produced this item. - The queries used to search for files. + - `AgentName string` - - `Status BetaResponseFileSearchToolCallStatus` + The canonical name of the agent that produced this item. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `Metadata map[string, string]` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + 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. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + - `Model BetaResponseModel` - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + - `type BetaResponseModel string` - - `Type FileSearchCall` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - The type of the file search tool call. Always `file_search_call`. + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - - `Agent BetaResponseFileSearchToolCallAgent` + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - The agent that produced this item. + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - - `AgentName string` + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - - `Results []BetaResponseFileSearchToolCallResult` + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - The results of the file search tool call. + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - 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. + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - - `string` + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - - `float64` + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - - `bool` + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - - `FileID string` + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - The unique ID of the file. + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - - `Filename string` + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - The name of the file. + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - - `Score float64` + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - The relevance score of the file - a value between 0 and 1. + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - - `Text string` + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - The text that was retrieved from the file. + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - - `type BetaResponseFunctionToolCall struct{…}` + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - - `Arguments string` + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - A JSON string of the arguments to pass to the function. + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - - `CallID string` + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - The unique ID of the function tool call generated by the model. + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - - `Name string` + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - The name of the function to run. + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - - `Type FunctionCall` + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - The type of the function tool call. Always `function_call`. + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - - `ID string` + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - The unique ID of the function tool call. + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - - `Agent BetaResponseFunctionToolCallAgent` + - `const BetaResponseModelO3 BetaResponseModel = "o3"` - The agent that produced this item. + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - - `AgentName string` + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `const BetaResponseModelO1 BetaResponseModel = "o1"` - The execution context that produced this tool call. + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - - `Type Direct` + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - - `const DirectDirect Direct = "direct"` + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - `CallerID string` + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - The call ID of the program item that produced this tool call. + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - - `Type Program` + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - - `Namespace string` + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - The namespace of the function to run. + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - - `Status BetaResponseFunctionToolCallStatus` + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - - `ID string` + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - The unique ID of the function call tool output. + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `CallID string` + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - The unique ID of the function tool call generated by the model. + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` - The output from the function call generated by your code. - Can be a string or an list of output content. + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` - - `string` + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - Text, image, or file output of the function call. + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - - `type BetaResponseInputText struct{…}` + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - A text input to the model. + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - - `Text string` + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - The text input to the model. + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - - `Type InputText` + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - The type of the input item. Always `input_text`. + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - - `const InputTextInputText InputText = "input_text"` + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - - `Mode Explicit` + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - The breakpoint mode. Always `explicit`. + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - - `type BetaResponseInputImage struct{…}` + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - - `Detail BetaResponseInputImageDetail` + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - - `Type InputImage` + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - The type of the input item. Always `input_image`. + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - - `const InputImageInputImage InputImage = "input_image"` + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - - `FileID string` + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - The ID of the file to be sent to the model. + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - - `ImageURL string` + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - - `Mode Explicit` + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - The breakpoint mode. Always `explicit`. + - `string` - - `const ExplicitExplicit Explicit = "explicit"` + - `Object Response` - - `type BetaResponseInputFile struct{…}` + The object type of this resource - always set to `response`. - A file input to the model. + - `const ResponseResponse Response = "response"` - - `Type InputFile` + - `Output []BetaResponseOutputItemUnion` - The type of the input item. Always `input_file`. + An array of content items generated by the model. - - `const InputFileInputFile InputFile = "input_file"` + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - - `Detail BetaResponseInputFileDetail` + - `type BetaResponseOutputMessage struct{…}` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + An output message from the model. - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `type BetaResponseFileSearchToolCall struct{…}` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `type BetaResponseFunctionToolCall struct{…}` - - `FileData string` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - The content of the file to be sent to the model. + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `FileID string` + - `ID string` - The ID of the file to be sent to the model. + The unique ID of the function call tool output. - - `FileURL string` + - `CallID string` - The URL of the file to be sent to the model. + The unique ID of the function tool call generated by the model. - - `Filename string` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - The name of the file to be sent to the model. + The output from the function call generated by your code. + Can be a string or an list of output content. - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - - `Mode Explicit` + Text, image, or file output of the function call. - The breakpoint mode. Always `explicit`. + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + A file input to the model. - `Status BetaResponseFunctionToolCallOutputItemStatus` @@ -109944,395 +122318,11 @@ func main() { The results of a web search tool call. See the [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `ID string` - - The unique ID of the web search tool call. - - - `Action BetaResponseFunctionWebSearchActionUnion` - - 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 BetaResponseFunctionWebSearchActionSearch 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 []BetaResponseFunctionWebSearchActionSearchSource` - - 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 BetaResponseFunctionWebSearchActionOpenPage 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 BetaResponseFunctionWebSearchActionFindInPage 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 BetaResponseFunctionWebSearchStatus` - - The status of the web search tool call. - - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - - - `Type WebSearchCall` - - The type of the web search tool call. Always `web_search_call`. - - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - - `Agent BetaResponseFunctionWebSearchAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - `type BetaResponseComputerToolCall struct{…}` A tool call to a computer use tool. See the [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) 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 []BetaResponseComputerToolCallPendingSafetyCheck` - - 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 BetaResponseComputerToolCallStatus` - - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - - `Type BetaResponseComputerToolCallType` - - The type of the computer call. Always `computer_call`. - - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - - `Action BetaComputerActionUnion` - - A click action. - - - `type BetaComputerActionClick struct{…}` - - A click action. - - - `Button string` - - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "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 BetaComputerActionDoubleClick 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 BetaComputerActionDrag struct{…}` - - A drag action. - - - `Path []BetaComputerActionDragPath` - - 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 BetaComputerActionKeypress 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 BetaComputerActionMove 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 BetaComputerActionScreenshot 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 BetaComputerActionScroll 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 BetaComputerActionType 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 BetaComputerActionWait 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 BetaComputerActionList` - - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. - - - `type BetaComputerActionClick struct{…}` - - A click action. - - - `type BetaComputerActionDoubleClick struct{…}` - - A double click action. - - - `type BetaComputerActionDrag struct{…}` - - A drag action. - - - `type BetaComputerActionKeypress struct{…}` - - A collection of keypresses the model would like to perform. - - - `type BetaComputerActionMove struct{…}` - - A mouse move action. - - - `type BetaComputerActionScreenshot struct{…}` - - A screenshot action. - - - `type BetaComputerActionScroll struct{…}` - - A scroll action. - - - `type BetaComputerActionType struct{…}` - - An action to type in text. - - - `type BetaComputerActionWait struct{…}` - - A wait action. - - - `Agent BetaResponseComputerToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - `type BetaResponseComputerToolCallOutputItem struct{…}` - `ID string` @@ -110347,21 +122337,6 @@ func main() { 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 BetaResponseComputerToolCallOutputItemStatus` The status of the message input. One of `in_progress`, `completed`, or @@ -110417,68 +122392,6 @@ func main() { for subsequent turns of a conversation if you are manually [managing context](https://platform.openai.com/docs/guides/conversation-state). - - `ID string` - - The unique identifier of the reasoning content. - - - `Summary []BetaResponseReasoningItemSummary` - - 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"` - - - `Agent BetaResponseReasoningItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Content []BetaResponseReasoningItemContent` - - 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 BetaResponseReasoningItemStatus` - - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `type BetaResponseOutputItemProgram struct{…}` - `ID string` @@ -110633,1127 +122546,1152 @@ func main() { Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Name string` + - `type BetaFileSearchTool struct{…}` - The name of the function to call. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Parameters map[string, any]` + - `type BetaComputerTool struct{…}` - A JSON schema object describing the parameters of the function. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Strict bool` + - `type BetaComputerUsePreviewTool struct{…}` - Whether strict parameter validation is enforced for this function tool. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Type Function` + - `type BetaWebSearchTool struct{…}` - The type of the function tool. Always `function`. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const FunctionFunction Function = "function"` + - `type BetaToolMcp struct{…}` - - `AllowedCallers []string` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The tool invocation context(s). + - `type BetaToolCodeInterpreter struct{…}` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + A tool that runs Python code to help generate a response to a prompt. - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `DeferLoading bool` + - `type BetaToolImageGeneration struct{…}` - Whether this function is deferred and loaded via tool search. + A tool that generates images using the GPT image models. - - `Description string` + - `type BetaToolLocalShell struct{…}` - A description of the function. Used by the model to determine whether or not to call the function. + A tool that allows the model to execute shell commands in a local environment. - - `OutputSchema map[string, any]` + - `type BetaFunctionShellTool struct{…}` - A JSON schema object describing the JSON value encoded in string outputs for this function. + A tool that allows the model to execute shell commands. - - `type BetaFileSearchTool struct{…}` + - `type BetaCustomTool struct{…}` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Type FileSearch` + - `type BetaNamespaceTool struct{…}` - The type of the file search tool. Always `file_search`. + Groups function/custom tools under a shared namespace. - - `const FileSearchFileSearch FileSearch = "file_search"` + - `type BetaToolSearchTool struct{…}` - - `VectorStoreIDs []string` + Hosted or BYOT tool search configuration for deferred tools. - The IDs of the vector stores to search. + - `type BetaWebSearchPreviewTool struct{…}` - - `Filters BetaFileSearchToolFiltersUnion` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - A filter to apply. + - `type BetaApplyPatchTool struct{…}` - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + Allows the assistant to create, delete, or update files using unified diffs. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `Type ToolSearchOutput` - - `Key string` + The type of the item. Always `tool_search_output`. - The key to compare against the value. + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `Type string` + - `Agent BetaResponseToolSearchOutputItemAgent` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The agent that produced this item. - - `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 + - `AgentName string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + The canonical name of the agent that produced this item. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `CreatedBy string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + The identifier of the actor that created the item. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `type BetaResponseOutputItemAdditionalTools struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + - `ID string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + The unique ID of the additional tools item. - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + - `Role string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + The role that provided the additional tools. - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - The value to compare against the attribute key; supports string, number, or boolean types. + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - - `string` + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - - `float64` + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - - `bool` + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - Combine multiple filters using `and` or `or`. + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + - `Tools []BetaToolUnion` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + The additional tool definitions made available at this item. - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `type BetaFunctionTool struct{…}` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `Key string` + - `type BetaFileSearchTool struct{…}` - The key to compare against the value. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Type string` + - `type BetaComputerTool struct{…}` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `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 + - `type BetaComputerUsePreviewTool struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + - `type BetaWebSearchTool struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + - `type BetaToolMcp struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + - `type BetaToolCodeInterpreter struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + A tool that runs Python code to help generate a response to a prompt. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + - `type BetaToolImageGeneration struct{…}` - The value to compare against the attribute key; supports string, number, or boolean types. + A tool that generates images using the GPT image models. - - `string` + - `type BetaToolLocalShell struct{…}` - - `float64` + A tool that allows the model to execute shell commands in a local environment. - - `bool` + - `type BetaFunctionShellTool struct{…}` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + A tool that allows the model to execute shell commands. - - `Type string` + - `type BetaCustomTool struct{…}` - Type of operation: `and` or `or`. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + - `type BetaNamespaceTool struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + Groups function/custom tools under a shared namespace. - - `MaxNumResults int64` + - `type BetaToolSearchTool struct{…}` - The maximum number of results to return. This number should be between 1 and 50 inclusive. + Hosted or BYOT tool search configuration for deferred tools. - - `RankingOptions BetaFileSearchToolRankingOptions` + - `type BetaWebSearchPreviewTool struct{…}` - Ranking options for search. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `type BetaApplyPatchTool struct{…}` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + Allows the assistant to create, delete, or update files using unified diffs. - - `EmbeddingWeight float64` + - `Type AdditionalTools` - The weight of the embedding in the reciprocal ranking fusion. + The type of the item. Always `additional_tools`. - - `TextWeight float64` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - The weight of the text in the reciprocal ranking fusion. + - `Agent BetaResponseOutputItemAdditionalToolsAgent` - - `Ranker string` + The agent that produced this item. - The ranker to use for the file search. + - `AgentName string` - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + The canonical name of the agent that produced this item. - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + - `type BetaResponseCompactionItem struct{…}` - - `ScoreThreshold float64` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - 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. + - `ID string` - - `type BetaComputerTool struct{…}` + The unique ID of the compaction item. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `EncryptedContent string` - - `Type Computer` + The encrypted content that was produced by compaction. - The type of the computer tool. Always `computer`. + - `Type Compaction` - - `const ComputerComputer Computer = "computer"` + The type of the item. Always `compaction`. - - `type BetaComputerUsePreviewTool struct{…}` + - `const CompactionCompaction Compaction = "compaction"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Agent BetaResponseCompactionItemAgent` - - `DisplayHeight int64` + The agent that produced this item. - The height of the computer display. + - `AgentName string` - - `DisplayWidth int64` + The canonical name of the agent that produced this item. - The width of the computer display. + - `CreatedBy string` - - `Environment BetaComputerUsePreviewToolEnvironment` + The identifier of the actor that created the item. - The type of computer environment to control. + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + An image generation request made by the model. - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `ID string` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + The unique ID of the image generation call. - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `Result string` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + The generated image encoded in base64. - - `Type ComputerUsePreview` + - `Status string` - The type of the computer use tool. Always `computer_use_preview`. + The status of the image generation call. - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - - `type BetaWebSearchTool struct{…}` + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - - `Type BetaWebSearchToolType` + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `Type ImageGenerationCall` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + The type of the image generation call. Always `image_generation_call`. - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Filters BetaWebSearchToolFilters` + - `Agent BetaResponseOutputItemImageGenerationCallAgent` - Filters for the search. + The agent that produced this item. - - `AllowedDomains []string` + - `AgentName string` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + The canonical name of the agent that produced this item. - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + A tool call to run code. - 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. + - `type BetaResponseOutputItemLocalShellCall struct{…}` - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + A tool call to run a command on the local shell. - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `ID string` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + The unique ID of the local shell call. - - `UserLocation BetaWebSearchToolUserLocation` + - `Action BetaResponseOutputItemLocalShellCallAction` - The approximate location of the user. + Execute a shell command on the server. - - `City string` + - `Command []string` - Free text input for the city of the user, e.g. `San Francisco`. + The command to run. - - `Country string` + - `Env map[string, string]` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + Environment variables to set for the command. - - `Region string` + - `Type Exec` - Free text input for the region of the user, e.g. `California`. + The type of the local shell action. Always `exec`. - - `Timezone string` + - `const ExecExec Exec = "exec"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `TimeoutMs int64` - - `Type string` + Optional timeout in milliseconds for the command. - The type of location approximation. Always `approximate`. + - `User string` - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + Optional user to run the command as. - - `type BetaToolMcp struct{…}` + - `WorkingDirectory string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + Optional working directory to run the command in. - - `ServerLabel string` + - `CallID string` - A label for this MCP server, used to identify it in tool calls. + The unique ID of the local shell tool call generated by the model. - - `Type Mcp` + - `Status string` - The type of the MCP tool. Always `mcp`. + The status of the local shell call. - - `const McpMcp Mcp = "mcp"` + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `AllowedCallers []string` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - The tool invocation context(s). + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + - `Type LocalShellCall` - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + The type of the local shell call. Always `local_shell_call`. - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - List of allowed tool names or a filter object. + - `Agent BetaResponseOutputItemLocalShellCallAgent` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + The agent that produced this item. - A string array of allowed tool names + - `AgentName string` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + The canonical name of the agent that produced this item. - A filter object to specify which tools are allowed. + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - `ReadOnly bool` + The output of a local shell tool call. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `ID string` - - `ToolNames []string` + The unique ID of the local shell tool call generated by the model. - List of allowed tool names. + - `Output string` - - `Authorization string` + A JSON string of the output of the local shell tool call. - 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. + - `Type LocalShellCallOutput` - - `ConnectorID string` + The type of the local shell tool call output. Always `local_shell_call_output`. - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - Currently supported `connector_id` values are: + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` - - 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` + The agent that produced this item. - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + - `AgentName string` - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + The canonical name of the agent that produced this item. - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `Status string` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + - `type BetaResponseFunctionShellToolCall struct{…}` - - `DeferLoading bool` + A tool call that executes one or more shell commands in a managed environment. - Whether this MCP tool is deferred and discovered via tool search. + - `ID string` - - `Headers map[string, string]` + The unique ID of the shell tool call. Populated when this item is returned via API. - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `Action BetaResponseFunctionShellToolCallAction` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + The shell commands and limits that describe how to run the tool call. - Specify which of the MCP server's tools require approval. + - `Commands []string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + - `MaxOutputLength int64` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + Optional maximum number of characters to return from each command. - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `TimeoutMs int64` - A filter object to specify which tools are allowed. + Optional timeout in milliseconds for the commands. - - `ReadOnly bool` + - `CallID string` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The unique ID of the shell tool call generated by the model. - - `ToolNames []string` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - List of allowed tool names. + Represents the use of a local environment to perform shell actions. - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `type BetaResponseLocalEnvironment struct{…}` - A filter object to specify which tools are allowed. + Represents the use of a local environment to perform shell actions. - - `ReadOnly bool` + - `Type Local` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The environment type. Always `local`. - - `ToolNames []string` + - `const LocalLocal Local = "local"` - List of allowed tool names. + - `type BetaResponseContainerReference struct{…}` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + Represents a container created with /v1/containers. - 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. + - `ContainerID string` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `Type ContainerReference` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + The environment type. Always `container_reference`. - - `ServerDescription string` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - Optional description of the MCP server, used to provide more context. + - `Status BetaResponseFunctionShellToolCallStatus` - - `ServerURL string` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - - `TunnelID string` + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - 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. + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `type BetaToolCodeInterpreter struct{…}` + - `Type ShellCall` - A tool that runs Python code to help generate a response to a prompt. + The type of the item. Always `shell_call`. - - `Container BetaToolCodeInterpreterContainerUnion` + - `const ShellCallShellCall ShellCall = "shell_call"` - 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. + - `Agent BetaResponseFunctionShellToolCallAgent` - - `string` + The agent that produced this item. - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + - `AgentName string` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + The canonical name of the agent that produced this item. - - `Type Auto` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - Always `auto`. + The execution context that produced this tool call. - - `const AutoAuto Auto = "auto"` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - - `FileIDs []string` + - `Type Direct` - An optional list of uploaded files to make available to your code. + - `const DirectDirect Direct = "direct"` - - `MemoryLimit string` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - The memory limit for the code interpreter container. + - `CallerID string` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + The call ID of the program item that produced this tool call. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `Type Program` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `const ProgramProgram Program = "program"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `CreatedBy string` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + The ID of the entity that created this tool call. - Network access policy for the container. + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + The output of a shell tool call that was emitted. - - `Type Disabled` + - `ID string` - Disable outbound network access. Always `disabled`. + The unique ID of the shell call output. Populated when this item is returned via API. - - `const DisabledDisabled Disabled = "disabled"` + - `CallID string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The unique ID of the shell tool call generated by the model. - - `AllowedDomains []string` + - `MaxOutputLength int64` - A list of allowed domains when type is `allowlist`. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `Type Allowlist` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - Allow outbound network access only to specified domains. Always `allowlist`. + An array of shell call output contents + + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + + Indicates that the shell call exceeded its configured time limit. + + - `Type Timeout` + + The outcome type. Always `timeout`. + + - `const TimeoutTimeout Timeout = "timeout"` + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit 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. - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - Optional domain-scoped secrets for allowlisted domains. + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `Domain string` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - The domain associated with the secret. + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - - `Name string` + - `Type ShellCallOutput` - The name of the secret to inject for the domain. + The type of the shell call output. Always `shell_call_output`. - - `Value string` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - The secret value to inject for the domain. + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - - `Type CodeInterpreter` + The agent that produced this item. - The type of the code interpreter tool. Always `code_interpreter`. + - `AgentName string` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + The canonical name of the agent that produced this item. - - `AllowedCallers []string` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - The tool invocation context(s). + The execution context that produced this tool call. - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + - `Type Direct` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const DirectDirect Direct = "direct"` - - `Type ProgrammaticToolCalling` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - The type of the tool. Always `programmatic_tool_calling`. + - `CallerID string` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + The call ID of the program item that produced this tool call. - - `type BetaToolImageGeneration struct{…}` + - `Type Program` - A tool that generates images using the GPT image models. + - `const ProgramProgram Program = "program"` - - `Type ImageGeneration` + - `CreatedBy string` - The type of the image generation tool. Always `image_generation`. + The identifier of the actor that created the item. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `type BetaResponseApplyPatchToolCall struct{…}` - - `Action string` + A tool call that applies file diffs by creating, deleting, or updating files. - Whether to generate a new image or edit an existing image. Default: `auto`. + - `ID string` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `CallID string` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + The unique ID of the apply patch tool call generated by the model. - - `Background string` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - 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. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - `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. + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + Instruction describing how to create a file via the apply_patch tool. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `Diff string` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + Diff to apply. - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `Path string` - - `InputFidelity string` + Path of the file to create. - 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`. + - `Type CreateFile` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + Create a new file with the provided diff. - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + - `const CreateFileCreateFile CreateFile = "create_file"` - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + Instruction describing how to delete a file via the apply_patch tool. - - `FileID string` + - `Path string` - File ID for the mask image. + Path of the file to delete. - - `ImageURL string` + - `Type DeleteFile` - Base64-encoded mask image. + Delete the specified file. - - `Model string` + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - The image generation model to use. Default: `gpt-image-1`. + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `string` + Instruction describing how to update a file via the apply_patch tool. - - `string` + - `Diff string` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + Diff to apply. - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `Path string` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + Path of the file to update. - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `Type UpdateFile` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + Update an existing file with the provided diff. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Moderation string` + - `Status BetaResponseApplyPatchToolCallStatus` - Moderation level for the generated image. Default: `auto`. + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - - `OutputCompression int64` + - `Type ApplyPatchCall` - Compression level for the output image. Default: 100. + The type of the item. Always `apply_patch_call`. - - `OutputFormat string` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `Agent BetaResponseApplyPatchToolCallAgent` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + The agent that produced this item. - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + - `AgentName string` - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + The canonical name of the agent that produced this item. - - `PartialImages int64` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + The execution context that produced this tool call. - - `Quality string` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `Type Direct` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `const DirectDirect Direct = "direct"` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `CallerID string` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The call ID of the program item that produced this tool call. - - `Size string` + - `Type Program` - 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`. + - `const ProgramProgram Program = "program"` - - `string` + - `CreatedBy string` - - `string` + The ID of the entity that created this tool call. - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + The output emitted by an apply patch tool call. - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `ID string` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `type BetaToolLocalShell struct{…}` + - `CallID string` - A tool that allows the model to execute shell commands in a local environment. + The unique ID of the apply patch tool call generated by the model. - - `Type LocalShell` + - `Status BetaResponseApplyPatchToolCallOutputStatus` - The type of the local shell tool. Always `local_shell`. + The status of the apply patch tool call output. One of `completed` or `failed`. - - `const LocalShellLocalShell LocalShell = "local_shell"` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `type BetaFunctionShellTool struct{…}` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - A tool that allows the model to execute shell commands. + - `Type ApplyPatchCallOutput` - - `Type Shell` + The type of the item. Always `apply_patch_call_output`. - The type of the shell tool. Always `shell`. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `const ShellShell Shell = "shell"` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - `AllowedCallers []string` + The agent that produced this item. - The tool invocation context(s). + - `AgentName string` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + The canonical name of the agent that produced this item. - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - `Environment BetaFunctionShellToolEnvironmentUnion` + The execution context that produced this tool call. - - `type BetaContainerAuto struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - `Type ContainerAuto` + - `Type Direct` - Automatically creates a container for this request + - `const DirectDirect Direct = "direct"` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - `FileIDs []string` + - `CallerID string` - An optional list of uploaded files to make available to your code. + The call ID of the program item that produced this tool call. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `Type Program` - The memory limit for the container. + - `const ProgramProgram Program = "program"` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `CreatedBy string` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The ID of the entity that created this tool call output. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `Output string` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + Optional textual output returned by the apply patch tool. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `type BetaResponseOutputItemMcpCall struct{…}` - Network access policy for the container. + An invocation of a tool on an MCP server. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `ID string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The unique ID of the tool call. - - `Skills []BetaContainerAutoSkillUnion` + - `Arguments string` - An optional list of skills referenced by id or inline data. + A JSON string of the arguments passed to the tool. - - `type BetaSkillReference struct{…}` + - `Name string` - - `SkillID string` + The name of the tool that was run. - The ID of the referenced skill. + - `ServerLabel string` - - `Type SkillReference` + The label of the MCP server running the tool. - References a skill created with the /v1/skills endpoint. + - `Type McpCall` - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + The type of the item. Always `mcp_call`. - - `Version string` + - `const McpCallMcpCall McpCall = "mcp_call"` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `Agent BetaResponseOutputItemMcpCallAgent` - - `type BetaInlineSkill struct{…}` + The agent that produced this item. - - `Description string` + - `AgentName string` - The description of the skill. + The canonical name of the agent that produced this item. - - `Name string` + - `ApprovalRequestID string` - The name of the skill. + 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. - - `Source BetaInlineSkillSource` + - `Error string` - Inline skill payload + The error from the tool call, if any. - - `Data string` + - `Output string` - Base64-encoded skill zip bundle. + The output from the tool call. - - `MediaType ApplicationZip` + - `Status string` - The media type of the inline skill payload. Must be `application/zip`. + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - `Type Base64` + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - The type of the inline skill source. Must be `base64`. + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `const Base64Base64 Base64 = "base64"` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - - `Type Inline` + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - Defines an inline skill for this request. + - `type BetaResponseOutputItemMcpListTools struct{…}` - - `const InlineInline Inline = "inline"` + A list of tools available on an MCP server. - - `type BetaLocalEnvironment struct{…}` + - `ID string` - - `Type Local` + The unique ID of the list. - Use a local computer environment. + - `ServerLabel string` - - `const LocalLocal Local = "local"` + The label of the MCP server. - - `Skills []BetaLocalSkill` + - `Tools []BetaResponseOutputItemMcpListToolsTool` - An optional list of skills. + The tools available on the server. - - `Description string` + - `InputSchema any` - The description of the skill. + The JSON schema describing the tool's input. - `Name string` - The name of the skill. - - - `Path string` + The name of the tool. - The path to the directory containing the skill. + - `Annotations any` - - `type BetaContainerReference struct{…}` + Additional annotations about the tool. - - `ContainerID string` + - `Description string` - The ID of the referenced container. + The description of the tool. - - `Type ContainerReference` + - `Type McpListTools` - References a container created with the /v1/containers endpoint + The type of the item. Always `mcp_list_tools`. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `type BetaCustomTool struct{…}` + - `Agent BetaResponseOutputItemMcpListToolsAgent` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the custom tool, used to identify it in tool calls. + The canonical name of the agent that produced this item. - - `Type Custom` + - `Error string` - The type of the custom tool. Always `custom`. + Error message if the server could not list tools. - - `const CustomCustom Custom = "custom"` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - `AllowedCallers []string` + A request for human approval of a tool invocation. - The tool invocation context(s). + - `ID string` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + The unique ID of the approval request. - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + - `Arguments string` - - `DeferLoading bool` + A JSON string of arguments for the tool. - Whether this tool should be deferred and discovered via tool search. + - `Name string` - - `Description string` + The name of the tool to run. - Optional description of the custom tool, used to provide more context. + - `ServerLabel string` - - `Format BetaCustomToolFormatUnion` + The label of the MCP server making the request. - The input format for the custom tool. Default is unconstrained text. + - `Type McpApprovalRequest` - - `type BetaCustomToolFormatText struct{…}` + The type of the item. Always `mcp_approval_request`. - Unconstrained free-form text. + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Type Text` + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` - Unconstrained text format. Always `text`. + The agent that produced this item. - - `const TextText Text = "text"` + - `AgentName string` - - `type BetaCustomToolFormatGrammar struct{…}` + The canonical name of the agent that produced this item. - A grammar defined by the user. + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - - `Definition string` + A response to an MCP approval request. - The grammar definition. + - `ID string` - - `Syntax string` + The unique ID of the approval response - The syntax of the grammar definition. One of `lark` or `regex`. + - `ApprovalRequestID string` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + The ID of the approval request being answered. - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `Approve bool` - - `Type Grammar` + Whether the request was approved. - Grammar format. Always `grammar`. + - `Type McpApprovalResponse` - - `const GrammarGrammar Grammar = "grammar"` + The type of the item. Always `mcp_approval_response`. - - `type BetaNamespaceTool struct{…}` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - Groups function/custom tools under a shared namespace. + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - - `Description string` + The agent that produced this item. - A description of the namespace shown to the model. + - `AgentName string` - - `Name string` + The canonical name of the agent that produced this item. - The namespace name used in tool calls (for example, `crm`). + - `Reason string` - - `Tools []BetaNamespaceToolToolUnion` + Optional reason for the decision. - The function/custom tools available inside this namespace. + - `type BetaResponseCustomToolCall struct{…}` - - `type BetaNamespaceToolToolFunction struct{…}` + A call to a custom tool created by the model. - - `Name string` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - - `Type Function` + The output of a custom tool call from your code, being sent back to the model. - - `const FunctionFunction Function = "function"` + - `ID string` - - `AllowedCallers []string` + The unique ID of the custom tool call output item. - The tool invocation context(s). + - `Status string` - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `DeferLoading bool` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - Whether this function should be deferred and discovered via tool search. + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `Description string` + - `CreatedBy string` - - `OutputSchema map[string, any]` + The identifier of the actor that created the item. - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `ParallelToolCalls bool` - - `Parameters any` + Whether to allow the model to run tool calls in parallel. - - `Strict bool` + - `Temperature float64` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - - `type BetaCustomTool struct{…}` + - `ToolChoice BetaResponseToolChoiceUnion` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - - `Type Namespace` + - `type BetaToolChoiceOptions string` - The type of the tool. Always `namespace`. + Controls which (if any) tool is called by the model. - - `const NamespaceNamespace Namespace = "namespace"` + `none` means the model will not call any tool and instead generates a message. - - `type BetaToolSearchTool struct{…}` + `auto` means the model can pick between generating a message or calling one or + more tools. - Hosted or BYOT tool search configuration for deferred tools. + `required` means the model must call one or more tools. - - `Type ToolSearch` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - The type of the tool. Always `tool_search`. + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - - `Description string` + - `type BetaToolChoiceAllowed struct{…}` - Description shown to the model for a client-executed tool search tool. + Constrains the tools available to the model to a pre-defined set. - - `Execution BetaToolSearchToolExecution` + - `Mode BetaToolChoiceAllowedMode` - Whether tool search is executed by the server or by the client. + Constrains the tools available to the model to a pre-defined set. - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + `auto` allows the model to pick from among the allowed tools and generate a + message. - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + `required` requires the model to call one or more of the allowed tools. - - `Parameters any` + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - Parameter schema for a client-executed tool search tool. + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - - `type BetaWebSearchPreviewTool struct{…}` + - `Tools []map[string, any]` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + A list of tool definitions that the model should be allowed to call. - - `Type BetaWebSearchPreviewToolType` + For the Responses API, the list of tool definitions might look like: - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `Type AllowedTools` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + Allowed tool configuration type. Always `allowed_tools`. - - `SearchContentTypes []string` + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `type BetaToolChoiceTypes struct{…}` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `Type BetaToolChoiceTypesType` - 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. + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + Allowed values are: - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - The user's location. + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `Type Approximate` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - The type of location approximation. Always `approximate`. + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - - `const ApproximateApproximate Approximate = "approximate"` + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - - `City string` + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - Free text input for the city of the user, e.g. `San Francisco`. + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - - `Country string` + - `type BetaToolChoiceFunction struct{…}` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + Use this option to force the model to call a specific function. - - `Region string` + - `Name string` - Free text input for the region of the user, e.g. `California`. + The name of the function to call. - - `Timezone string` + - `Type Function` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + For function calling, the type is always `function`. - - `type BetaApplyPatchTool struct{…}` + - `const FunctionFunction Function = "function"` - Allows the assistant to create, delete, or update files using unified diffs. + - `type BetaToolChoiceMcp struct{…}` - - `Type ApplyPatch` + Use this option to force the model to call a specific tool on a remote MCP server. - The type of the tool. Always `apply_patch`. + - `ServerLabel string` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + The label of the MCP server to use. - - `AllowedCallers []string` + - `Type Mcp` - The tool invocation context(s). + For MCP tools, the type is always `mcp`. - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `const McpMcp Mcp = "mcp"` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `Name string` - - `Type ToolSearchOutput` + The name of the tool to call on the server. - The type of the item. Always `tool_search_output`. + - `type BetaToolChoiceCustom struct{…}` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + Use this option to force the model to call a specific custom tool. - - `Agent BetaResponseToolSearchOutputItemAgent` + - `Name string` - The agent that produced this item. + The name of the custom tool to call. - - `AgentName string` + - `Type Custom` - The canonical name of the agent that produced this item. + For custom tool calling, the type is always `custom`. - - `CreatedBy string` + - `const CustomCustom Custom = "custom"` - The identifier of the actor that created the item. + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `Type ProgrammaticToolCalling` - - `ID string` + The tool to call. Always `programmatic_tool_calling`. - The unique ID of the additional tools item. + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `Role string` + - `type BetaToolChoiceApplyPatch struct{…}` - The role that provided the additional tools. + Forces the model to call the apply_patch tool when executing a tool call. - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + - `Type ApplyPatch` - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + The tool to call. Always `apply_patch`. - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `type BetaToolChoiceShell struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + Forces the model to call the shell tool when a tool call is required. - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + - `Type Shell` - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + The tool to call. Always `shell`. - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + - `const ShellShell Shell = "shell"` - `Tools []BetaToolUnion` - The additional tool definitions made available at this item. + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. - `type BetaFunctionTool struct{…}` @@ -111819,908 +123757,1077 @@ func main() { Allows the assistant to create, delete, or update files using unified diffs. - - `Type AdditionalTools` + - `TopP float64` - The type of the item. Always `additional_tools`. + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + We generally recommend altering this or `temperature` but not both. - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + - `Background bool` - The agent that produced this item. + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). - - `AgentName string` + - `CompletedAt float64` - The canonical name of the agent that produced this item. + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - - `type BetaResponseCompactionItem struct{…}` + - `Conversation BetaResponseConversation` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - `ID string` - The unique ID of the compaction item. + The unique ID of the conversation that this response was associated with. - - `EncryptedContent string` + - `MaxOutputTokens int64` - The encrypted content that was produced by compaction. + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - - `Type Compaction` + - `MaxToolCalls int64` - The type of the item. Always `compaction`. + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `const CompactionCompaction Compaction = "compaction"` + - `Moderation BetaResponseModeration` - - `Agent BetaResponseCompactionItemAgent` + Moderation results for the response input and output, if moderated completions were requested. - The agent that produced this item. + - `Input BetaResponseModerationInputUnion` - - `AgentName string` + Moderation for the response input. - The canonical name of the agent that produced this item. + - `type BetaResponseModerationInputModerationResult struct{…}` - - `CreatedBy string` + A moderation result produced for the response input or output. - The identifier of the actor that created the item. + - `Categories map[string, bool]` - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - An image generation request made by the model. + - `CategoryAppliedInputTypes map[string, []string]` - - `ID string` + Which modalities of input are reflected by the score for each category. - The unique ID of the image generation call. + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` - - `Result string` + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` - The generated image encoded in base64. + - `CategoryScores map[string, float64]` - - `Status string` + A dictionary of moderation categories to scores. - The status of the image generation call. + - `Flagged bool` - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + A boolean indicating whether the content was flagged by any category. - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + - `Model string` - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + The moderation model that produced this result. - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + - `Type ModerationResult` - - `Type ImageGenerationCall` + The object type, which was always `moderation_result` for successful moderation results. - The type of the image generation call. Always `image_generation_call`. + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `type BetaResponseModerationInputError struct{…}` - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + An error produced while attempting moderation for the response input or output. - The agent that produced this item. + - `Code string` - - `AgentName string` + The error code. - The canonical name of the agent that produced this item. + - `Message string` - - `type BetaResponseCodeInterpreterToolCall struct{…}` + The error message. - A tool call to run code. + - `Type Error` - - `ID string` + The object type, which was always `error` for moderation failures. - The unique ID of the code interpreter tool call. + - `const ErrorError Error = "error"` + + - `Output BetaResponseModerationOutputUnion` + + Moderation for the response output. + + - `type BetaResponseModerationOutputModerationResult struct{…}` + + A moderation result produced for the response input or output. + + - `Categories map[string, bool]` + + A dictionary of moderation categories to booleans, True if the input is flagged under this category. + + - `CategoryAppliedInputTypes map[string, []string]` + + Which modalities of input are reflected by the score for each category. + + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + + - `CategoryScores map[string, float64]` + + A dictionary of moderation categories to scores. + + - `Flagged bool` + + A boolean indicating whether the content was flagged by any category. + + - `Model string` + + The moderation model that produced this result. + + - `Type ModerationResult` + + The object type, which was always `moderation_result` for successful moderation results. + + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + + - `type BetaResponseModerationOutputError struct{…}` + + An error produced while attempting moderation for the response input or output. - `Code string` - The code to run, or null if not available. + The error code. - - `ContainerID string` + - `Message string` - The ID of the container used to run the code. + The error message. - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + - `Type Error` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + The object type, which was always `error` for moderation failures. - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `const ErrorError Error = "error"` - The logs output from the code interpreter. + - `PreviousResponseID string` - - `Logs string` + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - The logs output from the code interpreter. + - `Prompt BetaResponsePrompt` - - `Type Logs` + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - The type of the output. Always `logs`. + - `ID string` - - `const LogsLogs Logs = "logs"` + The unique identifier of the prompt template to use. - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + - `Variables map[string, BetaResponsePromptVariableUnion]` - The image output from the code interpreter. + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - - `Type Image` + - `string` - The type of the output. Always `image`. + - `type BetaResponseInputText struct{…}` - - `const ImageImage Image = "image"` + A text input to the model. - - `URL string` + - `type BetaResponseInputImage struct{…}` - The URL of the image output from the code interpreter. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Status BetaResponseCodeInterpreterToolCallStatus` + - `type BetaResponseInputFile struct{…}` - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + A file input to the model. - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + - `Version string` - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + Optional version of the prompt template. - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `PromptCacheKey string` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + - `PromptCacheOptions BetaResponsePromptCacheOptions` - - `Type CodeInterpreterCall` + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `Mode string` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + Whether implicit prompt-cache breakpoints were enabled. - - `Agent BetaResponseCodeInterpreterToolCallAgent` + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` - The agent that produced this item. + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` - - `AgentName string` + - `Ttl string` - The canonical name of the agent that produced this item. + The minimum lifetime applied to each cache breakpoint. - - `type BetaResponseOutputItemLocalShellCall struct{…}` + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` - A tool call to run a command on the local shell. + - `PromptCacheRetention BetaResponsePromptCacheRetention` - - `ID string` + Deprecated. Use `prompt_cache_options.ttl` instead. - The unique ID of the local shell call. + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - `Action BetaResponseOutputItemLocalShellCallAction` + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - Execute a shell command on the server. + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - `Command []string` + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` - The command to run. + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` - - `Env map[string, string]` + - `Reasoning BetaResponseReasoning` - Environment variables to set for the command. + **gpt-5 and o-series models only** - - `Type Exec` + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - The type of the local shell action. Always `exec`. + - `Context string` - - `const ExecExec Exec = "exec"` + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - - `TimeoutMs int64` + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` - Optional timeout in milliseconds for the command. + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` - - `User string` + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` - Optional user to run the command as. + - `Effort string` - - `WorkingDirectory string` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - Optional working directory to run the command in. + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` - - `CallID string` + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` - The unique ID of the local shell tool call generated by the model. + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` - - `Status string` + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` - The status of the local shell call. + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `GenerateSummary string` - - `Type LocalShellCall` + **Deprecated:** use `summary` instead. - The type of the local shell call. Always `local_shell_call`. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` - The agent that produced this item. + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` - - `AgentName string` + - `Mode string` - The canonical name of the agent that produced this item. + Controls the reasoning execution mode for the request. - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + When returned on a response, this is the effective execution mode. - The output of a local shell tool call. + - `string` - - `ID string` + - `string` - The unique ID of the local shell tool call generated by the model. + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` - - `Output string` + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` - A JSON string of the output of the local shell tool call. + - `Summary string` - - `Type LocalShellCallOutput` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - The type of the local shell tool call output. Always `local_shell_call_output`. + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` - The agent that produced this item. + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` - - `AgentName string` + - `SafetyIdentifier string` - The canonical name of the agent that produced this item. + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `Status string` + - `ServiceTier BetaResponseServiceTier` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + Specifies the processing type used for serving the request. - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` - - `type BetaResponseFunctionShellToolCall struct{…}` + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` - A tool call that executes one or more shell commands in a managed environment. + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + + - `Status BetaResponseStatus` + + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + + - `Text BetaResponseTextConfig` + + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: + + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + + - `Format BetaResponseFormatTextConfigUnion` + + An object specifying the format that the model must output. + + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + The default format is `{ "type": "text" }` with no additional options. + + **Not recommended for gpt-4o and newer models:** + + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. + + - `type BetaResponseFormatTextConfigText struct{…}` + + Default response format. Used to generate text responses. + + - `Type Text` + + The type of response format being defined. Always `text`. - - `ID string` + - `const TextText Text = "text"` - The unique ID of the shell tool call. Populated when this item is returned via API. + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - - `Action BetaResponseFunctionShellToolCallAction` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The shell commands and limits that describe how to run the tool call. + - `Name string` - - `Commands []string` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `MaxOutputLength int64` + - `Schema map[string, any]` - Optional maximum number of characters to return from each command. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `TimeoutMs int64` + - `Type JSONSchema` - Optional timeout in milliseconds for the commands. + The type of response format being defined. Always `json_schema`. - - `CallID string` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - The unique ID of the shell tool call generated by the model. + - `Description string` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + A description of what the response format is for, used by the model to + determine how to respond in the format. - Represents the use of a local environment to perform shell actions. + - `Strict bool` - - `type BetaResponseLocalEnvironment struct{…}` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - Represents the use of a local environment to perform shell actions. + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - - `Type Local` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - The environment type. Always `local`. + - `Type JSONObject` - - `const LocalLocal Local = "local"` + The type of response format being defined. Always `json_object`. - - `type BetaResponseContainerReference struct{…}` + - `const JSONObjectJSONObject JSONObject = "json_object"` - Represents a container created with /v1/containers. + - `Verbosity BetaResponseTextConfigVerbosity` - - `ContainerID string` + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - - `Type ContainerReference` + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - The environment type. Always `container_reference`. + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - - `Status BetaResponseFunctionShellToolCallStatus` + - `TopLogprobs int64` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + - `Truncation BetaResponseTruncation` - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + The truncation strategy to use for the model response. - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `Type ShellCall` + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` - The type of the item. Always `shell_call`. + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` - - `const ShellCallShellCall ShellCall = "shell_call"` + - `Usage BetaResponseUsage` - - `Agent BetaResponseFunctionShellToolCallAgent` + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - The agent that produced this item. + - `InputTokens int64` - - `AgentName string` + The number of input tokens. - The canonical name of the agent that produced this item. + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + A detailed breakdown of the input tokens. - The execution context that produced this tool call. + - `CacheWriteTokens int64` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + The number of input tokens that were written to the cache. - - `Type Direct` + - `CachedTokens int64` - - `const DirectDirect Direct = "direct"` + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `OutputTokens int64` - - `CallerID string` + The number of output tokens. - The call ID of the program item that produced this tool call. + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - - `Type Program` + A detailed breakdown of the output tokens. - - `const ProgramProgram Program = "program"` + - `ReasoningTokens int64` - - `CreatedBy string` + The number of reasoning tokens. - The ID of the entity that created this tool call. + - `TotalTokens int64` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + The total number of tokens used. - The output of a shell tool call that was emitted. + - `User string` - - `ID string` + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - The unique ID of the shell call output. Populated when this item is returned via API. + - `SequenceNumber int64` - - `CallID string` + The sequence number for this event. - The unique ID of the shell tool call generated by the model. + - `Type ResponseCompleted` - - `MaxOutputLength int64` + The type of the event. Always `response.completed`. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + - `Agent BetaResponseCompletedEventAgent` - An array of shell call output contents + The agent that owns this multi-agent streaming event. - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + - `AgentName string` - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + The canonical name of the agent that produced this item. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + - `type BetaResponseContentPartAddedEvent struct{…}` - Indicates that the shell call exceeded its configured time limit. + Emitted when a new content part is added. - - `Type Timeout` + - `ContentIndex int64` - The outcome type. Always `timeout`. + The index of the content part that was added. - - `const TimeoutTimeout Timeout = "timeout"` + - `ItemID string` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + The ID of the output item that the content part was added to. - Indicates that the shell commands finished and returned an exit code. + - `OutputIndex int64` - - `ExitCode int64` + The index of the output item that the content part was added to. - Exit code from the shell process. + - `Part BetaResponseContentPartAddedEventPartUnion` - - `Type Exit` + The content part that was added. - The outcome type. Always `exit`. + - `type BetaResponseOutputText struct{…}` - - `const ExitExit Exit = "exit"` + A text output from the model. - - `Stderr string` + - `type BetaResponseOutputRefusal struct{…}` - The standard error output that was captured. + A refusal from the model. - - `Stdout string` + - `type BetaResponseContentPartAddedEventPartReasoningText struct{…}` - The standard output that was captured. + Reasoning text from the model. - - `CreatedBy string` + - `Text string` - The identifier of the actor that created the item. + The reasoning text from the model. - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `Type ReasoningText` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + The type of the reasoning text. Always `reasoning_text`. - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `SequenceNumber int64` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + The sequence number of this event. - - `Type ShellCallOutput` + - `Type ResponseContentPartAdded` - The type of the shell call output. Always `shell_call_output`. + The type of the event. Always `response.content_part.added`. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `Agent BetaResponseContentPartAddedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `type BetaResponseContentPartDoneEvent struct{…}` - The execution context that produced this tool call. + Emitted when a content part is done. - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `ContentIndex int64` - - `Type Direct` + The index of the content part that is done. - - `const DirectDirect Direct = "direct"` + - `ItemID string` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + The ID of the output item that the content part was added to. - - `CallerID string` + - `OutputIndex int64` - The call ID of the program item that produced this tool call. + The index of the output item that the content part was added to. - - `Type Program` + - `Part BetaResponseContentPartDoneEventPartUnion` - - `const ProgramProgram Program = "program"` + The content part that is done. - - `CreatedBy string` + - `type BetaResponseOutputText struct{…}` - The identifier of the actor that created the item. + A text output from the model. - - `type BetaResponseApplyPatchToolCall struct{…}` + - `type BetaResponseOutputRefusal struct{…}` - A tool call that applies file diffs by creating, deleting, or updating files. + A refusal from the model. - - `ID string` + - `type BetaResponseContentPartDoneEventPartReasoningText struct{…}` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + Reasoning text from the model. - - `CallID string` + - `Text string` - The unique ID of the apply patch tool call generated by the model. + The reasoning text from the model. - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `Type ReasoningText` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + The type of the reasoning text. Always `reasoning_text`. - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - Instruction describing how to create a file via the apply_patch tool. + - `SequenceNumber int64` - - `Diff string` + The sequence number of this event. - Diff to apply. + - `Type ResponseContentPartDone` - - `Path string` + The type of the event. Always `response.content_part.done`. - Path of the file to create. + - `const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"` - - `Type CreateFile` + - `Agent BetaResponseContentPartDoneEventAgent` - Create a new file with the provided diff. + The agent that owns this multi-agent streaming event. - - `const CreateFileCreateFile CreateFile = "create_file"` + - `AgentName string` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + The canonical name of the agent that produced this item. - Instruction describing how to delete a file via the apply_patch tool. + - `type BetaResponseCreatedEvent struct{…}` - - `Path string` + An event that is emitted when a response is created. - Path of the file to delete. + - `Response BetaResponse` - - `Type DeleteFile` + The response that was created. - Delete the specified file. + - `SequenceNumber int64` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + The sequence number for this event. - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `Type ResponseCreated` - Instruction describing how to update a file via the apply_patch tool. + The type of the event. Always `response.created`. - - `Diff string` + - `const ResponseCreatedResponseCreated ResponseCreated = "response.created"` - Diff to apply. + - `Agent BetaResponseCreatedEventAgent` - - `Path string` + The agent that owns this multi-agent streaming event. - Path of the file to update. + - `AgentName string` - - `Type UpdateFile` + The canonical name of the agent that produced this item. - Update an existing file with the provided diff. + - `type BetaResponseErrorEvent struct{…}` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + Emitted when an error occurs. - - `Status BetaResponseApplyPatchToolCallStatus` + - `Code string` - The status of the apply patch tool call. One of `in_progress` or `completed`. + The error code. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `Message string` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + The error message. - - `Type ApplyPatchCall` + - `Param string` - The type of the item. Always `apply_patch_call`. + The error parameter. - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `SequenceNumber int64` - - `Agent BetaResponseApplyPatchToolCallAgent` + The sequence number of this event. - The agent that produced this item. + - `Type Error` + + The type of the event. Always `error`. + + - `const ErrorError Error = "error"` + + - `Agent BetaResponseErrorEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `type BetaResponseFileSearchCallCompletedEvent struct{…}` - The execution context that produced this tool call. + Emitted when a file search call is completed (results found). - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `ItemID string` - - `Type Direct` + The ID of the output item that the file search call is initiated. - - `const DirectDirect Direct = "direct"` + - `OutputIndex int64` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + The index of the output item that the file search call is initiated. - - `CallerID string` + - `SequenceNumber int64` - The call ID of the program item that produced this tool call. + The sequence number of this event. - - `Type Program` + - `Type ResponseFileSearchCallCompleted` - - `const ProgramProgram Program = "program"` + The type of the event. Always `response.file_search_call.completed`. - - `CreatedBy string` + - `const ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"` - The ID of the entity that created this tool call. + - `Agent BetaResponseFileSearchCallCompletedEventAgent` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + The agent that owns this multi-agent streaming event. - The output emitted by an apply patch tool call. + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `type BetaResponseFileSearchCallInProgressEvent struct{…}` - - `CallID string` + Emitted when a file search call is initiated. - The unique ID of the apply patch tool call generated by the model. + - `ItemID string` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + The ID of the output item that the file search call is initiated. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `OutputIndex int64` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + The index of the output item that the file search call is initiated. - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `SequenceNumber int64` - - `Type ApplyPatchCallOutput` + The sequence number of this event. - The type of the item. Always `apply_patch_call_output`. + - `Type ResponseFileSearchCallInProgress` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + The type of the event. Always `response.file_search_call.in_progress`. - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"` - The agent that produced this item. + - `Agent BetaResponseFileSearchCallInProgressEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `type BetaResponseFileSearchCallSearchingEvent struct{…}` - The execution context that produced this tool call. + Emitted when a file search is currently searching. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `ItemID string` - - `Type Direct` + The ID of the output item that the file search call is initiated. - - `const DirectDirect Direct = "direct"` + - `OutputIndex int64` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + The index of the output item that the file search call is searching. - - `CallerID string` + - `SequenceNumber int64` - The call ID of the program item that produced this tool call. + The sequence number of this event. - - `Type Program` + - `Type ResponseFileSearchCallSearching` - - `const ProgramProgram Program = "program"` + The type of the event. Always `response.file_search_call.searching`. - - `CreatedBy string` + - `const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"` - The ID of the entity that created this tool call output. + - `Agent BetaResponseFileSearchCallSearchingEventAgent` - - `Output string` + The agent that owns this multi-agent streaming event. - Optional textual output returned by the apply patch tool. + - `AgentName string` - - `type BetaResponseOutputItemMcpCall struct{…}` + The canonical name of the agent that produced this item. - An invocation of a tool on an MCP server. + - `type BetaResponseFunctionCallArgumentsDeltaEvent struct{…}` - - `ID string` + Emitted when there is a partial function-call arguments delta. - The unique ID of the tool call. + - `Delta string` - - `Arguments string` + The function-call arguments delta that is added. - A JSON string of the arguments passed to the tool. + - `ItemID string` - - `Name string` + The ID of the output item that the function-call arguments delta is added to. - The name of the tool that was run. + - `OutputIndex int64` - - `ServerLabel string` + The index of the output item that the function-call arguments delta is added to. - The label of the MCP server running the tool. + - `SequenceNumber int64` - - `Type McpCall` + The sequence number of this event. - The type of the item. Always `mcp_call`. + - `Type ResponseFunctionCallArgumentsDelta` - - `const McpCallMcpCall McpCall = "mcp_call"` + The type of the event. Always `response.function_call_arguments.delta`. - - `Agent BetaResponseOutputItemMcpCallAgent` + - `const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"` - The agent that produced this item. + - `Agent BetaResponseFunctionCallArgumentsDeltaEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `ApprovalRequestID string` + - `type BetaResponseFunctionCallArgumentsDoneEvent struct{…}` - 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. + Emitted when function-call arguments are finalized. - - `Error string` + - `Arguments string` - The error from the tool call, if any. + The function-call arguments. - - `Output string` + - `ItemID string` - The output from the tool call. + The ID of the item. - - `Status string` + - `Name string` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + The name of the function that was called. - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + - `OutputIndex int64` - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + The index of the output item. - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + - `SequenceNumber int64` - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + The sequence number of this event. - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + - `Type ResponseFunctionCallArgumentsDone` - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `const ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"` - A list of tools available on an MCP server. + - `Agent BetaResponseFunctionCallArgumentsDoneEventAgent` - - `ID string` + The agent that owns this multi-agent streaming event. - The unique ID of the list. + - `AgentName string` - - `ServerLabel string` + The canonical name of the agent that produced this item. - The label of the MCP server. + - `type BetaResponseInProgressEvent struct{…}` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + Emitted when the response is in progress. - The tools available on the server. + - `Response BetaResponse` - - `InputSchema any` + The response that is in progress. - The JSON schema describing the tool's input. + - `SequenceNumber int64` - - `Name string` + The sequence number of this event. - The name of the tool. + - `Type ResponseInProgress` - - `Annotations any` + The type of the event. Always `response.in_progress`. - Additional annotations about the tool. + - `const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"` - - `Description string` + - `Agent BetaResponseInProgressEventAgent` - The description of the tool. + The agent that owns this multi-agent streaming event. - - `Type McpListTools` + - `AgentName string` - The type of the item. Always `mcp_list_tools`. + The canonical name of the agent that produced this item. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `type BetaResponseFailedEvent struct{…}` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + An event that is emitted when a response fails. - The agent that produced this item. + - `Response BetaResponse` - - `AgentName string` + The response that failed. - The canonical name of the agent that produced this item. + - `SequenceNumber int64` - - `Error string` + The sequence number of this event. - Error message if the server could not list tools. + - `Type ResponseFailed` - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + The type of the event. Always `response.failed`. - A request for human approval of a tool invocation. + - `const ResponseFailedResponseFailed ResponseFailed = "response.failed"` - - `ID string` + - `Agent BetaResponseFailedEventAgent` - The unique ID of the approval request. + The agent that owns this multi-agent streaming event. - - `Arguments string` + - `AgentName string` - A JSON string of arguments for the tool. + The canonical name of the agent that produced this item. - - `Name string` + - `type BetaResponseIncompleteEvent struct{…}` - The name of the tool to run. + An event that is emitted when a response finishes as incomplete. - - `ServerLabel string` + - `Response BetaResponse` - The label of the MCP server making the request. + The response that was incomplete. - - `Type McpApprovalRequest` + - `SequenceNumber int64` - The type of the item. Always `mcp_approval_request`. + The sequence number of this event. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `Type ResponseIncomplete` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + The type of the event. Always `response.incomplete`. - The agent that produced this item. + - `const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"` + + - `Agent BetaResponseIncompleteEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - - A response to an MCP approval request. + - `type BetaResponseOutputItemAddedEvent struct{…}` - - `ID string` + Emitted when a new output item is added. - The unique ID of the approval response + - `Item BetaResponseOutputItemUnion` - - `ApprovalRequestID string` + The output item that was added. - The ID of the approval request being answered. + - `type BetaResponseOutputMessage struct{…}` - - `Approve bool` + An output message from the model. - Whether the request was approved. + - `type BetaResponseFileSearchToolCall struct{…}` - - `Type McpApprovalResponse` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - The type of the item. Always `mcp_approval_response`. + - `type BetaResponseFunctionToolCall struct{…}` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - The agent that produced this item. + - `type BetaResponseOutputItemAgentMessage struct{…}` - - `AgentName string` + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - The canonical name of the agent that produced this item. + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - - `Reason string` + - `type BetaResponseFunctionWebSearch struct{…}` - Optional reason for the decision. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `type BetaResponseCustomToolCall struct{…}` + - `type BetaResponseComputerToolCall struct{…}` - A call to a custom tool created by the model. + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `CallID string` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - An identifier used to map this custom tool call to a tool call output. + - `type BetaResponseReasoningItem struct{…}` - - `Input string` + 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](https://platform.openai.com/docs/guides/conversation-state). - The input for the custom tool call generated by the model. + - `type BetaResponseOutputItemProgram struct{…}` - - `Name string` + - `type BetaResponseOutputItemProgramOutput struct{…}` - The name of the custom tool being called. + - `type BetaResponseToolSearchCall struct{…}` - - `Type CustomToolCall` + - `type BetaResponseToolSearchOutputItem struct{…}` - The type of the custom tool call. Always `custom_tool_call`. + - `type BetaResponseOutputItemAdditionalTools struct{…}` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `type BetaResponseCompactionItem struct{…}` - - `ID string` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - The unique ID of the custom tool call in the OpenAI platform. + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - - `Agent BetaResponseCustomToolCallAgent` + An image generation request made by the model. - The agent that produced this item. + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `AgentName string` + A tool call to run code. - The canonical name of the agent that produced this item. + - `type BetaResponseOutputItemLocalShellCall struct{…}` - - `Caller BetaResponseCustomToolCallCallerUnion` + A tool call to run a command on the local shell. - The execution context that produced this tool call. + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + The output of a local shell tool call. - - `Type Direct` + - `type BetaResponseFunctionShellToolCall struct{…}` - - `const DirectDirect Direct = "direct"` + A tool call that executes one or more shell commands in a managed environment. - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - - `CallerID string` + The output of a shell tool call that was emitted. - The call ID of the program item that produced this tool call. + - `type BetaResponseApplyPatchToolCall struct{…}` - - `Type Program` + A tool call that applies file diffs by creating, deleting, or updating files. - - `const ProgramProgram Program = "program"` + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `Namespace string` + The output emitted by an apply patch tool call. - The namespace of the custom tool being called. + - `type BetaResponseOutputItemMcpCall struct{…}` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + An invocation of a tool on an MCP server. - The output of a custom tool call from your code, being sent back to the model. + - `type BetaResponseOutputItemMcpListTools struct{…}` - - `ID string` + A list of tools available on an MCP server. - The unique ID of the custom tool call output item. + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - `Status string` + A request for human approval of a tool invocation. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + A response to an MCP approval request. - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + - `type BetaResponseCustomToolCall struct{…}` - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + A call to a custom tool created by the model. - - `CreatedBy string` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - The identifier of the actor that created the item. + The output of a custom tool call from your code, being sent back to the model. - `OutputIndex int64` @@ -112744,9 +124851,7 @@ func main() { The canonical name of the agent that produced this item. -### Beta Response Output Item Done Event - -- `type BetaResponseOutputItemDoneEvent struct{…}` + - `type BetaResponseOutputItemDoneEvent struct{…}` Emitted when an output item is marked done. @@ -112754,1386 +124859,1311 @@ func main() { The output item that was marked done. - - `type BetaResponseOutputMessage struct{…}` - - An output message from the model. - - - `ID string` - - The unique ID of the output message. - - - `Content []BetaResponseOutputMessageContentUnion` - - The content of the output message. - - - `type BetaResponseOutputText struct{…}` - - A text output from the model. - - - `Annotations []BetaResponseOutputTextAnnotationUnion` - - The annotations of the text output. - - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - A citation to a file. - - - `FileID string` + - `OutputIndex int64` - The ID of the file. + The index of the output item that was marked done. - - `Filename string` + - `SequenceNumber int64` - The filename of the file cited. + The sequence number of this event. - - `Index int64` + - `Type ResponseOutputItemDone` - The index of the file in the list of files. + The type of the event. Always `response.output_item.done`. - - `Type FileCitation` + - `const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"` - The type of the file citation. Always `file_citation`. + - `Agent BetaResponseOutputItemDoneEventAgent` - - `const FileCitationFileCitation FileCitation = "file_citation"` + The agent that owns this multi-agent streaming event. - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `AgentName string` - A citation for a web resource used to generate a model response. + The canonical name of the agent that produced this item. - - `EndIndex int64` + - `type BetaResponseReasoningSummaryPartAddedEvent struct{…}` - The index of the last character of the URL citation in the message. + Emitted when a new reasoning summary part is added. - - `StartIndex int64` + - `ItemID string` - The index of the first character of the URL citation in the message. + The ID of the item this summary part is associated with. - - `Title string` + - `OutputIndex int64` - The title of the web resource. + The index of the output item this summary part is associated with. - - `Type URLCitation` + - `Part BetaResponseReasoningSummaryPartAddedEventPart` - The type of the URL citation. Always `url_citation`. + The summary part that was added. - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Text string` - - `URL string` + The text of the summary part. - The URL of the web resource. + - `Type SummaryText` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + The type of the summary part. Always `summary_text`. - A citation for a container file used to generate a model response. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `ContainerID string` + - `SequenceNumber int64` - The ID of the container file. + The sequence number of this event. - - `EndIndex int64` + - `SummaryIndex int64` - The index of the last character of the container file citation in the message. + The index of the summary part within the reasoning summary. - - `FileID string` + - `Type ResponseReasoningSummaryPartAdded` - The ID of the file. + The type of the event. Always `response.reasoning_summary_part.added`. - - `Filename string` + - `const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"` - The filename of the container file cited. + - `Agent BetaResponseReasoningSummaryPartAddedEventAgent` - - `StartIndex int64` + The agent that owns this multi-agent streaming event. - The index of the first character of the container file citation in the message. + - `AgentName string` - - `Type ContainerFileCitation` + The canonical name of the agent that produced this item. - The type of the container file citation. Always `container_file_citation`. + - `type BetaResponseReasoningSummaryPartDoneEvent struct{…}` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + Emitted when a reasoning summary part is completed. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `ItemID string` - A path to a file. + The ID of the item this summary part is associated with. - - `FileID string` + - `OutputIndex int64` - The ID of the file. + The index of the output item this summary part is associated with. - - `Index int64` + - `Part BetaResponseReasoningSummaryPartDoneEventPart` - The index of the file in the list of files. + The completed summary part. - - `Type FilePath` + - `Text string` - The type of the file path. Always `file_path`. + The text of the summary part. - - `const FilePathFilePath FilePath = "file_path"` + - `Type SummaryText` - - `Text string` + The type of the summary part. Always `summary_text`. - The text output from the model. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `Type OutputText` + - `SequenceNumber int64` - The type of the output text. Always `output_text`. + The sequence number of this event. - - `const OutputTextOutputText OutputText = "output_text"` + - `SummaryIndex int64` - - `Logprobs []BetaResponseOutputTextLogprob` + The index of the summary part within the reasoning summary. - - `Token string` + - `Type ResponseReasoningSummaryPartDone` - - `Bytes []int64` + The type of the event. Always `response.reasoning_summary_part.done`. - - `Logprob float64` + - `const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `Agent BetaResponseReasoningSummaryPartDoneEventAgent` - - `Token string` + The agent that owns this multi-agent streaming event. - - `Bytes []int64` + - `AgentName string` - - `Logprob float64` + The canonical name of the agent that produced this item. - - `type BetaResponseOutputRefusal struct{…}` + - `Status BetaResponseReasoningSummaryPartDoneEventStatus` - A refusal from the model. + The completion status of the summary part. Omitted when the part completed + normally and set to `incomplete` when generation was interrupted. - - `Refusal string` + - `const BetaResponseReasoningSummaryPartDoneEventStatusIncomplete BetaResponseReasoningSummaryPartDoneEventStatus = "incomplete"` - The refusal explanation from the model. + - `type BetaResponseReasoningSummaryTextDeltaEvent struct{…}` - - `Type Refusal` + Emitted when a delta is added to a reasoning summary text. - The type of the refusal. Always `refusal`. + - `Delta string` - - `const RefusalRefusal Refusal = "refusal"` + The text delta that was added to the summary. - - `Role Assistant` + - `ItemID string` - The role of the output message. Always `assistant`. + The ID of the item this summary text delta is associated with. - - `const AssistantAssistant Assistant = "assistant"` + - `OutputIndex int64` - - `Status BetaResponseOutputMessageStatus` + The index of the output item this summary text delta is associated with. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `SequenceNumber int64` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + The sequence number of this event. - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `SummaryIndex int64` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + The index of the summary part within the reasoning summary. - - `Type Message` + - `Type ResponseReasoningSummaryTextDelta` - The type of the output message. Always `message`. + The type of the event. Always `response.reasoning_summary_text.delta`. - - `const MessageMessage Message = "message"` + - `const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"` - - `Agent BetaResponseOutputMessageAgent` + - `Agent BetaResponseReasoningSummaryTextDeltaEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Phase BetaResponseOutputMessagePhase` - - 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 BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - - `type BetaResponseFileSearchToolCall struct{…}` - - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `type BetaResponseReasoningSummaryTextDoneEvent struct{…}` - - `ID string` + Emitted when a reasoning summary text is completed. - The unique ID of the file search tool call. + - `ItemID string` - - `Queries []string` + The ID of the item this summary text is associated with. - The queries used to search for files. + - `OutputIndex int64` - - `Status BetaResponseFileSearchToolCallStatus` + The index of the output item this summary text is associated with. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `SequenceNumber int64` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + The sequence number of this event. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `SummaryIndex int64` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + The index of the summary part within the reasoning summary. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `Text string` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + The full text of the completed reasoning summary. - - `Type FileSearchCall` + - `Type ResponseReasoningSummaryTextDone` - The type of the file search tool call. Always `file_search_call`. + The type of the event. Always `response.reasoning_summary_text.done`. - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"` - - `Agent BetaResponseFileSearchToolCallAgent` + - `Agent BetaResponseReasoningSummaryTextDoneEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Results []BetaResponseFileSearchToolCallResult` - - The results of the file search tool call. - - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - - 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` + - `type BetaResponseReasoningTextDeltaEvent struct{…}` - The text that was retrieved from the file. + Emitted when a delta is added to a reasoning text. - - `type BetaResponseFunctionToolCall struct{…}` + - `ContentIndex int64` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + The index of the reasoning content part this delta is associated with. - - `Arguments string` + - `Delta string` - A JSON string of the arguments to pass to the function. + The text delta that was added to the reasoning content. - - `CallID string` + - `ItemID string` - The unique ID of the function tool call generated by the model. + The ID of the item this reasoning text delta is associated with. - - `Name string` + - `OutputIndex int64` - The name of the function to run. + The index of the output item this reasoning text delta is associated with. - - `Type FunctionCall` + - `SequenceNumber int64` - The type of the function tool call. Always `function_call`. + The sequence number of this event. - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + - `Type ResponseReasoningTextDelta` - - `ID string` + The type of the event. Always `response.reasoning_text.delta`. - The unique ID of the function tool call. + - `const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"` - - `Agent BetaResponseFunctionToolCallAgent` + - `Agent BetaResponseReasoningTextDeltaEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionToolCallCallerUnion` - - The execution context that produced this tool call. + - `type BetaResponseReasoningTextDoneEvent struct{…}` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + Emitted when a reasoning text is completed. - - `Type Direct` + - `ContentIndex int64` - - `const DirectDirect Direct = "direct"` + The index of the reasoning content part. - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `ItemID string` - - `CallerID string` + The ID of the item this reasoning text is associated with. - The call ID of the program item that produced this tool call. + - `OutputIndex int64` - - `Type Program` + The index of the output item this reasoning text is associated with. - - `const ProgramProgram Program = "program"` + - `SequenceNumber int64` - - `Namespace string` + The sequence number of this event. - The namespace of the function to run. + - `Text string` - - `Status BetaResponseFunctionToolCallStatus` + The full text of the completed reasoning content. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Type ResponseReasoningTextDone` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + The type of the event. Always `response.reasoning_text.done`. - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `Agent BetaResponseReasoningTextDoneEventAgent` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + The agent that owns this multi-agent streaming event. - - `ID string` + - `AgentName string` - The unique ID of the function call tool output. + The canonical name of the agent that produced this item. - - `CallID string` + - `type BetaResponseRefusalDeltaEvent struct{…}` - The unique ID of the function tool call generated by the model. + Emitted when there is a partial refusal text. - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `ContentIndex int64` - The output from the function call generated by your code. - Can be a string or an list of output content. + The index of the content part that the refusal text is added to. - - `string` + - `Delta string` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + The refusal text that is added. - Text, image, or file output of the function call. + - `ItemID string` - - `type BetaResponseInputText struct{…}` + The ID of the output item that the refusal text is added to. - A text input to the model. + - `OutputIndex int64` - - `Text string` + The index of the output item that the refusal text is added to. - The text input to the model. + - `SequenceNumber int64` - - `Type InputText` + The sequence number of this event. - The type of the input item. Always `input_text`. + - `Type ResponseRefusalDelta` - - `const InputTextInputText InputText = "input_text"` + The type of the event. Always `response.refusal.delta`. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Agent BetaResponseRefusalDeltaEventAgent` - - `Mode Explicit` + The agent that owns this multi-agent streaming event. - The breakpoint mode. Always `explicit`. + - `AgentName string` - - `const ExplicitExplicit Explicit = "explicit"` + The canonical name of the agent that produced this item. - - `type BetaResponseInputImage struct{…}` + - `type BetaResponseRefusalDoneEvent struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + Emitted when refusal text is finalized. - - `Detail BetaResponseInputImageDetail` + - `ContentIndex int64` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The index of the content part that the refusal text is finalized. - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `ItemID string` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + The ID of the output item that the refusal text is finalized. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `OutputIndex int64` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + The index of the output item that the refusal text is finalized. - - `Type InputImage` + - `Refusal string` - The type of the input item. Always `input_image`. + The refusal text that is finalized. - - `const InputImageInputImage InputImage = "input_image"` + - `SequenceNumber int64` - - `FileID string` + The sequence number of this event. - The ID of the file to be sent to the model. + - `Type ResponseRefusalDone` - - `ImageURL string` + The type of the event. Always `response.refusal.done`. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `Agent BetaResponseRefusalDoneEventAgent` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The agent that owns this multi-agent streaming event. - - `Mode Explicit` + - `AgentName string` - The breakpoint mode. Always `explicit`. + The canonical name of the agent that produced this item. - - `const ExplicitExplicit Explicit = "explicit"` + - `type BetaResponseTextDeltaEvent struct{…}` - - `type BetaResponseInputFile struct{…}` + Emitted when there is an additional text delta. - A file input to the model. + - `ContentIndex int64` - - `Type InputFile` + The index of the content part that the text delta was added to. - The type of the input item. Always `input_file`. + - `Delta string` - - `const InputFileInputFile InputFile = "input_file"` + The text delta that was added. - - `Detail BetaResponseInputFileDetail` + - `ItemID string` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + The ID of the output item that the text delta was added to. - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `Logprobs []BetaResponseTextDeltaEventLogprob` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + The log probabilities of the tokens in the delta. - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `Token string` - - `FileData string` + A possible text token. - The content of the file to be sent to the model. + - `Logprob float64` - - `FileID string` + The log probability of this token. - The ID of the file to be sent to the model. + - `TopLogprobs []BetaResponseTextDeltaEventLogprobTopLogprob` - - `FileURL string` + The log probabilities of up to 20 of the most likely tokens. - The URL of the file to be sent to the model. + - `Token string` - - `Filename string` + A possible text token. - The name of the file to be sent to the model. + - `Logprob float64` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + The log probability of this token. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `OutputIndex int64` - - `Mode Explicit` + The index of the output item that the text delta was added to. - The breakpoint mode. Always `explicit`. + - `SequenceNumber int64` - - `const ExplicitExplicit Explicit = "explicit"` + The sequence number for this event. - - `Status BetaResponseFunctionToolCallOutputItemStatus` + - `Type ResponseOutputTextDelta` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The type of the event. Always `response.output_text.delta`. - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + - `const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"` - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + - `Agent BetaResponseTextDeltaEventAgent` - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + The agent that owns this multi-agent streaming event. - - `Type FunctionCallOutput` + - `AgentName string` - The type of the function tool call output. Always `function_call_output`. + The canonical name of the agent that produced this item. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `type BetaResponseTextDoneEvent struct{…}` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + Emitted when text content is finalized. - The agent that produced this item. + - `ContentIndex int64` - - `AgentName string` + The index of the content part that the text content is finalized. - The canonical name of the agent that produced this item. + - `ItemID string` - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + The ID of the output item that the text content is finalized. - The execution context that produced this tool call. + - `Logprobs []BetaResponseTextDoneEventLogprob` - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + The log probabilities of the tokens in the delta. - - `Type Direct` + - `Token string` - The caller type. Always `direct`. + A possible text token. - - `const DirectDirect Direct = "direct"` + - `Logprob float64` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + The log probability of this token. - - `CallerID string` + - `TopLogprobs []BetaResponseTextDoneEventLogprobTopLogprob` - The call ID of the program item that produced this tool call. + The log probabilities of up to 20 of the most likely tokens. - - `Type Program` + - `Token string` - The caller type. Always `program`. + A possible text token. - - `const ProgramProgram Program = "program"` + - `Logprob float64` - - `CreatedBy string` + The log probability of this token. - The identifier of the actor that created the item. + - `OutputIndex int64` - - `type BetaResponseOutputItemAgentMessage struct{…}` + The index of the output item that the text content is finalized. - - `ID string` + - `SequenceNumber int64` - The unique ID of the agent message. + The sequence number for this event. - - `Author string` + - `Text string` - The sending agent identity. + The text content that is finalized. - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + - `Type ResponseOutputTextDone` - Encrypted content sent between agents. + The type of the event. Always `response.output_text.done`. - - `type BetaResponseInputText struct{…}` + - `const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"` - A text input to the model. + - `Agent BetaResponseTextDoneEventAgent` - - `type BetaResponseOutputText struct{…}` + The agent that owns this multi-agent streaming event. - A text output from the model. + - `AgentName string` - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + The canonical name of the agent that produced this item. - A text content. + - `type BetaResponseWebSearchCallCompletedEvent struct{…}` - - `Text string` + Emitted when a web search call is completed. - - `Type Text` + - `ItemID string` - - `const TextText Text = "text"` + Unique ID for the output item associated with the web search call. - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + - `OutputIndex int64` - A summary text from the model. + The index of the output item that the web search call is associated with. - - `Text string` + - `SequenceNumber int64` - A summary of the reasoning output from the model so far. + The sequence number of the web search call being processed. - - `Type SummaryText` + - `Type ResponseWebSearchCallCompleted` - The type of the object. Always `summary_text`. + The type of the event. Always `response.web_search_call.completed`. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"` - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `Agent BetaResponseWebSearchCallCompletedEventAgent` - Reasoning text from the model. + The agent that owns this multi-agent streaming event. - - `Text string` + - `AgentName string` - The reasoning text from the model. + The canonical name of the agent that produced this item. - - `Type ReasoningText` + - `type BetaResponseWebSearchCallInProgressEvent struct{…}` - The type of the reasoning text. Always `reasoning_text`. + Emitted when a web search call is initiated. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `ItemID string` - - `type BetaResponseOutputRefusal struct{…}` + Unique ID for the output item associated with the web search call. - A refusal from the model. + - `OutputIndex int64` - - `type BetaResponseInputImage struct{…}` + The index of the output item that the web search call is associated with. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `SequenceNumber int64` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + The sequence number of the web search call being processed. - A screenshot of a computer. + - `Type ResponseWebSearchCallInProgress` - - `Detail string` + The type of the event. Always `response.web_search_call.in_progress`. - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `Agent BetaResponseWebSearchCallInProgressEventAgent` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `AgentName string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + The canonical name of the agent that produced this item. - - `FileID string` + - `type BetaResponseWebSearchCallSearchingEvent struct{…}` - The identifier of an uploaded file that contains the screenshot. + Emitted when a web search call is executing. - - `ImageURL string` + - `ItemID string` - The URL of the screenshot image. + Unique ID for the output item associated with the web search call. - - `Type ComputerScreenshot` + - `OutputIndex int64` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + The index of the output item that the web search call is associated with. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `SequenceNumber int64` - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + The sequence number of the web search call being processed. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Type ResponseWebSearchCallSearching` - - `Mode Explicit` + The type of the event. Always `response.web_search_call.searching`. - The breakpoint mode. Always `explicit`. + - `const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"` - - `const ExplicitExplicit Explicit = "explicit"` + - `Agent BetaResponseWebSearchCallSearchingEventAgent` - - `type BetaResponseInputFile struct{…}` + The agent that owns this multi-agent streaming event. - A file input to the model. + - `AgentName string` - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + The canonical name of the agent that produced this item. - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `type BetaResponseImageGenCallCompletedEvent struct{…}` - - `EncryptedContent string` + Emitted when an image generation tool call has completed and the final image is available. - Opaque encrypted content. + - `ItemID string` - - `Type EncryptedContent` + The unique identifier of the image generation item being processed. - The type of the input item. Always `encrypted_content`. + - `OutputIndex int64` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + The index of the output item in the response's output array. - - `Recipient string` + - `SequenceNumber int64` - The destination agent identity. + The sequence number of this event. - - `Type AgentMessage` + - `Type ResponseImageGenerationCallCompleted` - The type of the item. Always `agent_message`. + The type of the event. Always 'response.image_generation_call.completed'. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"` - - `Agent BetaResponseOutputItemAgentMessageAgent` + - `Agent BetaResponseImageGenCallCompletedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - - `ID string` - - The unique ID of the multi-agent call item. + - `type BetaResponseImageGenCallGeneratingEvent struct{…}` - - `Action string` + Emitted when an image generation tool call is actively generating an image (intermediate state). - The multi-agent action to execute. + - `ItemID string` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + The unique identifier of the image generation item being processed. - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + - `OutputIndex int64` - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + The index of the output item in the response's output array. - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + - `SequenceNumber int64` - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + The sequence number of the image generation item being processed. - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + - `Type ResponseImageGenerationCallGenerating` - - `Arguments string` + The type of the event. Always 'response.image_generation_call.generating'. - The JSON string of arguments generated for the action. + - `const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"` - - `CallID string` + - `Agent BetaResponseImageGenCallGeneratingEventAgent` - The unique ID linking this call to its output. + The agent that owns this multi-agent streaming event. - - `Type MultiAgentCall` + - `AgentName string` - The type of the multi-agent call. Always `multi_agent_call`. + The canonical name of the agent that produced this item. - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `type BetaResponseImageGenCallInProgressEvent struct{…}` - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + Emitted when an image generation tool call is in progress. - The agent that produced this item. + - `ItemID string` - - `AgentName string` + The unique identifier of the image generation item being processed. - The canonical name of the agent that produced this item. + - `OutputIndex int64` - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + The index of the output item in the response's output array. - - `ID string` + - `SequenceNumber int64` - The unique ID of the multi-agent call output item. + The sequence number of the image generation item being processed. - - `Action string` + - `Type ResponseImageGenerationCallInProgress` - The multi-agent action that produced this result. + The type of the event. Always 'response.image_generation_call.in_progress'. - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + - `const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `Agent BetaResponseImageGenCallInProgressEventAgent` - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `AgentName string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + The canonical name of the agent that produced this item. - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + - `type BetaResponseImageGenCallPartialImageEvent struct{…}` - - `CallID string` + Emitted when a partial image is available during image generation streaming. - The unique ID of the multi-agent call. + - `ItemID string` - - `Output []BetaResponseOutputText` + The unique identifier of the image generation item being processed. - Text output returned by the multi-agent action. + - `OutputIndex int64` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The index of the output item in the response's output array. - The annotations of the text output. + - `PartialImageB64 string` - - `Text string` + Base64-encoded partial image data, suitable for rendering as an image. - The text output from the model. + - `PartialImageIndex int64` - - `Type OutputText` + 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). - The type of the output text. Always `output_text`. + - `SequenceNumber int64` - - `Logprobs []BetaResponseOutputTextLogprob` + The sequence number of the image generation item being processed. - - `Type MultiAgentCallOutput` + - `Type ResponseImageGenerationCallPartialImage` - The type of the multi-agent result. Always `multi_agent_call_output`. + The type of the event. Always 'response.image_generation_call.partial_image'. - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `Agent BetaResponseImageGenCallPartialImageEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseFunctionWebSearch struct{…}` - - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - - `ID string` + - `type BetaResponseMcpCallArgumentsDeltaEvent struct{…}` - The unique ID of the web search tool call. + Emitted when there is a delta (partial update) to the arguments of an MCP tool call. - - `Action BetaResponseFunctionWebSearchActionUnion` + - `Delta string` - 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). + A JSON string containing the partial update to the arguments for the MCP tool call. - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `ItemID string` - Action type "search" - Performs a web search query. + The unique identifier of the MCP tool call item being processed. - - `Type Search` + - `OutputIndex int64` - The action type. + The index of the output item in the response's output array. - - `const SearchSearch Search = "search"` + - `SequenceNumber int64` - - `Queries []string` + The sequence number of this event. - The search queries. + - `Type ResponseMcpCallArgumentsDelta` - - `Query string` + The type of the event. Always 'response.mcp_call_arguments.delta'. - The search query. + - `const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + - `Agent BetaResponseMcpCallArgumentsDeltaEventAgent` - The sources used in the search. + The agent that owns this multi-agent streaming event. - - `Type URL` + - `AgentName string` - The type of source. Always `url`. + The canonical name of the agent that produced this item. - - `const URLURL URL = "url"` + - `type BetaResponseMcpCallArgumentsDoneEvent struct{…}` - - `URL string` + Emitted when the arguments for an MCP tool call are finalized. - The URL of the source. + - `Arguments string` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + A JSON string containing the finalized arguments for the MCP tool call. - Action type "open_page" - Opens a specific URL from search results. + - `ItemID string` - - `Type OpenPage` + The unique identifier of the MCP tool call item being processed. - The action type. + - `OutputIndex int64` - - `const OpenPageOpenPage OpenPage = "open_page"` + The index of the output item in the response's output array. - - `URL string` + - `SequenceNumber int64` - The URL opened by the model. + The sequence number of this event. - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `Type ResponseMcpCallArgumentsDone` - Action type "find_in_page": Searches for a pattern within a loaded page. + The type of the event. Always 'response.mcp_call_arguments.done'. - - `Pattern string` + - `const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"` - The pattern or text to search for within the page. + - `Agent BetaResponseMcpCallArgumentsDoneEventAgent` - - `Type FindInPage` + The agent that owns this multi-agent streaming event. - The action type. + - `AgentName string` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + The canonical name of the agent that produced this item. - - `URL string` + - `type BetaResponseMcpCallCompletedEvent struct{…}` - The URL of the page searched for the pattern. + Emitted when an MCP tool call has completed successfully. - - `Status BetaResponseFunctionWebSearchStatus` + - `ItemID string` - The status of the web search tool call. + The ID of the MCP tool call item that completed. - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `OutputIndex int64` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + The index of the output item that completed. - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `SequenceNumber int64` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + The sequence number of this event. - - `Type WebSearchCall` + - `Type ResponseMcpCallCompleted` - The type of the web search tool call. Always `web_search_call`. + The type of the event. Always 'response.mcp_call.completed'. - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"` - - `Agent BetaResponseFunctionWebSearchAgent` + - `Agent BetaResponseMcpCallCompletedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseComputerToolCall struct{…}` + - `type BetaResponseMcpCallFailedEvent struct{…}` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + Emitted when an MCP tool call has failed. - - `ID string` + - `ItemID string` - The unique ID of the computer call. + The ID of the MCP tool call item that failed. - - `CallID string` + - `OutputIndex int64` - An identifier used when responding to the tool call with output. + The index of the output item that failed. - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + - `SequenceNumber int64` - The pending safety checks for the computer call. + The sequence number of this event. - - `ID string` + - `Type ResponseMcpCallFailed` - The ID of the pending safety check. + The type of the event. Always 'response.mcp_call.failed'. - - `Code string` + - `const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"` - The type of the pending safety check. + - `Agent BetaResponseMcpCallFailedEventAgent` - - `Message string` + The agent that owns this multi-agent streaming event. - Details about the pending safety check. + - `AgentName string` - - `Status BetaResponseComputerToolCallStatus` + The canonical name of the agent that produced this item. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type BetaResponseMcpCallInProgressEvent struct{…}` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + Emitted when an MCP tool call is in progress. - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `ItemID string` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + The unique identifier of the MCP tool call item being processed. - - `Type BetaResponseComputerToolCallType` + - `OutputIndex int64` - The type of the computer call. Always `computer_call`. + The index of the output item in the response's output array. - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `SequenceNumber int64` - - `Action BetaComputerActionUnion` + The sequence number of this event. - A click action. + - `Type ResponseMcpCallInProgress` - - `type BetaComputerActionClick struct{…}` + The type of the event. Always 'response.mcp_call.in_progress'. - A click action. + - `const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"` - - `Button string` + - `Agent BetaResponseMcpCallInProgressEventAgent` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + The agent that owns this multi-agent streaming event. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `AgentName string` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + The canonical name of the agent that produced this item. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `type BetaResponseMcpListToolsCompletedEvent struct{…}` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + Emitted when the list of available MCP tools has been successfully retrieved. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `ItemID string` - - `Type Click` + The ID of the MCP tool call item that produced this output. - Specifies the event type. For a click action, this property is always `click`. + - `OutputIndex int64` - - `const ClickClick Click = "click"` + The index of the output item that was processed. - - `X int64` + - `SequenceNumber int64` - The x-coordinate where the click occurred. + The sequence number of this event. - - `Y int64` + - `Type ResponseMcpListToolsCompleted` - The y-coordinate where the click occurred. + The type of the event. Always 'response.mcp_list_tools.completed'. - - `Keys []string` + - `const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"` - The keys being held while clicking. + - `Agent BetaResponseMcpListToolsCompletedEventAgent` - - `type BetaComputerActionDoubleClick struct{…}` + The agent that owns this multi-agent streaming event. - A double click action. + - `AgentName string` - - `Keys []string` + The canonical name of the agent that produced this item. - The keys being held while double-clicking. + - `type BetaResponseMcpListToolsFailedEvent struct{…}` - - `Type DoubleClick` + Emitted when the attempt to list available MCP tools has failed. - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `ItemID string` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + The ID of the MCP tool call item that failed. - - `X int64` + - `OutputIndex int64` - The x-coordinate where the double click occurred. + The index of the output item that failed. - - `Y int64` + - `SequenceNumber int64` - The y-coordinate where the double click occurred. + The sequence number of this event. - - `type BetaComputerActionDrag struct{…}` + - `Type ResponseMcpListToolsFailed` - A drag action. + The type of the event. Always 'response.mcp_list_tools.failed'. - - `Path []BetaComputerActionDragPath` + - `const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `Agent BetaResponseMcpListToolsFailedEventAgent` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + The agent that owns this multi-agent streaming event. - - `X int64` + - `AgentName string` - The x-coordinate. + The canonical name of the agent that produced this item. - - `Y int64` + - `type BetaResponseMcpListToolsInProgressEvent struct{…}` - The y-coordinate. + Emitted when the system is in the process of retrieving the list of available MCP tools. - - `Type Drag` + - `ItemID string` - Specifies the event type. For a drag action, this property is always set to `drag`. + The ID of the MCP tool call item that is being processed. - - `const DragDrag Drag = "drag"` + - `OutputIndex int64` - - `Keys []string` + The index of the output item that is being processed. - The keys being held while dragging the mouse. + - `SequenceNumber int64` - - `type BetaComputerActionKeypress struct{…}` + The sequence number of this event. - A collection of keypresses the model would like to perform. + - `Type ResponseMcpListToolsInProgress` - - `Keys []string` + The type of the event. Always 'response.mcp_list_tools.in_progress'. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"` - - `Type Keypress` + - `Agent BetaResponseMcpListToolsInProgressEventAgent` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + The agent that owns this multi-agent streaming event. - - `const KeypressKeypress Keypress = "keypress"` + - `AgentName string` - - `type BetaComputerActionMove struct{…}` + The canonical name of the agent that produced this item. - A mouse move action. + - `type BetaResponseOutputTextAnnotationAddedEvent struct{…}` - - `Type Move` + Emitted when an annotation is added to output text content. - Specifies the event type. For a move action, this property is always set to `move`. + - `Annotation any` - - `const MoveMove Move = "move"` + The annotation object being added. (See annotation schema for details.) - - `X int64` + - `AnnotationIndex int64` - The x-coordinate to move to. + The index of the annotation within the content part. - - `Y int64` + - `ContentIndex int64` - The y-coordinate to move to. + The index of the content part within the output item. - - `Keys []string` + - `ItemID string` - The keys being held while moving the mouse. + The unique identifier of the item to which the annotation is being added. - - `type BetaComputerActionScreenshot struct{…}` + - `OutputIndex int64` - A screenshot action. + The index of the output item in the response's output array. - - `Type Screenshot` + - `SequenceNumber int64` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + The sequence number of this event. - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `Type ResponseOutputTextAnnotationAdded` - - `type BetaComputerActionScroll struct{…}` + The type of the event. Always 'response.output_text.annotation.added'. - A scroll action. + - `const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"` - - `ScrollX int64` + - `Agent BetaResponseOutputTextAnnotationAddedEventAgent` - The horizontal scroll distance. + The agent that owns this multi-agent streaming event. - - `ScrollY int64` + - `AgentName string` - The vertical scroll distance. + The canonical name of the agent that produced this item. - - `Type Scroll` + - `type BetaResponseQueuedEvent struct{…}` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + Emitted when a response is queued and waiting to be processed. - - `const ScrollScroll Scroll = "scroll"` + - `Response BetaResponse` - - `X int64` + The full response object that is queued. - The x-coordinate where the scroll occurred. + - `SequenceNumber int64` - - `Y int64` + The sequence number for this event. - The y-coordinate where the scroll occurred. + - `Type ResponseQueued` - - `Keys []string` + The type of the event. Always 'response.queued'. - The keys being held while scrolling. + - `const ResponseQueuedResponseQueued ResponseQueued = "response.queued"` - - `type BetaComputerActionType struct{…}` + - `Agent BetaResponseQueuedEventAgent` - An action to type in text. + The agent that owns this multi-agent streaming event. - - `Text string` + - `AgentName string` - The text to type. + The canonical name of the agent that produced this item. - - `Type Type` + - `type BetaResponseCustomToolCallInputDeltaEvent struct{…}` - Specifies the event type. For a type action, this property is always set to `type`. + Event representing a delta (partial update) to the input of a custom tool call. - - `const TypeType Type = "type"` + - `Delta string` - - `type BetaComputerActionWait struct{…}` + The incremental input data (delta) for the custom tool call. - A wait action. + - `ItemID string` - - `Type Wait` + Unique identifier for the API item associated with this event. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `OutputIndex int64` - - `const WaitWait Wait = "wait"` + The index of the output this delta applies to. - - `Actions BetaComputerActionList` + - `SequenceNumber int64` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + The sequence number of this event. - - `type BetaComputerActionClick struct{…}` + - `Type ResponseCustomToolCallInputDelta` - A click action. + The event type identifier. - - `type BetaComputerActionDoubleClick struct{…}` + - `const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"` - A double click action. + - `Agent BetaResponseCustomToolCallInputDeltaEventAgent` - - `type BetaComputerActionDrag struct{…}` + The agent that owns this multi-agent streaming event. - A drag action. + - `AgentName string` - - `type BetaComputerActionKeypress struct{…}` + The canonical name of the agent that produced this item. - A collection of keypresses the model would like to perform. + - `type BetaResponseCustomToolCallInputDoneEvent struct{…}` - - `type BetaComputerActionMove struct{…}` + Event indicating that input for a custom tool call is complete. - A mouse move action. + - `Input string` - - `type BetaComputerActionScreenshot struct{…}` + The complete input data for the custom tool call. - A screenshot action. + - `ItemID string` - - `type BetaComputerActionScroll struct{…}` + Unique identifier for the API item associated with this event. - A scroll action. + - `OutputIndex int64` - - `type BetaComputerActionType struct{…}` + The index of the output this event applies to. - An action to type in text. + - `SequenceNumber int64` - - `type BetaComputerActionWait struct{…}` + The sequence number of this event. - A wait action. + - `Type ResponseCustomToolCallInputDone` - - `Agent BetaResponseComputerToolCallAgent` + The event type identifier. - The agent that produced this item. + - `const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"` + + - `Agent BetaResponseCustomToolCallInputDoneEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseComputerToolCallOutputItem struct{…}` - - - `ID string` +### Beta Response Text Config - The unique ID of the computer call tool output. +- `type BetaResponseTextConfig struct{…}` - - `CallID string` + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - The ID of the computer tool call that produced the output. + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Format BetaResponseFormatTextConfigUnion` - A computer screenshot image used with the computer use tool. + An object specifying the format that the model must output. - - `Type ComputerScreenshot` + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + The default format is `{ "type": "text" }` with no additional options. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + **Not recommended for gpt-4o and newer models:** - - `FileID string` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - The identifier of an uploaded file that contains the screenshot. + - `type BetaResponseFormatTextConfigText struct{…}` - - `ImageURL string` + Default response format. Used to generate text responses. - The URL of the screenshot image. + - `Type Text` - - `Status BetaResponseComputerToolCallOutputItemStatus` + The type of response format being defined. Always `text`. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `const TextText Text = "text"` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `Name string` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `Type ComputerCallOutput` + - `Schema map[string, any]` - The type of the computer tool call output. Always `computer_call_output`. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `Type JSONSchema` - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + The type of response format being defined. Always `json_schema`. - The safety checks reported by the API that have been acknowledged by the - developer. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `ID string` + - `Description string` - The ID of the pending safety check. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `Code string` + - `Strict bool` - The type of the pending safety check. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Message string` + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - Details about the pending safety check. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `Type JSONObject` - The agent that produced this item. + The type of response format being defined. Always `json_object`. - - `AgentName string` + - `const JSONObjectJSONObject JSONObject = "json_object"` - The canonical name of the agent that produced this item. + - `Verbosity BetaResponseTextConfigVerbosity` - - `CreatedBy string` + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - The identifier of the actor that created the item. + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - - `type BetaResponseReasoningItem struct{…}` + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - 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](https://platform.openai.com/docs/guides/conversation-state). + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - - `ID string` +### Beta Response Text Delta Event - The unique identifier of the reasoning content. +- `type BetaResponseTextDeltaEvent struct{…}` - - `Summary []BetaResponseReasoningItemSummary` + Emitted when there is an additional text delta. - Reasoning summary content. + - `ContentIndex int64` - - `Text string` + The index of the content part that the text delta was added to. - A summary of the reasoning output from the model so far. + - `Delta string` - - `Type SummaryText` + The text delta that was added. - The type of the object. Always `summary_text`. + - `ItemID string` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + The ID of the output item that the text delta was added to. - - `Type Reasoning` + - `Logprobs []BetaResponseTextDeltaEventLogprob` - The type of the object. Always `reasoning`. + The log probabilities of the tokens in the delta. - - `const ReasoningReasoning Reasoning = "reasoning"` + - `Token string` - - `Agent BetaResponseReasoningItemAgent` + A possible text token. - The agent that produced this item. + - `Logprob float64` - - `AgentName string` + The log probability of this token. - The canonical name of the agent that produced this item. + - `TopLogprobs []BetaResponseTextDeltaEventLogprobTopLogprob` - - `Content []BetaResponseReasoningItemContent` + The log probabilities of up to 20 of the most likely tokens. - Reasoning text content. + - `Token string` - - `Text string` + A possible text token. - The reasoning text from the model. + - `Logprob float64` - - `Type ReasoningText` + The log probability of this token. - The type of the reasoning text. Always `reasoning_text`. + - `OutputIndex int64` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + The index of the output item that the text delta was added to. - - `EncryptedContent string` + - `SequenceNumber int64` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + The sequence number for this event. - - `Status BetaResponseReasoningItemStatus` + - `Type ResponseOutputTextDelta` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The type of the event. Always `response.output_text.delta`. - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + - `Agent BetaResponseTextDeltaEventAgent` - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + The agent that owns this multi-agent streaming event. - - `type BetaResponseOutputItemProgram struct{…}` + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - The unique ID of the program item. +### Beta Response Text Done Event - - `CallID string` +- `type BetaResponseTextDoneEvent struct{…}` - The stable call ID of the program item. + Emitted when text content is finalized. - - `Code string` + - `ContentIndex int64` - The JavaScript source executed by programmatic tool calling. + The index of the content part that the text content is finalized. - - `Fingerprint string` + - `ItemID string` - Opaque program replay fingerprint that must be round-tripped. + The ID of the output item that the text content is finalized. - - `Type Program` + - `Logprobs []BetaResponseTextDoneEventLogprob` - The type of the item. Always `program`. + The log probabilities of the tokens in the delta. - - `const ProgramProgram Program = "program"` + - `Token string` - - `Agent BetaResponseOutputItemProgramAgent` + A possible text token. - The agent that produced this item. + - `Logprob float64` - - `AgentName string` + The log probability of this token. - The canonical name of the agent that produced this item. + - `TopLogprobs []BetaResponseTextDoneEventLogprobTopLogprob` - - `type BetaResponseOutputItemProgramOutput struct{…}` + The log probabilities of up to 20 of the most likely tokens. - - `ID string` + - `Token string` - The unique ID of the program output item. + A possible text token. - - `CallID string` + - `Logprob float64` - The call ID of the program item. + The log probability of this token. - - `Result string` + - `OutputIndex int64` - The result produced by the program item. + The index of the output item that the text content is finalized. - - `Status string` + - `SequenceNumber int64` - The terminal status of the program output item. + The sequence number for this event. - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + - `Text string` - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + The text content that is finalized. - - `Type ProgramOutput` + - `Type ResponseOutputTextDone` - The type of the item. Always `program_output`. + The type of the event. Always `response.output_text.done`. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"` - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `Agent BetaResponseTextDoneEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseToolSearchCall struct{…}` +### Beta Response Tool Search Call + +- `type BetaResponseToolSearchCall struct{…}` - `ID string` @@ -114183,7 +126213,9 @@ func main() { The identifier of the actor that created the item. - - `type BetaResponseToolSearchOutputItem struct{…}` +### Beta Response Tool Search Output Item + +- `type BetaResponseToolSearchOutputItem struct{…}` - `ID string` @@ -114322,7 +126354,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -114379,7 +126415,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -115311,1638 +127351,1365 @@ func main() { The identifier of the actor that created the item. - - `type BetaResponseOutputItemAdditionalTools struct{…}` - - - `ID string` - - The unique ID of the additional tools item. - - - `Role string` - - The role that provided the additional tools. - - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` +### Beta Response Tool Search Output Item Param - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` +- `type BetaResponseToolSearchOutputItemParamResp struct{…}` - `Tools []BetaToolUnion` - The additional tool definitions made available at this item. + The loaded tool definitions returned by the tool search output. - `type BetaFunctionTool struct{…}` Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `type BetaFileSearchTool struct{…}` - - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - - `type BetaComputerTool struct{…}` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type BetaComputerUsePreviewTool struct{…}` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type BetaWebSearchTool struct{…}` - - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `type BetaToolMcp struct{…}` - - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - - `type BetaToolCodeInterpreter struct{…}` - - A tool that runs Python code to help generate a response to a prompt. - - - `type BetaToolProgrammaticToolCalling struct{…}` - - - `type BetaToolImageGeneration struct{…}` - - A tool that generates images using the GPT image models. - - - `type BetaToolLocalShell struct{…}` - - A tool that allows the model to execute shell commands in a local environment. - - - `type BetaFunctionShellTool struct{…}` - - A tool that allows the model to execute shell commands. - - - `type BetaCustomTool struct{…}` - - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - - `type BetaNamespaceTool struct{…}` - - Groups function/custom tools under a shared namespace. - - - `type BetaToolSearchTool struct{…}` - - Hosted or BYOT tool search configuration for deferred tools. - - - `type BetaWebSearchPreviewTool struct{…}` - - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `type BetaApplyPatchTool 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"` - - - `Agent BetaResponseOutputItemAdditionalToolsAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseCompactionItem struct{…}` - - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - - `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"` - - - `Agent BetaResponseCompactionItemAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `CreatedBy string` - - The identifier of the actor that created the item. - - - `type BetaResponseOutputItemImageGenerationCall 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 BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - - - `Type ImageGenerationCall` - - The type of the image generation call. Always `image_generation_call`. - - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - - `Agent BetaResponseOutputItemImageGenerationCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseCodeInterpreterToolCall 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 []BetaResponseCodeInterpreterToolCallOutputUnion` - - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. - - - `type BetaResponseCodeInterpreterToolCallOutputLogs 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 BetaResponseCodeInterpreterToolCallOutputImage 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 BetaResponseCodeInterpreterToolCallStatus` - - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - - `Type CodeInterpreterCall` - - The type of the code interpreter tool call. Always `code_interpreter_call`. - - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - - `Agent BetaResponseCodeInterpreterToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseOutputItemLocalShellCall struct{…}` - - A tool call to run a command on the local shell. - - - `ID string` - - The unique ID of the local shell call. - - - `Action BetaResponseOutputItemLocalShellCallAction` - - 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 BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - - - `Type LocalShellCall` - - The type of the local shell call. Always `local_shell_call`. - - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - - `Agent BetaResponseOutputItemLocalShellCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseOutputItemLocalShellCallOutput 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"` - - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. + - `Name string` - - `Status string` + The name of the function to call. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `Parameters map[string, any]` - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + A JSON schema object describing the parameters of the function. - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + - `Strict bool` - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + Whether strict parameter validation is enforced for this function tool. - - `type BetaResponseFunctionShellToolCall struct{…}` + - `Type Function` - A tool call that executes one or more shell commands in a managed environment. + The type of the function tool. Always `function`. - - `ID string` + - `const FunctionFunction Function = "function"` - The unique ID of the shell tool call. Populated when this item is returned via API. + - `AllowedCallers []string` - - `Action BetaResponseFunctionShellToolCallAction` + The tool invocation context(s). - The shell commands and limits that describe how to run the tool call. + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `Commands []string` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - - `MaxOutputLength int64` + - `DeferLoading bool` - Optional maximum number of characters to return from each command. + Whether this function is deferred and loaded via tool search. - - `TimeoutMs int64` + - `Description string` - Optional timeout in milliseconds for the commands. + A description of the function. Used by the model to determine whether or not to call the function. - - `CallID string` + - `OutputSchema map[string, any]` - The unique ID of the shell tool call generated by the model. + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + - `type BetaFileSearchTool struct{…}` - Represents the use of a local environment to perform shell actions. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `type BetaResponseLocalEnvironment struct{…}` + - `Type FileSearch` - Represents the use of a local environment to perform shell actions. + The type of the file search tool. Always `file_search`. - - `Type Local` + - `const FileSearchFileSearch FileSearch = "file_search"` - The environment type. Always `local`. + - `VectorStoreIDs []string` - - `const LocalLocal Local = "local"` + The IDs of the vector stores to search. - - `type BetaResponseContainerReference struct{…}` + - `Filters BetaFileSearchToolFiltersUnion` - Represents a container created with /v1/containers. + A filter to apply. - - `ContainerID string` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `Type ContainerReference` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - The environment type. Always `container_reference`. + - `Key string` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + The key to compare against the value. - - `Status BetaResponseFunctionShellToolCallStatus` + - `Type string` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + - `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 BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - `Type ShellCall` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - The type of the item. Always `shell_call`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - `const ShellCallShellCall ShellCall = "shell_call"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Agent BetaResponseFunctionShellToolCallAgent` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The agent that produced this item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `AgentName string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - The canonical name of the agent that produced this item. + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + The value to compare against the attribute key; supports string, number, or boolean types. - The execution context that produced this tool call. + - `string` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `float64` - - `Type Direct` + - `bool` - - `const DirectDirect Direct = "direct"` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `string` - - `CallerID string` + - `float64` - The call ID of the program item that produced this tool call. + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `Type Program` + Combine multiple filters using `and` or `or`. - - `const ProgramProgram Program = "program"` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - `CreatedBy string` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - The ID of the entity that created this tool call. + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - The output of a shell tool call that was emitted. + - `Key string` - - `ID string` + The key to compare against the value. - The unique ID of the shell call output. Populated when this item is returned via API. + - `Type string` - - `CallID string` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - The unique ID of the shell tool call generated by the model. + - `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 - - `MaxOutputLength int64` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - An array of shell call output contents + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - Indicates that the shell call exceeded its configured time limit. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `Type Timeout` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - The outcome type. Always `timeout`. + The value to compare against the attribute key; supports string, number, or boolean types. - - `const TimeoutTimeout Timeout = "timeout"` + - `string` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `float64` - Indicates that the shell commands finished and returned an exit code. + - `bool` - - `ExitCode int64` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - Exit code from the shell process. + - `string` - - `Type Exit` + - `float64` - The outcome type. Always `exit`. + - `Type string` - - `const ExitExit Exit = "exit"` + Type of operation: `and` or `or`. - - `Stderr string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - The standard error output that was captured. + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - `Stdout string` + - `MaxNumResults int64` - The standard output that was captured. + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `CreatedBy string` + - `RankingOptions BetaFileSearchToolRankingOptions` - The identifier of the actor that created the item. + Ranking options for search. - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `EmbeddingWeight float64` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + The weight of the embedding in the reciprocal ranking fusion. - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + - `TextWeight float64` - - `Type ShellCallOutput` + The weight of the text in the reciprocal ranking fusion. - The type of the shell call output. Always `shell_call_output`. + - `Ranker string` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + The ranker to use for the file search. - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - The agent that produced this item. + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - - `AgentName string` + - `ScoreThreshold float64` - The canonical name of the agent that produced this item. + 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. - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `type BetaComputerTool struct{…}` - The execution context that produced this tool call. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `Type Computer` - - `Type Direct` + The type of the computer tool. Always `computer`. - - `const DirectDirect Direct = "direct"` + - `const ComputerComputer Computer = "computer"` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `type BetaComputerUsePreviewTool struct{…}` - - `CallerID string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The call ID of the program item that produced this tool call. + - `DisplayHeight int64` - - `Type Program` + The height of the computer display. - - `const ProgramProgram Program = "program"` + - `DisplayWidth int64` - - `CreatedBy string` + The width of the computer display. - The identifier of the actor that created the item. + - `Environment BetaComputerUsePreviewToolEnvironment` - - `type BetaResponseApplyPatchToolCall struct{…}` + The type of computer environment to control. - A tool call that applies file diffs by creating, deleting, or updating files. + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - - `ID string` + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `CallID string` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - The unique ID of the apply patch tool call generated by the model. + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `Type ComputerUsePreview` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + The type of the computer use tool. Always `computer_use_preview`. - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - Instruction describing how to create a file via the apply_patch tool. + - `type BetaWebSearchTool struct{…}` - - `Diff string` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Diff to apply. + - `Type BetaWebSearchToolType` - - `Path string` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - Path of the file to create. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `Type CreateFile` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - Create a new file with the provided diff. + - `Filters BetaWebSearchToolFilters` - - `const CreateFileCreateFile CreateFile = "create_file"` + Filters for the search. - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `AllowedDomains []string` - Instruction describing how to delete a file via the apply_patch tool. + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `Path string` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - Path of the file to delete. + - `SearchContextSize BetaWebSearchToolSearchContextSize` - - `Type DeleteFile` + 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. - Delete the specified file. + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - Instruction describing how to update a file via the apply_patch tool. + - `UserLocation BetaWebSearchToolUserLocation` - - `Diff string` + The approximate location of the user. - Diff to apply. + - `City string` - - `Path string` + Free text input for the city of the user, e.g. `San Francisco`. - Path of the file to update. + - `Country string` - - `Type UpdateFile` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - Update an existing file with the provided diff. + - `Region string` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + Free text input for the region of the user, e.g. `California`. - - `Status BetaResponseApplyPatchToolCallStatus` + - `Timezone string` - The status of the apply patch tool call. One of `in_progress` or `completed`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `Type string` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + The type of location approximation. Always `approximate`. - - `Type ApplyPatchCall` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - The type of the item. Always `apply_patch_call`. + - `type BetaToolMcp struct{…}` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Agent BetaResponseApplyPatchToolCallAgent` + - `ServerLabel string` - The agent that produced this item. + A label for this MCP server, used to identify it in tool calls. - - `AgentName string` + - `Type Mcp` - The canonical name of the agent that produced this item. + The type of the MCP tool. Always `mcp`. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `const McpMcp Mcp = "mcp"` - The execution context that produced this tool call. + - `AllowedCallers []string` - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + The tool invocation context(s). - - `Type Direct` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - - `const DirectDirect Direct = "direct"` + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `CallerID string` + List of allowed tool names or a filter object. - The call ID of the program item that produced this tool call. + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `Type Program` + A string array of allowed tool names - - `const ProgramProgram Program = "program"` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `CreatedBy string` + A filter object to specify which tools are allowed. - The ID of the entity that created this tool call. + - `ReadOnly bool` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The output emitted by an apply patch tool call. + - `ToolNames []string` - - `ID string` + List of allowed tool names. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `Authorization string` - - `CallID 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. - The unique ID of the apply patch tool call generated by the model. + - `ConnectorID string` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - The status of the apply patch tool call output. One of `completed` or `failed`. + Currently supported `connector_id` values are: - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - 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 BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `Type ApplyPatchCallOutput` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - The type of the item. Always `apply_patch_call_output`. + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - The agent that produced this item. + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `AgentName string` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - The canonical name of the agent that produced this item. + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `DeferLoading bool` - The execution context that produced this tool call. + Whether this MCP tool is deferred and discovered via tool search. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `Headers map[string, string]` - - `Type Direct` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `const DirectDirect Direct = "direct"` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + Specify which of the MCP server's tools require approval. - - `CallerID string` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - The call ID of the program item that produced this tool call. + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `Type Program` + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `const ProgramProgram Program = "program"` + A filter object to specify which tools are allowed. - - `CreatedBy string` + - `ReadOnly bool` - The ID of the entity that created this tool call output. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Output string` + - `ToolNames []string` - Optional textual output returned by the apply patch tool. + List of allowed tool names. - - `type BetaResponseOutputItemMcpCall struct{…}` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - An invocation of a tool on an MCP server. + A filter object to specify which tools are allowed. - - `ID string` + - `ReadOnly bool` - The unique ID of the tool call. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Arguments string` + - `ToolNames []string` - A JSON string of the arguments passed to the tool. + List of allowed tool names. - - `Name string` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - The name of the tool that was run. + 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. - - `ServerLabel string` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - The label of the MCP server running the tool. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - - `Type McpCall` + - `ServerDescription string` - The type of the item. Always `mcp_call`. + Optional description of the MCP server, used to provide more context. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `ServerURL string` - - `Agent BetaResponseOutputItemMcpCallAgent` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - The agent that produced this item. + - `TunnelID string` - - `AgentName 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. - The canonical name of the agent that produced this item. + - `type BetaToolCodeInterpreter struct{…}` - - `ApprovalRequestID string` + A tool that runs Python code to help generate a response to a prompt. - 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. + - `Container BetaToolCodeInterpreterContainerUnion` - - `Error string` + 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. - The error from the tool call, if any. + - `string` - - `Output string` + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - The output from the tool call. + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `Status string` + - `Type Auto` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + Always `auto`. - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + - `const AutoAuto Auto = "auto"` - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + - `FileIDs []string` - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + An optional list of uploaded files to make available to your code. - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + - `MemoryLimit string` - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + The memory limit for the code interpreter container. - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - A list of tools available on an MCP server. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `ID string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - The unique ID of the list. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `ServerLabel string` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - The label of the MCP server. + Network access policy for the container. - - `Tools []BetaResponseOutputItemMcpListToolsTool` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The tools available on the server. + - `Type Disabled` - - `InputSchema any` + Disable outbound network access. Always `disabled`. - The JSON schema describing the tool's input. + - `const DisabledDisabled Disabled = "disabled"` - - `Name string` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - The name of the tool. + - `AllowedDomains []string` - - `Annotations any` + A list of allowed domains when type is `allowlist`. - Additional annotations about the tool. + - `Type Allowlist` - - `Description string` + Allow outbound network access only to specified domains. Always `allowlist`. - The description of the tool. + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `Type McpListTools` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - The type of the item. Always `mcp_list_tools`. + Optional domain-scoped secrets for allowlisted domains. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `Domain string` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + The domain associated with the secret. - The agent that produced this item. + - `Name string` - - `AgentName string` + The name of the secret to inject for the domain. - The canonical name of the agent that produced this item. + - `Value string` - - `Error string` + The secret value to inject for the domain. - Error message if the server could not list tools. + - `Type CodeInterpreter` - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + The type of the code interpreter tool. Always `code_interpreter`. - A request for human approval of a tool invocation. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `ID string` + - `AllowedCallers []string` - The unique ID of the approval request. + The tool invocation context(s). - - `Arguments string` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - A JSON string of arguments for the tool. + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `Name string` + - `type BetaToolProgrammaticToolCalling struct{…}` - The name of the tool to run. + - `Type ProgrammaticToolCalling` - - `ServerLabel string` + The type of the tool. Always `programmatic_tool_calling`. - The label of the MCP server making the request. + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `Type McpApprovalRequest` + - `type BetaToolImageGeneration struct{…}` - The type of the item. Always `mcp_approval_request`. + A tool that generates images using the GPT image models. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `Type ImageGeneration` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + The type of the image generation tool. Always `image_generation`. - The agent that produced this item. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `AgentName string` + - `Action string` - The canonical name of the agent that produced this item. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - A response to an MCP approval request. + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `ID string` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - The unique ID of the approval response + - `Background string` - - `ApprovalRequestID 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. - The ID of the approval request being answered. + `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. - - `Approve bool` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - Whether the request was approved. + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `Type McpApprovalResponse` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - The type of the item. Always `mcp_approval_response`. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `InputFidelity string` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + 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`. - The agent that produced this item. + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - - `AgentName string` + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - The canonical name of the agent that produced this item. + - `InputImageMask BetaToolImageGenerationInputImageMask` - - `Reason string` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - Optional reason for the decision. + - `FileID string` - - `type BetaResponseCustomToolCall struct{…}` + File ID for the mask image. - A call to a custom tool created by the model. + - `ImageURL string` - - `CallID string` + Base64-encoded mask image. - An identifier used to map this custom tool call to a tool call output. + - `Model string` - - `Input string` + The image generation model to use. Default: `gpt-image-1`. - The input for the custom tool call generated by the model. + - `string` - - `Name string` + - `string` - The name of the custom tool being called. + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - - `Type CustomToolCall` + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - The type of the custom tool call. Always `custom_tool_call`. + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `ID string` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - The unique ID of the custom tool call in the OpenAI platform. + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - `Agent BetaResponseCustomToolCallAgent` + - `Moderation string` - The agent that produced this item. + Moderation level for the generated image. Default: `auto`. - - `AgentName string` + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - The canonical name of the agent that produced this item. + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - - `Caller BetaResponseCustomToolCallCallerUnion` + - `OutputCompression int64` - The execution context that produced this tool call. + Compression level for the output image. Default: 100. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `OutputFormat string` - - `Type Direct` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `const DirectDirect Direct = "direct"` + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `CallerID string` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - The call ID of the program item that produced this tool call. + - `PartialImages int64` - - `Type Program` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `const ProgramProgram Program = "program"` + - `Quality string` - - `Namespace string` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - The namespace of the custom tool being called. + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - The output of a custom tool call from your code, being sent back to the model. + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `ID string` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - The unique ID of the custom tool call output item. + - `Size string` - - `Status 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`. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `string` - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `string` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `CreatedBy string` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - The identifier of the actor that created the item. + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - - `OutputIndex int64` + - `type BetaToolLocalShell struct{…}` - The index of the output item that was marked done. + A tool that allows the model to execute shell commands in a local environment. - - `SequenceNumber int64` + - `Type LocalShell` - The sequence number of this event. + The type of the local shell tool. Always `local_shell`. - - `Type ResponseOutputItemDone` + - `const LocalShellLocalShell LocalShell = "local_shell"` - The type of the event. Always `response.output_item.done`. + - `type BetaFunctionShellTool struct{…}` - - `const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"` + A tool that allows the model to execute shell commands. - - `Agent BetaResponseOutputItemDoneEventAgent` + - `Type Shell` - The agent that owns this multi-agent streaming event. + The type of the shell tool. Always `shell`. - - `AgentName string` + - `const ShellShell Shell = "shell"` - The canonical name of the agent that produced this item. + - `AllowedCallers []string` -### Beta Response Output Message + The tool invocation context(s). -- `type BetaResponseOutputMessage struct{…}` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - An output message from the model. + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - `ID string` + - `Environment BetaFunctionShellToolEnvironmentUnion` - The unique ID of the output message. + - `type BetaContainerAuto struct{…}` - - `Content []BetaResponseOutputMessageContentUnion` + - `Type ContainerAuto` - The content of the output message. + Automatically creates a container for this request - - `type BetaResponseOutputText struct{…}` + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - A text output from the model. + - `FileIDs []string` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + An optional list of uploaded files to make available to your code. - The annotations of the text output. + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + The memory limit for the container. - A citation to a file. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `FileID string` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - The ID of the file. + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `Filename string` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - The filename of the file cited. + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - - `Index int64` + Network access policy for the container. - The index of the file in the list of files. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `Type FileCitation` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - The type of the file citation. Always `file_citation`. + - `Skills []BetaContainerAutoSkillUnion` - - `const FileCitationFileCitation FileCitation = "file_citation"` + An optional list of skills referenced by id or inline data. - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `type BetaSkillReference struct{…}` - A citation for a web resource used to generate a model response. + - `SkillID string` - - `EndIndex int64` + The ID of the referenced skill. - The index of the last character of the URL citation in the message. + - `Type SkillReference` - - `StartIndex int64` + References a skill created with the /v1/skills endpoint. - The index of the first character of the URL citation in the message. + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `Title string` + - `Version string` - The title of the web resource. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `Type URLCitation` + - `type BetaInlineSkill struct{…}` - The type of the URL citation. Always `url_citation`. + - `Description string` - - `const URLCitationURLCitation URLCitation = "url_citation"` + The description of the skill. - - `URL string` + - `Name string` - The URL of the web resource. + The name of the skill. - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `Source BetaInlineSkillSource` - A citation for a container file used to generate a model response. + Inline skill payload - - `ContainerID string` + - `Data string` - The ID of the container file. + Base64-encoded skill zip bundle. - - `EndIndex int64` + - `MediaType ApplicationZip` - The index of the last character of the container file citation in the message. + The media type of the inline skill payload. Must be `application/zip`. - - `FileID string` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - The ID of the file. + - `Type Base64` - - `Filename string` + The type of the inline skill source. Must be `base64`. - The filename of the container file cited. + - `const Base64Base64 Base64 = "base64"` - - `StartIndex int64` + - `Type Inline` - The index of the first character of the container file citation in the message. + Defines an inline skill for this request. - - `Type ContainerFileCitation` + - `const InlineInline Inline = "inline"` - The type of the container file citation. Always `container_file_citation`. + - `type BetaLocalEnvironment struct{…}` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `Type Local` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + Use a local computer environment. - A path to a file. + - `const LocalLocal Local = "local"` - - `FileID string` + - `Skills []BetaLocalSkill` - The ID of the file. + An optional list of skills. - - `Index int64` + - `Description string` - The index of the file in the list of files. + The description of the skill. - - `Type FilePath` + - `Name string` - The type of the file path. Always `file_path`. + The name of the skill. - - `const FilePathFilePath FilePath = "file_path"` + - `Path string` - - `Text string` + The path to the directory containing the skill. - The text output from the model. + - `type BetaContainerReference struct{…}` - - `Type OutputText` + - `ContainerID string` - The type of the output text. Always `output_text`. + The ID of the referenced container. - - `const OutputTextOutputText OutputText = "output_text"` + - `Type ContainerReference` - - `Logprobs []BetaResponseOutputTextLogprob` + References a container created with the /v1/containers endpoint - - `Token string` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `Bytes []int64` + - `type BetaCustomTool struct{…}` - - `Logprob float64` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `Name string` - - `Token string` + The name of the custom tool, used to identify it in tool calls. - - `Bytes []int64` + - `Type Custom` - - `Logprob float64` + The type of the custom tool. Always `custom`. - - `type BetaResponseOutputRefusal struct{…}` + - `const CustomCustom Custom = "custom"` - A refusal from the model. + - `AllowedCallers []string` - - `Refusal string` + The tool invocation context(s). - The refusal explanation from the model. + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `Type Refusal` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - The type of the refusal. Always `refusal`. + - `DeferLoading bool` - - `const RefusalRefusal Refusal = "refusal"` + Whether this tool should be deferred and discovered via tool search. - - `Role Assistant` + - `Description string` - The role of the output message. Always `assistant`. + Optional description of the custom tool, used to provide more context. - - `const AssistantAssistant Assistant = "assistant"` + - `Format BetaCustomToolFormatUnion` - - `Status BetaResponseOutputMessageStatus` + The input format for the custom tool. Default is unconstrained text. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `type BetaCustomToolFormatText struct{…}` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + Unconstrained free-form text. - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `Type Text` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + Unconstrained text format. Always `text`. - - `Type Message` + - `const TextText Text = "text"` - The type of the output message. Always `message`. + - `type BetaCustomToolFormatGrammar struct{…}` - - `const MessageMessage Message = "message"` + A grammar defined by the user. - - `Agent BetaResponseOutputMessageAgent` + - `Definition string` - The agent that produced this item. + The grammar definition. - - `AgentName string` + - `Syntax string` - The canonical name of the agent that produced this item. + The syntax of the grammar definition. One of `lark` or `regex`. - - `Phase BetaResponseOutputMessagePhase` + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - 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 BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `Type Grammar` -### Beta Response Output Refusal + Grammar format. Always `grammar`. -- `type BetaResponseOutputRefusal struct{…}` + - `const GrammarGrammar Grammar = "grammar"` - A refusal from the model. + - `type BetaNamespaceTool struct{…}` - - `Refusal string` + Groups function/custom tools under a shared namespace. - The refusal explanation from the model. + - `Description string` - - `Type Refusal` + A description of the namespace shown to the model. - The type of the refusal. Always `refusal`. + - `Name string` - - `const RefusalRefusal Refusal = "refusal"` + The namespace name used in tool calls (for example, `crm`). -### Beta Response Output Text + - `Tools []BetaNamespaceToolToolUnion` -- `type BetaResponseOutputText struct{…}` + The function/custom tools available inside this namespace. - A text output from the model. + - `type BetaNamespaceToolToolFunction struct{…}` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `Name string` - The annotations of the text output. + - `Type Function` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `const FunctionFunction Function = "function"` - A citation to a file. + - `AllowedCallers []string` - - `FileID string` + The tool invocation context(s). - The ID of the file. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `Filename string` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - The filename of the file cited. + - `DeferLoading bool` - - `Index int64` + Whether this function should be deferred and discovered via tool search. - The index of the file in the list of files. + - `Description string` - - `Type FileCitation` + - `OutputSchema map[string, any]` - The type of the file citation. Always `file_citation`. + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `Parameters any` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `Strict bool` - A citation for a web resource used to generate a model response. + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `EndIndex int64` + - `type BetaCustomTool struct{…}` - The index of the last character of the URL citation in the message. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `StartIndex int64` + - `Type Namespace` - The index of the first character of the URL citation in the message. + The type of the tool. Always `namespace`. - - `Title string` + - `const NamespaceNamespace Namespace = "namespace"` - The title of the web resource. + - `type BetaToolSearchTool struct{…}` - - `Type URLCitation` + Hosted or BYOT tool search configuration for deferred tools. - The type of the URL citation. Always `url_citation`. + - `Type ToolSearch` - - `const URLCitationURLCitation URLCitation = "url_citation"` + The type of the tool. Always `tool_search`. - - `URL string` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - The URL of the web resource. + - `Description string` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + Description shown to the model for a client-executed tool search tool. - A citation for a container file used to generate a model response. + - `Execution BetaToolSearchToolExecution` - - `ContainerID string` + Whether tool search is executed by the server or by the client. - The ID of the container file. + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `EndIndex int64` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - The index of the last character of the container file citation in the message. + - `Parameters any` - - `FileID string` + Parameter schema for a client-executed tool search tool. - The ID of the file. + - `type BetaWebSearchPreviewTool struct{…}` - - `Filename string` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The filename of the container file cited. + - `Type BetaWebSearchPreviewToolType` - - `StartIndex int64` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The index of the first character of the container file citation in the message. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `Type ContainerFileCitation` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - The type of the container file citation. Always `container_file_citation`. + - `SearchContentTypes []string` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - A path to a file. + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - `FileID string` + 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. - The ID of the file. + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - - `Index int64` + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - The index of the file in the list of files. + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - `Type FilePath` + - `UserLocation BetaWebSearchPreviewToolUserLocation` - The type of the file path. Always `file_path`. + The user's location. - - `const FilePathFilePath FilePath = "file_path"` + - `Type Approximate` - - `Text string` + The type of location approximation. Always `approximate`. - The text output from the model. + - `const ApproximateApproximate Approximate = "approximate"` - - `Type OutputText` + - `City string` - The type of the output text. Always `output_text`. + Free text input for the city of the user, e.g. `San Francisco`. - - `const OutputTextOutputText OutputText = "output_text"` + - `Country string` - - `Logprobs []BetaResponseOutputTextLogprob` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `Token string` + - `Region string` - - `Bytes []int64` + Free text input for the region of the user, e.g. `California`. - - `Logprob float64` + - `Timezone string` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `Token string` + - `type BetaApplyPatchTool struct{…}` - - `Bytes []int64` + Allows the assistant to create, delete, or update files using unified diffs. - - `Logprob float64` + - `Type ApplyPatch` -### Beta Response Output Text Annotation Added Event + The type of the tool. Always `apply_patch`. -- `type BetaResponseOutputTextAnnotationAddedEvent struct{…}` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - Emitted when an annotation is added to output text content. + - `AllowedCallers []string` - - `Annotation any` + The tool invocation context(s). - The annotation object being added. (See annotation schema for details.) + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - - `AnnotationIndex int64` + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - The index of the annotation within the content part. + - `Type ToolSearchOutput` - - `ContentIndex int64` + The item type. Always `tool_search_output`. - The index of the content part within the output item. + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `ItemID string` + - `ID string` - The unique identifier of the item to which the annotation is being added. + The unique ID of this tool search output. - - `OutputIndex int64` + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - The index of the output item in the response's output array. + The agent that produced this item. - - `SequenceNumber int64` + - `AgentName string` - The sequence number of this event. + The canonical name of the agent that produced this item. - - `Type ResponseOutputTextAnnotationAdded` + - `CallID string` - The type of the event. Always 'response.output_text.annotation.added'. + The unique ID of the tool search call generated by the model. - - `const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - - `Agent BetaResponseOutputTextAnnotationAddedEventAgent` + Whether tool search was executed by the server or by the client. - The agent that owns this multi-agent streaming event. + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - `AgentName string` + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - The canonical name of the agent that produced this item. + - `Status BetaResponseToolSearchOutputItemParamStatus` -### Beta Response Prompt + The status of the tool search output. -- `type BetaResponsePrompt struct{…}` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `ID string` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - The unique identifier of the prompt template to use. +### Beta Response Usage - - `Variables map[string, BetaResponsePromptVariableUnion]` +- `type BetaResponseUsage struct{…}` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - - `string` + - `InputTokens int64` - - `type BetaResponseInputText struct{…}` + The number of input tokens. - A text input to the model. + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - - `Text string` + A detailed breakdown of the input tokens. - The text input to the model. + - `CacheWriteTokens int64` - - `Type InputText` + The number of input tokens that were written to the cache. - The type of the input item. Always `input_text`. + - `CachedTokens int64` - - `const InputTextInputText InputText = "input_text"` + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `OutputTokens int64` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The number of output tokens. - - `Mode Explicit` + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - The breakpoint mode. Always `explicit`. + A detailed breakdown of the output tokens. - - `const ExplicitExplicit Explicit = "explicit"` + - `ReasoningTokens int64` - - `type BetaResponseInputImage struct{…}` + The number of reasoning tokens. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `TotalTokens int64` - - `Detail BetaResponseInputImageDetail` + The total number of tokens used. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. +### Beta Response Web Search Call Completed Event - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` +- `type BetaResponseWebSearchCallCompletedEvent struct{…}` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + Emitted when a web search call is completed. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `ItemID string` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + Unique ID for the output item associated with the web search call. - - `Type InputImage` + - `OutputIndex int64` - The type of the input item. Always `input_image`. + The index of the output item that the web search call is associated with. - - `const InputImageInputImage InputImage = "input_image"` + - `SequenceNumber int64` - - `FileID string` + The sequence number of the web search call being processed. - The ID of the file to be sent to the model. + - `Type ResponseWebSearchCallCompleted` - - `ImageURL string` + The type of the event. Always `response.web_search_call.completed`. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `Agent BetaResponseWebSearchCallCompletedEventAgent` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The agent that owns this multi-agent streaming event. - - `Mode Explicit` + - `AgentName string` - The breakpoint mode. Always `explicit`. + The canonical name of the agent that produced this item. - - `const ExplicitExplicit Explicit = "explicit"` +### Beta Response Web Search Call In Progress Event - - `type BetaResponseInputFile struct{…}` +- `type BetaResponseWebSearchCallInProgressEvent struct{…}` - A file input to the model. + Emitted when a web search call is initiated. - - `Type InputFile` + - `ItemID string` - The type of the input item. Always `input_file`. + Unique ID for the output item associated with the web search call. - - `const InputFileInputFile InputFile = "input_file"` + - `OutputIndex int64` - - `Detail BetaResponseInputFileDetail` + The index of the output item that the web search call is associated with. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `SequenceNumber int64` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + The sequence number of the web search call being processed. - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `Type ResponseWebSearchCallInProgress` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + The type of the event. Always `response.web_search_call.in_progress`. - - `FileData string` + - `const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"` - The content of the file to be sent to the model. + - `Agent BetaResponseWebSearchCallInProgressEventAgent` - - `FileID string` + The agent that owns this multi-agent streaming event. - The ID of the file to be sent to the model. + - `AgentName string` - - `FileURL string` + The canonical name of the agent that produced this item. - The URL of the file to be sent to the model. +### Beta Response Web Search Call Searching Event - - `Filename string` +- `type BetaResponseWebSearchCallSearchingEvent struct{…}` - The name of the file to be sent to the model. + Emitted when a web search call is executing. - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `ItemID string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Unique ID for the output item associated with the web search call. - - `Mode Explicit` + - `OutputIndex int64` - The breakpoint mode. Always `explicit`. + The index of the output item that the web search call is associated with. - - `const ExplicitExplicit Explicit = "explicit"` + - `SequenceNumber int64` - - `Version string` + The sequence number of the web search call being processed. - Optional version of the prompt template. + - `Type ResponseWebSearchCallSearching` -### Beta Response Queued Event + The type of the event. Always `response.web_search_call.searching`. -- `type BetaResponseQueuedEvent struct{…}` + - `const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"` - Emitted when a response is queued and waiting to be processed. + - `Agent BetaResponseWebSearchCallSearchingEventAgent` - - `Response BetaResponse` + The agent that owns this multi-agent streaming event. - The full response object that is queued. + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - Unique identifier for this Response. +### Beta Responses Client Event - - `CreatedAt float64` +- `type BetaResponsesClientEventUnion interface{…}` - Unix timestamp (in seconds) of when this Response was created. + Client events accepted by the Responses WebSocket server. - - `Error BetaResponseError` + - `BetaResponsesClientEventResponseCreate` - An error object returned when the model fails to generate a Response. + - `Type ResponseCreate` - - `Code BetaResponseErrorCode` + The type of the client event. Always `response.create`. - The error code for the response. + - `const ResponseCreateResponseCreate ResponseCreate = "response.create"` - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + - `Background bool` - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + - `ContextManagement []BetaResponsesClientEventResponseCreateContextManagement` - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + Context management configuration for this request. - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `Type string` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + The context management entry type. Currently only 'compaction' is supported. - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + - `CompactThreshold int64` - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + Token threshold at which compaction should be triggered for this entry. - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + - `Conversation BetaResponsesClientEventResponseCreateConversationUnion` - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. + Input items and output items from this response are automatically added to this conversation after this response completes. - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + - `string` - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + - `type BetaResponseConversationParamResp struct{…}` - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + The conversation that this response belongs to. - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + - `ID string` - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + The unique ID of the conversation. - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + - `Include []BetaResponseIncludable` - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + Specify additional output data to include in the model response. Currently supported values are: - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `web_search_call.action.sources`: Include the sources of the web search tool call. + - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. + - `computer_call_output.output.image_url`: Include image urls from the computer call output. + - `file_search_call.results`: Include the search results of the file search tool call. + - `message.input_image.image_url`: Include image urls from the input message. + - `message.output_text.logprobs`: Include logprobs with assistant messages. + - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` - - `Message string` + - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` - A human-readable description of the error. + - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` - - `IncompleteDetails BetaResponseIncompleteDetails` + - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` - Details about why the response is incomplete. + - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` - - `Reason string` + - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` - The reason why the response is incomplete. + - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + - `Input BetaResponsesClientEventResponseCreateInputUnion` - - `Instructions BetaResponseInstructionsUnion` + Text, image, or file inputs to the model, used to generate a response. - A system (or developer) message inserted into the model's context. + Learn more: - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Image inputs](https://platform.openai.com/docs/guides/images) + - [File inputs](https://platform.openai.com/docs/guides/pdf-files) + - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) + - [Function calling](https://platform.openai.com/docs/guides/function-calling) - `string` - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + - `type BetaResponseInput []BetaResponseInputItemUnion` A list of one or many input items to the model, containing different content types. @@ -117098,6 +128865,8 @@ func main() { - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` + - `Type BetaEasyInputMessageType` The type of the message input. Always `message`. @@ -117345,6 +129114,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -118525,7 +130296,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -118582,7 +130357,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -120368,1376 +132147,2137 @@ func main() { - `Name string` - The name of the tool to run. + 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"` + + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + + A response to an MCP approval request. + + - `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"` + + - `ID string` + + The unique ID of the approval response + + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Reason string` + + Optional reason for the decision. + + - `type BetaResponseInputItemMcpCall 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"` + + - `Agent BetaResponseInputItemMcpCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `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 BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + + - `type BetaResponseCustomToolCallOutput struct{…}` + + The output of a custom tool call from your code, being sent back to the model. + + - `CallID string` + + The call ID, used to map this custom tool call output to a custom tool call. + + - `Output BetaResponseCustomToolCallOutputOutputUnion` + + The output from the custom tool call generated by your code. + Can be a string or an list of output content. + + - `string` + + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + + Text, image, or file output of the custom tool call. + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Type CustomToolCallOutput` + + The type of the custom tool call output. Always `custom_tool_call_output`. + + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + + - `ID string` + + The unique ID of the custom tool call output in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseCustomToolCallOutputCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. + + - `CallID string` + + An identifier used to map this custom tool call to a tool call output. + + - `Input string` + + The input for the custom tool call generated by the model. + + - `Name string` + + The name of the custom tool being called. + + - `Type CustomToolCall` + + The type of the custom tool call. Always `custom_tool_call`. + + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + + - `ID string` + + The unique ID of the custom tool call in the OpenAI platform. + + - `Agent BetaResponseCustomToolCallAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Caller BetaResponseCustomToolCallCallerUnion` + + The execution context that produced this tool call. + + - `type BetaResponseCustomToolCallCallerDirect struct{…}` + + - `Type Direct` + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + - `const ProgramProgram Program = "program"` + + - `Namespace string` + + The namespace of the custom tool being called. + + - `type BetaResponseInputItemCompactionTrigger struct{…}` + + Compacts the current context. Must be the final input item. + + - `Type CompactionTrigger` + + The type of the item. Always `compaction_trigger`. + + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + + - `Agent BetaResponseInputItemCompactionTriggerAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemItemReference struct{…}` + + An internal identifier for an item to reference. + + - `ID string` + + The ID of the item to reference. + + - `Agent BetaResponseInputItemItemReferenceAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Type string` + + The type of item to reference. Always `item_reference`. + + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + + - `type BetaResponseInputItemProgram struct{…}` + + - `ID string` + + The unique ID of this program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The item type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseInputItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of this program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output. + + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The item type. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseInputItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Instructions string` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + + - `MaxOutputTokens int64` + + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + + - `MaxToolCalls int64` + + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + + - `Metadata map[string, string]` + + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + + - `Model BetaResponsesClientEventResponseCreateModel` + + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + + - `BetaResponsesClientEventResponseCreateModel` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_6Sol BetaResponsesClientEventResponseCreateModel = "gpt-5.6-sol"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_6Terra BetaResponsesClientEventResponseCreateModel = "gpt-5.6-terra"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_6Luna BetaResponsesClientEventResponseCreateModel = "gpt-5.6-luna"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_4 BetaResponsesClientEventResponseCreateModel = "gpt-5.4"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_4Mini BetaResponsesClientEventResponseCreateModel = "gpt-5.4-mini"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_4Nano BetaResponsesClientEventResponseCreateModel = "gpt-5.4-nano"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_4Mini2026_03_17 BetaResponsesClientEventResponseCreateModel = "gpt-5.4-mini-2026-03-17"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_4Nano2026_03_17 BetaResponsesClientEventResponseCreateModel = "gpt-5.4-nano-2026-03-17"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_3ChatLatest BetaResponsesClientEventResponseCreateModel = "gpt-5.3-chat-latest"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_2 BetaResponsesClientEventResponseCreateModel = "gpt-5.2"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_2_2025_12_11 BetaResponsesClientEventResponseCreateModel = "gpt-5.2-2025-12-11"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_2ChatLatest BetaResponsesClientEventResponseCreateModel = "gpt-5.2-chat-latest"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_2Pro BetaResponsesClientEventResponseCreateModel = "gpt-5.2-pro"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_2Pro2025_12_11 BetaResponsesClientEventResponseCreateModel = "gpt-5.2-pro-2025-12-11"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_1 BetaResponsesClientEventResponseCreateModel = "gpt-5.1"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_1_2025_11_13 BetaResponsesClientEventResponseCreateModel = "gpt-5.1-2025-11-13"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_1Codex BetaResponsesClientEventResponseCreateModel = "gpt-5.1-codex"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_1Mini BetaResponsesClientEventResponseCreateModel = "gpt-5.1-mini"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_1ChatLatest BetaResponsesClientEventResponseCreateModel = "gpt-5.1-chat-latest"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5 BetaResponsesClientEventResponseCreateModel = "gpt-5"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5Mini BetaResponsesClientEventResponseCreateModel = "gpt-5-mini"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5Nano BetaResponsesClientEventResponseCreateModel = "gpt-5-nano"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_2025_08_07 BetaResponsesClientEventResponseCreateModel = "gpt-5-2025-08-07"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5Mini2025_08_07 BetaResponsesClientEventResponseCreateModel = "gpt-5-mini-2025-08-07"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5Nano2025_08_07 BetaResponsesClientEventResponseCreateModel = "gpt-5-nano-2025-08-07"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5ChatLatest BetaResponsesClientEventResponseCreateModel = "gpt-5-chat-latest"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_1 BetaResponsesClientEventResponseCreateModel = "gpt-4.1"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_1Mini BetaResponsesClientEventResponseCreateModel = "gpt-4.1-mini"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_1Nano BetaResponsesClientEventResponseCreateModel = "gpt-4.1-nano"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_1_2025_04_14 BetaResponsesClientEventResponseCreateModel = "gpt-4.1-2025-04-14"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_1Mini2025_04_14 BetaResponsesClientEventResponseCreateModel = "gpt-4.1-mini-2025-04-14"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_1Nano2025_04_14 BetaResponsesClientEventResponseCreateModel = "gpt-4.1-nano-2025-04-14"` + + - `const BetaResponsesClientEventResponseCreateModelO4Mini BetaResponsesClientEventResponseCreateModel = "o4-mini"` + + - `const BetaResponsesClientEventResponseCreateModelO4Mini2025_04_16 BetaResponsesClientEventResponseCreateModel = "o4-mini-2025-04-16"` + + - `const BetaResponsesClientEventResponseCreateModelO3 BetaResponsesClientEventResponseCreateModel = "o3"` + + - `const BetaResponsesClientEventResponseCreateModelO3_2025_04_16 BetaResponsesClientEventResponseCreateModel = "o3-2025-04-16"` + + - `const BetaResponsesClientEventResponseCreateModelO3Mini BetaResponsesClientEventResponseCreateModel = "o3-mini"` + + - `const BetaResponsesClientEventResponseCreateModelO3Mini2025_01_31 BetaResponsesClientEventResponseCreateModel = "o3-mini-2025-01-31"` + + - `const BetaResponsesClientEventResponseCreateModelO1 BetaResponsesClientEventResponseCreateModel = "o1"` + + - `const BetaResponsesClientEventResponseCreateModelO1_2024_12_17 BetaResponsesClientEventResponseCreateModel = "o1-2024-12-17"` + + - `const BetaResponsesClientEventResponseCreateModelO1Preview BetaResponsesClientEventResponseCreateModel = "o1-preview"` + + - `const BetaResponsesClientEventResponseCreateModelO1Preview2024_09_12 BetaResponsesClientEventResponseCreateModel = "o1-preview-2024-09-12"` + + - `const BetaResponsesClientEventResponseCreateModelO1Mini BetaResponsesClientEventResponseCreateModel = "o1-mini"` + + - `const BetaResponsesClientEventResponseCreateModelO1Mini2024_09_12 BetaResponsesClientEventResponseCreateModel = "o1-mini-2024-09-12"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4o BetaResponsesClientEventResponseCreateModel = "gpt-4o"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4o2024_11_20 BetaResponsesClientEventResponseCreateModel = "gpt-4o-2024-11-20"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4o2024_08_06 BetaResponsesClientEventResponseCreateModel = "gpt-4o-2024-08-06"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4o2024_05_13 BetaResponsesClientEventResponseCreateModel = "gpt-4o-2024-05-13"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oAudioPreview BetaResponsesClientEventResponseCreateModel = "gpt-4o-audio-preview"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oAudioPreview2024_10_01 BetaResponsesClientEventResponseCreateModel = "gpt-4o-audio-preview-2024-10-01"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oAudioPreview2024_12_17 BetaResponsesClientEventResponseCreateModel = "gpt-4o-audio-preview-2024-12-17"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oAudioPreview2025_06_03 BetaResponsesClientEventResponseCreateModel = "gpt-4o-audio-preview-2025-06-03"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oMiniAudioPreview BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-audio-preview"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oMiniAudioPreview2024_12_17 BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-audio-preview-2024-12-17"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oSearchPreview BetaResponsesClientEventResponseCreateModel = "gpt-4o-search-preview"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oMiniSearchPreview BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-search-preview"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oSearchPreview2025_03_11 BetaResponsesClientEventResponseCreateModel = "gpt-4o-search-preview-2025-03-11"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oMiniSearchPreview2025_03_11 BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-search-preview-2025-03-11"` + + - `const BetaResponsesClientEventResponseCreateModelChatgpt4oLatest BetaResponsesClientEventResponseCreateModel = "chatgpt-4o-latest"` + + - `const BetaResponsesClientEventResponseCreateModelCodexMiniLatest BetaResponsesClientEventResponseCreateModel = "codex-mini-latest"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oMini BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4oMini2024_07_18 BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-2024-07-18"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4Turbo BetaResponsesClientEventResponseCreateModel = "gpt-4-turbo"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4Turbo2024_04_09 BetaResponsesClientEventResponseCreateModel = "gpt-4-turbo-2024-04-09"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_0125Preview BetaResponsesClientEventResponseCreateModel = "gpt-4-0125-preview"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4TurboPreview BetaResponsesClientEventResponseCreateModel = "gpt-4-turbo-preview"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_1106Preview BetaResponsesClientEventResponseCreateModel = "gpt-4-1106-preview"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4VisionPreview BetaResponsesClientEventResponseCreateModel = "gpt-4-vision-preview"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4 BetaResponsesClientEventResponseCreateModel = "gpt-4"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_0314 BetaResponsesClientEventResponseCreateModel = "gpt-4-0314"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_0613 BetaResponsesClientEventResponseCreateModel = "gpt-4-0613"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_32k BetaResponsesClientEventResponseCreateModel = "gpt-4-32k"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_32k0314 BetaResponsesClientEventResponseCreateModel = "gpt-4-32k-0314"` + + - `const BetaResponsesClientEventResponseCreateModelGPT4_32k0613 BetaResponsesClientEventResponseCreateModel = "gpt-4-32k-0613"` + + - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo"` + + - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo16k BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-16k"` + + - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo0301 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-0301"` + + - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo0613 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-0613"` + + - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo1106 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-1106"` + + - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo0125 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-0125"` + + - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo16k0613 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-16k-0613"` + + - `const BetaResponsesClientEventResponseCreateModelO1Pro BetaResponsesClientEventResponseCreateModel = "o1-pro"` + + - `const BetaResponsesClientEventResponseCreateModelO1Pro2025_03_19 BetaResponsesClientEventResponseCreateModel = "o1-pro-2025-03-19"` + + - `const BetaResponsesClientEventResponseCreateModelO3Pro BetaResponsesClientEventResponseCreateModel = "o3-pro"` + + - `const BetaResponsesClientEventResponseCreateModelO3Pro2025_06_10 BetaResponsesClientEventResponseCreateModel = "o3-pro-2025-06-10"` + + - `const BetaResponsesClientEventResponseCreateModelO3DeepResearch BetaResponsesClientEventResponseCreateModel = "o3-deep-research"` + + - `const BetaResponsesClientEventResponseCreateModelO3DeepResearch2025_06_26 BetaResponsesClientEventResponseCreateModel = "o3-deep-research-2025-06-26"` + + - `const BetaResponsesClientEventResponseCreateModelO4MiniDeepResearch BetaResponsesClientEventResponseCreateModel = "o4-mini-deep-research"` + + - `const BetaResponsesClientEventResponseCreateModelO4MiniDeepResearch2025_06_26 BetaResponsesClientEventResponseCreateModel = "o4-mini-deep-research-2025-06-26"` + + - `const BetaResponsesClientEventResponseCreateModelComputerUsePreview BetaResponsesClientEventResponseCreateModel = "computer-use-preview"` + + - `const BetaResponsesClientEventResponseCreateModelComputerUsePreview2025_03_11 BetaResponsesClientEventResponseCreateModel = "computer-use-preview-2025-03-11"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5Codex BetaResponsesClientEventResponseCreateModel = "gpt-5-codex"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5Pro BetaResponsesClientEventResponseCreateModel = "gpt-5-pro"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5Pro2025_10_06 BetaResponsesClientEventResponseCreateModel = "gpt-5-pro-2025-10-06"` + + - `const BetaResponsesClientEventResponseCreateModelGPT5_1CodexMax BetaResponsesClientEventResponseCreateModel = "gpt-5.1-codex-max"` + + - `string` + + - `Moderation BetaResponsesClientEventResponseCreateModeration` + + Configuration for running moderation on the input and output of this response. + + - `Model string` + + The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'. + + - `Policy BetaResponsesClientEventResponseCreateModerationPolicy` + + The policy to apply to moderated response input and output. + + - `Input BetaResponsesClientEventResponseCreateModerationPolicyInput` + + The moderation policy for the response input. + + - `Mode string` + + - `const BetaResponsesClientEventResponseCreateModerationPolicyInputModeScore BetaResponsesClientEventResponseCreateModerationPolicyInputMode = "score"` + + - `const BetaResponsesClientEventResponseCreateModerationPolicyInputModeBlock BetaResponsesClientEventResponseCreateModerationPolicyInputMode = "block"` + + - `Output BetaResponsesClientEventResponseCreateModerationPolicyOutput` + + The moderation policy for the response output. + + - `Mode string` + + - `const BetaResponsesClientEventResponseCreateModerationPolicyOutputModeScore BetaResponsesClientEventResponseCreateModerationPolicyOutputMode = "score"` + + - `const BetaResponsesClientEventResponseCreateModerationPolicyOutputModeBlock BetaResponsesClientEventResponseCreateModerationPolicyOutputMode = "block"` + + - `MultiAgent BetaResponsesClientEventResponseCreateMultiAgent` + + Configuration for server-hosted multi-agent execution. + + - `Enabled bool` + + Whether to enable server-hosted multi-agent execution for this response. + + - `MaxConcurrentSubagents int64` + + `max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent. + The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run. + + - `ParallelToolCalls bool` + + Whether to allow the model to run tool calls in parallel. + + - `PreviousResponseID string` + + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + + - `Prompt BetaResponsePrompt` + + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + + - `ID string` + + The unique identifier of the prompt template to use. + + - `Variables map[string, BetaResponsePromptVariableUnion]` + + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. + + - `string` + + - `type BetaResponseInputText struct{…}` + + A text input to the model. + + - `type BetaResponseInputImage struct{…}` + + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + + - `type BetaResponseInputFile struct{…}` + + A file input to the model. + + - `Version string` + + Optional version of the prompt template. + + - `PromptCacheKey string` + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + + - `PromptCacheOptions BetaResponsesClientEventResponseCreatePromptCacheOptions` + + Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details. + + - `Mode string` - - `ServerLabel string` + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. - The label of the MCP server making the request. + - `const BetaResponsesClientEventResponseCreatePromptCacheOptionsModeImplicit BetaResponsesClientEventResponseCreatePromptCacheOptionsMode = "implicit"` - - `Type McpApprovalRequest` + - `const BetaResponsesClientEventResponseCreatePromptCacheOptionsModeExplicit BetaResponsesClientEventResponseCreatePromptCacheOptionsMode = "explicit"` - The type of the item. Always `mcp_approval_request`. + - `Ttl string` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `const BetaResponsesClientEventResponseCreatePromptCacheOptionsTtl30m BetaResponsesClientEventResponseCreatePromptCacheOptionsTtl = "30m"` - The agent that produced this item. + - `PromptCacheRetention string` - - `AgentName string` + Deprecated. Use `prompt_cache_options.ttl` instead. - The canonical name of the agent that produced this item. + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - A response to an MCP approval request. + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - `ApprovalRequestID string` + - `const BetaResponsesClientEventResponseCreatePromptCacheRetentionInMemory BetaResponsesClientEventResponseCreatePromptCacheRetention = "in_memory"` - The ID of the approval request being answered. + - `const BetaResponsesClientEventResponseCreatePromptCacheRetention24h BetaResponsesClientEventResponseCreatePromptCacheRetention = "24h"` - - `Approve bool` + - `Reasoning BetaResponsesClientEventResponseCreateReasoning` - Whether the request was approved. + **gpt-5 and o-series models only** - - `Type McpApprovalResponse` + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - The type of the item. Always `mcp_approval_response`. + - `Context string` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - - `ID string` + - `const BetaResponsesClientEventResponseCreateReasoningContextAuto BetaResponsesClientEventResponseCreateReasoningContext = "auto"` - The unique ID of the approval response + - `const BetaResponsesClientEventResponseCreateReasoningContextCurrentTurn BetaResponsesClientEventResponseCreateReasoningContext = "current_turn"` - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `const BetaResponsesClientEventResponseCreateReasoningContextAllTurns BetaResponsesClientEventResponseCreateReasoningContext = "all_turns"` - The agent that produced this item. + - `Effort string` - - `AgentName string` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - The canonical name of the agent that produced this item. + - `const BetaResponsesClientEventResponseCreateReasoningEffortNone BetaResponsesClientEventResponseCreateReasoningEffort = "none"` - - `Reason string` + - `const BetaResponsesClientEventResponseCreateReasoningEffortMinimal BetaResponsesClientEventResponseCreateReasoningEffort = "minimal"` - Optional reason for the decision. + - `const BetaResponsesClientEventResponseCreateReasoningEffortLow BetaResponsesClientEventResponseCreateReasoningEffort = "low"` - - `type BetaResponseInputItemMcpCall struct{…}` + - `const BetaResponsesClientEventResponseCreateReasoningEffortMedium BetaResponsesClientEventResponseCreateReasoningEffort = "medium"` - An invocation of a tool on an MCP server. + - `const BetaResponsesClientEventResponseCreateReasoningEffortHigh BetaResponsesClientEventResponseCreateReasoningEffort = "high"` - - `ID string` + - `const BetaResponsesClientEventResponseCreateReasoningEffortXhigh BetaResponsesClientEventResponseCreateReasoningEffort = "xhigh"` - The unique ID of the tool call. + - `const BetaResponsesClientEventResponseCreateReasoningEffortMax BetaResponsesClientEventResponseCreateReasoningEffort = "max"` - - `Arguments string` + - `GenerateSummary string` - A JSON string of the arguments passed to the tool. + **Deprecated:** use `summary` instead. - - `Name string` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - The name of the tool that was run. + - `const BetaResponsesClientEventResponseCreateReasoningGenerateSummaryAuto BetaResponsesClientEventResponseCreateReasoningGenerateSummary = "auto"` - - `ServerLabel string` + - `const BetaResponsesClientEventResponseCreateReasoningGenerateSummaryConcise BetaResponsesClientEventResponseCreateReasoningGenerateSummary = "concise"` - The label of the MCP server running the tool. + - `const BetaResponsesClientEventResponseCreateReasoningGenerateSummaryDetailed BetaResponsesClientEventResponseCreateReasoningGenerateSummary = "detailed"` - - `Type McpCall` + - `Mode string` - The type of the item. Always `mcp_call`. + Controls the reasoning execution mode for the request. - - `const McpCallMcpCall McpCall = "mcp_call"` + When returned on a response, this is the effective execution mode. - - `Agent BetaResponseInputItemMcpCallAgent` + - `string` - The agent that produced this item. + - `string` - - `AgentName string` + - `const BetaResponsesClientEventResponseCreateReasoningModeStandard BetaResponsesClientEventResponseCreateReasoningMode = "standard"` - The canonical name of the agent that produced this item. + - `const BetaResponsesClientEventResponseCreateReasoningModePro BetaResponsesClientEventResponseCreateReasoningMode = "pro"` - - `ApprovalRequestID string` + - `Summary 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. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `Error string` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - The error from the tool call, if any. + - `const BetaResponsesClientEventResponseCreateReasoningSummaryAuto BetaResponsesClientEventResponseCreateReasoningSummary = "auto"` - - `Output string` + - `const BetaResponsesClientEventResponseCreateReasoningSummaryConcise BetaResponsesClientEventResponseCreateReasoningSummary = "concise"` - The output from the tool call. + - `const BetaResponsesClientEventResponseCreateReasoningSummaryDetailed BetaResponsesClientEventResponseCreateReasoningSummary = "detailed"` - - `Status string` + - `SafetyIdentifier string` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + - `ServiceTier string` - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + Specifies the processing type used for serving the request. - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + - `const BetaResponsesClientEventResponseCreateServiceTierAuto BetaResponsesClientEventResponseCreateServiceTier = "auto"` - - `type BetaResponseCustomToolCallOutput struct{…}` + - `const BetaResponsesClientEventResponseCreateServiceTierDefault BetaResponsesClientEventResponseCreateServiceTier = "default"` - The output of a custom tool call from your code, being sent back to the model. + - `const BetaResponsesClientEventResponseCreateServiceTierFlex BetaResponsesClientEventResponseCreateServiceTier = "flex"` - - `CallID string` + - `const BetaResponsesClientEventResponseCreateServiceTierScale BetaResponsesClientEventResponseCreateServiceTier = "scale"` - The call ID, used to map this custom tool call output to a custom tool call. + - `const BetaResponsesClientEventResponseCreateServiceTierPriority BetaResponsesClientEventResponseCreateServiceTier = "priority"` - - `Output BetaResponseCustomToolCallOutputOutputUnion` + - `Store bool` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + Whether to store the generated model response for later retrieval via + API. - - `string` + - `Stream bool` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + If set to true, the model response data will be streamed to the client + as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) + for more information. - Text, image, or file output of the custom tool call. + - `StreamOptions BetaResponsesClientEventResponseCreateStreamOptions` - - `type BetaResponseInputText struct{…}` + Options for streaming responses. Only set this when you set `stream: true`. - A text input to the model. + - `IncludeObfuscation bool` - - `type BetaResponseInputImage struct{…}` + When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events to + normalize payload sizes as a mitigation to certain side-channel attacks. + These obfuscation fields are included by default, but add a small amount + of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between + your application and the OpenAI API. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Temperature float64` - - `type BetaResponseInputFile struct{…}` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - A file input to the model. + - `Text BetaResponseTextConfig` - - `Type CustomToolCallOutput` + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - The type of the custom tool call output. Always `custom_tool_call_output`. + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `Format BetaResponseFormatTextConfigUnion` - - `ID string` + An object specifying the format that the model must output. - The unique ID of the custom tool call output in the OpenAI platform. + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Agent BetaResponseCustomToolCallOutputAgent` + The default format is `{ "type": "text" }` with no additional options. - The agent that produced this item. + **Not recommended for gpt-4o and newer models:** - - `AgentName string` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - The canonical name of the agent that produced this item. + - `type BetaResponseFormatTextConfigText struct{…}` - - `Caller BetaResponseCustomToolCallOutputCallerUnion` + Default response format. Used to generate text responses. - The execution context that produced this tool call. + - `Type Text` - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + The type of response format being defined. Always `text`. - - `Type Direct` + - `const TextText Text = "text"` - The caller type. Always `direct`. + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - - `const DirectDirect Direct = "direct"` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `Name string` - - `CallerID string` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The call ID of the program item that produced this tool call. + - `Schema map[string, any]` - - `Type Program` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - The caller type. Always `program`. + - `Type JSONSchema` - - `const ProgramProgram Program = "program"` + The type of response format being defined. Always `json_schema`. - - `type BetaResponseCustomToolCall struct{…}` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - A call to a custom tool created by the model. + - `Description string` - - `CallID string` + A description of what the response format is for, used by the model to + determine how to respond in the format. - An identifier used to map this custom tool call to a tool call output. + - `Strict bool` - - `Input string` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The input for the custom tool call generated by the model. + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - - `Name string` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - The name of the custom tool being called. + - `Type JSONObject` - - `Type CustomToolCall` + The type of response format being defined. Always `json_object`. - The type of the custom tool call. Always `custom_tool_call`. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `Verbosity BetaResponseTextConfigVerbosity` - - `ID string` + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - The unique ID of the custom tool call in the OpenAI platform. + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - - `Agent BetaResponseCustomToolCallAgent` + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - The agent that produced this item. + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - - `AgentName string` + - `ToolChoice BetaResponsesClientEventResponseCreateToolChoiceUnion` - The canonical name of the agent that produced this item. + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `type BetaToolChoiceOptions string` - The execution context that produced this tool call. + Controls which (if any) tool is called by the model. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + `none` means the model will not call any tool and instead generates a message. - - `Type Direct` + `auto` means the model can pick between generating a message or calling one or + more tools. - - `const DirectDirect Direct = "direct"` + `required` means the model must call one or more tools. - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - - `CallerID string` + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - The call ID of the program item that produced this tool call. + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - - `Type Program` + - `type BetaToolChoiceAllowed struct{…}` - - `const ProgramProgram Program = "program"` + Constrains the tools available to the model to a pre-defined set. - - `Namespace string` + - `Mode BetaToolChoiceAllowedMode` - The namespace of the custom tool being called. + Constrains the tools available to the model to a pre-defined set. - - `type BetaResponseInputItemCompactionTrigger struct{…}` + `auto` allows the model to pick from among the allowed tools and generate a + message. - Compacts the current context. Must be the final input item. + `required` requires the model to call one or more of the allowed tools. - - `Type CompactionTrigger` + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - The type of the item. Always `compaction_trigger`. + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `Tools []map[string, any]` - - `Agent BetaResponseInputItemCompactionTriggerAgent` + A list of tool definitions that the model should be allowed to call. - The agent that produced this item. + For the Responses API, the list of tool definitions might look like: - - `AgentName string` + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - The canonical name of the agent that produced this item. + - `Type AllowedTools` - - `type BetaResponseInputItemItemReference struct{…}` + Allowed tool configuration type. Always `allowed_tools`. - An internal identifier for an item to reference. + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `ID string` + - `type BetaToolChoiceTypes struct{…}` - The ID of the item to reference. + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - - `Agent BetaResponseInputItemItemReferenceAgent` + - `Type BetaToolChoiceTypesType` - The agent that produced this item. + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - - `AgentName string` + Allowed values are: - The canonical name of the agent that produced this item. + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - - `Type string` + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - The type of item to reference. Always `item_reference`. + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `type BetaResponseInputItemProgram struct{…}` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - - `ID string` + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - The unique ID of this program item. + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - - `CallID string` + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - The stable call ID of the program item. + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - - `Code string` + - `type BetaToolChoiceFunction struct{…}` - The JavaScript source executed by programmatic tool calling. + Use this option to force the model to call a specific function. - - `Fingerprint string` + - `Name string` - Opaque program replay fingerprint that must be round-tripped. + The name of the function to call. - - `Type Program` + - `Type Function` - The item type. Always `program`. + For function calling, the type is always `function`. - - `const ProgramProgram Program = "program"` + - `const FunctionFunction Function = "function"` - - `Agent BetaResponseInputItemProgramAgent` + - `type BetaToolChoiceMcp struct{…}` - The agent that produced this item. + Use this option to force the model to call a specific tool on a remote MCP server. - - `AgentName string` + - `ServerLabel string` - The canonical name of the agent that produced this item. + The label of the MCP server to use. - - `type BetaResponseInputItemProgramOutput struct{…}` + - `Type Mcp` - - `ID string` + For MCP tools, the type is always `mcp`. - The unique ID of this program output item. + - `const McpMcp Mcp = "mcp"` - - `CallID string` + - `Name string` - The call ID of the program item. + The name of the tool to call on the server. - - `Result string` + - `type BetaToolChoiceCustom struct{…}` - The result produced by the program item. + Use this option to force the model to call a specific custom tool. - - `Status string` + - `Name string` - The terminal status of the program output. + The name of the custom tool to call. - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `Type Custom` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + For custom tool calling, the type is always `custom`. - - `Type ProgramOutput` + - `const CustomCustom Custom = "custom"` - The item type. Always `program_output`. + - `BetaResponsesClientEventResponseCreateToolChoiceBetaSpecificProgrammaticToolCallingParam` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `Type ProgrammaticToolCalling` - - `Agent BetaResponseInputItemProgramOutputAgent` + The tool to call. Always `programmatic_tool_calling`. - The agent that produced this item. + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `AgentName string` + - `type BetaToolChoiceApplyPatch struct{…}` - The canonical name of the agent that produced this item. + Forces the model to call the apply_patch tool when executing a tool call. - - `Metadata map[string, string]` + - `Type ApplyPatch` - 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. + The tool to call. Always `apply_patch`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `Model BetaResponseModel` + - `type BetaToolChoiceShell struct{…}` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + Forces the model to call the shell tool when a tool call is required. - - `type BetaResponseModel string` + - `Type Shell` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + The tool to call. Always `shell`. - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + - `const ShellShell Shell = "shell"` - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + - `Tools []BetaToolUnion` - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + We support the following categories of tools: - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + - `type BetaFunctionTool struct{…}` - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + - `type BetaFileSearchTool struct{…}` - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + - `type BetaComputerTool struct{…}` - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + - `type BetaWebSearchTool struct{…}` - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + - `type BetaToolMcp struct{…}` - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + - `type BetaToolCodeInterpreter struct{…}` - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + A tool that runs Python code to help generate a response to a prompt. - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + - `type BetaToolImageGeneration struct{…}` - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + A tool that generates images using the GPT image models. - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + - `type BetaToolLocalShell struct{…}` - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + A tool that allows the model to execute shell commands in a local environment. - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + - `type BetaFunctionShellTool struct{…}` - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + A tool that allows the model to execute shell commands. - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + - `type BetaCustomTool struct{…}` - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + - `type BetaNamespaceTool struct{…}` - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + Groups function/custom tools under a shared namespace. - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + - `type BetaToolSearchTool struct{…}` - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + Hosted or BYOT tool search configuration for deferred tools. - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + - `type BetaWebSearchPreviewTool struct{…}` - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + - `type BetaApplyPatchTool struct{…}` - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + Allows the assistant to create, delete, or update files using unified diffs. - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + - `TopLogprobs int64` - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - - `const BetaResponseModelO1 BetaResponseModel = "o1"` + - `TopP float64` - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + We generally recommend altering this or `temperature` but not both. - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + - `Truncation string` - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + The truncation strategy to use for the model response. - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + - `const BetaResponsesClientEventResponseCreateTruncationAuto BetaResponsesClientEventResponseCreateTruncation = "auto"` - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + - `const BetaResponsesClientEventResponseCreateTruncationDisabled BetaResponsesClientEventResponseCreateTruncation = "disabled"` - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + - `User string` - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + - `type BetaResponseInjectEvent struct{…}` - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + Injects input items into an active response over a WebSocket connection. + The items are validated and committed atomically. Currently, the server + accepts client-owned tool outputs that resume a waiting agent. - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + - `Input []BetaResponseInputItemUnion` - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + Input items to inject into the active response. - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + - `type BetaEasyInputMessage struct{…}` - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + - `type BetaResponseInputItemMessage struct{…}` - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + - `type BetaResponseOutputMessage struct{…}` - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + An output message from the model. - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + - `type BetaResponseFileSearchToolCall struct{…}` - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + - `type BetaResponseComputerToolCall struct{…}` - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + - `type BetaResponseInputItemComputerCallOutput struct{…}` - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + The output of a computer tool call. - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + - `type BetaResponseFunctionWebSearch struct{…}` - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + - `type BetaResponseFunctionToolCall struct{…}` - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + The output of a function tool call. - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + - `type BetaResponseInputItemAgentMessage struct{…}` - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + A message routed between agents. - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + - `type BetaResponseInputItemToolSearchCall struct{…}` - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + - `type BetaResponseReasoningItem struct{…}` - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + 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](https://platform.openai.com/docs/guides/conversation-state). - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + - `type BetaResponseCompactionItemParamResp struct{…}` - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + An image generation request made by the model. - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + A tool call to run code. - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + - `type BetaResponseInputItemLocalShellCall struct{…}` - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + A tool call to run a command on the local shell. - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + The output of a local shell tool call. - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + - `type BetaResponseInputItemShellCall struct{…}` - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + A tool representing a request to execute one or more shell commands. - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + The streamed output items emitted by a shell tool call. - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + - `type BetaResponseInputItemApplyPatchCall struct{…}` - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + A tool call representing a request to create, delete, or update files using diff patches. - - `string` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - - `Object Response` + The streamed output emitted by an apply patch tool call. - The object type of this resource - always set to `response`. + - `type BetaResponseInputItemMcpListTools struct{…}` - - `const ResponseResponse Response = "response"` + A list of tools available on an MCP server. - - `Output []BetaResponseOutputItemUnion` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - An array of content items generated by the model. + A request for human approval of a tool invocation. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - - `type BetaResponseOutputMessage struct{…}` + A response to an MCP approval request. - An output message from the model. + - `type BetaResponseInputItemMcpCall struct{…}` - - `type BetaResponseFileSearchToolCall struct{…}` + An invocation of a tool on an MCP server. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `type BetaResponseCustomToolCallOutput struct{…}` - - `type BetaResponseFunctionToolCall struct{…}` + The output of a custom tool call from your code, being sent back to the model. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `type BetaResponseCustomToolCall struct{…}` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + A call to a custom tool created by the model. - - `ID string` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - The unique ID of the function call tool output. + Compacts the current context. Must be the final input item. - - `CallID string` + - `type BetaResponseInputItemItemReference struct{…}` - The unique ID of the function tool call generated by the model. + An internal identifier for an item to reference. - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `type BetaResponseInputItemProgram struct{…}` - The output from the function call generated by your code. - Can be a string or an list of output content. + - `type BetaResponseInputItemProgramOutput struct{…}` - - `string` + - `ResponseID string` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + The ID of the active response that should receive the input. - Text, image, or file output of the function call. + - `Type ResponseInject` - - `type BetaResponseInputText struct{…}` + The event discriminator. Always `response.inject`. - A text input to the model. + - `const ResponseInjectResponseInject ResponseInject = "response.inject"` - - `type BetaResponseInputImage struct{…}` +### Beta Responses Server Event - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). +- `type BetaResponsesServerEventUnion interface{…}` - - `type BetaResponseInputFile struct{…}` + Server events emitted by the Responses WebSocket server. - A file input to the model. + - `type BetaResponseAudioDeltaEvent struct{…}` - - `Status BetaResponseFunctionToolCallOutputItemStatus` + Emitted when there is a partial audio response. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Delta string` - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + A chunk of Base64 encoded response audio bytes. - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + - `SequenceNumber int64` - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + A sequence number for this chunk of the stream response. - - `Type FunctionCallOutput` + - `Type ResponseAudioDelta` - The type of the function tool call output. Always `function_call_output`. + The type of the event. Always `response.audio.delta`. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `Agent BetaResponseAudioDeltaEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `type BetaResponseAudioDoneEvent struct{…}` - - `Type Direct` + Emitted when the audio response is complete. - The caller type. Always `direct`. + - `SequenceNumber int64` - - `const DirectDirect Direct = "direct"` + The sequence number of the delta. - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `Type ResponseAudioDone` - - `CallerID string` + The type of the event. Always `response.audio.done`. - The call ID of the program item that produced this tool call. + - `const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"` - - `Type Program` + - `Agent BetaResponseAudioDoneEventAgent` - The caller type. Always `program`. + The agent that owns this multi-agent streaming event. - - `const ProgramProgram Program = "program"` + - `AgentName string` - - `CreatedBy string` + The canonical name of the agent that produced this item. - The identifier of the actor that created the item. + - `type BetaResponseAudioTranscriptDeltaEvent struct{…}` - - `type BetaResponseOutputItemAgentMessage struct{…}` + Emitted when there is a partial transcript of audio. - - `ID string` + - `Delta string` - The unique ID of the agent message. + The partial transcript of the audio response. - - `Author string` + - `SequenceNumber int64` - The sending agent identity. + The sequence number of this event. - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + - `Type ResponseAudioTranscriptDelta` - Encrypted content sent between agents. + The type of the event. Always `response.audio.transcript.delta`. - - `type BetaResponseInputText struct{…}` + - `const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"` - A text input to the model. + - `Agent BetaResponseAudioTranscriptDeltaEventAgent` - - `type BetaResponseOutputText struct{…}` + The agent that owns this multi-agent streaming event. - A text output from the model. + - `AgentName string` - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + The canonical name of the agent that produced this item. - A text content. + - `type BetaResponseAudioTranscriptDoneEvent struct{…}` - - `Text string` + Emitted when the full audio transcript is completed. - - `Type Text` + - `SequenceNumber int64` - - `const TextText Text = "text"` + The sequence number of this event. - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + - `Type ResponseAudioTranscriptDone` - A summary text from the model. + The type of the event. Always `response.audio.transcript.done`. - - `Text string` + - `const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"` - A summary of the reasoning output from the model so far. + - `Agent BetaResponseAudioTranscriptDoneEventAgent` - - `Type SummaryText` + The agent that owns this multi-agent streaming event. - The type of the object. Always `summary_text`. + - `AgentName string` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + - `type BetaResponseCodeInterpreterCallCodeDeltaEvent struct{…}` - Reasoning text from the model. + Emitted when a partial code snippet is streamed by the code interpreter. - - `Text string` + - `Delta string` - The reasoning text from the model. + The partial code snippet being streamed by the code interpreter. - - `Type ReasoningText` + - `ItemID string` - The type of the reasoning text. Always `reasoning_text`. + The unique identifier of the code interpreter tool call item. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `OutputIndex int64` - - `type BetaResponseOutputRefusal struct{…}` + The index of the output item in the response for which the code is being streamed. - A refusal from the model. + - `SequenceNumber int64` - - `type BetaResponseInputImage struct{…}` + The sequence number of this event, used to order streaming events. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Type ResponseCodeInterpreterCallCodeDelta` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + The type of the event. Always `response.code_interpreter_call_code.delta`. - A screenshot of a computer. + - `const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"` - - `Detail string` + - `Agent BetaResponseCodeInterpreterCallCodeDeltaEventAgent` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The agent that owns this multi-agent streaming event. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + - `AgentName string` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + The canonical name of the agent that produced this item. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `type BetaResponseCodeInterpreterCallCodeDoneEvent struct{…}` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + Emitted when the code snippet is finalized by the code interpreter. - - `FileID string` + - `Code string` - The identifier of an uploaded file that contains the screenshot. + The final code snippet output by the code interpreter. - - `ImageURL string` + - `ItemID string` - The URL of the screenshot image. + The unique identifier of the code interpreter tool call item. - - `Type ComputerScreenshot` + - `OutputIndex int64` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + The index of the output item in the response for which the code is finalized. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `SequenceNumber int64` - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + The sequence number of this event, used to order streaming events. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Type ResponseCodeInterpreterCallCodeDone` - - `Mode Explicit` + The type of the event. Always `response.code_interpreter_call_code.done`. - The breakpoint mode. Always `explicit`. + - `const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"` - - `const ExplicitExplicit Explicit = "explicit"` + - `Agent BetaResponseCodeInterpreterCallCodeDoneEventAgent` - - `type BetaResponseInputFile struct{…}` + The agent that owns this multi-agent streaming event. - A file input to the model. + - `AgentName string` - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + The canonical name of the agent that produced this item. - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `type BetaResponseCodeInterpreterCallCompletedEvent struct{…}` - - `EncryptedContent string` + Emitted when the code interpreter call is completed. - Opaque encrypted content. + - `ItemID string` - - `Type EncryptedContent` + The unique identifier of the code interpreter tool call item. - The type of the input item. Always `encrypted_content`. + - `OutputIndex int64` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + The index of the output item in the response for which the code interpreter call is completed. - - `Recipient string` + - `SequenceNumber int64` - The destination agent identity. + The sequence number of this event, used to order streaming events. - - `Type AgentMessage` + - `Type ResponseCodeInterpreterCallCompleted` - The type of the item. Always `agent_message`. + The type of the event. Always `response.code_interpreter_call.completed`. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"` - - `Agent BetaResponseOutputItemAgentMessageAgent` + - `Agent BetaResponseCodeInterpreterCallCompletedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - - `ID string` - - The unique ID of the multi-agent call item. - - - `Action string` - - The multi-agent action to execute. + - `type BetaResponseCodeInterpreterCallInProgressEvent struct{…}` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + Emitted when a code interpreter call is in progress. - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + - `ItemID string` - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + The unique identifier of the code interpreter tool call item. - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + - `OutputIndex int64` - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + The index of the output item in the response for which the code interpreter call is in progress. - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + - `SequenceNumber int64` - - `Arguments string` + The sequence number of this event, used to order streaming events. - The JSON string of arguments generated for the action. + - `Type ResponseCodeInterpreterCallInProgress` - - `CallID string` + The type of the event. Always `response.code_interpreter_call.in_progress`. - The unique ID linking this call to its output. + - `const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"` - - `Type MultiAgentCall` + - `Agent BetaResponseCodeInterpreterCallInProgressEventAgent` - The type of the multi-agent call. Always `multi_agent_call`. + The agent that owns this multi-agent streaming event. - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `AgentName string` - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + The canonical name of the agent that produced this item. - The agent that produced this item. + - `type BetaResponseCodeInterpreterCallInterpretingEvent struct{…}` - - `AgentName string` + Emitted when the code interpreter is actively interpreting the code snippet. - The canonical name of the agent that produced this item. + - `ItemID string` - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + The unique identifier of the code interpreter tool call item. - - `ID string` + - `OutputIndex int64` - The unique ID of the multi-agent call output item. + The index of the output item in the response for which the code interpreter is interpreting code. - - `Action string` + - `SequenceNumber int64` - The multi-agent action that produced this result. + The sequence number of this event, used to order streaming events. - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + - `Type ResponseCodeInterpreterCallInterpreting` - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + The type of the event. Always `response.code_interpreter_call.interpreting`. - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + - `const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `Agent BetaResponseCodeInterpreterCallInterpretingEventAgent` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + - `AgentName string` - - `CallID string` + The canonical name of the agent that produced this item. - The unique ID of the multi-agent call. + - `type BetaResponseCompletedEvent struct{…}` - - `Output []BetaResponseOutputText` + Emitted when the model response is complete. - Text output returned by the multi-agent action. + - `Response BetaResponse` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + Properties of the completed response. - The annotations of the text output. + - `ID string` - - `Text string` + Unique identifier for this Response. - The text output from the model. + - `CreatedAt float64` - - `Type OutputText` + Unix timestamp (in seconds) of when this Response was created. - The type of the output text. Always `output_text`. + - `Error BetaResponseError` - - `Logprobs []BetaResponseOutputTextLogprob` + An error object returned when the model fails to generate a Response. - - `Type MultiAgentCallOutput` + - `Code BetaResponseErrorCode` - The type of the multi-agent result. Always `multi_agent_call_output`. + The error code for the response. - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` - The agent that produced this item. + - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` - - `AgentName string` + - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` - The canonical name of the agent that produced this item. + - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` - - `type BetaResponseFunctionWebSearch struct{…}` + - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` - - `type BetaResponseComputerToolCall struct{…}` + - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` - - `ID string` + - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` - The unique ID of the computer call tool output. + - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` - - `CallID string` + - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` - The ID of the computer tool call that produced the output. + - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` - A computer screenshot image used with the computer use tool. + - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + - `Message string` - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + A human-readable description of the error. - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `IncompleteDetails BetaResponseIncompleteDetails` - - `Type ComputerCallOutput` + Details about why the response is incomplete. - The type of the computer tool call output. Always `computer_call_output`. + - `Reason string` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + The reason why the response is incomplete. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` - The safety checks reported by the API that have been acknowledged by the - developer. + - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` - - `ID string` + - `Instructions BetaResponseInstructionsUnion` - The ID of the pending safety check. + A system (or developer) message inserted into the model's context. - - `Code string` + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. - The type of the pending safety check. + - `string` - - `Message string` + - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` - Details about the pending safety check. + A list of one or many input items to the model, containing + different content types. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `type BetaEasyInputMessage struct{…}` - The agent that produced this item. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `AgentName string` + - `Content BetaEasyInputMessageContentUnion` - The canonical name of the agent that produced this item. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - - `CreatedBy string` + - `string` - The identifier of the actor that created the item. + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - `type BetaResponseReasoningItem struct{…}` + A list of one or many input items to the model, containing different content + types. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `type BetaResponseInputText struct{…}` - - `type BetaResponseOutputItemProgram struct{…}` + A text input to the model. - - `ID string` + - `Text string` - The unique ID of the program item. + The text input to the model. - - `CallID string` + - `Type InputText` - The stable call ID of the program item. + The type of the input item. Always `input_text`. - - `Code string` + - `const InputTextInputText InputText = "input_text"` - The JavaScript source executed by programmatic tool calling. + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `Fingerprint string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Opaque program replay fingerprint that must be round-tripped. + - `Mode Explicit` - - `Type Program` + The breakpoint mode. Always `explicit`. - The type of the item. Always `program`. + - `const ExplicitExplicit Explicit = "explicit"` - - `const ProgramProgram Program = "program"` + - `type BetaResponseInputImage struct{…}` - - `Agent BetaResponseOutputItemProgramAgent` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The agent that produced this item. + - `Detail BetaResponseInputImageDetail` - - `AgentName string` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The canonical name of the agent that produced this item. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `ID string` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - The unique ID of the program output item. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `CallID string` + - `Type InputImage` - The call ID of the program item. + The type of the input item. Always `input_image`. - - `Result string` + - `const InputImageInputImage InputImage = "input_image"` - The result produced by the program item. + - `FileID string` - - `Status string` + The ID of the file to be sent to the model. - The terminal status of the program output item. + - `ImageURL string` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `Type ProgramOutput` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The type of the item. Always `program_output`. + - `Mode Explicit` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + The breakpoint mode. Always `explicit`. - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `const ExplicitExplicit Explicit = "explicit"` - The agent that produced this item. + - `type BetaResponseInputFile struct{…}` - - `AgentName string` + A file input to the model. - The canonical name of the agent that produced this item. + - `Type InputFile` - - `type BetaResponseToolSearchCall struct{…}` + The type of the input item. Always `input_file`. - - `ID string` + - `const InputFileInputFile InputFile = "input_file"` - The unique ID of the tool search call item. + - `Detail BetaResponseInputFileDetail` - - `Arguments any` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - Arguments used for the tool search call. + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - - `CallID string` + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - The unique ID of the tool search call generated by the model. + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - - `Execution BetaResponseToolSearchCallExecution` + - `FileData string` - Whether tool search was executed by the server or by the client. + The content of the file to be sent to the model. - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `FileID string` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + The ID of the file to be sent to the model. - - `Status BetaResponseToolSearchCallStatus` + - `FileURL string` - The status of the tool search call item that was recorded. + The URL of the file to be sent to the model. - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + - `Filename string` - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + The name of the file to be sent to the model. - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - - `Type ToolSearchCall` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The type of the item. Always `tool_search_call`. + - `Mode Explicit` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + The breakpoint mode. Always `explicit`. - - `Agent BetaResponseToolSearchCallAgent` + - `const ExplicitExplicit Explicit = "explicit"` - The agent that produced this item. + - `Role BetaEasyInputMessageRole` - - `AgentName string` + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - The canonical name of the agent that produced this item. + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - - `CreatedBy string` + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - The identifier of the actor that created the item. + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - - `type BetaResponseToolSearchOutputItem struct{…}` + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - - `ID string` + - `Phase BetaEasyInputMessagePhase` - The unique ID of the tool search output item. + 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. - - `CallID string` + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - The unique ID of the tool search call generated by the model. + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - - `Execution BetaResponseToolSearchOutputItemExecution` + - `Type BetaEasyInputMessageType` - Whether tool search was executed by the server or by the client. + The type of the message input. Always `message`. - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `type BetaResponseInputItemMessage struct{…}` - - `Status BetaResponseToolSearchOutputItemStatus` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - The status of the tool search output item that was recorded. + - `Content BetaResponseInputMessageContentList` - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + A list of one or many input items to the model, containing different content + types. - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `Role string` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + The role of the message input. One of `user`, `system`, or `developer`. - - `Tools []BetaToolUnion` + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` - The loaded tool definitions returned by tool search. + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` - - `type BetaFunctionTool struct{…}` + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Agent BetaResponseInputItemMessageAgent` - - `type BetaFileSearchTool struct{…}` + The agent that produced this item. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `AgentName string` - - `type BetaComputerTool struct{…}` + The canonical name of the agent that produced this item. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Status string` - - `type BetaComputerUsePreviewTool struct{…}` + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - - `type BetaWebSearchTool struct{…}` + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - - `type BetaToolMcp struct{…}` + - `Type string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The type of the message input. Always set to `message`. - - `type BetaToolCodeInterpreter struct{…}` + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - A tool that runs Python code to help generate a response to a prompt. + - `type BetaResponseOutputMessage struct{…}` - - `type BetaToolProgrammaticToolCalling struct{…}` + An output message from the model. - - `type BetaToolImageGeneration struct{…}` + - `ID string` - A tool that generates images using the GPT image models. + The unique ID of the output message. - - `type BetaToolLocalShell struct{…}` + - `Content []BetaResponseOutputMessageContentUnion` - A tool that allows the model to execute shell commands in a local environment. + The content of the output message. - - `type BetaFunctionShellTool struct{…}` + - `type BetaResponseOutputText struct{…}` - A tool that allows the model to execute shell commands. + A text output from the model. - - `type BetaCustomTool struct{…}` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The annotations of the text output. - - `type BetaNamespaceTool struct{…}` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - Groups function/custom tools under a shared namespace. + A citation to a file. - - `type BetaToolSearchTool struct{…}` + - `FileID string` - Hosted or BYOT tool search configuration for deferred tools. + The ID of the file. - - `type BetaWebSearchPreviewTool struct{…}` + - `Filename string` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The filename of the file cited. - - `type BetaApplyPatchTool struct{…}` + - `Index int64` - Allows the assistant to create, delete, or update files using unified diffs. + The index of the file in the list of files. - - `Type ToolSearchOutput` + - `Type FileCitation` - The type of the item. Always `tool_search_output`. + The type of the file citation. Always `file_citation`. - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `Agent BetaResponseToolSearchOutputItemAgent` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - The agent that produced this item. + A citation for a web resource used to generate a model response. - - `AgentName string` + - `EndIndex int64` - The canonical name of the agent that produced this item. + The index of the last character of the URL citation in the message. - - `CreatedBy string` + - `StartIndex int64` - The identifier of the actor that created the item. + The index of the first character of the URL citation in the message. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `Title string` - - `ID string` + The title of the web resource. - The unique ID of the additional tools item. + - `Type URLCitation` - - `Role string` + The type of the URL citation. Always `url_citation`. - The role that provided the additional tools. + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + - `URL string` - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + The URL of the web resource. - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + A citation for a container file used to generate a model response. - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + - `ContainerID string` - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + The ID of the container file. - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + - `EndIndex int64` - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + The index of the last character of the container file citation in the message. - - `Tools []BetaToolUnion` + - `FileID string` - The additional tool definitions made available at this item. + The ID of the file. - - `type BetaFunctionTool struct{…}` + - `Filename string` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The filename of the container file cited. - - `type BetaFileSearchTool struct{…}` + - `StartIndex int64` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The index of the first character of the container file citation in the message. - - `type BetaComputerTool struct{…}` + - `Type ContainerFileCitation` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The type of the container file citation. Always `container_file_citation`. - - `type BetaComputerUsePreviewTool struct{…}` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - - `type BetaWebSearchTool struct{…}` + A path to a file. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `FileID string` - - `type BetaToolMcp struct{…}` + The ID of the file. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Index int64` - - `type BetaToolCodeInterpreter struct{…}` + The index of the file in the list of files. - A tool that runs Python code to help generate a response to a prompt. + - `Type FilePath` - - `type BetaToolProgrammaticToolCalling struct{…}` + The type of the file path. Always `file_path`. - - `type BetaToolImageGeneration struct{…}` + - `const FilePathFilePath FilePath = "file_path"` - A tool that generates images using the GPT image models. + - `Text string` - - `type BetaToolLocalShell struct{…}` + The text output from the model. - A tool that allows the model to execute shell commands in a local environment. + - `Type OutputText` - - `type BetaFunctionShellTool struct{…}` + The type of the output text. Always `output_text`. - A tool that allows the model to execute shell commands. + - `const OutputTextOutputText OutputText = "output_text"` - - `type BetaCustomTool struct{…}` + - `Logprobs []BetaResponseOutputTextLogprob` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Token string` - - `type BetaNamespaceTool struct{…}` + - `Bytes []int64` - Groups function/custom tools under a shared namespace. + - `Logprob float64` - - `type BetaToolSearchTool struct{…}` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - Hosted or BYOT tool search configuration for deferred tools. + - `Token string` - - `type BetaWebSearchPreviewTool struct{…}` + - `Bytes []int64` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Logprob float64` - - `type BetaApplyPatchTool struct{…}` + - `type BetaResponseOutputRefusal struct{…}` - Allows the assistant to create, delete, or update files using unified diffs. + A refusal from the model. - - `Type AdditionalTools` + - `Refusal string` - The type of the item. Always `additional_tools`. + The refusal explanation from the model. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `Type Refusal` - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + The type of the refusal. Always `refusal`. - The agent that produced this item. + - `const RefusalRefusal Refusal = "refusal"` - - `AgentName string` + - `Role Assistant` - The canonical name of the agent that produced this item. + The role of the output message. Always `assistant`. - - `type BetaResponseCompactionItem struct{…}` + - `const AssistantAssistant Assistant = "assistant"` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `Status BetaResponseOutputMessageStatus` - - `ID string` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - The unique ID of the compaction item. + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `EncryptedContent string` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - The encrypted content that was produced by compaction. + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `Type Compaction` + - `Type Message` - The type of the item. Always `compaction`. + The type of the output message. Always `message`. - - `const CompactionCompaction Compaction = "compaction"` + - `const MessageMessage Message = "message"` - - `Agent BetaResponseCompactionItemAgent` + - `Agent BetaResponseOutputMessageAgent` The agent that produced this item. @@ -121745,41 +134285,51 @@ func main() { The canonical name of the agent that produced this item. - - `CreatedBy string` + - `Phase BetaResponseOutputMessagePhase` - The identifier of the actor that created the item. + 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. - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - An image generation request made by the model. + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + + - `type BetaResponseFileSearchToolCall struct{…}` + + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - `ID string` - The unique ID of the image generation call. + The unique ID of the file search tool call. - - `Result string` + - `Queries []string` - The generated image encoded in base64. + The queries used to search for files. - - `Status string` + - `Status BetaResponseFileSearchToolCallStatus` - The status of the image generation call. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `Type ImageGenerationCall` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - The type of the image generation call. Always `image_generation_call`. + - `Type FileSearchCall` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + The type of the file search tool call. Always `file_search_call`. - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + + - `Agent BetaResponseFileSearchToolCallAgent` The agent that produced this item. @@ -121787,2671 +134337,2604 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCall struct{…}` - - A tool call to run code. - - - `type BetaResponseOutputItemLocalShellCall struct{…}` + - `Results []BetaResponseFileSearchToolCallResult` - A tool call to run a command on the local shell. + The results of the file search tool call. - - `ID string` + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - The unique ID of the local shell call. + 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. - - `Action BetaResponseOutputItemLocalShellCallAction` + - `string` - Execute a shell command on the server. + - `float64` - - `Command []string` + - `bool` - The command to run. + - `FileID string` - - `Env map[string, string]` + The unique ID of the file. - Environment variables to set for the command. + - `Filename string` - - `Type Exec` + The name of the file. - The type of the local shell action. Always `exec`. + - `Score float64` - - `const ExecExec Exec = "exec"` + The relevance score of the file - a value between 0 and 1. - - `TimeoutMs int64` + - `Text string` - Optional timeout in milliseconds for the command. + The text that was retrieved from the file. - - `User string` + - `type BetaResponseComputerToolCall struct{…}` - Optional user to run the command as. + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `WorkingDirectory string` + - `ID string` - Optional working directory to run the command in. + The unique ID of the computer call. - `CallID string` - The unique ID of the local shell tool call generated by the model. - - - `Status string` + An identifier used when responding to the tool call with output. - The status of the local shell call. + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + The pending safety checks for the computer call. - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + - `ID string` - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + The ID of the pending safety check. - - `Type LocalShellCall` + - `Code string` - The type of the local shell call. Always `local_shell_call`. + The type of the pending safety check. - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `Message string` - - `Agent BetaResponseOutputItemLocalShellCallAgent` + Details about the pending safety check. - The agent that produced this item. + - `Status BetaResponseComputerToolCallStatus` - - `AgentName string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The canonical name of the agent that produced this item. + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - The output of a local shell tool call. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `ID string` + - `Type BetaResponseComputerToolCallType` - The unique ID of the local shell tool call generated by the model. + The type of the computer call. Always `computer_call`. - - `Output string` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - A JSON string of the output of the local shell tool call. + - `Action BetaComputerActionUnion` - - `Type LocalShellCallOutput` + A click action. - The type of the local shell tool call output. Always `local_shell_call_output`. + - `type BetaComputerActionClick struct{…}` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + A click action. - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + - `Button string` - The agent that produced this item. + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `AgentName string` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - The canonical name of the agent that produced this item. + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - `Status string` + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + - `Type Click` - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + Specifies the event type. For a click action, this property is always `click`. - - `type BetaResponseFunctionShellToolCall struct{…}` + - `const ClickClick Click = "click"` - A tool call that executes one or more shell commands in a managed environment. + - `X int64` - - `ID string` + The x-coordinate where the click occurred. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `Y int64` - - `Action BetaResponseFunctionShellToolCallAction` + The y-coordinate where the click occurred. - The shell commands and limits that describe how to run the tool call. + - `Keys []string` - - `Commands []string` + The keys being held while clicking. - - `MaxOutputLength int64` + - `type BetaComputerActionDoubleClick struct{…}` - Optional maximum number of characters to return from each command. + A double click action. - - `TimeoutMs int64` + - `Keys []string` - Optional timeout in milliseconds for the commands. + The keys being held while double-clicking. - - `CallID string` + - `Type DoubleClick` - The unique ID of the shell tool call generated by the model. + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - Represents the use of a local environment to perform shell actions. + - `X int64` - - `type BetaResponseLocalEnvironment struct{…}` + The x-coordinate where the double click occurred. - Represents the use of a local environment to perform shell actions. + - `Y int64` - - `Type Local` + The y-coordinate where the double click occurred. - The environment type. Always `local`. + - `type BetaComputerActionDrag struct{…}` - - `const LocalLocal Local = "local"` + A drag action. - - `type BetaResponseContainerReference struct{…}` + - `Path []BetaComputerActionDragPath` - Represents a container created with /v1/containers. + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `ContainerID string` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `Type ContainerReference` + - `X int64` - The environment type. Always `container_reference`. + The x-coordinate. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `Y int64` - - `Status BetaResponseFunctionShellToolCallStatus` + The y-coordinate. - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `Type Drag` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + Specifies the event type. For a drag action, this property is always set to `drag`. - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `const DragDrag Drag = "drag"` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `Keys []string` - - `Type ShellCall` + The keys being held while dragging the mouse. - The type of the item. Always `shell_call`. + - `type BetaComputerActionKeypress struct{…}` - - `const ShellCallShellCall ShellCall = "shell_call"` + A collection of keypresses the model would like to perform. - - `Agent BetaResponseFunctionShellToolCallAgent` + - `Keys []string` - The agent that produced this item. + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `AgentName string` + - `Type Keypress` - The canonical name of the agent that produced this item. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `const KeypressKeypress Keypress = "keypress"` - The execution context that produced this tool call. + - `type BetaComputerActionMove struct{…}` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + A mouse move action. - - `Type Direct` + - `Type Move` - - `const DirectDirect Direct = "direct"` + Specifies the event type. For a move action, this property is always set to `move`. - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `const MoveMove Move = "move"` - - `CallerID string` + - `X int64` - The call ID of the program item that produced this tool call. + The x-coordinate to move to. - - `Type Program` + - `Y int64` - - `const ProgramProgram Program = "program"` + The y-coordinate to move to. - - `CreatedBy string` + - `Keys []string` - The ID of the entity that created this tool call. + The keys being held while moving the mouse. - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `type BetaComputerActionScreenshot struct{…}` - The output of a shell tool call that was emitted. + A screenshot action. - - `ID string` + - `Type Screenshot` - The unique ID of the shell call output. Populated when this item is returned via API. + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `CallID string` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - The unique ID of the shell tool call generated by the model. + - `type BetaComputerActionScroll struct{…}` - - `MaxOutputLength int64` + A scroll action. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `ScrollX int64` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + The horizontal scroll distance. - An array of shell call output contents + - `ScrollY int64` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + The vertical scroll distance. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Type Scroll` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - Indicates that the shell call exceeded its configured time limit. + - `const ScrollScroll Scroll = "scroll"` - - `Type Timeout` + - `X int64` - The outcome type. Always `timeout`. + The x-coordinate where the scroll occurred. - - `const TimeoutTimeout Timeout = "timeout"` + - `Y int64` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + The y-coordinate where the scroll occurred. - Indicates that the shell commands finished and returned an exit code. + - `Keys []string` - - `ExitCode int64` + The keys being held while scrolling. - Exit code from the shell process. + - `type BetaComputerActionType struct{…}` - - `Type Exit` + An action to type in text. - The outcome type. Always `exit`. + - `Text string` - - `const ExitExit Exit = "exit"` + The text to type. - - `Stderr string` + - `Type Type` - The standard error output that was captured. + Specifies the event type. For a type action, this property is always set to `type`. - - `Stdout string` + - `const TypeType Type = "type"` - The standard output that was captured. + - `type BetaComputerActionWait struct{…}` - - `CreatedBy string` + A wait action. - The identifier of the actor that created the item. + - `Type Wait` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + Specifies the event type. For a wait action, this property is always set to `wait`. - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `const WaitWait Wait = "wait"` - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `Actions BetaComputerActionList` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + - `type BetaComputerActionClick struct{…}` - - `Type ShellCallOutput` + A click action. - The type of the shell call output. Always `shell_call_output`. + - `type BetaComputerActionDoubleClick struct{…}` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + A double click action. - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `type BetaComputerActionDrag struct{…}` - The agent that produced this item. + A drag action. - - `AgentName string` + - `type BetaComputerActionKeypress struct{…}` - The canonical name of the agent that produced this item. + A collection of keypresses the model would like to perform. - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `type BetaComputerActionMove struct{…}` - The execution context that produced this tool call. + A mouse move action. - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `type BetaComputerActionScreenshot struct{…}` - - `Type Direct` + A screenshot action. - - `const DirectDirect Direct = "direct"` + - `type BetaComputerActionScroll struct{…}` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + A scroll action. - - `CallerID string` + - `type BetaComputerActionType struct{…}` - The call ID of the program item that produced this tool call. + An action to type in text. - - `Type Program` + - `type BetaComputerActionWait struct{…}` - - `const ProgramProgram Program = "program"` + A wait action. - - `CreatedBy string` + - `Agent BetaResponseComputerToolCallAgent` - The identifier of the actor that created the item. + The agent that produced this item. - - `type BetaResponseApplyPatchToolCall struct{…}` + - `AgentName string` - A tool call that applies file diffs by creating, deleting, or updating files. + The canonical name of the agent that produced this item. - - `ID string` + - `type BetaResponseInputItemComputerCallOutput struct{…}` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + The output of a computer tool call. - `CallID string` - The unique ID of the apply patch tool call generated by the model. - - - `Operation BetaResponseApplyPatchToolCallOperationUnion` - - One of the create_file, delete_file, or update_file operations applied via apply_patch. - - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - - Instruction describing how to create a file via the apply_patch tool. - - - `Diff string` - - Diff to apply. - - - `Path string` + The ID of the computer tool call that produced the output. - Path of the file to create. + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `Type CreateFile` + A computer screenshot image used with the computer use tool. - Create a new file with the provided diff. + - `Type ComputerScreenshot` - - `const CreateFileCreateFile CreateFile = "create_file"` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - Instruction describing how to delete a file via the apply_patch tool. + - `FileID string` - - `Path string` + The identifier of an uploaded file that contains the screenshot. - Path of the file to delete. + - `ImageURL string` - - `Type DeleteFile` + The URL of the screenshot image. - Delete the specified file. + - `Type ComputerCallOutput` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + The type of the computer tool call output. Always `computer_call_output`. - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - Instruction describing how to update a file via the apply_patch tool. + - `ID string` - - `Diff string` + The ID of the computer tool call output. - Diff to apply. + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` - - `Path string` + The safety checks reported by the API that have been acknowledged by the developer. - Path of the file to update. + - `ID string` - - `Type UpdateFile` + The ID of the pending safety check. - Update an existing file with the provided diff. + - `Code string` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + The type of the pending safety check. - - `Status BetaResponseApplyPatchToolCallStatus` + - `Message string` - The status of the apply patch tool call. One of `in_progress` or `completed`. + Details about the pending safety check. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `Agent BetaResponseInputItemComputerCallOutputAgent` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + The agent that produced this item. - - `Type ApplyPatchCall` + - `AgentName string` - The type of the item. Always `apply_patch_call`. + The canonical name of the agent that produced this item. - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `Status string` - - `Agent BetaResponseApplyPatchToolCallAgent` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - The agent that produced this item. + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `AgentName string` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - The canonical name of the agent that produced this item. + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `type BetaResponseFunctionWebSearch struct{…}` - The execution context that produced this tool call. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `ID string` - - `Type Direct` + The unique ID of the web search tool call. - - `const DirectDirect Direct = "direct"` + - `Action BetaResponseFunctionWebSearchActionUnion` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + 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). - - `CallerID string` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - The call ID of the program item that produced this tool call. + Action type "search" - Performs a web search query. - - `Type Program` + - `Type Search` - - `const ProgramProgram Program = "program"` + The action type. - - `CreatedBy string` + - `const SearchSearch Search = "search"` - The ID of the entity that created this tool call. + - `Queries []string` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + The search queries. - The output emitted by an apply patch tool call. + - `Query string` - - `ID string` + The search query. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `CallID string` + The sources used in the search. - The unique ID of the apply patch tool call generated by the model. + - `Type URL` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + The type of source. Always `url`. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const URLURL URL = "url"` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `URL string` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + The URL of the source. - - `Type ApplyPatchCallOutput` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - The type of the item. Always `apply_patch_call_output`. + Action type "open_page" - Opens a specific URL from search results. - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `Type OpenPage` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + The action type. - The agent that produced this item. + - `const OpenPageOpenPage OpenPage = "open_page"` - - `AgentName string` + - `URL string` - The canonical name of the agent that produced this item. + The URL opened by the model. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - The execution context that produced this tool call. + Action type "find_in_page": Searches for a pattern within a loaded page. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `Pattern string` - - `Type Direct` + The pattern or text to search for within the page. - - `const DirectDirect Direct = "direct"` + - `Type FindInPage` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + The action type. - - `CallerID string` + - `const FindInPageFindInPage FindInPage = "find_in_page"` - The call ID of the program item that produced this tool call. + - `URL string` - - `Type Program` + The URL of the page searched for the pattern. - - `const ProgramProgram Program = "program"` + - `Status BetaResponseFunctionWebSearchStatus` - - `CreatedBy string` + The status of the web search tool call. - The ID of the entity that created this tool call output. + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - - `Output string` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - Optional textual output returned by the apply patch tool. + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - - `type BetaResponseOutputItemMcpCall struct{…}` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - An invocation of a tool on an MCP server. + - `Type WebSearchCall` - - `ID string` + The type of the web search tool call. Always `web_search_call`. - The unique ID of the tool call. + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `Arguments string` + - `Agent BetaResponseFunctionWebSearchAgent` - A JSON string of the arguments passed to the tool. + The agent that produced this item. - - `Name string` + - `AgentName string` - The name of the tool that was run. + The canonical name of the agent that produced this item. - - `ServerLabel string` + - `type BetaResponseFunctionToolCall struct{…}` - The label of the MCP server running the tool. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `Type McpCall` + - `Arguments string` - The type of the item. Always `mcp_call`. + A JSON string of the arguments to pass to the function. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `CallID string` - - `Agent BetaResponseOutputItemMcpCallAgent` + The unique ID of the function tool call generated by the model. - The agent that produced this item. + - `Name string` - - `AgentName string` + The name of the function to run. - The canonical name of the agent that produced this item. + - `Type FunctionCall` - - `ApprovalRequestID string` + The type of the function tool call. Always `function_call`. - 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. + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `Error string` + - `ID string` - The error from the tool call, if any. + The unique ID of the function tool call. - - `Output string` + - `Agent BetaResponseFunctionToolCallAgent` - The output from the tool call. + The agent that produced this item. - - `Status string` + - `AgentName string` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + The canonical name of the agent that produced this item. - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + - `Caller BetaResponseFunctionToolCallCallerUnion` - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + The execution context that produced this tool call. - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + - `Type Direct` - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + - `const DirectDirect Direct = "direct"` - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - A list of tools available on an MCP server. + - `CallerID string` - - `ID string` + The call ID of the program item that produced this tool call. - The unique ID of the list. + - `Type Program` - - `ServerLabel string` + - `const ProgramProgram Program = "program"` - The label of the MCP server. + - `Namespace string` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + The namespace of the function to run. - The tools available on the server. + - `Status BetaResponseFunctionToolCallStatus` - - `InputSchema any` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The JSON schema describing the tool's input. + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `Name string` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - The name of the tool. + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `Annotations any` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - Additional annotations about the tool. + The output of a function tool call. - - `Description string` + - `CallID string` - The description of the tool. + The unique ID of the function tool call generated by the model. - - `Type McpListTools` + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - The type of the item. Always `mcp_list_tools`. + Text, image, or file output of the function tool call. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `string` - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - The agent that produced this item. + An array of content outputs (text, image, file) for the function tool call. - - `AgentName string` + - `type BetaResponseInputTextContent struct{…}` - The canonical name of the agent that produced this item. + A text input to the model. - - `Error string` + - `Text string` - Error message if the server could not list tools. + The text input to the model. - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + - `Type InputText` - A request for human approval of a tool invocation. + The type of the input item. Always `input_text`. - - `ID string` + - `const InputTextInputText InputText = "input_text"` - The unique ID of the approval request. + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `Arguments string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A JSON string of arguments for the tool. + - `Mode Explicit` - - `Name string` + The breakpoint mode. Always `explicit`. - The name of the tool to run. + - `const ExplicitExplicit Explicit = "explicit"` - - `ServerLabel string` + - `type BetaResponseInputImageContent struct{…}` - The label of the MCP server making the request. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `Type McpApprovalRequest` + - `Type InputImage` - The type of the item. Always `mcp_approval_request`. + The type of the input item. Always `input_image`. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const InputImageInputImage InputImage = "input_image"` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `Detail BetaResponseInputImageContentDetail` - The agent that produced this item. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `AgentName string` + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - The canonical name of the agent that produced this item. + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - A response to an MCP approval request. + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - - `ID string` + - `FileID string` - The unique ID of the approval response + The ID of the file to be sent to the model. - - `ApprovalRequestID string` + - `ImageURL string` - The ID of the approval request being answered. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `Approve bool` + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - Whether the request was approved. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Type McpApprovalResponse` + - `Mode Explicit` - The type of the item. Always `mcp_approval_response`. + The breakpoint mode. Always `explicit`. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `const ExplicitExplicit Explicit = "explicit"` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + - `type BetaResponseInputFileContent struct{…}` - The agent that produced this item. + A file input to the model. - - `AgentName string` + - `Type InputFile` - The canonical name of the agent that produced this item. + The type of the input item. Always `input_file`. - - `Reason string` + - `const InputFileInputFile InputFile = "input_file"` - Optional reason for the decision. + - `Detail BetaResponseInputFileContentDetail` - - `type BetaResponseCustomToolCall struct{…}` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - A call to a custom tool created by the model. + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - The output of a custom tool call from your code, being sent back to the model. + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `ID string` + - `FileData string` - The unique ID of the custom tool call output item. + The base64-encoded data of the file to be sent to the model. - - `Status string` + - `FileID string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The ID of the file to be sent to the model. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `FileURL string` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + The URL of the file to be sent to the model. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `Filename string` - - `CreatedBy string` + The name of the file to be sent to the model. - The identifier of the actor that created the item. + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - - `ParallelToolCalls bool` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Whether to allow the model to run tool calls in parallel. + - `Mode Explicit` - - `Temperature float64` + The breakpoint mode. Always `explicit`. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `const ExplicitExplicit Explicit = "explicit"` - - `ToolChoice BetaResponseToolChoiceUnion` + - `Type FunctionCallOutput` - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + The type of the function tool call output. Always `function_call_output`. - - `type BetaToolChoiceOptions string` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - Controls which (if any) tool is called by the model. + - `ID string` - `none` means the model will not call any tool and instead generates a message. + The unique ID of the function tool call output. Populated when this item is returned via API. - `auto` means the model can pick between generating a message or calling one or - more tools. + - `Agent BetaResponseInputItemFunctionCallOutputAgent` - `required` means the model must call one or more tools. + The agent that produced this item. - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + - `AgentName string` - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + The canonical name of the agent that produced this item. - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - - `type BetaToolChoiceAllowed struct{…}` + The execution context that produced this tool call. - Constrains the tools available to the model to a pre-defined set. + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - - `Mode BetaToolChoiceAllowedMode` + - `Type Direct` - Constrains the tools available to the model to a pre-defined set. + The caller type. Always `direct`. - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `const DirectDirect Direct = "direct"` - `required` requires the model to call one or more of the allowed tools. + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + - `CallerID string` - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + The call ID of the program item that produced this tool call. - - `Tools []map[string, any]` + - `Type Program` - A list of tool definitions that the model should be allowed to call. + The caller type. Always `program`. - For the Responses API, the list of tool definitions might look like: + - `const ProgramProgram Program = "program"` - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `Status string` - - `Type AllowedTools` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - Allowed tool configuration type. Always `allowed_tools`. + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - - `type BetaToolChoiceTypes struct{…}` + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `type BetaResponseInputItemAgentMessage struct{…}` - - `Type BetaToolChoiceTypesType` + A message routed between agents. - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `Author string` - Allowed values are: + The sending agent identity. - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + - `Content []BetaResponseInputItemAgentMessageContentUnion` - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + Plaintext, image, or encrypted content sent between agents. - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + - `type BetaResponseInputTextContent struct{…}` - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + A text input to the model. - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `type BetaResponseInputImageContent struct{…}` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `EncryptedContent string` - - `type BetaToolChoiceFunction struct{…}` + Opaque encrypted content. - Use this option to force the model to call a specific function. + - `Type EncryptedContent` - - `Name string` + The type of the input item. Always `encrypted_content`. - The name of the function to call. + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `Type Function` + - `Recipient string` - For function calling, the type is always `function`. + The destination agent identity. - - `const FunctionFunction Function = "function"` + - `Type AgentMessage` - - `type BetaToolChoiceMcp struct{…}` + The item type. Always `agent_message`. - Use this option to force the model to call a specific tool on a remote MCP server. + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `ServerLabel string` + - `ID string` - The label of the MCP server to use. + The unique ID of this agent message item. - - `Type Mcp` + - `Agent BetaResponseInputItemAgentMessageAgent` - For MCP tools, the type is always `mcp`. + The agent that produced this item. - - `const McpMcp Mcp = "mcp"` + - `AgentName string` - - `Name string` + The canonical name of the agent that produced this item. - The name of the tool to call on the server. + - `type BetaResponseInputItemMultiAgentCall struct{…}` - - `type BetaToolChoiceCustom struct{…}` + - `Action string` - Use this option to force the model to call a specific custom tool. + The multi-agent action that was executed. - - `Name string` + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - The name of the custom tool to call. + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - - `Type Custom` + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - For custom tool calling, the type is always `custom`. + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - - `const CustomCustom Custom = "custom"` + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - - `Type ProgrammaticToolCalling` + - `Arguments string` - The tool to call. Always `programmatic_tool_calling`. + The action arguments as a JSON string. - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `CallID string` - - `type BetaToolChoiceApplyPatch struct{…}` + The unique ID linking this call to its output. - Forces the model to call the apply_patch tool when executing a tool call. + - `Type MultiAgentCall` - - `Type ApplyPatch` + The item type. Always `multi_agent_call`. - The tool to call. Always `apply_patch`. + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `ID string` - - `type BetaToolChoiceShell struct{…}` + The unique ID of this multi-agent call. - Forces the model to call the shell tool when a tool call is required. + - `Agent BetaResponseInputItemMultiAgentCallAgent` - - `Type Shell` + The agent that produced this item. - The tool to call. Always `shell`. + - `AgentName string` - - `const ShellShell Shell = "shell"` + The canonical name of the agent that produced this item. - - `Tools []BetaToolUnion` + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + - `Action string` - We support the following categories of tools: + The multi-agent action that produced this result. - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - - `type BetaFunctionTool struct{…}` + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - - `type BetaFileSearchTool struct{…}` + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - - `type BetaComputerTool struct{…}` + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `CallID string` - - `type BetaComputerUsePreviewTool struct{…}` + The unique ID of the multi-agent call. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `type BetaWebSearchTool struct{…}` + Text output returned by the multi-agent action. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Text string` - - `type BetaToolMcp struct{…}` + The text content. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Type OutputText` - - `type BetaToolCodeInterpreter struct{…}` + The content type. Always `output_text`. - A tool that runs Python code to help generate a response to a prompt. + - `const OutputTextOutputText OutputText = "output_text"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - `type BetaToolImageGeneration struct{…}` + Citations associated with the text content. - A tool that generates images using the GPT image models. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `type BetaToolLocalShell struct{…}` + - `FileID string` - A tool that allows the model to execute shell commands in a local environment. + The ID of the file. - - `type BetaFunctionShellTool struct{…}` + - `Filename string` - A tool that allows the model to execute shell commands. + The filename of the file cited. - - `type BetaCustomTool struct{…}` + - `Index int64` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The index of the file in the list of files. - - `type BetaNamespaceTool struct{…}` + - `Type FileCitation` - Groups function/custom tools under a shared namespace. + The citation type. Always `file_citation`. - - `type BetaToolSearchTool struct{…}` + - `const FileCitationFileCitation FileCitation = "file_citation"` - Hosted or BYOT tool search configuration for deferred tools. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - - `type BetaWebSearchPreviewTool struct{…}` + - `EndIndex int64` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The index of the last character of the citation in the message. - - `type BetaApplyPatchTool struct{…}` + - `StartIndex int64` - Allows the assistant to create, delete, or update files using unified diffs. + The index of the first character of the citation in the message. - - `TopP float64` + - `Title string` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + The title of the cited resource. - We generally recommend altering this or `temperature` but not both. + - `Type URLCitation` - - `Background bool` + The citation type. Always `url_citation`. - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `CompletedAt float64` + - `URL string` - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. + The URL of the cited resource. - - `Conversation BetaResponseConversation` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + - `ContainerID string` - - `ID string` + The ID of the container. - The unique ID of the conversation that this response was associated with. + - `EndIndex int64` - - `MaxOutputTokens int64` + The index of the last character of the citation in the message. - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + - `FileID string` - - `MaxToolCalls int64` + The ID of the container file. - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + - `Filename string` - - `Moderation BetaResponseModeration` + The filename of the container file cited. - Moderation results for the response input and output, if moderated completions were requested. + - `StartIndex int64` - - `Input BetaResponseModerationInputUnion` + The index of the first character of the citation in the message. - Moderation for the response input. + - `Type ContainerFileCitation` - - `type BetaResponseModerationInputModerationResult struct{…}` + The citation type. Always `container_file_citation`. - A moderation result produced for the response input or output. + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `Categories map[string, bool]` + - `Type MultiAgentCallOutput` - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + The item type. Always `multi_agent_call_output`. - - `CategoryAppliedInputTypes map[string, []string]` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - Which modalities of input are reflected by the score for each category. + - `ID string` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + The unique ID of this multi-agent call output. - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` - - `CategoryScores map[string, float64]` + The agent that produced this item. - A dictionary of moderation categories to scores. + - `AgentName string` - - `Flagged bool` + The canonical name of the agent that produced this item. - A boolean indicating whether the content was flagged by any category. + - `type BetaResponseInputItemToolSearchCall struct{…}` - - `Model string` + - `Arguments any` - The moderation model that produced this result. + The arguments supplied to the tool search call. - - `Type ModerationResult` + - `Type ToolSearchCall` - The object type, which was always `moderation_result` for successful moderation results. + The item type. Always `tool_search_call`. - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `type BetaResponseModerationInputError struct{…}` + - `ID string` - An error produced while attempting moderation for the response input or output. + The unique ID of this tool search call. - - `Code string` + - `Agent BetaResponseInputItemToolSearchCallAgent` - The error code. + The agent that produced this item. - - `Message string` + - `AgentName string` - The error message. + The canonical name of the agent that produced this item. - - `Type Error` + - `CallID string` - The object type, which was always `error` for moderation failures. + The unique ID of the tool search call generated by the model. - - `const ErrorError Error = "error"` + - `Execution string` - - `Output BetaResponseModerationOutputUnion` + Whether tool search was executed by the server or by the client. - Moderation for the response output. + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - - `type BetaResponseModerationOutputModerationResult struct{…}` + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - A moderation result produced for the response input or output. + - `Status string` - - `Categories map[string, bool]` + The status of the tool search call. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - - `CategoryAppliedInputTypes map[string, []string]` + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - Which modalities of input are reflected by the score for each category. + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + - `Tools []BetaToolUnion` - - `CategoryScores map[string, float64]` + The loaded tool definitions returned by the tool search output. - A dictionary of moderation categories to scores. + - `type BetaFunctionTool struct{…}` - - `Flagged bool` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - A boolean indicating whether the content was flagged by any category. + - `Name string` - - `Model string` + The name of the function to call. - The moderation model that produced this result. + - `Parameters map[string, any]` - - `Type ModerationResult` + A JSON schema object describing the parameters of the function. - The object type, which was always `moderation_result` for successful moderation results. + - `Strict bool` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + Whether strict parameter validation is enforced for this function tool. - - `type BetaResponseModerationOutputError struct{…}` + - `Type Function` - An error produced while attempting moderation for the response input or output. + The type of the function tool. Always `function`. - - `Code string` + - `const FunctionFunction Function = "function"` - The error code. + - `AllowedCallers []string` - - `Message string` + The tool invocation context(s). - The error message. + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `Type Error` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - The object type, which was always `error` for moderation failures. + - `DeferLoading bool` - - `const ErrorError Error = "error"` + Whether this function is deferred and loaded via tool search. - - `PreviousResponseID string` + - `Description string` - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + A description of the function. Used by the model to determine whether or not to call the function. - - `Prompt BetaResponsePrompt` + - `OutputSchema map[string, any]` - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `ID string` + - `type BetaFileSearchTool struct{…}` - The unique identifier of the prompt template to use. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Variables map[string, BetaResponsePromptVariableUnion]` + - `Type FileSearch` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + The type of the file search tool. Always `file_search`. - - `string` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type BetaResponseInputText struct{…}` + - `VectorStoreIDs []string` - A text input to the model. + The IDs of the vector stores to search. - - `type BetaResponseInputImage struct{…}` + - `Filters BetaFileSearchToolFiltersUnion` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + A filter to apply. - - `type BetaResponseInputFile struct{…}` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - A file input to the model. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `Version string` + - `Key string` - Optional version of the prompt template. + The key to compare against the value. - - `PromptCacheKey string` + - `Type string` - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `PromptCacheOptions BetaResponsePromptCacheOptions` + - `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 - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `Mode string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - Whether implicit prompt-cache breakpoints were enabled. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Ttl string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The minimum lifetime applied to each cache breakpoint. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `PromptCacheRetention BetaResponsePromptCacheRetention` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - Deprecated. Use `prompt_cache_options.ttl` instead. + The value to compare against the attribute key; supports string, number, or boolean types. - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + - `string` - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + - `float64` - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + - `bool` - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + - `string` - - `Reasoning BetaResponseReasoning` + - `float64` - **gpt-5 and o-series models only** + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + Combine multiple filters using `and` or `or`. - - `Context string` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + - `Key string` - - `Effort string` + The key to compare against the value. - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `Type string` - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `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 BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `GenerateSummary string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - **Deprecated:** use `summary` instead. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + The value to compare against the attribute key; supports string, number, or boolean types. - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + - `string` - - `Mode string` + - `float64` - Controls the reasoning execution mode for the request. + - `bool` - When returned on a response, this is the effective execution mode. + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - `string` - - `string` + - `float64` - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + - `Type string` - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + Type of operation: `and` or `or`. - - `Summary string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `MaxNumResults int64` - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + - `RankingOptions BetaFileSearchToolRankingOptions` - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + Ranking options for search. - - `SafetyIdentifier string` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `ServiceTier BetaResponseServiceTier` + - `EmbeddingWeight float64` - Specifies the processing type used for serving the request. + The weight of the embedding in the reciprocal ranking fusion. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `TextWeight float64` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + The weight of the text in the reciprocal ranking fusion. - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `Ranker string` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + The ranker to use for the file search. - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + - `ScoreThreshold float64` - - `Status BetaResponseStatus` + 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. - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `type BetaComputerTool struct{…}` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `Type Computer` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + The type of the computer tool. Always `computer`. - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + - `const ComputerComputer Computer = "computer"` - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Text BetaResponseTextConfig` + - `DisplayHeight int64` - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + The height of the computer display. - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `DisplayWidth int64` - - `Format BetaResponseFormatTextConfigUnion` + The width of the computer display. - An object specifying the format that the model must output. + - `Environment BetaComputerUsePreviewToolEnvironment` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The type of computer environment to control. - The default format is `{ "type": "text" }` with no additional options. + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - **Not recommended for gpt-4o and newer models:** + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `type BetaResponseFormatTextConfigText struct{…}` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - Default response format. Used to generate text responses. + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `Type Text` + - `Type ComputerUsePreview` - The type of response format being defined. Always `text`. + The type of the computer use tool. Always `computer_use_preview`. - - `const TextText Text = "text"` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + - `type BetaWebSearchTool struct{…}` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Name string` + - `Type BetaWebSearchToolType` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `Schema map[string, any]` + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - - `Type JSONSchema` + - `Filters BetaWebSearchToolFilters` - The type of response format being defined. Always `json_schema`. + Filters for the search. - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `AllowedDomains []string` - - `Description string` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - A description of what the response format is for, used by the model to - determine how to respond in the format. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `Strict bool` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + 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. - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `Type JSONObject` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - The type of response format being defined. Always `json_object`. + - `UserLocation BetaWebSearchToolUserLocation` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The approximate location of the user. - - `Verbosity BetaResponseTextConfigVerbosity` + - `City string` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + Free text input for the city of the user, e.g. `San Francisco`. - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + - `Country string` - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + - `Region string` - - `TopLogprobs int64` + Free text input for the region of the user, e.g. `California`. - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + - `Timezone string` - - `Truncation BetaResponseTruncation` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The truncation strategy to use for the model response. + - `Type string` - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + The type of location approximation. Always `approximate`. - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + - `type BetaToolMcp struct{…}` - - `Usage BetaResponseUsage` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + - `ServerLabel string` - - `InputTokens int64` + A label for this MCP server, used to identify it in tool calls. - The number of input tokens. + - `Type Mcp` - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + The type of the MCP tool. Always `mcp`. - A detailed breakdown of the input tokens. + - `const McpMcp Mcp = "mcp"` - - `CacheWriteTokens int64` + - `AllowedCallers []string` - The number of input tokens that were written to the cache. + The tool invocation context(s). - - `CachedTokens int64` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `OutputTokens int64` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - The number of output tokens. + List of allowed tool names or a filter object. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - A detailed breakdown of the output tokens. + A string array of allowed tool names - - `ReasoningTokens int64` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - The number of reasoning tokens. + A filter object to specify which tools are allowed. - - `TotalTokens int64` + - `ReadOnly bool` - The total number of tokens used. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `User string` + - `ToolNames []string` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + List of allowed tool names. - - `SequenceNumber int64` + - `Authorization string` - The sequence number for this event. + 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. - - `Type ResponseQueued` + - `ConnectorID string` - The type of the event. Always 'response.queued'. + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `const ResponseQueuedResponseQueued ResponseQueued = "response.queued"` + Currently supported `connector_id` values are: - - `Agent BetaResponseQueuedEventAgent` + - 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` - The agent that owns this multi-agent streaming event. + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `AgentName string` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - The canonical name of the agent that produced this item. + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` -### Beta Response Reasoning Item + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` -- `type BetaResponseReasoningItem struct{…}` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - 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](https://platform.openai.com/docs/guides/conversation-state). + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `ID string` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - The unique identifier of the reasoning content. + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `Summary []BetaResponseReasoningItemSummary` + - `DeferLoading bool` - Reasoning summary content. + Whether this MCP tool is deferred and discovered via tool search. - - `Text string` + - `Headers map[string, string]` - A summary of the reasoning output from the model so far. + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `Type SummaryText` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - The type of the object. Always `summary_text`. + Specify which of the MCP server's tools require approval. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `Type Reasoning` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - The type of the object. Always `reasoning`. + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `const ReasoningReasoning Reasoning = "reasoning"` + A filter object to specify which tools are allowed. - - `Agent BetaResponseReasoningItemAgent` + - `ReadOnly bool` - The agent that produced this item. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `AgentName string` + - `ToolNames []string` - The canonical name of the agent that produced this item. + List of allowed tool names. - - `Content []BetaResponseReasoningItemContent` + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - Reasoning text content. + A filter object to specify which tools are allowed. - - `Text string` + - `ReadOnly bool` - The reasoning text from the model. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Type ReasoningText` + - `ToolNames []string` - The type of the reasoning text. Always `reasoning_text`. + List of allowed tool names. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `EncryptedContent 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. - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - - `Status BetaResponseReasoningItemStatus` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `ServerDescription string` - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + Optional description of the MCP server, used to provide more context. - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + - `ServerURL string` - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. -### Beta Response Reasoning Summary Part Added Event + - `TunnelID string` -- `type BetaResponseReasoningSummaryPartAddedEvent struct{…}` + 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. - Emitted when a new reasoning summary part is added. + - `type BetaToolCodeInterpreter struct{…}` - - `ItemID string` + A tool that runs Python code to help generate a response to a prompt. - The ID of the item this summary part is associated with. + - `Container BetaToolCodeInterpreterContainerUnion` - - `OutputIndex int64` + 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. - The index of the output item this summary part is associated with. + - `string` - - `Part BetaResponseReasoningSummaryPartAddedEventPart` + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - The summary part that was added. + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `Text string` + - `Type Auto` - The text of the summary part. + Always `auto`. - - `Type SummaryText` + - `const AutoAuto Auto = "auto"` - The type of the summary part. Always `summary_text`. + - `FileIDs []string` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + An optional list of uploaded files to make available to your code. - - `SequenceNumber int64` + - `MemoryLimit string` - The sequence number of this event. + The memory limit for the code interpreter container. - - `SummaryIndex int64` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - The index of the summary part within the reasoning summary. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `Type ResponseReasoningSummaryPartAdded` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - The type of the event. Always `response.reasoning_summary_part.added`. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - - `Agent BetaResponseReasoningSummaryPartAddedEventAgent` + Network access policy for the container. - The agent that owns this multi-agent streaming event. + - `type BetaContainerNetworkPolicyDisabled struct{…}` - - `AgentName string` + - `Type Disabled` - The canonical name of the agent that produced this item. + Disable outbound network access. Always `disabled`. -### Beta Response Reasoning Summary Part Done Event + - `const DisabledDisabled Disabled = "disabled"` -- `type BetaResponseReasoningSummaryPartDoneEvent struct{…}` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - Emitted when a reasoning summary part is completed. + - `AllowedDomains []string` - - `ItemID string` + A list of allowed domains when type is `allowlist`. - The ID of the item this summary part is associated with. + - `Type Allowlist` - - `OutputIndex int64` + Allow outbound network access only to specified domains. Always `allowlist`. - The index of the output item this summary part is associated with. + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `Part BetaResponseReasoningSummaryPartDoneEventPart` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - The completed summary part. + Optional domain-scoped secrets for allowlisted domains. - - `Text string` + - `Domain string` - The text of the summary part. + The domain associated with the secret. - - `Type SummaryText` + - `Name string` - The type of the summary part. Always `summary_text`. + The name of the secret to inject for the domain. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `Value string` - - `SequenceNumber int64` + The secret value to inject for the domain. - The sequence number of this event. + - `Type CodeInterpreter` - - `SummaryIndex int64` + The type of the code interpreter tool. Always `code_interpreter`. - The index of the summary part within the reasoning summary. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Type ResponseReasoningSummaryPartDone` + - `AllowedCallers []string` - The type of the event. Always `response.reasoning_summary_part.done`. + The tool invocation context(s). - - `const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - - `Agent BetaResponseReasoningSummaryPartDoneEventAgent` + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - The agent that owns this multi-agent streaming event. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `AgentName string` + - `Type ProgrammaticToolCalling` - The canonical name of the agent that produced this item. + The type of the tool. Always `programmatic_tool_calling`. - - `Status BetaResponseReasoningSummaryPartDoneEventStatus` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - The completion status of the summary part. Omitted when the part completed - normally and set to `incomplete` when generation was interrupted. + - `type BetaToolImageGeneration struct{…}` - - `const BetaResponseReasoningSummaryPartDoneEventStatusIncomplete BetaResponseReasoningSummaryPartDoneEventStatus = "incomplete"` + A tool that generates images using the GPT image models. -### Beta Response Reasoning Summary Text Delta Event + - `Type ImageGeneration` -- `type BetaResponseReasoningSummaryTextDeltaEvent struct{…}` + The type of the image generation tool. Always `image_generation`. - Emitted when a delta is added to a reasoning summary text. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `Delta string` + - `Action string` - The text delta that was added to the summary. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `ItemID string` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - The ID of the item this summary text delta is associated with. + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `OutputIndex int64` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - The index of the output item this summary text delta is associated with. + - `Background string` - - `SequenceNumber int64` + 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. - The sequence number of this event. + `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. - - `SummaryIndex int64` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - The index of the summary part within the reasoning summary. + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `Type ResponseReasoningSummaryTextDelta` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - The type of the event. Always `response.reasoning_summary_text.delta`. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"` + - `InputFidelity string` - - `Agent BetaResponseReasoningSummaryTextDeltaEventAgent` + 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`. - The agent that owns this multi-agent streaming event. + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - - `AgentName string` + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - The canonical name of the agent that produced this item. + - `InputImageMask BetaToolImageGenerationInputImageMask` -### Beta Response Reasoning Summary Text Done Event + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). -- `type BetaResponseReasoningSummaryTextDoneEvent struct{…}` + - `FileID string` - Emitted when a reasoning summary text is completed. + File ID for the mask image. - - `ItemID string` + - `ImageURL string` - The ID of the item this summary text is associated with. + Base64-encoded mask image. - - `OutputIndex int64` + - `Model string` - The index of the output item this summary text is associated with. + The image generation model to use. Default: `gpt-image-1`. - - `SequenceNumber int64` + - `string` - The sequence number of this event. + - `string` - - `SummaryIndex int64` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - The index of the summary part within the reasoning summary. + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `Text string` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - The full text of the completed reasoning summary. + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `Type ResponseReasoningSummaryTextDone` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - The type of the event. Always `response.reasoning_summary_text.done`. + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - `const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"` + - `Moderation string` - - `Agent BetaResponseReasoningSummaryTextDoneEventAgent` + Moderation level for the generated image. Default: `auto`. - The agent that owns this multi-agent streaming event. + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `AgentName string` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - The canonical name of the agent that produced this item. + - `OutputCompression int64` -### Beta Response Reasoning Text Delta Event + Compression level for the output image. Default: 100. -- `type BetaResponseReasoningTextDeltaEvent struct{…}` + - `OutputFormat string` - Emitted when a delta is added to a reasoning text. + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `ContentIndex int64` + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - The index of the reasoning content part this delta is associated with. + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `Delta string` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - The text delta that was added to the reasoning content. + - `PartialImages int64` - - `ItemID string` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The ID of the item this reasoning text delta is associated with. + - `Quality string` - - `OutputIndex int64` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - The index of the output item this reasoning text delta is associated with. + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `SequenceNumber int64` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - The sequence number of this event. + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `Type ResponseReasoningTextDelta` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - The type of the event. Always `response.reasoning_text.delta`. + - `Size string` - - `const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"` + 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`. - - `Agent BetaResponseReasoningTextDeltaEventAgent` + - `string` - The agent that owns this multi-agent streaming event. + - `string` - - `AgentName string` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - The canonical name of the agent that produced this item. + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` -### Beta Response Reasoning Text Done Event + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` -- `type BetaResponseReasoningTextDoneEvent struct{…}` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - Emitted when a reasoning text is completed. + - `type BetaToolLocalShell struct{…}` - - `ContentIndex int64` + A tool that allows the model to execute shell commands in a local environment. - The index of the reasoning content part. + - `Type LocalShell` - - `ItemID string` + The type of the local shell tool. Always `local_shell`. - The ID of the item this reasoning text is associated with. + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `OutputIndex int64` + - `type BetaFunctionShellTool struct{…}` - The index of the output item this reasoning text is associated with. + A tool that allows the model to execute shell commands. - - `SequenceNumber int64` + - `Type Shell` - The sequence number of this event. + The type of the shell tool. Always `shell`. - - `Text string` + - `const ShellShell Shell = "shell"` - The full text of the completed reasoning content. + - `AllowedCallers []string` - - `Type ResponseReasoningTextDone` + The tool invocation context(s). - The type of the event. Always `response.reasoning_text.done`. + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - `const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"` + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - `Agent BetaResponseReasoningTextDoneEventAgent` + - `Environment BetaFunctionShellToolEnvironmentUnion` - The agent that owns this multi-agent streaming event. + - `type BetaContainerAuto struct{…}` - - `AgentName string` + - `Type ContainerAuto` - The canonical name of the agent that produced this item. + Automatically creates a container for this request -### Beta Response Refusal Delta Event + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` -- `type BetaResponseRefusalDeltaEvent struct{…}` + - `FileIDs []string` - Emitted when there is a partial refusal text. + An optional list of uploaded files to make available to your code. - - `ContentIndex int64` + - `MemoryLimit BetaContainerAutoMemoryLimit` - The index of the content part that the refusal text is added to. + The memory limit for the container. - - `Delta string` + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - The refusal text that is added. + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `ItemID string` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - The ID of the output item that the refusal text is added to. + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `OutputIndex int64` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - The index of the output item that the refusal text is added to. + Network access policy for the container. - - `SequenceNumber int64` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The sequence number of this event. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `Type ResponseRefusalDelta` + - `Skills []BetaContainerAutoSkillUnion` - The type of the event. Always `response.refusal.delta`. + An optional list of skills referenced by id or inline data. - - `const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"` + - `type BetaSkillReference struct{…}` - - `Agent BetaResponseRefusalDeltaEventAgent` + - `SkillID string` - The agent that owns this multi-agent streaming event. + The ID of the referenced skill. - - `AgentName string` + - `Type SkillReference` - The canonical name of the agent that produced this item. + References a skill created with the /v1/skills endpoint. -### Beta Response Refusal Done Event + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` -- `type BetaResponseRefusalDoneEvent struct{…}` + - `Version string` - Emitted when refusal text is finalized. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `ContentIndex int64` + - `type BetaInlineSkill struct{…}` - The index of the content part that the refusal text is finalized. + - `Description string` - - `ItemID string` + The description of the skill. - The ID of the output item that the refusal text is finalized. + - `Name string` - - `OutputIndex int64` + The name of the skill. - The index of the output item that the refusal text is finalized. + - `Source BetaInlineSkillSource` - - `Refusal string` + Inline skill payload - The refusal text that is finalized. + - `Data string` - - `SequenceNumber int64` + Base64-encoded skill zip bundle. - The sequence number of this event. + - `MediaType ApplicationZip` - - `Type ResponseRefusalDone` + The media type of the inline skill payload. Must be `application/zip`. - The type of the event. Always `response.refusal.done`. + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"` + - `Type Base64` - - `Agent BetaResponseRefusalDoneEventAgent` + The type of the inline skill source. Must be `base64`. - The agent that owns this multi-agent streaming event. + - `const Base64Base64 Base64 = "base64"` - - `AgentName string` + - `Type Inline` - The canonical name of the agent that produced this item. + Defines an inline skill for this request. -### Beta Response Status + - `const InlineInline Inline = "inline"` -- `type BetaResponseStatus string` + - `type BetaLocalEnvironment struct{…}` - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `Type Local` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + Use a local computer environment. - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `const LocalLocal Local = "local"` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + - `Skills []BetaLocalSkill` - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + An optional list of skills. - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `Description string` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + The description of the skill. -### Beta Response Stream Event + - `Name string` -- `type BetaResponseStreamEventUnion interface{…}` + The name of the skill. - Emitted when there is a partial audio response. + - `Path string` - - `type BetaResponseAudioDeltaEvent struct{…}` + The path to the directory containing the skill. - Emitted when there is a partial audio response. + - `type BetaContainerReference struct{…}` - - `Delta string` + - `ContainerID string` - A chunk of Base64 encoded response audio bytes. + The ID of the referenced container. - - `SequenceNumber int64` + - `Type ContainerReference` - A sequence number for this chunk of the stream response. + References a container created with the /v1/containers endpoint - - `Type ResponseAudioDelta` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - The type of the event. Always `response.audio.delta`. + - `type BetaCustomTool struct{…}` - - `const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Agent BetaResponseAudioDeltaEventAgent` + - `Name string` - The agent that owns this multi-agent streaming event. + The name of the custom tool, used to identify it in tool calls. - - `AgentName string` + - `Type Custom` - The canonical name of the agent that produced this item. + The type of the custom tool. Always `custom`. - - `type BetaResponseAudioDoneEvent struct{…}` + - `const CustomCustom Custom = "custom"` - Emitted when the audio response is complete. + - `AllowedCallers []string` - - `SequenceNumber int64` + The tool invocation context(s). - The sequence number of the delta. + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `Type ResponseAudioDone` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - The type of the event. Always `response.audio.done`. + - `DeferLoading bool` - - `const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"` + Whether this tool should be deferred and discovered via tool search. - - `Agent BetaResponseAudioDoneEventAgent` + - `Description string` - The agent that owns this multi-agent streaming event. + Optional description of the custom tool, used to provide more context. - - `AgentName string` + - `Format BetaCustomToolFormatUnion` - The canonical name of the agent that produced this item. + The input format for the custom tool. Default is unconstrained text. - - `type BetaResponseAudioTranscriptDeltaEvent struct{…}` + - `type BetaCustomToolFormatText struct{…}` - Emitted when there is a partial transcript of audio. + Unconstrained free-form text. - - `Delta string` + - `Type Text` - The partial transcript of the audio response. + Unconstrained text format. Always `text`. - - `SequenceNumber int64` + - `const TextText Text = "text"` - The sequence number of this event. + - `type BetaCustomToolFormatGrammar struct{…}` - - `Type ResponseAudioTranscriptDelta` + A grammar defined by the user. - The type of the event. Always `response.audio.transcript.delta`. + - `Definition string` - - `const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"` + The grammar definition. - - `Agent BetaResponseAudioTranscriptDeltaEventAgent` + - `Syntax string` - The agent that owns this multi-agent streaming event. + The syntax of the grammar definition. One of `lark` or `regex`. - - `AgentName string` + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - The canonical name of the agent that produced this item. + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `type BetaResponseAudioTranscriptDoneEvent struct{…}` + - `Type Grammar` - Emitted when the full audio transcript is completed. + Grammar format. Always `grammar`. - - `SequenceNumber int64` + - `const GrammarGrammar Grammar = "grammar"` - The sequence number of this event. + - `type BetaNamespaceTool struct{…}` - - `Type ResponseAudioTranscriptDone` + Groups function/custom tools under a shared namespace. - The type of the event. Always `response.audio.transcript.done`. + - `Description string` - - `const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"` + A description of the namespace shown to the model. - - `Agent BetaResponseAudioTranscriptDoneEventAgent` + - `Name string` - The agent that owns this multi-agent streaming event. + The namespace name used in tool calls (for example, `crm`). - - `AgentName string` + - `Tools []BetaNamespaceToolToolUnion` - The canonical name of the agent that produced this item. + The function/custom tools available inside this namespace. - - `type BetaResponseCodeInterpreterCallCodeDeltaEvent struct{…}` + - `type BetaNamespaceToolToolFunction struct{…}` - Emitted when a partial code snippet is streamed by the code interpreter. + - `Name string` - - `Delta string` + - `Type Function` - The partial code snippet being streamed by the code interpreter. + - `const FunctionFunction Function = "function"` - - `ItemID string` + - `AllowedCallers []string` - The unique identifier of the code interpreter tool call item. + The tool invocation context(s). - - `OutputIndex int64` + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - The index of the output item in the response for which the code is being streamed. + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - - `SequenceNumber int64` + - `DeferLoading bool` - The sequence number of this event, used to order streaming events. + Whether this function should be deferred and discovered via tool search. - - `Type ResponseCodeInterpreterCallCodeDelta` + - `Description string` - The type of the event. Always `response.code_interpreter_call_code.delta`. + - `OutputSchema map[string, any]` - - `const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `Agent BetaResponseCodeInterpreterCallCodeDeltaEventAgent` + - `Parameters any` - The agent that owns this multi-agent streaming event. + - `Strict bool` - - `AgentName string` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - The canonical name of the agent that produced this item. + - `type BetaCustomTool struct{…}` - - `type BetaResponseCodeInterpreterCallCodeDoneEvent struct{…}` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - Emitted when the code snippet is finalized by the code interpreter. + - `Type Namespace` - - `Code string` + The type of the tool. Always `namespace`. - The final code snippet output by the code interpreter. + - `const NamespaceNamespace Namespace = "namespace"` - - `ItemID string` + - `type BetaToolSearchTool struct{…}` - The unique identifier of the code interpreter tool call item. + Hosted or BYOT tool search configuration for deferred tools. - - `OutputIndex int64` + - `Type ToolSearch` - The index of the output item in the response for which the code is finalized. + The type of the tool. Always `tool_search`. - - `SequenceNumber int64` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - The sequence number of this event, used to order streaming events. + - `Description string` - - `Type ResponseCodeInterpreterCallCodeDone` + Description shown to the model for a client-executed tool search tool. - The type of the event. Always `response.code_interpreter_call_code.done`. + - `Execution BetaToolSearchToolExecution` - - `const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"` + Whether tool search is executed by the server or by the client. - - `Agent BetaResponseCodeInterpreterCallCodeDoneEventAgent` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - The agent that owns this multi-agent streaming event. + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `AgentName string` + - `Parameters any` - The canonical name of the agent that produced this item. + Parameter schema for a client-executed tool search tool. - - `type BetaResponseCodeInterpreterCallCompletedEvent struct{…}` + - `type BetaWebSearchPreviewTool struct{…}` - Emitted when the code interpreter call is completed. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `ItemID string` + - `Type BetaWebSearchPreviewToolType` - The unique identifier of the code interpreter tool call item. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `OutputIndex int64` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - The index of the output item in the response for which the code interpreter call is completed. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `SequenceNumber int64` + - `SearchContentTypes []string` - The sequence number of this event, used to order streaming events. + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `Type ResponseCodeInterpreterCallCompleted` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - The type of the event. Always `response.code_interpreter_call.completed`. + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - `const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"` + 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. - - `Agent BetaResponseCodeInterpreterCallCompletedEventAgent` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - The agent that owns this multi-agent streaming event. + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `AgentName string` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - The canonical name of the agent that produced this item. + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `type BetaResponseCodeInterpreterCallInProgressEvent struct{…}` + The user's location. - Emitted when a code interpreter call is in progress. + - `Type Approximate` - - `ItemID string` + The type of location approximation. Always `approximate`. - The unique identifier of the code interpreter tool call item. + - `const ApproximateApproximate Approximate = "approximate"` - - `OutputIndex int64` + - `City string` - The index of the output item in the response for which the code interpreter call is in progress. + Free text input for the city of the user, e.g. `San Francisco`. - - `SequenceNumber int64` + - `Country string` - The sequence number of this event, used to order streaming events. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `Type ResponseCodeInterpreterCallInProgress` + - `Region string` - The type of the event. Always `response.code_interpreter_call.in_progress`. + Free text input for the region of the user, e.g. `California`. - - `const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"` + - `Timezone string` - - `Agent BetaResponseCodeInterpreterCallInProgressEventAgent` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The agent that owns this multi-agent streaming event. + - `type BetaApplyPatchTool struct{…}` - - `AgentName string` + Allows the assistant to create, delete, or update files using unified diffs. - The canonical name of the agent that produced this item. + - `Type ApplyPatch` - - `type BetaResponseCodeInterpreterCallInterpretingEvent struct{…}` + The type of the tool. Always `apply_patch`. - Emitted when the code interpreter is actively interpreting the code snippet. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `ItemID string` + - `AllowedCallers []string` - The unique identifier of the code interpreter tool call item. + The tool invocation context(s). - - `OutputIndex int64` + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - The index of the output item in the response for which the code interpreter is interpreting code. + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `SequenceNumber int64` + - `Type ToolSearchOutput` - The sequence number of this event, used to order streaming events. + The item type. Always `tool_search_output`. - - `Type ResponseCodeInterpreterCallInterpreting` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - The type of the event. Always `response.code_interpreter_call.interpreting`. + - `ID string` - - `const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"` + The unique ID of this tool search output. - - `Agent BetaResponseCodeInterpreterCallInterpretingEventAgent` + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseCompletedEvent struct{…}` - - Emitted when the model response is complete. - - - `Response BetaResponse` + - `CallID string` - Properties of the completed response. + The unique ID of the tool search call generated by the model. - - `ID string` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - Unique identifier for this Response. + Whether tool search was executed by the server or by the client. - - `CreatedAt float64` + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - Unix timestamp (in seconds) of when this Response was created. + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - `Error BetaResponseError` + - `Status BetaResponseToolSearchOutputItemParamStatus` - An error object returned when the model fails to generate a Response. + The status of the tool search output. - - `Code BetaResponseErrorCode` + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - The error code for the response. + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + - `Role Developer` - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + The role that provided the additional tools. Only `developer` is supported. - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `const DeveloperDeveloper Developer = "developer"` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + - `Tools []BetaToolUnion` - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + A list of additional tools made available at this item. - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + - `type BetaFunctionTool struct{…}` - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + - `type BetaFileSearchTool struct{…}` - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + - `type BetaComputerTool struct{…}` - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + - `type BetaComputerUsePreviewTool struct{…}` - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + - `type BetaWebSearchTool struct{…}` - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + - `type BetaToolMcp struct{…}` - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `Message string` + - `type BetaToolCodeInterpreter struct{…}` - A human-readable description of the error. + A tool that runs Python code to help generate a response to a prompt. - - `IncompleteDetails BetaResponseIncompleteDetails` + - `type BetaToolProgrammaticToolCalling struct{…}` - Details about why the response is incomplete. + - `type BetaToolImageGeneration struct{…}` - - `Reason string` + A tool that generates images using the GPT image models. - The reason why the response is incomplete. + - `type BetaToolLocalShell struct{…}` - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + A tool that allows the model to execute shell commands in a local environment. - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + - `type BetaFunctionShellTool struct{…}` - - `Instructions BetaResponseInstructionsUnion` + A tool that allows the model to execute shell commands. - A system (or developer) message inserted into the model's context. + - `type BetaCustomTool struct{…}` - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `string` + - `type BetaNamespaceTool struct{…}` - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + Groups function/custom tools under a shared namespace. - A list of one or many input items to the model, containing - different content types. + - `type BetaToolSearchTool struct{…}` - - `type BetaEasyInputMessage struct{…}` + Hosted or BYOT tool search configuration for deferred tools. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `type BetaWebSearchPreviewTool struct{…}` - - `Content BetaEasyInputMessageContentUnion` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `type BetaApplyPatchTool struct{…}` - - `string` + Allows the assistant to create, delete, or update files using unified diffs. - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `Type AdditionalTools` - A list of one or many input items to the model, containing different content - types. + The item type. Always `additional_tools`. - - `type BetaResponseInputText struct{…}` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - A text input to the model. + - `ID string` - - `Text string` + The unique ID of this additional tools item. - The text input to the model. + - `Agent BetaResponseInputItemAdditionalToolsAgent` - - `Type InputText` + The agent that produced this item. - The type of the input item. Always `input_text`. + - `AgentName string` - - `const InputTextInputText InputText = "input_text"` + The canonical name of the agent that produced this item. - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `type BetaResponseReasoningItem struct{…}` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `Mode Explicit` + - `ID string` - The breakpoint mode. Always `explicit`. + The unique identifier of the reasoning content. - - `const ExplicitExplicit Explicit = "explicit"` + - `Summary []BetaResponseReasoningItemSummary` - - `type BetaResponseInputImage struct{…}` + Reasoning summary content. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Text string` - - `Detail BetaResponseInputImageDetail` + A summary of the reasoning output from the model so far. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Type SummaryText` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + The type of the object. Always `summary_text`. - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `Type Reasoning` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + The type of the object. Always `reasoning`. - - `Type InputImage` + - `const ReasoningReasoning Reasoning = "reasoning"` - The type of the input item. Always `input_image`. + - `Agent BetaResponseReasoningItemAgent` - - `const InputImageInputImage InputImage = "input_image"` + The agent that produced this item. - - `FileID string` + - `AgentName string` - The ID of the file to be sent to the model. + The canonical name of the agent that produced this item. - - `ImageURL string` + - `Content []BetaResponseReasoningItemContent` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + Reasoning text content. - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `Text string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The reasoning text from the model. - - `Mode Explicit` + - `Type ReasoningText` - The breakpoint mode. Always `explicit`. + The type of the reasoning text. Always `reasoning_text`. - - `const ExplicitExplicit Explicit = "explicit"` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `type BetaResponseInputFile struct{…}` + - `EncryptedContent string` - A file input to the model. + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `Type InputFile` + - `Status BetaResponseReasoningItemStatus` - The type of the input item. Always `input_file`. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const InputFileInputFile InputFile = "input_file"` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - `Detail BetaResponseInputFileDetail` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `type BetaResponseCompactionItemParamResp struct{…}` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `EncryptedContent string` - - `FileData string` + The encrypted content of the compaction summary. - The content of the file to be sent to the model. + - `Type Compaction` - - `FileID string` + The type of the item. Always `compaction`. - The ID of the file to be sent to the model. + - `const CompactionCompaction Compaction = "compaction"` - - `FileURL string` + - `ID string` - The URL of the file to be sent to the model. + The ID of the compaction item. - - `Filename string` + - `Agent BetaResponseCompactionItemParamAgentResp` - The name of the file to be sent to the model. + The agent that produced this item. - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `AgentName string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The canonical name of the agent that produced this item. - - `Mode Explicit` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - The breakpoint mode. Always `explicit`. + An image generation request made by the model. - - `const ExplicitExplicit Explicit = "explicit"` + - `ID string` - - `Role BetaEasyInputMessageRole` + The unique ID of the image generation call. - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + - `Result string` - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + The generated image encoded in base64. - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + - `Status string` - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + The status of the image generation call. - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - - `Phase BetaEasyInputMessagePhase` + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - 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 BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - - `Type BetaEasyInputMessageType` + - `Type ImageGenerationCall` - The type of the message input. Always `message`. + The type of the image generation call. Always `image_generation_call`. - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `type BetaResponseInputItemMessage struct{…}` + - `Agent BetaResponseInputItemImageGenerationCallAgent` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + The agent that produced this item. - - `Content BetaResponseInputMessageContentList` + - `AgentName string` - A list of one or many input items to the model, containing different content - types. + The canonical name of the agent that produced this item. - - `Role string` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - The role of the message input. One of `user`, `system`, or `developer`. + A tool call to run code. - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + - `ID string` - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + The unique ID of the code interpreter tool call. - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + - `Code string` - - `Agent BetaResponseInputItemMessageAgent` + The code to run, or null if not available. - The agent that produced this item. + - `ContainerID string` - - `AgentName string` + The ID of the container used to run the code. - The canonical name of the agent that produced this item. + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `Status string` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + The logs output from the code interpreter. - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + - `Logs string` - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + The logs output from the code interpreter. - - `Type string` + - `Type Logs` - The type of the message input. Always set to `message`. + The type of the output. Always `logs`. - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + - `const LogsLogs Logs = "logs"` - - `type BetaResponseOutputMessage struct{…}` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - An output message from the model. + The image output from the code interpreter. - - `ID string` + - `Type Image` - The unique ID of the output message. + The type of the output. Always `image`. - - `Content []BetaResponseOutputMessageContentUnion` + - `const ImageImage Image = "image"` - The content of the output message. + - `URL string` - - `type BetaResponseOutputText struct{…}` + The URL of the image output from the code interpreter. - A text output from the model. + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - The annotations of the text output. + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - A citation to a file. + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `FileID string` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - The ID of the file. + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `Filename string` + - `Type CodeInterpreterCall` - The filename of the file cited. + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `Index int64` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - The index of the file in the list of files. + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `Type FileCitation` + The agent that produced this item. - The type of the file citation. Always `file_citation`. + - `AgentName string` - - `const FileCitationFileCitation FileCitation = "file_citation"` + The canonical name of the agent that produced this item. - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `type BetaResponseInputItemLocalShellCall struct{…}` - A citation for a web resource used to generate a model response. + A tool call to run a command on the local shell. - - `EndIndex int64` + - `ID string` - The index of the last character of the URL citation in the message. + The unique ID of the local shell call. - - `StartIndex int64` + - `Action BetaResponseInputItemLocalShellCallAction` - The index of the first character of the URL citation in the message. + Execute a shell command on the server. - - `Title string` + - `Command []string` - The title of the web resource. + The command to run. - - `Type URLCitation` + - `Env map[string, string]` - The type of the URL citation. Always `url_citation`. + Environment variables to set for the command. - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Type Exec` - - `URL string` + The type of the local shell action. Always `exec`. - The URL of the web resource. + - `const ExecExec Exec = "exec"` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `TimeoutMs int64` - A citation for a container file used to generate a model response. + Optional timeout in milliseconds for the command. - - `ContainerID string` + - `User string` - The ID of the container file. + Optional user to run the command as. - - `EndIndex int64` + - `WorkingDirectory string` - The index of the last character of the container file citation in the message. + Optional working directory to run the command in. - - `FileID string` + - `CallID string` - The ID of the file. + The unique ID of the local shell tool call generated by the model. - - `Filename string` + - `Status string` - The filename of the container file cited. + The status of the local shell call. - - `StartIndex int64` + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` - The index of the first character of the container file citation in the message. + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` - - `Type ContainerFileCitation` + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` - The type of the container file citation. Always `container_file_citation`. + - `Type LocalShellCall` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + The type of the local shell call. Always `local_shell_call`. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - A path to a file. + - `Agent BetaResponseInputItemLocalShellCallAgent` - - `FileID string` + The agent that produced this item. - The ID of the file. + - `AgentName string` - - `Index int64` + The canonical name of the agent that produced this item. - The index of the file in the list of files. + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `Type FilePath` + The output of a local shell tool call. - The type of the file path. Always `file_path`. + - `ID string` - - `const FilePathFilePath FilePath = "file_path"` + The unique ID of the local shell tool call generated by the model. - - `Text string` + - `Output string` - The text output from the model. + A JSON string of the output of the local shell tool call. - - `Type OutputText` + - `Type LocalShellCallOutput` - The type of the output text. Always `output_text`. + The type of the local shell tool call output. Always `local_shell_call_output`. - - `const OutputTextOutputText OutputText = "output_text"` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `Logprobs []BetaResponseOutputTextLogprob` + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` - - `Token string` + The agent that produced this item. - - `Bytes []int64` + - `AgentName string` - - `Logprob float64` + The canonical name of the agent that produced this item. - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `Status string` - - `Token string` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `Bytes []int64` + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - - `Logprob float64` + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - - `type BetaResponseOutputRefusal struct{…}` + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - A refusal from the model. + - `type BetaResponseInputItemShellCall struct{…}` - - `Refusal string` + A tool representing a request to execute one or more shell commands. - The refusal explanation from the model. + - `Action BetaResponseInputItemShellCallAction` - - `Type Refusal` + The shell commands and limits that describe how to run the tool call. - The type of the refusal. Always `refusal`. + - `Commands []string` - - `const RefusalRefusal Refusal = "refusal"` + Ordered shell commands for the execution environment to run. - - `Role Assistant` + - `MaxOutputLength int64` - The role of the output message. Always `assistant`. + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - `const AssistantAssistant Assistant = "assistant"` + - `TimeoutMs int64` - - `Status BetaResponseOutputMessageStatus` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `CallID string` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + The unique ID of the shell tool call generated by the model. - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `Type ShellCall` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + The type of the item. Always `shell_call`. - - `Type Message` + - `const ShellCallShellCall ShellCall = "shell_call"` - The type of the output message. Always `message`. + - `ID string` - - `const MessageMessage Message = "message"` + The unique ID of the shell tool call. Populated when this item is returned via API. - - `Agent BetaResponseOutputMessageAgent` + - `Agent BetaResponseInputItemShellCallAgent` The agent that produced this item. @@ -124459,373 +136942,365 @@ func main() { The canonical name of the agent that produced this item. - - `Phase BetaResponseOutputMessagePhase` + - `Caller BetaResponseInputItemShellCallCallerUnion` - 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. + The execution context that produced this tool call. - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - `type BetaResponseFileSearchToolCall struct{…}` + - `Type Direct` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The caller type. Always `direct`. - - `ID string` + - `const DirectDirect Direct = "direct"` - The unique ID of the file search tool call. + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - - `Queries []string` + - `CallerID string` - The queries used to search for files. + The call ID of the program item that produced this tool call. - - `Status BetaResponseFileSearchToolCallStatus` + - `Type Program` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + The caller type. Always `program`. - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + - `const ProgramProgram Program = "program"` - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + The environment to execute the shell commands in. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `type BetaLocalEnvironment struct{…}` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + - `type BetaContainerReference struct{…}` - - `Type FileSearchCall` + - `Status string` - The type of the file search tool call. Always `file_search_call`. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - - `Agent BetaResponseFileSearchToolCallAgent` + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - The agent that produced this item. + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - - `AgentName string` + - `type BetaResponseInputItemShellCallOutput struct{…}` - The canonical name of the agent that produced this item. + The streamed output items emitted by a shell tool call. - - `Results []BetaResponseFileSearchToolCallResult` + - `CallID string` - The results of the file search tool call. + The unique ID of the shell tool call generated by the model. - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + - `Output []BetaResponseFunctionShellCallOutputContent` - 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. + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `string` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - `float64` + The exit or timeout outcome associated with this shell call. - - `bool` + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - - `FileID string` + Indicates that the shell call exceeded its configured time limit. - The unique ID of the file. + - `Type Timeout` - - `Filename string` + The outcome type. Always `timeout`. - The name of the file. + - `const TimeoutTimeout Timeout = "timeout"` - - `Score float64` + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - The relevance score of the file - a value between 0 and 1. + Indicates that the shell commands finished and returned an exit code. - - `Text string` + - `ExitCode int64` - The text that was retrieved from the file. + The exit code returned by the shell process. - - `type BetaResponseComputerToolCall struct{…}` + - `Type Exit` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + The outcome type. Always `exit`. - - `ID string` + - `const ExitExit Exit = "exit"` - The unique ID of the computer call. + - `Stderr string` - - `CallID string` + Captured stderr output for the shell call. - An identifier used when responding to the tool call with output. + - `Stdout string` - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + Captured stdout output for the shell call. - The pending safety checks for the computer call. + - `Type ShellCallOutput` + + The type of the item. Always `shell_call_output`. + + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - `ID string` - The ID of the pending safety check. + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `Code string` + - `Agent BetaResponseInputItemShellCallOutputAgent` - The type of the pending safety check. + The agent that produced this item. - - `Message string` + - `AgentName string` - Details about the pending safety check. + The canonical name of the agent that produced this item. - - `Status BetaResponseComputerToolCallStatus` + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The execution context that produced this tool call. - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `Type Direct` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + The caller type. Always `direct`. - - `Type BetaResponseComputerToolCallType` + - `const DirectDirect Direct = "direct"` - The type of the computer call. Always `computer_call`. + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `CallerID string` - - `Action BetaComputerActionUnion` + The call ID of the program item that produced this tool call. - A click action. + - `Type Program` - - `type BetaComputerActionClick struct{…}` + The caller type. Always `program`. - A click action. + - `const ProgramProgram Program = "program"` - - `Button string` + - `MaxOutputLength int64` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `Status string` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + The status of the shell call output. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - - `Type Click` + - `type BetaResponseInputItemApplyPatchCall struct{…}` - Specifies the event type. For a click action, this property is always `click`. + A tool call representing a request to create, delete, or update files using diff patches. - - `const ClickClick Click = "click"` + - `CallID string` - - `X int64` + The unique ID of the apply patch tool call generated by the model. - The x-coordinate where the click occurred. + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - - `Y int64` + The specific create, delete, or update instruction for the apply_patch tool call. - The y-coordinate where the click occurred. + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - - `Keys []string` + Instruction for creating a new file via the apply_patch tool. - The keys being held while clicking. + - `Diff string` - - `type BetaComputerActionDoubleClick struct{…}` + Unified diff content to apply when creating the file. - A double click action. + - `Path string` - - `Keys []string` + Path of the file to create relative to the workspace root. - The keys being held while double-clicking. + - `Type CreateFile` - - `Type DoubleClick` + The operation type. Always `create_file`. - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - - `X int64` + Instruction for deleting an existing file via the apply_patch tool. - The x-coordinate where the double click occurred. + - `Path string` - - `Y int64` + Path of the file to delete relative to the workspace root. - The y-coordinate where the double click occurred. + - `Type DeleteFile` - - `type BetaComputerActionDrag struct{…}` + The operation type. Always `delete_file`. - A drag action. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `Path []BetaComputerActionDragPath` + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + Instruction for updating an existing file via the apply_patch tool. - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `Diff string` - - `X int64` + Unified diff content to apply to the existing file. - The x-coordinate. + - `Path string` - - `Y int64` + Path of the file to update relative to the workspace root. - The y-coordinate. + - `Type UpdateFile` - - `Type Drag` + The operation type. Always `update_file`. - Specifies the event type. For a drag action, this property is always set to `drag`. + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `const DragDrag Drag = "drag"` + - `Status string` - - `Keys []string` + The status of the apply patch tool call. One of `in_progress` or `completed`. - The keys being held while dragging the mouse. + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `type BetaComputerActionKeypress struct{…}` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - A collection of keypresses the model would like to perform. + - `Type ApplyPatchCall` - - `Keys []string` + The type of the item. Always `apply_patch_call`. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `Type Keypress` + - `ID string` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const KeypressKeypress Keypress = "keypress"` + - `Agent BetaResponseInputItemApplyPatchCallAgent` - - `type BetaComputerActionMove struct{…}` + The agent that produced this item. - A mouse move action. + - `AgentName string` - - `Type Move` + The canonical name of the agent that produced this item. - Specifies the event type. For a move action, this property is always set to `move`. + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - - `const MoveMove Move = "move"` + The execution context that produced this tool call. - - `X int64` + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - The x-coordinate to move to. + - `Type Direct` - - `Y int64` + The caller type. Always `direct`. - The y-coordinate to move to. + - `const DirectDirect Direct = "direct"` - - `Keys []string` + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - The keys being held while moving the mouse. + - `CallerID string` - - `type BetaComputerActionScreenshot struct{…}` + The call ID of the program item that produced this tool call. - A screenshot action. + - `Type Program` - - `Type Screenshot` + The caller type. Always `program`. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `const ProgramProgram Program = "program"` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - - `type BetaComputerActionScroll struct{…}` + The streamed output emitted by an apply patch tool call. - A scroll action. + - `CallID string` - - `ScrollX int64` + The unique ID of the apply patch tool call generated by the model. - The horizontal scroll distance. + - `Status string` - - `ScrollY int64` + The status of the apply patch tool call output. One of `completed` or `failed`. - The vertical scroll distance. + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - - `Type Scroll` + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `Type ApplyPatchCallOutput` - - `const ScrollScroll Scroll = "scroll"` + The type of the item. Always `apply_patch_call_output`. - - `X int64` + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - The x-coordinate where the scroll occurred. + - `ID string` - - `Y int64` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - The y-coordinate where the scroll occurred. + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - - `Keys []string` + The agent that produced this item. - The keys being held while scrolling. + - `AgentName string` - - `type BetaComputerActionType struct{…}` + The canonical name of the agent that produced this item. - An action to type in text. + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - - `Text string` + The execution context that produced this tool call. - The text to type. + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - - `Type Type` + - `Type Direct` - Specifies the event type. For a type action, this property is always set to `type`. + The caller type. Always `direct`. - - `const TypeType Type = "type"` + - `const DirectDirect Direct = "direct"` - - `type BetaComputerActionWait struct{…}` + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - A wait action. + - `CallerID string` - - `Type Wait` + The call ID of the program item that produced this tool call. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `Type Program` - - `const WaitWait Wait = "wait"` + The caller type. Always `program`. - - `Actions BetaComputerActionList` + - `const ProgramProgram Program = "program"` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `Output string` - - `type BetaComputerActionClick struct{…}` + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - A click action. + - `type BetaResponseInputItemMcpListTools struct{…}` - - `type BetaComputerActionDoubleClick struct{…}` + A list of tools available on an MCP server. - A double click action. + - `ID string` - - `type BetaComputerActionDrag struct{…}` + The unique ID of the list. - A drag action. + - `ServerLabel string` - - `type BetaComputerActionKeypress struct{…}` + The label of the MCP server. - A collection of keypresses the model would like to perform. + - `Tools []BetaResponseInputItemMcpListToolsTool` - - `type BetaComputerActionMove struct{…}` + The tools available on the server. - A mouse move action. + - `InputSchema any` - - `type BetaComputerActionScreenshot struct{…}` + The JSON schema describing the tool's input. - A screenshot action. + - `Name string` - - `type BetaComputerActionScroll struct{…}` + The name of the tool. - A scroll action. + - `Annotations any` - - `type BetaComputerActionType struct{…}` + Additional annotations about the tool. - An action to type in text. + - `Description string` - - `type BetaComputerActionWait struct{…}` + The description of the tool. - A wait action. + - `Type McpListTools` - - `Agent BetaResponseComputerToolCallAgent` + The type of the item. Always `mcp_list_tools`. + + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + + - `Agent BetaResponseInputItemMcpListToolsAgent` The agent that produced this item. @@ -124833,60 +137308,67 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemComputerCallOutput struct{…}` + - `Error string` - The output of a computer tool call. + Error message if the server could not list tools. - - `CallID string` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - The ID of the computer tool call that produced the output. + A request for human approval of a tool invocation. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `ID string` - A computer screenshot image used with the computer use tool. + The unique ID of the approval request. - - `Type ComputerScreenshot` + - `Arguments string` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + A JSON string of arguments for the tool. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `Name string` - - `FileID string` + The name of the tool to run. - The identifier of an uploaded file that contains the screenshot. + - `ServerLabel string` - - `ImageURL string` + The label of the MCP server making the request. - The URL of the screenshot image. + - `Type McpApprovalRequest` - - `Type ComputerCallOutput` + The type of the item. Always `mcp_approval_request`. - The type of the computer tool call output. Always `computer_call_output`. + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - - `ID string` + The agent that produced this item. - The ID of the computer tool call output. + - `AgentName string` - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + The canonical name of the agent that produced this item. - The safety checks reported by the API that have been acknowledged by the developer. + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - - `ID string` + A response to an MCP approval request. - The ID of the pending safety check. + - `ApprovalRequestID string` - - `Code string` + The ID of the approval request being answered. - The type of the pending safety check. + - `Approve bool` - - `Message string` + Whether the request was approved. - Details about the pending safety check. + - `Type McpApprovalResponse` - - `Agent BetaResponseInputItemComputerCallOutputAgent` + The type of the item. Always `mcp_approval_response`. + + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + + - `ID string` + + The unique ID of the approval response + + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` The agent that produced this item. @@ -124894,113 +137376,113 @@ func main() { The canonical name of the agent that produced this item. - - `Status string` + - `Reason string` - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + Optional reason for the decision. - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + - `type BetaResponseInputItemMcpCall struct{…}` - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + An invocation of a tool on an MCP server. - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + - `ID string` - - `type BetaResponseFunctionWebSearch struct{…}` + The unique ID of the tool call. - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `Arguments string` - - `ID string` + A JSON string of the arguments passed to the tool. - The unique ID of the web search tool call. + - `Name string` - - `Action BetaResponseFunctionWebSearchActionUnion` + The name of the tool that was run. - 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). + - `ServerLabel string` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + The label of the MCP server running the tool. - Action type "search" - Performs a web search query. + - `Type McpCall` - - `Type Search` + The type of the item. Always `mcp_call`. - The action type. + - `const McpCallMcpCall McpCall = "mcp_call"` - - `const SearchSearch Search = "search"` + - `Agent BetaResponseInputItemMcpCallAgent` - - `Queries []string` + The agent that produced this item. - The search queries. + - `AgentName string` - - `Query string` + The canonical name of the agent that produced this item. - The search query. + - `ApprovalRequestID string` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + 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. - The sources used in the search. + - `Error string` - - `Type URL` + The error from the tool call, if any. - The type of source. Always `url`. + - `Output string` - - `const URLURL URL = "url"` + The output from the tool call. - - `URL string` + - `Status string` - The URL of the source. + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - Action type "open_page" - Opens a specific URL from search results. + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - `Type OpenPage` + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - The action type. + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - `const OpenPageOpenPage OpenPage = "open_page"` + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - `URL string` + - `type BetaResponseCustomToolCallOutput struct{…}` - The URL opened by the model. + The output of a custom tool call from your code, being sent back to the model. - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `CallID string` - Action type "find_in_page": Searches for a pattern within a loaded page. + The call ID, used to map this custom tool call output to a custom tool call. - - `Pattern string` + - `Output BetaResponseCustomToolCallOutputOutputUnion` - The pattern or text to search for within the page. + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `Type FindInPage` + - `string` - The action type. + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + Text, image, or file output of the custom tool call. - - `URL string` + - `type BetaResponseInputText struct{…}` - The URL of the page searched for the pattern. + A text input to the model. - - `Status BetaResponseFunctionWebSearchStatus` + - `type BetaResponseInputImage struct{…}` - The status of the web search tool call. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `type BetaResponseInputFile struct{…}` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + A file input to the model. - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `Type CustomToolCallOutput` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + The type of the custom tool call output. Always `custom_tool_call_output`. - - `Type WebSearchCall` + - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - The type of the web search tool call. Always `web_search_call`. + - `ID string` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + The unique ID of the custom tool call output in the OpenAI platform. - - `Agent BetaResponseFunctionWebSearchAgent` + - `Agent BetaResponseCustomToolCallOutputAgent` The agent that produced this item. @@ -125008,34 +137490,57 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseFunctionToolCall struct{…}` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + The execution context that produced this tool call. - - `Arguments string` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - A JSON string of the arguments to pass to the function. + - `Type Direct` + + The caller type. Always `direct`. + + - `const DirectDirect Direct = "direct"` + + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + + - `CallerID string` + + The call ID of the program item that produced this tool call. + + - `Type Program` + + The caller type. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `type BetaResponseCustomToolCall struct{…}` + + A call to a custom tool created by the model. - `CallID string` - The unique ID of the function tool call generated by the model. + An identifier used to map this custom tool call to a tool call output. + + - `Input string` + + The input for the custom tool call generated by the model. - `Name string` - The name of the function to run. + The name of the custom tool being called. - - `Type FunctionCall` + - `Type CustomToolCall` - The type of the function tool call. Always `function_call`. + The type of the custom tool call. Always `custom_tool_call`. - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - `ID string` - The unique ID of the function tool call. + The unique ID of the custom tool call in the OpenAI platform. - - `Agent BetaResponseFunctionToolCallAgent` + - `Agent BetaResponseCustomToolCallAgent` The agent that produced this item. @@ -125043,17 +137548,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `Caller BetaResponseCustomToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - `Type Direct` - `const DirectDirect Direct = "direct"` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - `CallerID string` @@ -125065,1570 +137570,1576 @@ func main() { - `Namespace string` - The namespace of the function to run. + The namespace of the custom tool being called. - - `Status BetaResponseFunctionToolCallStatus` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Compacts the current context. Must be the final input item. - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + - `Type CompactionTrigger` - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + The type of the item. Always `compaction_trigger`. - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - The output of a function tool call. + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseInputItemItemReference struct{…}` + + An internal identifier for an item to reference. + + - `ID string` + + The ID of the item to reference. + + - `Agent BetaResponseInputItemItemReferenceAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Type string` + + The type of item to reference. Always `item_reference`. + + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + + - `type BetaResponseInputItemProgram struct{…}` + + - `ID string` + + The unique ID of this program item. - `CallID string` - The unique ID of the function tool call generated by the model. + The stable call ID of the program item. - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + - `Code string` - Text, image, or file output of the function tool call. + The JavaScript source executed by programmatic tool calling. - - `string` + - `Fingerprint string` - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + Opaque program replay fingerprint that must be round-tripped. - An array of content outputs (text, image, file) for the function tool call. + - `Type Program` - - `type BetaResponseInputTextContent struct{…}` + The item type. Always `program`. - A text input to the model. + - `const ProgramProgram Program = "program"` - - `Text string` + - `Agent BetaResponseInputItemProgramAgent` - The text input to the model. + The agent that produced this item. - - `Type InputText` + - `AgentName string` - The type of the input item. Always `input_text`. + The canonical name of the agent that produced this item. - - `const InputTextInputText InputText = "input_text"` + - `type BetaResponseInputItemProgramOutput struct{…}` - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + - `ID string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The unique ID of this program output item. - - `Mode Explicit` + - `CallID string` - The breakpoint mode. Always `explicit`. + The call ID of the program item. - - `const ExplicitExplicit Explicit = "explicit"` + - `Result string` - - `type BetaResponseInputImageContent struct{…}` + The result produced by the program item. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + - `Status string` - - `Type InputImage` + The terminal status of the program output. - The type of the input item. Always `input_image`. + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `const InputImageInputImage InputImage = "input_image"` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - - `Detail BetaResponseInputImageContentDetail` + - `Type ProgramOutput` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The item type. Always `program_output`. - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + - `Agent BetaResponseInputItemProgramOutputAgent` - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + The agent that produced this item. - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `AgentName string` - - `FileID string` + The canonical name of the agent that produced this item. - The ID of the file to be sent to the model. + - `Metadata map[string, string]` - - `ImageURL string` + 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. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `Model BetaResponseModel` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - - `Mode Explicit` + - `type BetaResponseModel string` - The breakpoint mode. Always `explicit`. + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` - - `type BetaResponseInputFileContent struct{…}` + - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` - A file input to the model. + - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` - - `Type InputFile` + - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` - The type of the input item. Always `input_file`. + - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` - - `const InputFileInputFile InputFile = "input_file"` + - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` - - `Detail BetaResponseInputFileContentDetail` + - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` - - `FileData string` + - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` - The base64-encoded data of the file to be sent to the model. + - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` - - `FileID string` + - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` - The ID of the file to be sent to the model. + - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` - - `FileURL string` + - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` - The URL of the file to be sent to the model. + - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` - - `Filename string` + - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` - The name of the file to be sent to the model. + - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` - - `Mode Explicit` + - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` - The breakpoint mode. Always `explicit`. + - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` - - `Type FunctionCallOutput` + - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` - The type of the function tool call output. Always `function_call_output`. + - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` - - `ID string` + - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` - The unique ID of the function tool call output. Populated when this item is returned via API. + - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` - The agent that produced this item. + - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` - - `AgentName string` + - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` - The execution context that produced this tool call. + - `const BetaResponseModelO3 BetaResponseModel = "o3"` - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` - - `Type Direct` + - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` - The caller type. Always `direct`. + - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` - - `const DirectDirect Direct = "direct"` + - `const BetaResponseModelO1 BetaResponseModel = "o1"` - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` - - `CallerID string` + - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` - The call ID of the program item that produced this tool call. + - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` - - `Type Program` + - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` - The caller type. Always `program`. + - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` - - `Status string` + - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` - - `type BetaResponseInputItemAgentMessage struct{…}` + - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` - A message routed between agents. + - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` - - `Author string` + - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` - The sending agent identity. + - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - `Content []BetaResponseInputItemAgentMessageContentUnion` + - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` - Plaintext, image, or encrypted content sent between agents. + - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` - - `type BetaResponseInputTextContent struct{…}` + - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` - A text input to the model. + - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `type BetaResponseInputImageContent struct{…}` + - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + + - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + + - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` - - `EncryptedContent string` + - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` - Opaque encrypted content. + - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` - - `Type EncryptedContent` + - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` - The type of the input item. Always `encrypted_content`. + - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` - - `Recipient string` + - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` - The destination agent identity. + - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` - - `Type AgentMessage` + - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` - The item type. Always `agent_message`. + - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` - - `ID string` + - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` - The unique ID of this agent message item. + - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` - - `Agent BetaResponseInputItemAgentMessageAgent` + - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` - The agent that produced this item. + - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` - - `AgentName string` + - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` - The canonical name of the agent that produced this item. + - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` - - `type BetaResponseInputItemMultiAgentCall struct{…}` + - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` - - `Action string` + - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` - The multi-agent action that was executed. + - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` - - `Arguments string` + - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` - The action arguments as a JSON string. + - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` - - `CallID string` + - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` - The unique ID linking this call to its output. + - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` - - `Type MultiAgentCall` + - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` - The item type. Always `multi_agent_call`. + - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `string` - - `ID string` + - `Object Response` - The unique ID of this multi-agent call. + The object type of this resource - always set to `response`. - - `Agent BetaResponseInputItemMultiAgentCallAgent` + - `const ResponseResponse Response = "response"` - The agent that produced this item. + - `Output []BetaResponseOutputItemUnion` - - `AgentName string` + An array of content items generated by the model. - The canonical name of the agent that produced this item. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `type BetaResponseOutputMessage struct{…}` - - `Action string` + An output message from the model. - The multi-agent action that produced this result. + - `type BetaResponseFileSearchToolCall struct{…}` - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `type BetaResponseFunctionToolCall struct{…}` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + - `ID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + The unique ID of the function call tool output. - `CallID string` - The unique ID of the multi-agent call. + The unique ID of the function tool call generated by the model. - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - Text output returned by the multi-agent action. + The output from the function call generated by your code. + Can be a string or an list of output content. - - `Text string` + - `string` - The text content. + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - - `Type OutputText` + Text, image, or file output of the function call. - The content type. Always `output_text`. + - `type BetaResponseInputText struct{…}` - - `const OutputTextOutputText OutputText = "output_text"` + A text input to the model. - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + - `type BetaResponseInputImage struct{…}` - Citations associated with the text content. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + - `type BetaResponseInputFile struct{…}` - - `FileID string` + A file input to the model. - The ID of the file. + - `Status BetaResponseFunctionToolCallOutputItemStatus` - - `Filename string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The filename of the file cited. + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `Index int64` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - The index of the file in the list of files. + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `Type FileCitation` + - `Type FunctionCallOutput` - The citation type. Always `file_citation`. + The type of the function tool call output. Always `function_call_output`. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - - `EndIndex int64` + The agent that produced this item. - The index of the last character of the citation in the message. + - `AgentName string` - - `StartIndex int64` + The canonical name of the agent that produced this item. - The index of the first character of the citation in the message. + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - `Title string` + The execution context that produced this tool call. - The title of the cited resource. + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - - `Type URLCitation` + - `Type Direct` - The citation type. Always `url_citation`. + The caller type. Always `direct`. - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `const DirectDirect Direct = "direct"` - - `URL string` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - The URL of the cited resource. + - `CallerID string` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + The call ID of the program item that produced this tool call. - - `ContainerID string` + - `Type Program` - The ID of the container. + The caller type. Always `program`. - - `EndIndex int64` + - `const ProgramProgram Program = "program"` - The index of the last character of the citation in the message. + - `CreatedBy string` - - `FileID string` + The identifier of the actor that created the item. - The ID of the container file. + - `type BetaResponseOutputItemAgentMessage struct{…}` - - `Filename string` + - `ID string` - The filename of the container file cited. + The unique ID of the agent message. - - `StartIndex int64` + - `Author string` - The index of the first character of the citation in the message. + The sending agent identity. - - `Type ContainerFileCitation` + - `Content []BetaResponseOutputItemAgentMessageContentUnion` - The citation type. Always `container_file_citation`. + Encrypted content sent between agents. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `type BetaResponseInputText struct{…}` - - `Type MultiAgentCallOutput` + A text input to the model. - The item type. Always `multi_agent_call_output`. + - `type BetaResponseOutputText struct{…}` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + A text output from the model. - - `ID string` + - `type BetaResponseOutputItemAgentMessageContentText struct{…}` - The unique ID of this multi-agent call output. + A text content. - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + - `Text string` - The agent that produced this item. + - `Type Text` - - `AgentName string` + - `const TextText Text = "text"` - The canonical name of the agent that produced this item. + - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` - - `type BetaResponseInputItemToolSearchCall struct{…}` + A summary text from the model. - - `Arguments any` + - `Text string` - The arguments supplied to the tool search call. + A summary of the reasoning output from the model so far. - - `Type ToolSearchCall` + - `Type SummaryText` - The item type. Always `tool_search_call`. + The type of the object. Always `summary_text`. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `ID string` + - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` - The unique ID of this tool search call. + Reasoning text from the model. - - `Agent BetaResponseInputItemToolSearchCallAgent` + - `Text string` - The agent that produced this item. + The reasoning text from the model. - - `AgentName string` + - `Type ReasoningText` - The canonical name of the agent that produced this item. + The type of the reasoning text. Always `reasoning_text`. - - `CallID string` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - The unique ID of the tool search call generated by the model. + - `type BetaResponseOutputRefusal struct{…}` - - `Execution string` + A refusal from the model. - Whether tool search was executed by the server or by the client. + - `type BetaResponseInputImage struct{…}` - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` - - `Status string` + A screenshot of a computer. - The status of the tool search call. + - `Detail string` - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `Tools []BetaToolUnion` + - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` - The loaded tool definitions returned by the tool search output. + - `FileID string` - - `type BetaFunctionTool struct{…}` + The identifier of an uploaded file that contains the screenshot. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `ImageURL string` - - `Name string` + The URL of the screenshot image. - The name of the function to call. + - `Type ComputerScreenshot` - - `Parameters map[string, any]` + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - A JSON schema object describing the parameters of the function. + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - - `Strict bool` + - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - Whether strict parameter validation is enforced for this function tool. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Type Function` + - `Mode Explicit` - The type of the function tool. Always `function`. + The breakpoint mode. Always `explicit`. - - `const FunctionFunction Function = "function"` + - `const ExplicitExplicit Explicit = "explicit"` - - `AllowedCallers []string` + - `type BetaResponseInputFile struct{…}` - The tool invocation context(s). + A file input to the model. - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `DeferLoading bool` + - `EncryptedContent string` - Whether this function is deferred and loaded via tool search. + Opaque encrypted content. - - `Description string` + - `Type EncryptedContent` - A description of the function. Used by the model to determine whether or not to call the function. + The type of the input item. Always `encrypted_content`. - - `OutputSchema map[string, any]` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - A JSON schema object describing the JSON value encoded in string outputs for this function. + - `Recipient string` - - `type BetaFileSearchTool struct{…}` + The destination agent identity. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `Type AgentMessage` - - `Type FileSearch` + The type of the item. Always `agent_message`. - The type of the file search tool. Always `file_search`. + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `Agent BetaResponseOutputItemAgentMessageAgent` - - `VectorStoreIDs []string` + The agent that produced this item. - The IDs of the vector stores to search. + - `AgentName string` - - `Filters BetaFileSearchToolFiltersUnion` + The canonical name of the agent that produced this item. - A filter to apply. + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `ID string` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + The unique ID of the multi-agent call item. - - `Key string` + - `Action string` - The key to compare against the value. + The multi-agent action to execute. - - `Type string` + - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` - - `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 BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `Arguments string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + The JSON string of arguments generated for the action. - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + - `CallID string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + The unique ID linking this call to its output. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `Type MultiAgentCall` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + The type of the multi-agent call. Always `multi_agent_call`. - The value to compare against the attribute key; supports string, number, or boolean types. + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `string` + - `Agent BetaResponseOutputItemMultiAgentCallAgent` - - `float64` + The agent that produced this item. - - `bool` + - `AgentName string` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + The canonical name of the agent that produced this item. - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - Combine multiple filters using `and` or `or`. + - `ID string` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + The unique ID of the multi-agent call output item. - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `Action string` - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + The multi-agent action that produced this result. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` - - `Key string` + - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` - The key to compare against the value. + - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` - - `Type string` + - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` - - `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 BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `CallID string` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + The unique ID of the multi-agent call. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `Output []BetaResponseOutputText` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + Text output returned by the multi-agent action. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + The annotations of the text output. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `Text string` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + The text output from the model. - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + - `Type OutputText` - The value to compare against the attribute key; supports string, number, or boolean types. + The type of the output text. Always `output_text`. - - `string` + - `Logprobs []BetaResponseOutputTextLogprob` - - `float64` + - `Type MultiAgentCallOutput` - - `bool` + The type of the multi-agent result. Always `multi_agent_call_output`. - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - - `Type string` + - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` - Type of operation: `and` or `or`. + The agent that produced this item. - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + - `AgentName string` - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + The canonical name of the agent that produced this item. - - `MaxNumResults int64` + - `type BetaResponseFunctionWebSearch struct{…}` - The maximum number of results to return. This number should be between 1 and 50 inclusive. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `RankingOptions BetaFileSearchToolRankingOptions` + - `type BetaResponseComputerToolCall struct{…}` - Ranking options for search. + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + - `ID string` - - `EmbeddingWeight float64` + The unique ID of the computer call tool output. - The weight of the embedding in the reciprocal ranking fusion. + - `CallID string` - - `TextWeight float64` + The ID of the computer tool call that produced the output. - The weight of the text in the reciprocal ranking fusion. + - `Output BetaResponseComputerToolCallOutputScreenshot` - - `Ranker string` + A computer screenshot image used with the computer use tool. - The ranker to use for the file search. + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - - `ScoreThreshold float64` + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - 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. + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - - `type BetaComputerTool struct{…}` + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Type ComputerCallOutput` - - `Type Computer` + The type of the computer tool call output. Always `computer_call_output`. - The type of the computer tool. Always `computer`. + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `const ComputerComputer Computer = "computer"` + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `type BetaComputerUsePreviewTool struct{…}` + The safety checks reported by the API that have been acknowledged by the + developer. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `ID string` - - `DisplayHeight int64` + The ID of the pending safety check. - The height of the computer display. + - `Code string` - - `DisplayWidth int64` + The type of the pending safety check. - The width of the computer display. + - `Message string` - - `Environment BetaComputerUsePreviewToolEnvironment` + Details about the pending safety check. - The type of computer environment to control. + - `Agent BetaResponseComputerToolCallOutputItemAgent` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + The agent that produced this item. - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `AgentName string` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + The canonical name of the agent that produced this item. - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `CreatedBy string` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + The identifier of the actor that created the item. - - `Type ComputerUsePreview` + - `type BetaResponseReasoningItem struct{…}` - The type of the computer use tool. Always `computer_use_preview`. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `type BetaResponseOutputItemProgram struct{…}` - - `type BetaWebSearchTool struct{…}` + - `ID string` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The unique ID of the program item. - - `Type BetaWebSearchToolType` + - `CallID string` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + The stable call ID of the program item. - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `Code string` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + The JavaScript source executed by programmatic tool calling. - - `Filters BetaWebSearchToolFilters` + - `Fingerprint string` - Filters for the search. + Opaque program replay fingerprint that must be round-tripped. - - `AllowedDomains []string` + - `Type Program` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + The type of the item. Always `program`. - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `const ProgramProgram Program = "program"` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + - `Agent BetaResponseOutputItemProgramAgent` - 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. + The agent that produced this item. - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `AgentName string` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + The canonical name of the agent that produced this item. - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `type BetaResponseOutputItemProgramOutput struct{…}` - - `UserLocation BetaWebSearchToolUserLocation` + - `ID string` - The approximate location of the user. + The unique ID of the program output item. - - `City string` + - `CallID string` - Free text input for the city of the user, e.g. `San Francisco`. + The call ID of the program item. - - `Country string` + - `Result string` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + The result produced by the program item. - - `Region string` + - `Status string` - Free text input for the region of the user, e.g. `California`. + The terminal status of the program output item. - - `Timezone string` + - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` - - `Type string` + - `Type ProgramOutput` - The type of location approximation. Always `approximate`. + The type of the item. Always `program_output`. - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `type BetaToolMcp struct{…}` + - `Agent BetaResponseOutputItemProgramOutputAgent` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The agent that produced this item. - - `ServerLabel string` + - `AgentName string` - A label for this MCP server, used to identify it in tool calls. + The canonical name of the agent that produced this item. - - `Type Mcp` + - `type BetaResponseToolSearchCall struct{…}` - The type of the MCP tool. Always `mcp`. + - `ID string` - - `const McpMcp Mcp = "mcp"` + The unique ID of the tool search call item. - - `AllowedCallers []string` + - `Arguments any` - The tool invocation context(s). + Arguments used for the tool search call. - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + - `CallID string` - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + The unique ID of the tool search call generated by the model. - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `Execution BetaResponseToolSearchCallExecution` - List of allowed tool names or a filter object. + Whether tool search was executed by the server or by the client. - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - A string array of allowed tool names + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `Status BetaResponseToolSearchCallStatus` - A filter object to specify which tools are allowed. + The status of the tool search call item that was recorded. - - `ReadOnly bool` + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - - `ToolNames []string` + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - List of allowed tool names. + - `Type ToolSearchCall` - - `Authorization string` + The type of the item. Always `tool_search_call`. - 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. + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `ConnectorID string` + - `Agent BetaResponseToolSearchCallAgent` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + The agent that produced this item. - Currently supported `connector_id` values are: + - `AgentName string` - - 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` + The canonical name of the agent that produced this item. - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + - `CreatedBy string` - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + The identifier of the actor that created the item. - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `type BetaResponseToolSearchOutputItem struct{…}` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + - `ID string` - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + The unique ID of the tool search output item. - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + - `CallID string` - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + The unique ID of the tool search call generated by the model. - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + - `Execution BetaResponseToolSearchOutputItemExecution` - - `DeferLoading bool` + Whether tool search was executed by the server or by the client. - Whether this MCP tool is deferred and discovered via tool search. + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - `Headers map[string, string]` + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `Status BetaResponseToolSearchOutputItemStatus` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + The status of the tool search output item that was recorded. - Specify which of the MCP server's tools require approval. + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `Tools []BetaToolUnion` - A filter object to specify which tools are allowed. + The loaded tool definitions returned by tool search. - - `ReadOnly bool` + - `type BetaFunctionTool struct{…}` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `ToolNames []string` + - `type BetaFileSearchTool struct{…}` - List of allowed tool names. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `type BetaComputerTool struct{…}` - A filter object to specify which tools are allowed. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `ReadOnly bool` + - `type BetaComputerUsePreviewTool struct{…}` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `ToolNames []string` + - `type BetaWebSearchTool struct{…}` - List of allowed tool names. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `type BetaToolMcp struct{…}` - 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. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `type BetaToolCodeInterpreter struct{…}` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + A tool that runs Python code to help generate a response to a prompt. - - `ServerDescription string` + - `type BetaToolProgrammaticToolCalling struct{…}` - Optional description of the MCP server, used to provide more context. + - `type BetaToolImageGeneration struct{…}` - - `ServerURL string` + A tool that generates images using the GPT image models. - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `type BetaToolLocalShell struct{…}` - - `TunnelID string` + A tool that allows the model to execute shell commands in a local environment. - 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 BetaFunctionShellTool struct{…}` - - `type BetaToolCodeInterpreter struct{…}` + A tool that allows the model to execute shell commands. - A tool that runs Python code to help generate a response to a prompt. + - `type BetaCustomTool struct{…}` - - `Container BetaToolCodeInterpreterContainerUnion` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - 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. + - `type BetaNamespaceTool struct{…}` - - `string` + Groups function/custom tools under a shared namespace. - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + - `type BetaToolSearchTool struct{…}` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + Hosted or BYOT tool search configuration for deferred tools. - - `Type Auto` + - `type BetaWebSearchPreviewTool struct{…}` - Always `auto`. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `const AutoAuto Auto = "auto"` + - `type BetaApplyPatchTool struct{…}` - - `FileIDs []string` + Allows the assistant to create, delete, or update files using unified diffs. - An optional list of uploaded files to make available to your code. + - `Type ToolSearchOutput` - - `MemoryLimit string` + The type of the item. Always `tool_search_output`. - The memory limit for the code interpreter container. + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + - `Agent BetaResponseToolSearchOutputItemAgent` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + The agent that produced this item. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `AgentName string` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + The canonical name of the agent that produced this item. - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `CreatedBy string` - Network access policy for the container. + The identifier of the actor that created the item. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `type BetaResponseOutputItemAdditionalTools struct{…}` - - `Type Disabled` + - `ID string` - Disable outbound network access. Always `disabled`. + The unique ID of the additional tools item. - - `const DisabledDisabled Disabled = "disabled"` + - `Role string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The role that provided the additional tools. - - `AllowedDomains []string` + - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` - A list of allowed domains when type is `allowlist`. + - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` - - `Type Allowlist` + - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` - Allow outbound network access only to specified domains. Always `allowlist`. + - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` - Optional domain-scoped secrets for allowlisted domains. + - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` - - `Domain string` + - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` - The domain associated with the secret. + - `Tools []BetaToolUnion` - - `Name string` + The additional tool definitions made available at this item. - The name of the secret to inject for the domain. + - `type BetaFunctionTool struct{…}` - - `Value string` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The secret value to inject for the domain. + - `type BetaFileSearchTool struct{…}` - - `Type CodeInterpreter` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The type of the code interpreter tool. Always `code_interpreter`. + - `type BetaComputerTool struct{…}` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `AllowedCallers []string` + - `type BetaComputerUsePreviewTool struct{…}` - The tool invocation context(s). + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `type BetaWebSearchTool struct{…}` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `type BetaToolProgrammaticToolCalling struct{…}` + - `type BetaToolMcp struct{…}` - - `Type ProgrammaticToolCalling` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - The type of the tool. Always `programmatic_tool_calling`. + - `type BetaToolCodeInterpreter struct{…}` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + A tool that runs Python code to help generate a response to a prompt. + + - `type BetaToolProgrammaticToolCalling struct{…}` - `type BetaToolImageGeneration 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`. + - `type BetaToolLocalShell struct{…}` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + A tool that allows the model to execute shell commands in a local environment. - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `type BetaFunctionShellTool struct{…}` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + A tool that allows the model to execute shell commands. - - `Background string` + - `type BetaCustomTool struct{…}` - 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. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - `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. + - `type BetaNamespaceTool struct{…}` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + Groups function/custom tools under a shared namespace. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `type BetaToolSearchTool struct{…}` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + Hosted or BYOT tool search configuration for deferred tools. - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `type BetaWebSearchPreviewTool struct{…}` - - `InputFidelity string` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - 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`. + - `type BetaApplyPatchTool struct{…}` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + Allows the assistant to create, delete, or update files using unified diffs. - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + - `Type AdditionalTools` - - `InputImageMask BetaToolImageGenerationInputImageMask` + The type of the item. Always `additional_tools`. - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `FileID string` + - `Agent BetaResponseOutputItemAdditionalToolsAgent` - File ID for the mask image. + The agent that produced this item. - - `ImageURL string` + - `AgentName string` - Base64-encoded mask image. + The canonical name of the agent that produced this item. - - `Model string` + - `type BetaResponseCompactionItem struct{…}` - The image generation model to use. Default: `gpt-image-1`. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `string` + - `ID string` - - `string` + The unique ID of the compaction item. - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + - `EncryptedContent string` - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + The encrypted content that was produced by compaction. - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + - `Type Compaction` - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + The type of the item. Always `compaction`. - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + - `const CompactionCompaction Compaction = "compaction"` - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `Agent BetaResponseCompactionItemAgent` - - `Moderation string` + The agent that produced this item. - Moderation level for the generated image. Default: `auto`. + - `AgentName string` - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + The canonical name of the agent that produced this item. - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `CreatedBy string` - - `OutputCompression int64` + The identifier of the actor that created the item. - Compression level for the output image. Default: 100. + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - - `OutputFormat string` + An image generation request made by the model. - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `ID string` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + The unique ID of the image generation call. - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + - `Result string` - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + The generated image encoded in base64. - - `PartialImages int64` + - `Status string` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + The status of the image generation call. - - `Quality string` + - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `Type ImageGenerationCall` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The type of the image generation call. Always `image_generation_call`. - - `Size string` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - 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`. + - `Agent BetaResponseOutputItemImageGenerationCallAgent` - - `string` + The agent that produced this item. - - `string` + - `AgentName string` - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + The canonical name of the agent that produced this item. - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + A tool call to run code. - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + - `type BetaResponseOutputItemLocalShellCall struct{…}` - - `type BetaToolLocalShell struct{…}` + A tool call to run a command on the local shell. - A tool that allows the model to execute shell commands in a local environment. + - `ID string` - - `Type LocalShell` + The unique ID of the local shell call. - The type of the local shell tool. Always `local_shell`. + - `Action BetaResponseOutputItemLocalShellCallAction` - - `const LocalShellLocalShell LocalShell = "local_shell"` + Execute a shell command on the server. - - `type BetaFunctionShellTool struct{…}` + - `Command []string` - A tool that allows the model to execute shell commands. + The command to run. - - `Type Shell` + - `Env map[string, string]` - The type of the shell tool. Always `shell`. + Environment variables to set for the command. - - `const ShellShell Shell = "shell"` + - `Type Exec` - - `AllowedCallers []string` + The type of the local shell action. Always `exec`. - The tool invocation context(s). + - `const ExecExec Exec = "exec"` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + - `TimeoutMs int64` - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + Optional timeout in milliseconds for the command. - - `Environment BetaFunctionShellToolEnvironmentUnion` + - `User string` - - `type BetaContainerAuto struct{…}` + Optional user to run the command as. - - `Type ContainerAuto` + - `WorkingDirectory string` - Automatically creates a container for this request + Optional working directory to run the command in. - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + - `CallID string` - - `FileIDs []string` + The unique ID of the local shell tool call generated by the model. - An optional list of uploaded files to make available to your code. + - `Status string` - - `MemoryLimit BetaContainerAutoMemoryLimit` + The status of the local shell call. - The memory limit for the container. + - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `Type LocalShellCall` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + The type of the local shell call. Always `local_shell_call`. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - Network access policy for the container. + - `Agent BetaResponseOutputItemLocalShellCallAgent` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + The agent that produced this item. - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `AgentName string` - - `Skills []BetaContainerAutoSkillUnion` + The canonical name of the agent that produced this item. - An optional list of skills referenced by id or inline data. + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - `type BetaSkillReference struct{…}` + The output of a local shell tool call. - - `SkillID string` + - `ID string` - The ID of the referenced skill. + The unique ID of the local shell tool call generated by the model. - - `Type SkillReference` + - `Output string` - References a skill created with the /v1/skills endpoint. + A JSON string of the output of the local shell tool call. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `Type LocalShellCallOutput` - - `Version string` + The type of the local shell tool call output. Always `local_shell_call_output`. - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `type BetaInlineSkill struct{…}` + - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` - - `Description string` + The agent that produced this item. - The description of the skill. + - `AgentName string` - - `Name string` + The canonical name of the agent that produced this item. - The name of the skill. + - `Status string` - - `Source BetaInlineSkillSource` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - Inline skill payload + - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` - - `Data string` + - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` - Base64-encoded skill zip bundle. + - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` - - `MediaType ApplicationZip` + - `type BetaResponseFunctionShellToolCall struct{…}` - The media type of the inline skill payload. Must be `application/zip`. + A tool call that executes one or more shell commands in a managed environment. - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `ID string` - - `Type Base64` + The unique ID of the shell tool call. Populated when this item is returned via API. - The type of the inline skill source. Must be `base64`. + - `Action BetaResponseFunctionShellToolCallAction` - - `const Base64Base64 Base64 = "base64"` + The shell commands and limits that describe how to run the tool call. - - `Type Inline` + - `Commands []string` - Defines an inline skill for this request. + - `MaxOutputLength int64` - - `const InlineInline Inline = "inline"` + Optional maximum number of characters to return from each command. - - `type BetaLocalEnvironment struct{…}` + - `TimeoutMs int64` - - `Type Local` + Optional timeout in milliseconds for the commands. - Use a local computer environment. + - `CallID string` - - `const LocalLocal Local = "local"` + The unique ID of the shell tool call generated by the model. - - `Skills []BetaLocalSkill` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - An optional list of skills. + Represents the use of a local environment to perform shell actions. - - `Description string` + - `type BetaResponseLocalEnvironment struct{…}` - The description of the skill. + Represents the use of a local environment to perform shell actions. - - `Name string` + - `Type Local` - The name of the skill. + The environment type. Always `local`. - - `Path string` + - `const LocalLocal Local = "local"` - The path to the directory containing the skill. + - `type BetaResponseContainerReference struct{…}` - - `type BetaContainerReference struct{…}` + Represents a container created with /v1/containers. - `ContainerID string` - The ID of the referenced container. - - `Type ContainerReference` - References a container created with the /v1/containers endpoint + The environment type. Always `container_reference`. - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `type BetaCustomTool struct{…}` + - `Status BetaResponseFunctionShellToolCallStatus` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `Name string` + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - The name of the custom tool, used to identify it in tool calls. + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - - `Type Custom` + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - The type of the custom tool. Always `custom`. + - `Type ShellCall` - - `const CustomCustom Custom = "custom"` + The type of the item. Always `shell_call`. - - `AllowedCallers []string` + - `const ShellCallShellCall ShellCall = "shell_call"` - The tool invocation context(s). + - `Agent BetaResponseFunctionShellToolCallAgent` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + The agent that produced this item. - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + - `AgentName string` - - `DeferLoading bool` + The canonical name of the agent that produced this item. - Whether this tool should be deferred and discovered via tool search. + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - - `Description string` + The execution context that produced this tool call. - Optional description of the custom tool, used to provide more context. + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - - `Format BetaCustomToolFormatUnion` + - `Type Direct` - The input format for the custom tool. Default is unconstrained text. + - `const DirectDirect Direct = "direct"` - - `type BetaCustomToolFormatText struct{…}` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - Unconstrained free-form text. + - `CallerID string` - - `Type Text` + The call ID of the program item that produced this tool call. - Unconstrained text format. Always `text`. + - `Type Program` - - `const TextText Text = "text"` + - `const ProgramProgram Program = "program"` - - `type BetaCustomToolFormatGrammar struct{…}` + - `CreatedBy string` - A grammar defined by the user. + The ID of the entity that created this tool call. - - `Definition string` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - The grammar definition. + The output of a shell tool call that was emitted. - - `Syntax string` + - `ID string` - The syntax of the grammar definition. One of `lark` or `regex`. + The unique ID of the shell call output. Populated when this item is returned via API. - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `CallID string` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + The unique ID of the shell tool call generated by the model. - - `Type Grammar` + - `MaxOutputLength int64` - Grammar format. Always `grammar`. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `const GrammarGrammar Grammar = "grammar"` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - - `type BetaNamespaceTool struct{…}` + An array of shell call output contents - Groups function/custom tools under a shared namespace. + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - - `Description string` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - A description of the namespace shown to the model. + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - - `Name string` + Indicates that the shell call exceeded its configured time limit. - The namespace name used in tool calls (for example, `crm`). + - `Type Timeout` - - `Tools []BetaNamespaceToolToolUnion` + The outcome type. Always `timeout`. - The function/custom tools available inside this namespace. + - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaNamespaceToolToolFunction struct{…}` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - - `Name string` + Indicates that the shell commands finished and returned an exit code. - - `Type Function` + - `ExitCode int64` - - `const FunctionFunction Function = "function"` + Exit code from the shell process. - - `AllowedCallers []string` + - `Type Exit` - The tool invocation context(s). + The outcome type. Always `exit`. - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `const ExitExit Exit = "exit"` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `Stderr string` - - `DeferLoading bool` + The standard error output that was captured. - Whether this function should be deferred and discovered via tool search. + - `Stdout string` - - `Description string` + The standard output that was captured. - - `OutputSchema map[string, any]` + - `CreatedBy string` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + The identifier of the actor that created the item. - - `Parameters any` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `Strict bool` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `type BetaCustomTool struct{…}` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - - `Type Namespace` + - `Type ShellCallOutput` - The type of the tool. Always `namespace`. + The type of the shell call output. Always `shell_call_output`. - - `const NamespaceNamespace Namespace = "namespace"` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `type BetaToolSearchTool struct{…}` + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - Hosted or BYOT tool search configuration for deferred tools. + The agent that produced this item. - - `Type ToolSearch` + - `AgentName string` - The type of the tool. Always `tool_search`. + The canonical name of the agent that produced this item. - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - - `Description string` + The execution context that produced this tool call. - Description shown to the model for a client-executed tool search tool. + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `Execution BetaToolSearchToolExecution` + - `Type Direct` - Whether tool search is executed by the server or by the client. + - `const DirectDirect Direct = "direct"` - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `CallerID string` - - `Parameters any` + The call ID of the program item that produced this tool call. - Parameter schema for a client-executed tool search tool. + - `Type Program` - - `type BetaWebSearchPreviewTool struct{…}` + - `const ProgramProgram Program = "program"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `CreatedBy string` - - `Type BetaWebSearchPreviewToolType` + The identifier of the actor that created the item. - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `type BetaResponseApplyPatchToolCall struct{…}` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + A tool call that applies file diffs by creating, deleting, or updating files. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + - `ID string` - - `SearchContentTypes []string` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `CallID string` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + The unique ID of the apply patch tool call generated by the model. - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - 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. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + Instruction describing how to create a file via the apply_patch tool. - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `Diff string` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + Diff to apply. - The user's location. + - `Path string` - - `Type Approximate` + Path of the file to create. - The type of location approximation. Always `approximate`. + - `Type CreateFile` - - `const ApproximateApproximate Approximate = "approximate"` + Create a new file with the provided diff. - - `City string` + - `const CreateFileCreateFile CreateFile = "create_file"` - Free text input for the city of the user, e.g. `San Francisco`. + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - - `Country string` + Instruction describing how to delete a file via the apply_patch tool. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `Path string` - - `Region string` + Path of the file to delete. - Free text input for the region of the user, e.g. `California`. + - `Type DeleteFile` - - `Timezone string` + Delete the specified file. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `type BetaApplyPatchTool struct{…}` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - Allows the assistant to create, delete, or update files using unified diffs. + Instruction describing how to update a file via the apply_patch tool. - - `Type ApplyPatch` + - `Diff string` - The type of the tool. Always `apply_patch`. + Diff to apply. - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `Path string` - - `AllowedCallers []string` + Path of the file to update. - The tool invocation context(s). + - `Type UpdateFile` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + Update an existing file with the provided diff. - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Type ToolSearchOutput` + - `Status BetaResponseApplyPatchToolCallStatus` - The item type. Always `tool_search_output`. + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `ID string` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - The unique ID of this tool search output. + - `Type ApplyPatchCall` - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + The type of the item. Always `apply_patch_call`. + + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + + - `Agent BetaResponseApplyPatchToolCallAgent` The agent that produced this item. @@ -126636,210 +139147,192 @@ func main() { The canonical name of the agent that produced this item. - - `CallID string` - - The unique ID of the tool search call generated by the model. - - - `Execution BetaResponseToolSearchOutputItemParamExecution` - - Whether tool search was executed by the server or by the client. - - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - - - `Status BetaResponseToolSearchOutputItemParamStatus` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - The status of the tool search output. + The execution context that produced this tool call. - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + - `Type Direct` - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `Role Developer` + - `CallerID string` - The role that provided the additional tools. Only `developer` is supported. + The call ID of the program item that produced this tool call. - - `const DeveloperDeveloper Developer = "developer"` + - `Type Program` - - `Tools []BetaToolUnion` + - `const ProgramProgram Program = "program"` - A list of additional tools made available at this item. + - `CreatedBy string` - - `type BetaFunctionTool struct{…}` + The ID of the entity that created this tool call. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `type BetaFileSearchTool struct{…}` + The output emitted by an apply patch tool call. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `ID string` - - `type BetaComputerTool struct{…}` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `CallID string` - - `type BetaComputerUsePreviewTool struct{…}` + The unique ID of the apply patch tool call generated by the model. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Status BetaResponseApplyPatchToolCallOutputStatus` - - `type BetaWebSearchTool struct{…}` + The status of the apply patch tool call output. One of `completed` or `failed`. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `type BetaToolMcp struct{…}` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Type ApplyPatchCallOutput` - - `type BetaToolCodeInterpreter struct{…}` + The type of the item. Always `apply_patch_call_output`. - A tool that runs Python code to help generate a response to a prompt. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - `type BetaToolImageGeneration struct{…}` + The agent that produced this item. - A tool that generates images using the GPT image models. + - `AgentName string` - - `type BetaToolLocalShell struct{…}` + The canonical name of the agent that produced this item. - A tool that allows the model to execute shell commands in a local environment. + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - `type BetaFunctionShellTool struct{…}` + The execution context that produced this tool call. - A tool that allows the model to execute shell commands. + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - `type BetaCustomTool struct{…}` + - `Type Direct` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const DirectDirect Direct = "direct"` - - `type BetaNamespaceTool struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - Groups function/custom tools under a shared namespace. + - `CallerID string` - - `type BetaToolSearchTool struct{…}` + The call ID of the program item that produced this tool call. - Hosted or BYOT tool search configuration for deferred tools. + - `Type Program` - - `type BetaWebSearchPreviewTool struct{…}` + - `const ProgramProgram Program = "program"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `CreatedBy string` - - `type BetaApplyPatchTool struct{…}` + The ID of the entity that created this tool call output. - Allows the assistant to create, delete, or update files using unified diffs. + - `Output string` - - `Type AdditionalTools` + Optional textual output returned by the apply patch tool. - The item type. Always `additional_tools`. + - `type BetaResponseOutputItemMcpCall struct{…}` - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + An invocation of a tool on an MCP server. - `ID string` - The unique ID of this additional tools item. + The unique ID of the tool call. - - `Agent BetaResponseInputItemAdditionalToolsAgent` + - `Arguments string` - The agent that produced this item. + A JSON string of the arguments passed to the tool. - - `AgentName string` + - `Name string` - The canonical name of the agent that produced this item. + The name of the tool that was run. - - `type BetaResponseReasoningItem struct{…}` + - `ServerLabel string` - 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](https://platform.openai.com/docs/guides/conversation-state). + The label of the MCP server running the tool. - - `ID string` + - `Type McpCall` - The unique identifier of the reasoning content. + The type of the item. Always `mcp_call`. - - `Summary []BetaResponseReasoningItemSummary` + - `const McpCallMcpCall McpCall = "mcp_call"` - Reasoning summary content. + - `Agent BetaResponseOutputItemMcpCallAgent` - - `Text string` + The agent that produced this item. - A summary of the reasoning output from the model so far. + - `AgentName string` - - `Type SummaryText` + The canonical name of the agent that produced this item. - The type of the object. Always `summary_text`. + - `ApprovalRequestID string` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + 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. - - `Type Reasoning` + - `Error string` - The type of the object. Always `reasoning`. + The error from the tool call, if any. - - `const ReasoningReasoning Reasoning = "reasoning"` + - `Output string` - - `Agent BetaResponseReasoningItemAgent` + The output from the tool call. - The agent that produced this item. + - `Status string` - - `AgentName string` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - The canonical name of the agent that produced this item. + - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` - - `Content []BetaResponseReasoningItemContent` + - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` - Reasoning text content. + - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` - - `Text string` + - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` - The reasoning text from the model. + - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` - - `Type ReasoningText` + - `type BetaResponseOutputItemMcpListTools struct{…}` - The type of the reasoning text. Always `reasoning_text`. + A list of tools available on an MCP server. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `ID string` - - `EncryptedContent string` + The unique ID of the list. - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `ServerLabel string` - - `Status BetaResponseReasoningItemStatus` + The label of the MCP server. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Tools []BetaResponseOutputItemMcpListToolsTool` - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + The tools available on the server. - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + - `InputSchema any` - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + The JSON schema describing the tool's input. - - `type BetaResponseCompactionItemParamResp struct{…}` + - `Name string` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The name of the tool. - - `EncryptedContent string` + - `Annotations any` - The encrypted content of the compaction summary. + Additional annotations about the tool. - - `Type Compaction` + - `Description string` - The type of the item. Always `compaction`. + The description of the tool. - - `const CompactionCompaction Compaction = "compaction"` + - `Type McpListTools` - - `ID string` + The type of the item. Always `mcp_list_tools`. - The ID of the compaction item. + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Agent BetaResponseCompactionItemParamAgentResp` + - `Agent BetaResponseOutputItemMcpListToolsAgent` The agent that produced this item. @@ -126847,37 +139340,37 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemImageGenerationCall struct{…}` + - `Error string` - An image generation request made by the model. + Error message if the server could not list tools. - - `ID string` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - The unique ID of the image generation call. + A request for human approval of a tool invocation. - - `Result string` + - `ID string` - The generated image encoded in base64. + The unique ID of the approval request. - - `Status string` + - `Arguments string` - The status of the image generation call. + A JSON string of arguments for the tool. - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `Name string` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + The name of the tool to run. - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + - `ServerLabel string` - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + The label of the MCP server making the request. - - `Type ImageGenerationCall` + - `Type McpApprovalRequest` - The type of the image generation call. Always `image_generation_call`. + The type of the item. Always `mcp_approval_request`. - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Agent BetaResponseInputItemImageGenerationCallAgent` + - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` The agent that produced this item. @@ -126885,5394 +139378,5473 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - A tool call to run code. + A response to an MCP approval request. - `ID string` - The unique ID of the code interpreter tool call. - - - `Code string` - - The code to run, or null if not available. + The unique ID of the approval response - - `ContainerID string` + - `ApprovalRequestID string` - The ID of the container used to run the code. + The ID of the approval request being answered. - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + - `Approve bool` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + Whether the request was approved. - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `Type McpApprovalResponse` - The logs output from the code interpreter. + The type of the item. Always `mcp_approval_response`. - - `Logs string` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - The logs output from the code interpreter. + - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` - - `Type Logs` + The agent that produced this item. - The type of the output. Always `logs`. + - `AgentName string` - - `const LogsLogs Logs = "logs"` + The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + - `Reason string` - The image output from the code interpreter. + Optional reason for the decision. - - `Type Image` + - `type BetaResponseCustomToolCall struct{…}` - The type of the output. Always `image`. + A call to a custom tool created by the model. - - `const ImageImage Image = "image"` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - - `URL string` + The output of a custom tool call from your code, being sent back to the model. - The URL of the image output from the code interpreter. + - `ID string` - - `Status BetaResponseCodeInterpreterToolCallStatus` + The unique ID of the custom tool call output item. - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `Status string` - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + - `CreatedBy string` - - `Type CodeInterpreterCall` + The identifier of the actor that created the item. - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `ParallelToolCalls bool` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + Whether to allow the model to run tool calls in parallel. - - `Agent BetaResponseCodeInterpreterToolCallAgent` + - `Temperature float64` - The agent that produced this item. + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - - `AgentName string` + - `ToolChoice BetaResponseToolChoiceUnion` - The canonical name of the agent that produced this item. + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `type BetaToolChoiceOptions string` - A tool call to run a command on the local shell. + Controls which (if any) tool is called by the model. - - `ID string` + `none` means the model will not call any tool and instead generates a message. - The unique ID of the local shell call. + `auto` means the model can pick between generating a message or calling one or + more tools. - - `Action BetaResponseInputItemLocalShellCallAction` + `required` means the model must call one or more tools. - Execute a shell command on the server. + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - - `Command []string` + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - The command to run. + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - - `Env map[string, string]` + - `type BetaToolChoiceAllowed struct{…}` - Environment variables to set for the command. + Constrains the tools available to the model to a pre-defined set. - - `Type Exec` + - `Mode BetaToolChoiceAllowedMode` - The type of the local shell action. Always `exec`. + Constrains the tools available to the model to a pre-defined set. - - `const ExecExec Exec = "exec"` + `auto` allows the model to pick from among the allowed tools and generate a + message. - - `TimeoutMs int64` + `required` requires the model to call one or more of the allowed tools. - Optional timeout in milliseconds for the command. + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - - `User string` + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - Optional user to run the command as. + - `Tools []map[string, any]` - - `WorkingDirectory string` + A list of tool definitions that the model should be allowed to call. - Optional working directory to run the command in. + For the Responses API, the list of tool definitions might look like: - - `CallID string` + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - The unique ID of the local shell tool call generated by the model. + - `Type AllowedTools` - - `Status string` + Allowed tool configuration type. Always `allowed_tools`. - The status of the local shell call. + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + - `type BetaToolChoiceTypes struct{…}` - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `Type BetaToolChoiceTypesType` - - `Type LocalShellCall` + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - The type of the local shell call. Always `local_shell_call`. + Allowed values are: - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - - `Agent BetaResponseInputItemLocalShellCallAgent` + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - The agent that produced this item. + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - - `AgentName string` + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - The canonical name of the agent that produced this item. + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - The output of a local shell tool call. + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - - `ID string` + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - The unique ID of the local shell tool call generated by the model. + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - - `Output string` + - `type BetaToolChoiceFunction struct{…}` - A JSON string of the output of the local shell tool call. + Use this option to force the model to call a specific function. - - `Type LocalShellCallOutput` + - `Name string` - The type of the local shell tool call output. Always `local_shell_call_output`. + The name of the function to call. - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `Type Function` - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + For function calling, the type is always `function`. - The agent that produced this item. + - `const FunctionFunction Function = "function"` - - `AgentName string` + - `type BetaToolChoiceMcp struct{…}` - The canonical name of the agent that produced this item. + Use this option to force the model to call a specific tool on a remote MCP server. - - `Status string` + - `ServerLabel string` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + The label of the MCP server to use. - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + - `Type Mcp` - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + For MCP tools, the type is always `mcp`. - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `const McpMcp Mcp = "mcp"` - - `type BetaResponseInputItemShellCall struct{…}` + - `Name string` - A tool representing a request to execute one or more shell commands. + The name of the tool to call on the server. - - `Action BetaResponseInputItemShellCallAction` + - `type BetaToolChoiceCustom struct{…}` - The shell commands and limits that describe how to run the tool call. + Use this option to force the model to call a specific custom tool. - - `Commands []string` + - `Name string` - Ordered shell commands for the execution environment to run. + The name of the custom tool to call. - - `MaxOutputLength int64` + - `Type Custom` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + For custom tool calling, the type is always `custom`. - - `TimeoutMs int64` + - `const CustomCustom Custom = "custom"` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - - `CallID string` + - `Type ProgrammaticToolCalling` - The unique ID of the shell tool call generated by the model. + The tool to call. Always `programmatic_tool_calling`. - - `Type ShellCall` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - The type of the item. Always `shell_call`. + - `type BetaToolChoiceApplyPatch struct{…}` - - `const ShellCallShellCall ShellCall = "shell_call"` + Forces the model to call the apply_patch tool when executing a tool call. - - `ID string` + - `Type ApplyPatch` - The unique ID of the shell tool call. Populated when this item is returned via API. + The tool to call. Always `apply_patch`. - - `Agent BetaResponseInputItemShellCallAgent` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - The agent that produced this item. + - `type BetaToolChoiceShell struct{…}` - - `AgentName string` + Forces the model to call the shell tool when a tool call is required. - The canonical name of the agent that produced this item. + - `Type Shell` - - `Caller BetaResponseInputItemShellCallCallerUnion` + The tool to call. Always `shell`. - The execution context that produced this tool call. + - `const ShellShell Shell = "shell"` - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + - `Tools []BetaToolUnion` - - `Type Direct` + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. - The caller type. Always `direct`. + We support the following categories of tools: - - `const DirectDirect Direct = "direct"` + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `type BetaFunctionTool struct{…}` - - `CallerID string` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The call ID of the program item that produced this tool call. + - `type BetaFileSearchTool struct{…}` - - `Type Program` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The caller type. Always `program`. + - `type BetaComputerTool struct{…}` - - `const ProgramProgram Program = "program"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + - `type BetaComputerUsePreviewTool struct{…}` - The environment to execute the shell commands in. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type BetaLocalEnvironment struct{…}` + - `type BetaWebSearchTool struct{…}` - - `type BetaContainerReference struct{…}` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Status string` + - `type BetaToolMcp struct{…}` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + - `type BetaToolCodeInterpreter struct{…}` - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + A tool that runs Python code to help generate a response to a prompt. - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `type BetaToolImageGeneration struct{…}` - The streamed output items emitted by a shell tool call. + A tool that generates images using the GPT image models. - - `CallID string` + - `type BetaToolLocalShell struct{…}` - The unique ID of the shell tool call generated by the model. + A tool that allows the model to execute shell commands in a local environment. - - `Output []BetaResponseFunctionShellCallOutputContent` + - `type BetaFunctionShellTool struct{…}` - Captured chunks of stdout and stderr output, along with their associated outcomes. + A tool that allows the model to execute shell commands. - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + - `type BetaCustomTool struct{…}` - The exit or timeout outcome associated with this shell call. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + - `type BetaNamespaceTool struct{…}` - Indicates that the shell call exceeded its configured time limit. + Groups function/custom tools under a shared namespace. - - `Type Timeout` + - `type BetaToolSearchTool struct{…}` - The outcome type. Always `timeout`. + Hosted or BYOT tool search configuration for deferred tools. - - `const TimeoutTimeout Timeout = "timeout"` + - `type BetaWebSearchPreviewTool struct{…}` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Indicates that the shell commands finished and returned an exit code. + - `type BetaApplyPatchTool struct{…}` - - `ExitCode int64` + Allows the assistant to create, delete, or update files using unified diffs. - The exit code returned by the shell process. + - `TopP float64` - - `Type Exit` + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - The outcome type. Always `exit`. + We generally recommend altering this or `temperature` but not both. - - `const ExitExit Exit = "exit"` + - `Background bool` - - `Stderr string` + Whether to run the model response in the background. + [Learn more](https://platform.openai.com/docs/guides/background). - Captured stderr output for the shell call. + - `CompletedAt float64` - - `Stdout string` + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - Captured stdout output for the shell call. + - `Conversation BetaResponseConversation` - - `Type ShellCallOutput` + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - The type of the item. Always `shell_call_output`. + - `ID string` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + The unique ID of the conversation that this response was associated with. - - `ID string` + - `MaxOutputTokens int64` - The unique ID of the shell tool call output. Populated when this item is returned via API. + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `MaxToolCalls int64` - The agent that produced this item. + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `AgentName string` + - `Moderation BetaResponseModeration` - The canonical name of the agent that produced this item. + Moderation results for the response input and output, if moderated completions were requested. - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + - `Input BetaResponseModerationInputUnion` - The execution context that produced this tool call. + Moderation for the response input. - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + - `type BetaResponseModerationInputModerationResult struct{…}` - - `Type Direct` + A moderation result produced for the response input or output. - The caller type. Always `direct`. + - `Categories map[string, bool]` - - `const DirectDirect Direct = "direct"` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + - `CategoryAppliedInputTypes map[string, []string]` - - `CallerID string` + Which modalities of input are reflected by the score for each category. - The call ID of the program item that produced this tool call. + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` - - `Type Program` + - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` - The caller type. Always `program`. + - `CategoryScores map[string, float64]` - - `const ProgramProgram Program = "program"` + A dictionary of moderation categories to scores. - - `MaxOutputLength int64` + - `Flagged bool` - The maximum number of UTF-8 characters captured for this shell call's combined output. + A boolean indicating whether the content was flagged by any category. - - `Status string` + - `Model string` - The status of the shell call output. + The moderation model that produced this result. - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + - `Type ModerationResult` - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + The object type, which was always `moderation_result` for successful moderation results. - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `type BetaResponseInputItemApplyPatchCall struct{…}` + - `type BetaResponseModerationInputError struct{…}` - A tool call representing a request to create, delete, or update files using diff patches. + An error produced while attempting moderation for the response input or output. - - `CallID string` + - `Code string` - The unique ID of the apply patch tool call generated by the model. + The error code. - - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + - `Message string` - The specific create, delete, or update instruction for the apply_patch tool call. + The error message. - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + - `Type Error` - Instruction for creating a new file via the apply_patch tool. + The object type, which was always `error` for moderation failures. - - `Diff string` + - `const ErrorError Error = "error"` - Unified diff content to apply when creating the file. + - `Output BetaResponseModerationOutputUnion` - - `Path string` + Moderation for the response output. - Path of the file to create relative to the workspace root. + - `type BetaResponseModerationOutputModerationResult struct{…}` - - `Type CreateFile` + A moderation result produced for the response input or output. - The operation type. Always `create_file`. + - `Categories map[string, bool]` - - `const CreateFileCreateFile CreateFile = "create_file"` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + - `CategoryAppliedInputTypes map[string, []string]` - Instruction for deleting an existing file via the apply_patch tool. + Which modalities of input are reflected by the score for each category. - - `Path string` + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` - Path of the file to delete relative to the workspace root. + - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` - - `Type DeleteFile` + - `CategoryScores map[string, float64]` - The operation type. Always `delete_file`. + A dictionary of moderation categories to scores. - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `Flagged bool` - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + A boolean indicating whether the content was flagged by any category. - Instruction for updating an existing file via the apply_patch tool. + - `Model string` - - `Diff string` + The moderation model that produced this result. - Unified diff content to apply to the existing file. + - `Type ModerationResult` - - `Path string` + The object type, which was always `moderation_result` for successful moderation results. - Path of the file to update relative to the workspace root. + - `const ModerationResultModerationResult ModerationResult = "moderation_result"` - - `Type UpdateFile` + - `type BetaResponseModerationOutputError struct{…}` - The operation type. Always `update_file`. + An error produced while attempting moderation for the response input or output. - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `Code string` - - `Status string` + The error code. - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `Message string` - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + The error message. - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + - `Type Error` - - `Type ApplyPatchCall` + The object type, which was always `error` for moderation failures. - The type of the item. Always `apply_patch_call`. + - `const ErrorError Error = "error"` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `PreviousResponseID string` - - `ID string` + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `Prompt BetaResponsePrompt` - - `Agent BetaResponseInputItemApplyPatchCallAgent` + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - The agent that produced this item. + - `ID string` - - `AgentName string` + The unique identifier of the prompt template to use. - The canonical name of the agent that produced this item. + - `Variables map[string, BetaResponsePromptVariableUnion]` - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - The execution context that produced this tool call. + - `string` - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + - `type BetaResponseInputText struct{…}` - - `Type Direct` + A text input to the model. - The caller type. Always `direct`. + - `type BetaResponseInputImage struct{…}` - - `const DirectDirect Direct = "direct"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `type BetaResponseInputFile struct{…}` - - `CallerID string` + A file input to the model. - The call ID of the program item that produced this tool call. + - `Version string` - - `Type Program` + Optional version of the prompt template. - The caller type. Always `program`. + - `PromptCacheKey string` - - `const ProgramProgram Program = "program"` + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `PromptCacheOptions BetaResponsePromptCacheOptions` - The streamed output emitted by an apply patch tool call. + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - `CallID string` + - `Mode string` - The unique ID of the apply patch tool call generated by the model. + Whether implicit prompt-cache breakpoints were enabled. - - `Status string` + - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `Ttl string` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + The minimum lifetime applied to each cache breakpoint. - - `Type ApplyPatchCallOutput` + - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` - The type of the item. Always `apply_patch_call_output`. + - `PromptCacheRetention BetaResponsePromptCacheRetention` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + Deprecated. Use `prompt_cache_options.ttl` instead. - - `ID string` + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - The agent that produced this item. + - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` - - `AgentName string` + - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` - The canonical name of the agent that produced this item. + - `Reasoning BetaResponseReasoning` - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + **gpt-5 and o-series models only** - The execution context that produced this tool call. + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + - `Context string` - - `Type Direct` + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - The caller type. Always `direct`. + - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` - - `const DirectDirect Direct = "direct"` + - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` - - `CallerID string` + - `Effort string` - The call ID of the program item that produced this tool call. + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - - `Type Program` + - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` - The caller type. Always `program`. + - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` - - `Output string` + - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` - - `type BetaResponseInputItemMcpListTools struct{…}` + - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` - A list of tools available on an MCP server. + - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` - - `ID string` + - `GenerateSummary string` - The unique ID of the list. + **Deprecated:** use `summary` instead. - - `ServerLabel string` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - The label of the MCP server. + - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` - - `Tools []BetaResponseInputItemMcpListToolsTool` + - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` - The tools available on the server. + - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` - - `InputSchema any` + - `Mode string` - The JSON schema describing the tool's input. + Controls the reasoning execution mode for the request. - - `Name string` + When returned on a response, this is the effective execution mode. - The name of the tool. + - `string` - - `Annotations any` + - `string` - Additional annotations about the tool. + - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` - - `Description string` + - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` - The description of the tool. + - `Summary string` - - `Type McpListTools` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - The type of the item. Always `mcp_list_tools`. + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` - - `Agent BetaResponseInputItemMcpListToolsAgent` + - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` - The agent that produced this item. + - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` - - `AgentName string` + - `SafetyIdentifier string` - The canonical name of the agent that produced this item. + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `Error string` + - `ServiceTier BetaResponseServiceTier` - Error message if the server could not list tools. + Specifies the processing type used for serving the request. - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - A request for human approval of a tool invocation. + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - `ID string` + - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` - The unique ID of the approval request. + - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` - - `Arguments string` + - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` - A JSON string of arguments for the tool. + - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` - - `Name string` + - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` - The name of the tool to run. + - `Status BetaResponseStatus` - - `ServerLabel string` + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. - The label of the MCP server making the request. + - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` - - `Type McpApprovalRequest` + - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` - The type of the item. Always `mcp_approval_request`. + - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` - The agent that produced this item. + - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` - - `AgentName string` + - `Text BetaResponseTextConfig` - The canonical name of the agent that produced this item. + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - A response to an MCP approval request. + - `Format BetaResponseFormatTextConfigUnion` - - `ApprovalRequestID string` + An object specifying the format that the model must output. - The ID of the approval request being answered. + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Approve bool` + The default format is `{ "type": "text" }` with no additional options. - Whether the request was approved. + **Not recommended for gpt-4o and newer models:** - - `Type McpApprovalResponse` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - The type of the item. Always `mcp_approval_response`. + - `type BetaResponseFormatTextConfigText struct{…}` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + Default response format. Used to generate text responses. - - `ID string` + - `Type Text` - The unique ID of the approval response + The type of response format being defined. Always `text`. - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `const TextText Text = "text"` - The agent that produced this item. + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - - `AgentName string` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The canonical name of the agent that produced this item. + - `Name string` - - `Reason string` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - Optional reason for the decision. + - `Schema map[string, any]` - - `type BetaResponseInputItemMcpCall struct{…}` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - An invocation of a tool on an MCP server. + - `Type JSONSchema` - - `ID string` + The type of response format being defined. Always `json_schema`. - The unique ID of the tool call. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `Arguments string` + - `Description string` - A JSON string of the arguments passed to the tool. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `Name string` + - `Strict bool` - The name of the tool that was run. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `ServerLabel string` + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - The label of the MCP server running the tool. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `Type McpCall` + - `Type JSONObject` - The type of the item. Always `mcp_call`. + The type of response format being defined. Always `json_object`. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `Agent BetaResponseInputItemMcpCallAgent` + - `Verbosity BetaResponseTextConfigVerbosity` - The agent that produced this item. + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - - `AgentName string` + - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` - The canonical name of the agent that produced this item. + - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` - - `ApprovalRequestID string` + - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` - 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. + - `TopLogprobs int64` - - `Error string` + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - The error from the tool call, if any. + - `Truncation BetaResponseTruncation` - - `Output string` + The truncation strategy to use for the model response. - The output from the tool call. + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `Status string` + - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + - `Usage BetaResponseUsage` - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + - `InputTokens int64` - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + The number of input tokens. - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + - `InputTokensDetails BetaResponseUsageInputTokensDetails` - - `type BetaResponseCustomToolCallOutput struct{…}` + A detailed breakdown of the input tokens. - The output of a custom tool call from your code, being sent back to the model. + - `CacheWriteTokens int64` - - `CallID string` + The number of input tokens that were written to the cache. - The call ID, used to map this custom tool call output to a custom tool call. + - `CachedTokens int64` - - `Output BetaResponseCustomToolCallOutputOutputUnion` + The number of tokens that were retrieved from the cache. + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + - `OutputTokens int64` - - `string` + The number of output tokens. - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` - Text, image, or file output of the custom tool call. + A detailed breakdown of the output tokens. - - `type BetaResponseInputText struct{…}` + - `ReasoningTokens int64` - A text input to the model. + The number of reasoning tokens. - - `type BetaResponseInputImage struct{…}` + - `TotalTokens int64` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The total number of tokens used. - - `type BetaResponseInputFile struct{…}` + - `User string` - A file input to the model. + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - - `Type CustomToolCallOutput` + - `SequenceNumber int64` - The type of the custom tool call output. Always `custom_tool_call_output`. + The sequence number for this event. - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `Type ResponseCompleted` - - `ID string` + The type of the event. Always `response.completed`. - The unique ID of the custom tool call output in the OpenAI platform. + - `const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"` - - `Agent BetaResponseCustomToolCallOutputAgent` + - `Agent BetaResponseCompletedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallOutputCallerUnion` + - `type BetaResponseContentPartAddedEvent struct{…}` - The execution context that produced this tool call. + Emitted when a new content part is added. - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + - `ContentIndex int64` - - `Type Direct` + The index of the content part that was added. - The caller type. Always `direct`. + - `ItemID string` - - `const DirectDirect Direct = "direct"` + The ID of the output item that the content part was added to. - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `OutputIndex int64` - - `CallerID string` + The index of the output item that the content part was added to. - The call ID of the program item that produced this tool call. + - `Part BetaResponseContentPartAddedEventPartUnion` - - `Type Program` + The content part that was added. - The caller type. Always `program`. + - `type BetaResponseOutputText struct{…}` - - `const ProgramProgram Program = "program"` + A text output from the model. - - `type BetaResponseCustomToolCall struct{…}` + - `type BetaResponseOutputRefusal struct{…}` - A call to a custom tool created by the model. + A refusal from the model. - - `CallID string` + - `type BetaResponseContentPartAddedEventPartReasoningText struct{…}` - An identifier used to map this custom tool call to a tool call output. + Reasoning text from the model. - - `Input string` + - `Text string` - The input for the custom tool call generated by the model. + The reasoning text from the model. - - `Name string` + - `Type ReasoningText` - The name of the custom tool being called. + The type of the reasoning text. Always `reasoning_text`. - - `Type CustomToolCall` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - The type of the custom tool call. Always `custom_tool_call`. + - `SequenceNumber int64` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + The sequence number of this event. - - `ID string` + - `Type ResponseContentPartAdded` - The unique ID of the custom tool call in the OpenAI platform. + The type of the event. Always `response.content_part.added`. - - `Agent BetaResponseCustomToolCallAgent` + - `const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"` - The agent that produced this item. + - `Agent BetaResponseContentPartAddedEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `type BetaResponseContentPartDoneEvent struct{…}` - The execution context that produced this tool call. + Emitted when a content part is done. - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `ContentIndex int64` - - `Type Direct` + The index of the content part that is done. - - `const DirectDirect Direct = "direct"` + - `ItemID string` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + The ID of the output item that the content part was added to. - - `CallerID string` + - `OutputIndex int64` - The call ID of the program item that produced this tool call. + The index of the output item that the content part was added to. - - `Type Program` + - `Part BetaResponseContentPartDoneEventPartUnion` - - `const ProgramProgram Program = "program"` + The content part that is done. - - `Namespace string` + - `type BetaResponseOutputText struct{…}` - The namespace of the custom tool being called. + A text output from the model. - - `type BetaResponseInputItemCompactionTrigger struct{…}` + - `type BetaResponseOutputRefusal struct{…}` - Compacts the current context. Must be the final input item. + A refusal from the model. - - `Type CompactionTrigger` + - `type BetaResponseContentPartDoneEventPartReasoningText struct{…}` - The type of the item. Always `compaction_trigger`. + Reasoning text from the model. - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `Text string` - - `Agent BetaResponseInputItemCompactionTriggerAgent` + The reasoning text from the model. - The agent that produced this item. + - `Type ReasoningText` - - `AgentName string` + The type of the reasoning text. Always `reasoning_text`. - The canonical name of the agent that produced this item. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `type BetaResponseInputItemItemReference struct{…}` + - `SequenceNumber int64` - An internal identifier for an item to reference. + The sequence number of this event. - - `ID string` + - `Type ResponseContentPartDone` - The ID of the item to reference. + The type of the event. Always `response.content_part.done`. - - `Agent BetaResponseInputItemItemReferenceAgent` + - `const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"` - The agent that produced this item. + - `Agent BetaResponseContentPartDoneEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Type string` - - The type of item to reference. Always `item_reference`. - - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - - - `type BetaResponseInputItemProgram struct{…}` - - - `ID string` - - The unique ID of this program item. - - - `CallID string` + - `type BetaResponseCreatedEvent struct{…}` - The stable call ID of the program item. + An event that is emitted when a response is created. - - `Code string` + - `Response BetaResponse` - The JavaScript source executed by programmatic tool calling. + The response that was created. - - `Fingerprint string` + - `SequenceNumber int64` - Opaque program replay fingerprint that must be round-tripped. + The sequence number for this event. - - `Type Program` + - `Type ResponseCreated` - The item type. Always `program`. + The type of the event. Always `response.created`. - - `const ProgramProgram Program = "program"` + - `const ResponseCreatedResponseCreated ResponseCreated = "response.created"` - - `Agent BetaResponseInputItemProgramAgent` + - `Agent BetaResponseCreatedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseInputItemProgramOutput struct{…}` - - - `ID string` + - `type BetaResponseErrorEvent struct{…}` - The unique ID of this program output item. + Emitted when an error occurs. - - `CallID string` + - `Code string` - The call ID of the program item. + The error code. - - `Result string` + - `Message string` - The result produced by the program item. + The error message. - - `Status string` + - `Param string` - The terminal status of the program output. + The error parameter. - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `SequenceNumber int64` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + The sequence number of this event. - - `Type ProgramOutput` + - `Type Error` - The item type. Always `program_output`. + The type of the event. Always `error`. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `const ErrorError Error = "error"` - - `Agent BetaResponseInputItemProgramOutputAgent` + - `Agent BetaResponseErrorEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Metadata map[string, string]` - - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - - - `Model BetaResponseModel` - - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `type BetaResponseFileSearchCallCompletedEvent struct{…}` - - `type BetaResponseModel string` + Emitted when a file search call is completed (results found). - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `ItemID string` - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + The ID of the output item that the file search call is initiated. - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` + - `OutputIndex int64` - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` + The index of the output item that the file search call is initiated. - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` + - `SequenceNumber int64` - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + The sequence number of this event. - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` + - `Type ResponseFileSearchCallCompleted` - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` + The type of the event. Always `response.file_search_call.completed`. - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` + - `const ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"` - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` + - `Agent BetaResponseFileSearchCallCompletedEventAgent` - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` + - `AgentName string` - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` + - `type BetaResponseFileSearchCallInProgressEvent struct{…}` - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` + Emitted when a file search call is initiated. - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` + - `ItemID string` - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` + The ID of the output item that the file search call is initiated. - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` + - `OutputIndex int64` - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` + The index of the output item that the file search call is initiated. - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` + - `SequenceNumber int64` - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` + The sequence number of this event. - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` + - `Type ResponseFileSearchCallInProgress` - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` + The type of the event. Always `response.file_search_call.in_progress`. - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` + - `const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"` - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + - `Agent BetaResponseFileSearchCallInProgressEventAgent` - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + - `AgentName string` - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + - `type BetaResponseFileSearchCallSearchingEvent struct{…}` - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + Emitted when a file search is currently searching. - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + - `ItemID string` - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + The ID of the output item that the file search call is initiated. - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` + - `OutputIndex int64` - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` + The index of the output item that the file search call is searching. - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` + - `SequenceNumber int64` - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + The sequence number of this event. - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` + - `Type ResponseFileSearchCallSearching` - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` + The type of the event. Always `response.file_search_call.searching`. - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` + - `const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"` - - `const BetaResponseModelO1 BetaResponseModel = "o1"` + - `Agent BetaResponseFileSearchCallSearchingEventAgent` - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` + - `AgentName string` - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` + - `type BetaResponseFunctionCallArgumentsDeltaEvent struct{…}` - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` + Emitted when there is a partial function-call arguments delta. - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` + - `Delta string` - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` + The function-call arguments delta that is added. - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` + - `ItemID string` - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` + The ID of the output item that the function-call arguments delta is added to. - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` + - `OutputIndex int64` - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + The index of the output item that the function-call arguments delta is added to. - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + - `SequenceNumber int64` - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + The sequence number of this event. - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + - `Type ResponseFunctionCallArgumentsDelta` - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + The type of the event. Always `response.function_call_arguments.delta`. - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + - `const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"` - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + - `Agent BetaResponseFunctionCallArgumentsDeltaEventAgent` - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `AgentName string` - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + - `type BetaResponseFunctionCallArgumentsDoneEvent struct{…}` - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + Emitted when function-call arguments are finalized. - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` + - `Arguments string` - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` + The function-call arguments. - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + - `ItemID string` - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + The ID of the item. - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + - `Name string` - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + The name of the function that was called. - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + - `OutputIndex int64` - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + The index of the output item. - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + - `SequenceNumber int64` - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + The sequence number of this event. - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + - `Type ResponseFunctionCallArgumentsDone` - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + - `const ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"` - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + - `Agent BetaResponseFunctionCallArgumentsDoneEventAgent` - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + - `AgentName string` - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + - `type BetaResponseInProgressEvent struct{…}` - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + Emitted when the response is in progress. - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + - `Response BetaResponse` - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + The response that is in progress. - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + - `SequenceNumber int64` - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + The sequence number of this event. - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + - `Type ResponseInProgress` - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + The type of the event. Always `response.in_progress`. - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + - `const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"` - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + - `Agent BetaResponseInProgressEventAgent` - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + - `AgentName string` - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + The canonical name of the agent that produced this item. - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + - `type BetaResponseFailedEvent struct{…}` - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + An event that is emitted when a response fails. - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + - `Response BetaResponse` - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + The response that failed. - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + - `SequenceNumber int64` - - `string` + The sequence number of this event. - - `Object Response` + - `Type ResponseFailed` - The object type of this resource - always set to `response`. + The type of the event. Always `response.failed`. - - `const ResponseResponse Response = "response"` + - `const ResponseFailedResponseFailed ResponseFailed = "response.failed"` - - `Output []BetaResponseOutputItemUnion` + - `Agent BetaResponseFailedEventAgent` - An array of content items generated by the model. + The agent that owns this multi-agent streaming event. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + - `AgentName string` - - `type BetaResponseOutputMessage struct{…}` + The canonical name of the agent that produced this item. - An output message from the model. + - `type BetaResponseIncompleteEvent struct{…}` - - `type BetaResponseFileSearchToolCall struct{…}` + An event that is emitted when a response finishes as incomplete. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `Response BetaResponse` - - `type BetaResponseFunctionToolCall struct{…}` + The response that was incomplete. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `SequenceNumber int64` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + The sequence number of this event. - - `ID string` + - `Type ResponseIncomplete` - The unique ID of the function call tool output. + The type of the event. Always `response.incomplete`. - - `CallID string` + - `const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"` - The unique ID of the function tool call generated by the model. + - `Agent BetaResponseIncompleteEventAgent` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + The agent that owns this multi-agent streaming event. - The output from the function call generated by your code. - Can be a string or an list of output content. + - `AgentName string` - - `string` + The canonical name of the agent that produced this item. - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `type BetaResponseOutputItemAddedEvent struct{…}` - Text, image, or file output of the function call. + Emitted when a new output item is added. - - `type BetaResponseInputText struct{…}` + - `Item BetaResponseOutputItemUnion` - A text input to the model. + The output item that was added. - - `type BetaResponseInputImage struct{…}` + - `type BetaResponseOutputMessage struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + An output message from the model. - - `type BetaResponseInputFile struct{…}` + - `type BetaResponseFileSearchToolCall struct{…}` - A file input to the model. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `Status BetaResponseFunctionToolCallOutputItemStatus` + - `type BetaResponseFunctionToolCall struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + - `type BetaResponseOutputItemAgentMessage struct{…}` - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `type BetaResponseOutputItemMultiAgentCall struct{…}` - - `Type FunctionCallOutput` + - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - The type of the function tool call output. Always `function_call_output`. + - `type BetaResponseFunctionWebSearch struct{…}` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `type BetaResponseComputerToolCall struct{…}` - The agent that produced this item. + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `AgentName string` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - The canonical name of the agent that produced this item. + - `type BetaResponseReasoningItem struct{…}` - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + 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](https://platform.openai.com/docs/guides/conversation-state). - The execution context that produced this tool call. + - `type BetaResponseOutputItemProgram struct{…}` - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `type BetaResponseOutputItemProgramOutput struct{…}` - - `Type Direct` + - `type BetaResponseToolSearchCall struct{…}` - The caller type. Always `direct`. + - `type BetaResponseToolSearchOutputItem struct{…}` - - `const DirectDirect Direct = "direct"` + - `type BetaResponseOutputItemAdditionalTools struct{…}` - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `type BetaResponseCompactionItem struct{…}` - - `CallerID string` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - The call ID of the program item that produced this tool call. + - `type BetaResponseOutputItemImageGenerationCall struct{…}` - - `Type Program` + An image generation request made by the model. - The caller type. Always `program`. + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const ProgramProgram Program = "program"` + A tool call to run code. - - `CreatedBy string` + - `type BetaResponseOutputItemLocalShellCall struct{…}` - The identifier of the actor that created the item. + A tool call to run a command on the local shell. - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` - - `ID string` + The output of a local shell tool call. - The unique ID of the agent message. + - `type BetaResponseFunctionShellToolCall struct{…}` - - `Author string` + A tool call that executes one or more shell commands in a managed environment. - The sending agent identity. + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + The output of a shell tool call that was emitted. - Encrypted content sent between agents. + - `type BetaResponseApplyPatchToolCall struct{…}` - - `type BetaResponseInputText struct{…}` + A tool call that applies file diffs by creating, deleting, or updating files. - A text input to the model. + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `type BetaResponseOutputText struct{…}` + The output emitted by an apply patch tool call. - A text output from the model. + - `type BetaResponseOutputItemMcpCall struct{…}` - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + An invocation of a tool on an MCP server. - A text content. + - `type BetaResponseOutputItemMcpListTools struct{…}` - - `Text string` + A list of tools available on an MCP server. - - `Type Text` + - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` - - `const TextText Text = "text"` + A request for human approval of a tool invocation. - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` - A summary text from the model. + A response to an MCP approval request. - - `Text string` + - `type BetaResponseCustomToolCall struct{…}` - A summary of the reasoning output from the model so far. + A call to a custom tool created by the model. - - `Type SummaryText` + - `type BetaResponseCustomToolCallOutputItem struct{…}` - The type of the object. Always `summary_text`. + The output of a custom tool call from your code, being sent back to the model. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `OutputIndex int64` - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` + The index of the output item that was added. - Reasoning text from the model. + - `SequenceNumber int64` - - `Text string` + The sequence number of this event. - The reasoning text from the model. + - `Type ResponseOutputItemAdded` - - `Type ReasoningText` + The type of the event. Always `response.output_item.added`. - The type of the reasoning text. Always `reasoning_text`. + - `const ResponseOutputItemAddedResponseOutputItemAdded ResponseOutputItemAdded = "response.output_item.added"` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `Agent BetaResponseOutputItemAddedEventAgent` - - `type BetaResponseOutputRefusal struct{…}` + The agent that owns this multi-agent streaming event. - A refusal from the model. + - `AgentName string` - - `type BetaResponseInputImage struct{…}` + The canonical name of the agent that produced this item. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `type BetaResponseOutputItemDoneEvent struct{…}` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + Emitted when an output item is marked done. - A screenshot of a computer. + - `Item BetaResponseOutputItemUnion` - - `Detail string` + The output item that was marked done. - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `OutputIndex int64` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + The index of the output item that was marked done. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + - `SequenceNumber int64` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + The sequence number of this event. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + - `Type ResponseOutputItemDone` - - `FileID string` + The type of the event. Always `response.output_item.done`. - The identifier of an uploaded file that contains the screenshot. + - `const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"` - - `ImageURL string` + - `Agent BetaResponseOutputItemDoneEventAgent` - The URL of the screenshot image. + The agent that owns this multi-agent streaming event. - - `Type ComputerScreenshot` + - `AgentName string` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + The canonical name of the agent that produced this item. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `type BetaResponseReasoningSummaryPartAddedEvent struct{…}` - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + Emitted when a new reasoning summary part is added. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `ItemID string` - - `Mode Explicit` + The ID of the item this summary part is associated with. - The breakpoint mode. Always `explicit`. + - `OutputIndex int64` - - `const ExplicitExplicit Explicit = "explicit"` + The index of the output item this summary part is associated with. - - `type BetaResponseInputFile struct{…}` + - `Part BetaResponseReasoningSummaryPartAddedEventPart` - A file input to the model. + The summary part that was added. - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + - `Text string` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The text of the summary part. - - `EncryptedContent string` + - `Type SummaryText` - Opaque encrypted content. + The type of the summary part. Always `summary_text`. - - `Type EncryptedContent` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - The type of the input item. Always `encrypted_content`. + - `SequenceNumber int64` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + The sequence number of this event. - - `Recipient string` + - `SummaryIndex int64` - The destination agent identity. + The index of the summary part within the reasoning summary. - - `Type AgentMessage` + - `Type ResponseReasoningSummaryPartAdded` - The type of the item. Always `agent_message`. + The type of the event. Always `response.reasoning_summary_part.added`. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"` - - `Agent BetaResponseOutputItemAgentMessageAgent` + - `Agent BetaResponseReasoningSummaryPartAddedEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + - `type BetaResponseReasoningSummaryPartDoneEvent struct{…}` - - `ID string` + Emitted when a reasoning summary part is completed. - The unique ID of the multi-agent call item. + - `ItemID string` - - `Action string` + The ID of the item this summary part is associated with. - The multi-agent action to execute. + - `OutputIndex int64` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + The index of the output item this summary part is associated with. - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` + - `Part BetaResponseReasoningSummaryPartDoneEventPart` - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` + The completed summary part. - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + - `Text string` - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + The text of the summary part. - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + - `Type SummaryText` - - `Arguments string` + The type of the summary part. Always `summary_text`. - The JSON string of arguments generated for the action. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `CallID string` + - `SequenceNumber int64` - The unique ID linking this call to its output. + The sequence number of this event. - - `Type MultiAgentCall` + - `SummaryIndex int64` - The type of the multi-agent call. Always `multi_agent_call`. + The index of the summary part within the reasoning summary. - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `Type ResponseReasoningSummaryPartDone` - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + The type of the event. Always `response.reasoning_summary_part.done`. - The agent that produced this item. + - `const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"` + + - `Agent BetaResponseReasoningSummaryPartDoneEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` - - - `ID string` + - `Status BetaResponseReasoningSummaryPartDoneEventStatus` - The unique ID of the multi-agent call output item. + The completion status of the summary part. Omitted when the part completed + normally and set to `incomplete` when generation was interrupted. - - `Action string` + - `const BetaResponseReasoningSummaryPartDoneEventStatusIncomplete BetaResponseReasoningSummaryPartDoneEventStatus = "incomplete"` - The multi-agent action that produced this result. + - `type BetaResponseReasoningSummaryTextDeltaEvent struct{…}` - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` + Emitted when a delta is added to a reasoning summary text. - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `Delta string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + The text delta that was added to the summary. - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `ItemID string` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + The ID of the item this summary text delta is associated with. - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` + - `OutputIndex int64` - - `CallID string` + The index of the output item this summary text delta is associated with. - The unique ID of the multi-agent call. + - `SequenceNumber int64` - - `Output []BetaResponseOutputText` + The sequence number of this event. - Text output returned by the multi-agent action. + - `SummaryIndex int64` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The index of the summary part within the reasoning summary. - The annotations of the text output. + - `Type ResponseReasoningSummaryTextDelta` - - `Text string` + The type of the event. Always `response.reasoning_summary_text.delta`. - The text output from the model. + - `const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"` - - `Type OutputText` + - `Agent BetaResponseReasoningSummaryTextDeltaEventAgent` - The type of the output text. Always `output_text`. + The agent that owns this multi-agent streaming event. - - `Logprobs []BetaResponseOutputTextLogprob` + - `AgentName string` - - `Type MultiAgentCallOutput` + The canonical name of the agent that produced this item. - The type of the multi-agent result. Always `multi_agent_call_output`. + - `type BetaResponseReasoningSummaryTextDoneEvent struct{…}` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + Emitted when a reasoning summary text is completed. - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `ItemID string` - The agent that produced this item. + The ID of the item this summary text is associated with. - - `AgentName string` + - `OutputIndex int64` - The canonical name of the agent that produced this item. + The index of the output item this summary text is associated with. - - `type BetaResponseFunctionWebSearch struct{…}` + - `SequenceNumber int64` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + The sequence number of this event. - - `type BetaResponseComputerToolCall struct{…}` + - `SummaryIndex int64` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + The index of the summary part within the reasoning summary. - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `Text string` - - `ID string` + The full text of the completed reasoning summary. - The unique ID of the computer call tool output. + - `Type ResponseReasoningSummaryTextDone` - - `CallID string` + The type of the event. Always `response.reasoning_summary_text.done`. - The ID of the computer tool call that produced the output. + - `const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"` - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Agent BetaResponseReasoningSummaryTextDoneEventAgent` - A computer screenshot image used with the computer use tool. + The agent that owns this multi-agent streaming event. - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `AgentName string` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + The canonical name of the agent that produced this item. - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `type BetaResponseReasoningTextDeltaEvent struct{…}` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + Emitted when a delta is added to a reasoning text. - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `ContentIndex int64` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + The index of the reasoning content part this delta is associated with. - - `Type ComputerCallOutput` + - `Delta string` - The type of the computer tool call output. Always `computer_call_output`. + The text delta that was added to the reasoning content. - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `ItemID string` - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + The ID of the item this reasoning text delta is associated with. - The safety checks reported by the API that have been acknowledged by the - developer. + - `OutputIndex int64` - - `ID string` + The index of the output item this reasoning text delta is associated with. - The ID of the pending safety check. + - `SequenceNumber int64` - - `Code string` + The sequence number of this event. - The type of the pending safety check. + - `Type ResponseReasoningTextDelta` - - `Message string` + The type of the event. Always `response.reasoning_text.delta`. - Details about the pending safety check. + - `const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"` - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `Agent BetaResponseReasoningTextDeltaEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `CreatedBy string` - - The identifier of the actor that created the item. + - `type BetaResponseReasoningTextDoneEvent struct{…}` - - `type BetaResponseReasoningItem struct{…}` + Emitted when a reasoning text is completed. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `ContentIndex int64` - - `type BetaResponseOutputItemProgram struct{…}` + The index of the reasoning content part. - - `ID string` + - `ItemID string` - The unique ID of the program item. + The ID of the item this reasoning text is associated with. - - `CallID string` + - `OutputIndex int64` - The stable call ID of the program item. + The index of the output item this reasoning text is associated with. - - `Code string` + - `SequenceNumber int64` - The JavaScript source executed by programmatic tool calling. + The sequence number of this event. - - `Fingerprint string` + - `Text string` - Opaque program replay fingerprint that must be round-tripped. + The full text of the completed reasoning content. - - `Type Program` + - `Type ResponseReasoningTextDone` - The type of the item. Always `program`. + The type of the event. Always `response.reasoning_text.done`. - - `const ProgramProgram Program = "program"` + - `const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"` - - `Agent BetaResponseOutputItemProgramAgent` + - `Agent BetaResponseReasoningTextDoneEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `type BetaResponseRefusalDeltaEvent struct{…}` - - `ID string` + Emitted when there is a partial refusal text. - The unique ID of the program output item. + - `ContentIndex int64` - - `CallID string` + The index of the content part that the refusal text is added to. - The call ID of the program item. + - `Delta string` - - `Result string` + The refusal text that is added. - The result produced by the program item. + - `ItemID string` - - `Status string` + The ID of the output item that the refusal text is added to. - The terminal status of the program output item. + - `OutputIndex int64` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + The index of the output item that the refusal text is added to. - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + - `SequenceNumber int64` - - `Type ProgramOutput` + The sequence number of this event. - The type of the item. Always `program_output`. + - `Type ResponseRefusalDelta` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + The type of the event. Always `response.refusal.delta`. - - `Agent BetaResponseOutputItemProgramOutputAgent` + - `const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"` - The agent that produced this item. + - `Agent BetaResponseRefusalDeltaEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseToolSearchCall struct{…}` + - `type BetaResponseRefusalDoneEvent struct{…}` - - `ID string` + Emitted when refusal text is finalized. - The unique ID of the tool search call item. + - `ContentIndex int64` - - `Arguments any` + The index of the content part that the refusal text is finalized. - Arguments used for the tool search call. + - `ItemID string` - - `CallID string` + The ID of the output item that the refusal text is finalized. - The unique ID of the tool search call generated by the model. + - `OutputIndex int64` - - `Execution BetaResponseToolSearchCallExecution` + The index of the output item that the refusal text is finalized. - Whether tool search was executed by the server or by the client. + - `Refusal string` - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + The refusal text that is finalized. - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `SequenceNumber int64` - - `Status BetaResponseToolSearchCallStatus` + The sequence number of this event. - The status of the tool search call item that was recorded. + - `Type ResponseRefusalDone` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + The type of the event. Always `response.refusal.done`. - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + - `Agent BetaResponseRefusalDoneEventAgent` - - `Type ToolSearchCall` + The agent that owns this multi-agent streaming event. - The type of the item. Always `tool_search_call`. + - `AgentName string` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + The canonical name of the agent that produced this item. - - `Agent BetaResponseToolSearchCallAgent` + - `type BetaResponseTextDeltaEvent struct{…}` - The agent that produced this item. + Emitted when there is an additional text delta. - - `AgentName string` + - `ContentIndex int64` - The canonical name of the agent that produced this item. + The index of the content part that the text delta was added to. - - `CreatedBy string` + - `Delta string` - The identifier of the actor that created the item. + The text delta that was added. - - `type BetaResponseToolSearchOutputItem struct{…}` + - `ItemID string` - - `ID string` + The ID of the output item that the text delta was added to. - The unique ID of the tool search output item. + - `Logprobs []BetaResponseTextDeltaEventLogprob` - - `CallID string` + The log probabilities of the tokens in the delta. - The unique ID of the tool search call generated by the model. + - `Token string` - - `Execution BetaResponseToolSearchOutputItemExecution` + A possible text token. - Whether tool search was executed by the server or by the client. + - `Logprob float64` - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + The log probability of this token. - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `TopLogprobs []BetaResponseTextDeltaEventLogprobTopLogprob` - - `Status BetaResponseToolSearchOutputItemStatus` + The log probabilities of up to 20 of the most likely tokens. - The status of the tool search output item that was recorded. + - `Token string` - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + A possible text token. - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `Logprob float64` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + The log probability of this token. - - `Tools []BetaToolUnion` + - `OutputIndex int64` - The loaded tool definitions returned by tool search. + The index of the output item that the text delta was added to. - - `type BetaFunctionTool struct{…}` + - `SequenceNumber int64` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The sequence number for this event. - - `type BetaFileSearchTool struct{…}` + - `Type ResponseOutputTextDelta` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The type of the event. Always `response.output_text.delta`. - - `type BetaComputerTool struct{…}` + - `const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Agent BetaResponseTextDeltaEventAgent` - - `type BetaComputerUsePreviewTool struct{…}` + The agent that owns this multi-agent streaming event. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `AgentName string` - - `type BetaWebSearchTool struct{…}` + The canonical name of the agent that produced this item. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `type BetaResponseTextDoneEvent struct{…}` - - `type BetaToolMcp struct{…}` + Emitted when text content is finalized. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `ContentIndex int64` - - `type BetaToolCodeInterpreter struct{…}` + The index of the content part that the text content is finalized. - A tool that runs Python code to help generate a response to a prompt. + - `ItemID string` - - `type BetaToolProgrammaticToolCalling struct{…}` + The ID of the output item that the text content is finalized. - - `type BetaToolImageGeneration struct{…}` + - `Logprobs []BetaResponseTextDoneEventLogprob` - A tool that generates images using the GPT image models. + The log probabilities of the tokens in the delta. - - `type BetaToolLocalShell struct{…}` + - `Token string` - A tool that allows the model to execute shell commands in a local environment. + A possible text token. - - `type BetaFunctionShellTool struct{…}` + - `Logprob float64` - A tool that allows the model to execute shell commands. + The log probability of this token. - - `type BetaCustomTool struct{…}` + - `TopLogprobs []BetaResponseTextDoneEventLogprobTopLogprob` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The log probabilities of up to 20 of the most likely tokens. - - `type BetaNamespaceTool struct{…}` + - `Token string` - Groups function/custom tools under a shared namespace. + A possible text token. - - `type BetaToolSearchTool struct{…}` + - `Logprob float64` - Hosted or BYOT tool search configuration for deferred tools. + The log probability of this token. - - `type BetaWebSearchPreviewTool struct{…}` + - `OutputIndex int64` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The index of the output item that the text content is finalized. - - `type BetaApplyPatchTool struct{…}` + - `SequenceNumber int64` - Allows the assistant to create, delete, or update files using unified diffs. + The sequence number for this event. - - `Type ToolSearchOutput` + - `Text string` - The type of the item. Always `tool_search_output`. + The text content that is finalized. - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `Type ResponseOutputTextDone` - - `Agent BetaResponseToolSearchOutputItemAgent` + The type of the event. Always `response.output_text.done`. - The agent that produced this item. + - `const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"` + + - `Agent BetaResponseTextDoneEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `CreatedBy string` + - `type BetaResponseWebSearchCallCompletedEvent struct{…}` - The identifier of the actor that created the item. + Emitted when a web search call is completed. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `ItemID string` - - `ID string` + Unique ID for the output item associated with the web search call. - The unique ID of the additional tools item. + - `OutputIndex int64` - - `Role string` + The index of the output item that the web search call is associated with. - The role that provided the additional tools. + - `SequenceNumber int64` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + The sequence number of the web search call being processed. - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + - `Type ResponseWebSearchCallCompleted` - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + The type of the event. Always `response.web_search_call.completed`. - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + - `Agent BetaResponseWebSearchCallCompletedEventAgent` - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + The agent that owns this multi-agent streaming event. - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + - `AgentName string` - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + The canonical name of the agent that produced this item. - - `Tools []BetaToolUnion` + - `type BetaResponseWebSearchCallInProgressEvent struct{…}` - The additional tool definitions made available at this item. + Emitted when a web search call is initiated. - - `type BetaFunctionTool struct{…}` + - `ItemID string` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + Unique ID for the output item associated with the web search call. - - `type BetaFileSearchTool struct{…}` + - `OutputIndex int64` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The index of the output item that the web search call is associated with. - - `type BetaComputerTool struct{…}` + - `SequenceNumber int64` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The sequence number of the web search call being processed. - - `type BetaComputerUsePreviewTool struct{…}` + - `Type ResponseWebSearchCallInProgress` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The type of the event. Always `response.web_search_call.in_progress`. - - `type BetaWebSearchTool struct{…}` + - `const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Agent BetaResponseWebSearchCallInProgressEventAgent` - - `type BetaToolMcp struct{…}` + The agent that owns this multi-agent streaming event. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `AgentName string` - - `type BetaToolCodeInterpreter struct{…}` + The canonical name of the agent that produced this item. - A tool that runs Python code to help generate a response to a prompt. + - `type BetaResponseWebSearchCallSearchingEvent struct{…}` - - `type BetaToolProgrammaticToolCalling struct{…}` + Emitted when a web search call is executing. - - `type BetaToolImageGeneration struct{…}` + - `ItemID string` - A tool that generates images using the GPT image models. + Unique ID for the output item associated with the web search call. - - `type BetaToolLocalShell struct{…}` + - `OutputIndex int64` - A tool that allows the model to execute shell commands in a local environment. + The index of the output item that the web search call is associated with. - - `type BetaFunctionShellTool struct{…}` + - `SequenceNumber int64` - A tool that allows the model to execute shell commands. + The sequence number of the web search call being processed. - - `type BetaCustomTool struct{…}` + - `Type ResponseWebSearchCallSearching` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The type of the event. Always `response.web_search_call.searching`. - - `type BetaNamespaceTool struct{…}` + - `const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"` - Groups function/custom tools under a shared namespace. + - `Agent BetaResponseWebSearchCallSearchingEventAgent` - - `type BetaToolSearchTool struct{…}` + The agent that owns this multi-agent streaming event. - Hosted or BYOT tool search configuration for deferred tools. + - `AgentName string` - - `type BetaWebSearchPreviewTool struct{…}` + The canonical name of the agent that produced this item. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `type BetaResponseImageGenCallCompletedEvent struct{…}` - - `type BetaApplyPatchTool struct{…}` + Emitted when an image generation tool call has completed and the final image is available. - Allows the assistant to create, delete, or update files using unified diffs. + - `ItemID string` - - `Type AdditionalTools` + The unique identifier of the image generation item being processed. - The type of the item. Always `additional_tools`. + - `OutputIndex int64` - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + The index of the output item in the response's output array. - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + - `SequenceNumber int64` - The agent that produced this item. + The sequence number of this event. - - `AgentName string` + - `Type ResponseImageGenerationCallCompleted` - The canonical name of the agent that produced this item. + The type of the event. Always 'response.image_generation_call.completed'. - - `type BetaResponseCompactionItem struct{…}` + - `const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `Agent BetaResponseImageGenCallCompletedEventAgent` - - `ID string` + The agent that owns this multi-agent streaming event. - The unique ID of the compaction item. + - `AgentName string` - - `EncryptedContent string` + The canonical name of the agent that produced this item. - The encrypted content that was produced by compaction. + - `type BetaResponseImageGenCallGeneratingEvent struct{…}` - - `Type Compaction` + Emitted when an image generation tool call is actively generating an image (intermediate state). - The type of the item. Always `compaction`. + - `ItemID string` - - `const CompactionCompaction Compaction = "compaction"` + The unique identifier of the image generation item being processed. - - `Agent BetaResponseCompactionItemAgent` + - `OutputIndex int64` - The agent that produced this item. + The index of the output item in the response's output array. - - `AgentName string` + - `SequenceNumber int64` - The canonical name of the agent that produced this item. + The sequence number of the image generation item being processed. - - `CreatedBy string` + - `Type ResponseImageGenerationCallGenerating` - The identifier of the actor that created the item. + The type of the event. Always 'response.image_generation_call.generating'. - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"` - An image generation request made by the model. + - `Agent BetaResponseImageGenCallGeneratingEventAgent` - - `ID string` + The agent that owns this multi-agent streaming event. - The unique ID of the image generation call. + - `AgentName string` - - `Result string` + The canonical name of the agent that produced this item. - The generated image encoded in base64. + - `type BetaResponseImageGenCallInProgressEvent struct{…}` - - `Status string` + Emitted when an image generation tool call is in progress. - The status of the image generation call. + - `ItemID string` - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + The unique identifier of the image generation item being processed. - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + - `OutputIndex int64` - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + The index of the output item in the response's output array. - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + - `SequenceNumber int64` - - `Type ImageGenerationCall` + The sequence number of the image generation item being processed. - The type of the image generation call. Always `image_generation_call`. + - `Type ResponseImageGenerationCallInProgress` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + The type of the event. Always 'response.image_generation_call.in_progress'. - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"` - The agent that produced this item. + - `Agent BetaResponseImageGenCallInProgressEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `type BetaResponseImageGenCallPartialImageEvent struct{…}` - A tool call to run code. + Emitted when a partial image is available during image generation streaming. - - `type BetaResponseOutputItemLocalShellCall struct{…}` + - `ItemID string` - A tool call to run a command on the local shell. + The unique identifier of the image generation item being processed. - - `ID string` + - `OutputIndex int64` - The unique ID of the local shell call. + The index of the output item in the response's output array. - - `Action BetaResponseOutputItemLocalShellCallAction` + - `PartialImageB64 string` - Execute a shell command on the server. + Base64-encoded partial image data, suitable for rendering as an image. - - `Command []string` + - `PartialImageIndex int64` - The command to run. + 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). - - `Env map[string, string]` + - `SequenceNumber int64` - Environment variables to set for the command. + The sequence number of the image generation item being processed. - - `Type Exec` + - `Type ResponseImageGenerationCallPartialImage` - The type of the local shell action. Always `exec`. + The type of the event. Always 'response.image_generation_call.partial_image'. - - `const ExecExec Exec = "exec"` + - `const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"` - - `TimeoutMs int64` + - `Agent BetaResponseImageGenCallPartialImageEventAgent` - Optional timeout in milliseconds for the command. + The agent that owns this multi-agent streaming event. - - `User string` + - `AgentName string` - Optional user to run the command as. + The canonical name of the agent that produced this item. - - `WorkingDirectory string` + - `type BetaResponseMcpCallArgumentsDeltaEvent struct{…}` - Optional working directory to run the command in. + Emitted when there is a delta (partial update) to the arguments of an MCP tool call. - - `CallID string` + - `Delta string` - The unique ID of the local shell tool call generated by the model. + A JSON string containing the partial update to the arguments for the MCP tool call. - - `Status string` + - `ItemID string` - The status of the local shell call. + The unique identifier of the MCP tool call item being processed. - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + - `OutputIndex int64` - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + The index of the output item in the response's output array. - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `SequenceNumber int64` - - `Type LocalShellCall` + The sequence number of this event. - The type of the local shell call. Always `local_shell_call`. + - `Type ResponseMcpCallArgumentsDelta` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + The type of the event. Always 'response.mcp_call_arguments.delta'. - - `Agent BetaResponseOutputItemLocalShellCallAgent` + - `const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"` - The agent that produced this item. + - `Agent BetaResponseMcpCallArgumentsDeltaEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + - `type BetaResponseMcpCallArgumentsDoneEvent struct{…}` - The output of a local shell tool call. + Emitted when the arguments for an MCP tool call are finalized. - - `ID string` + - `Arguments string` - The unique ID of the local shell tool call generated by the model. + A JSON string containing the finalized arguments for the MCP tool call. - - `Output string` + - `ItemID string` - A JSON string of the output of the local shell tool call. + The unique identifier of the MCP tool call item being processed. - - `Type LocalShellCallOutput` + - `OutputIndex int64` - The type of the local shell tool call output. Always `local_shell_call_output`. + The index of the output item in the response's output array. - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `SequenceNumber int64` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + The sequence number of this event. - The agent that produced this item. + - `Type ResponseMcpCallArgumentsDone` + + The type of the event. Always 'response.mcp_call_arguments.done'. + + - `const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"` + + - `Agent BetaResponseMcpCallArgumentsDoneEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Status string` + - `type BetaResponseMcpCallCompletedEvent struct{…}` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + Emitted when an MCP tool call has completed successfully. - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + - `ItemID string` - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + The ID of the MCP tool call item that completed. - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + - `OutputIndex int64` - - `type BetaResponseFunctionShellToolCall struct{…}` + The index of the output item that completed. - A tool call that executes one or more shell commands in a managed environment. + - `SequenceNumber int64` - - `ID string` + The sequence number of this event. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `Type ResponseMcpCallCompleted` - - `Action BetaResponseFunctionShellToolCallAction` + The type of the event. Always 'response.mcp_call.completed'. - The shell commands and limits that describe how to run the tool call. + - `const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"` - - `Commands []string` + - `Agent BetaResponseMcpCallCompletedEventAgent` - - `MaxOutputLength int64` + The agent that owns this multi-agent streaming event. - Optional maximum number of characters to return from each command. + - `AgentName string` - - `TimeoutMs int64` + The canonical name of the agent that produced this item. - Optional timeout in milliseconds for the commands. + - `type BetaResponseMcpCallFailedEvent struct{…}` - - `CallID string` + Emitted when an MCP tool call has failed. - The unique ID of the shell tool call generated by the model. + - `ItemID string` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + The ID of the MCP tool call item that failed. - Represents the use of a local environment to perform shell actions. + - `OutputIndex int64` - - `type BetaResponseLocalEnvironment struct{…}` + The index of the output item that failed. - Represents the use of a local environment to perform shell actions. + - `SequenceNumber int64` - - `Type Local` + The sequence number of this event. - The environment type. Always `local`. + - `Type ResponseMcpCallFailed` - - `const LocalLocal Local = "local"` + The type of the event. Always 'response.mcp_call.failed'. - - `type BetaResponseContainerReference struct{…}` + - `const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"` - Represents a container created with /v1/containers. + - `Agent BetaResponseMcpCallFailedEventAgent` - - `ContainerID string` + The agent that owns this multi-agent streaming event. - - `Type ContainerReference` + - `AgentName string` - The environment type. Always `container_reference`. + The canonical name of the agent that produced this item. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `type BetaResponseMcpCallInProgressEvent struct{…}` - - `Status BetaResponseFunctionShellToolCallStatus` + Emitted when an MCP tool call is in progress. - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `ItemID string` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + The unique identifier of the MCP tool call item being processed. - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `OutputIndex int64` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + The index of the output item in the response's output array. - - `Type ShellCall` + - `SequenceNumber int64` - The type of the item. Always `shell_call`. + The sequence number of this event. - - `const ShellCallShellCall ShellCall = "shell_call"` + - `Type ResponseMcpCallInProgress` - - `Agent BetaResponseFunctionShellToolCallAgent` + The type of the event. Always 'response.mcp_call.in_progress'. - The agent that produced this item. + - `const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"` + + - `Agent BetaResponseMcpCallInProgressEventAgent` + + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `type BetaResponseMcpListToolsCompletedEvent struct{…}` - The execution context that produced this tool call. + Emitted when the list of available MCP tools has been successfully retrieved. - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `ItemID string` - - `Type Direct` + The ID of the MCP tool call item that produced this output. - - `const DirectDirect Direct = "direct"` + - `OutputIndex int64` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + The index of the output item that was processed. - - `CallerID string` + - `SequenceNumber int64` - The call ID of the program item that produced this tool call. + The sequence number of this event. - - `Type Program` + - `Type ResponseMcpListToolsCompleted` - - `const ProgramProgram Program = "program"` + The type of the event. Always 'response.mcp_list_tools.completed'. - - `CreatedBy string` + - `const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"` - The ID of the entity that created this tool call. + - `Agent BetaResponseMcpListToolsCompletedEventAgent` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + The agent that owns this multi-agent streaming event. - The output of a shell tool call that was emitted. + - `AgentName string` - - `ID string` + The canonical name of the agent that produced this item. - The unique ID of the shell call output. Populated when this item is returned via API. + - `type BetaResponseMcpListToolsFailedEvent struct{…}` - - `CallID string` + Emitted when the attempt to list available MCP tools has failed. - The unique ID of the shell tool call generated by the model. + - `ItemID string` - - `MaxOutputLength int64` + The ID of the MCP tool call item that failed. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `OutputIndex int64` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + The index of the output item that failed. - An array of shell call output contents + - `SequenceNumber int64` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + The sequence number of this event. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Type ResponseMcpListToolsFailed` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + The type of the event. Always 'response.mcp_list_tools.failed'. - Indicates that the shell call exceeded its configured time limit. + - `const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"` - - `Type Timeout` + - `Agent BetaResponseMcpListToolsFailedEventAgent` - The outcome type. Always `timeout`. + The agent that owns this multi-agent streaming event. - - `const TimeoutTimeout Timeout = "timeout"` + - `AgentName string` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + The canonical name of the agent that produced this item. - Indicates that the shell commands finished and returned an exit code. + - `type BetaResponseMcpListToolsInProgressEvent struct{…}` - - `ExitCode int64` + Emitted when the system is in the process of retrieving the list of available MCP tools. - Exit code from the shell process. + - `ItemID string` - - `Type Exit` + The ID of the MCP tool call item that is being processed. - The outcome type. Always `exit`. + - `OutputIndex int64` - - `const ExitExit Exit = "exit"` + The index of the output item that is being processed. - - `Stderr string` + - `SequenceNumber int64` - The standard error output that was captured. + The sequence number of this event. - - `Stdout string` + - `Type ResponseMcpListToolsInProgress` - The standard output that was captured. + The type of the event. Always 'response.mcp_list_tools.in_progress'. - - `CreatedBy string` + - `const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"` - The identifier of the actor that created the item. + - `Agent BetaResponseMcpListToolsInProgressEventAgent` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + The agent that owns this multi-agent streaming event. - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `AgentName string` - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + The canonical name of the agent that produced this item. - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `type BetaResponseOutputTextAnnotationAddedEvent struct{…}` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + Emitted when an annotation is added to output text content. - - `Type ShellCallOutput` + - `Annotation any` - The type of the shell call output. Always `shell_call_output`. + The annotation object being added. (See annotation schema for details.) - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `AnnotationIndex int64` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + The index of the annotation within the content part. - The agent that produced this item. + - `ContentIndex int64` - - `AgentName string` + The index of the content part within the output item. - The canonical name of the agent that produced this item. + - `ItemID string` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + The unique identifier of the item to which the annotation is being added. - The execution context that produced this tool call. + - `OutputIndex int64` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + The index of the output item in the response's output array. - - `Type Direct` + - `SequenceNumber int64` - - `const DirectDirect Direct = "direct"` + The sequence number of this event. - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `Type ResponseOutputTextAnnotationAdded` - - `CallerID string` + The type of the event. Always 'response.output_text.annotation.added'. - The call ID of the program item that produced this tool call. + - `const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"` - - `Type Program` + - `Agent BetaResponseOutputTextAnnotationAddedEventAgent` - - `const ProgramProgram Program = "program"` + The agent that owns this multi-agent streaming event. - - `CreatedBy string` + - `AgentName string` - The identifier of the actor that created the item. + The canonical name of the agent that produced this item. - - `type BetaResponseApplyPatchToolCall struct{…}` + - `type BetaResponseQueuedEvent struct{…}` - A tool call that applies file diffs by creating, deleting, or updating files. + Emitted when a response is queued and waiting to be processed. - - `ID string` + - `Response BetaResponse` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + The full response object that is queued. - - `CallID string` + - `SequenceNumber int64` - The unique ID of the apply patch tool call generated by the model. + The sequence number for this event. - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `Type ResponseQueued` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + The type of the event. Always 'response.queued'. - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `const ResponseQueuedResponseQueued ResponseQueued = "response.queued"` - Instruction describing how to create a file via the apply_patch tool. + - `Agent BetaResponseQueuedEventAgent` - - `Diff string` + The agent that owns this multi-agent streaming event. - Diff to apply. + - `AgentName string` - - `Path string` + The canonical name of the agent that produced this item. - Path of the file to create. + - `type BetaResponseCustomToolCallInputDeltaEvent struct{…}` - - `Type CreateFile` + Event representing a delta (partial update) to the input of a custom tool call. - Create a new file with the provided diff. + - `Delta string` - - `const CreateFileCreateFile CreateFile = "create_file"` + The incremental input data (delta) for the custom tool call. - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `ItemID string` - Instruction describing how to delete a file via the apply_patch tool. + Unique identifier for the API item associated with this event. - - `Path string` + - `OutputIndex int64` - Path of the file to delete. + The index of the output this delta applies to. - - `Type DeleteFile` + - `SequenceNumber int64` - Delete the specified file. + The sequence number of this event. - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `Type ResponseCustomToolCallInputDelta` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + The event type identifier. - Instruction describing how to update a file via the apply_patch tool. + - `const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"` - - `Diff string` + - `Agent BetaResponseCustomToolCallInputDeltaEventAgent` - Diff to apply. + The agent that owns this multi-agent streaming event. - - `Path string` + - `AgentName string` - Path of the file to update. + The canonical name of the agent that produced this item. - - `Type UpdateFile` + - `type BetaResponseCustomToolCallInputDoneEvent struct{…}` - Update an existing file with the provided diff. + Event indicating that input for a custom tool call is complete. - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `Input string` - - `Status BetaResponseApplyPatchToolCallStatus` + The complete input data for the custom tool call. - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `ItemID string` - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + Unique identifier for the API item associated with this event. - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + - `OutputIndex int64` - - `Type ApplyPatchCall` + The index of the output this event applies to. - The type of the item. Always `apply_patch_call`. + - `SequenceNumber int64` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + The sequence number of this event. - - `Agent BetaResponseApplyPatchToolCallAgent` + - `Type ResponseCustomToolCallInputDone` + + The event type identifier. + + - `const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"` + + - `Agent BetaResponseCustomToolCallInputDoneEventAgent` - The agent that produced this item. + The agent that owns this multi-agent streaming event. - `AgentName string` The canonical name of the agent that produced this item. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `type BetaResponseInjectCreatedEvent struct{…}` - The execution context that produced this tool call. + Emitted when all injected input items were validated and committed to the + active response. - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `ResponseID string` - - `Type Direct` + The ID of the response that accepted the input. - - `const DirectDirect Direct = "direct"` + - `SequenceNumber int64` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + The sequence number for this event. - - `CallerID string` + - `Type ResponseInjectCreated` - The call ID of the program item that produced this tool call. + The event discriminator. Always `response.inject.created`. - - `Type Program` + - `const ResponseInjectCreatedResponseInjectCreated ResponseInjectCreated = "response.inject.created"` - - `const ProgramProgram Program = "program"` + - `StreamID string` - - `CreatedBy string` + The multiplexed WebSocket stream that emitted the event. This field is + present only when WebSocket multiplexing is enabled separately. - The ID of the entity that created this tool call. + - `type BetaResponseInjectFailedEvent struct{…}` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + Emitted when injected input could not be committed to a response. The event + returns the uncommitted raw input so the client can retry it in another + response when appropriate. - The output emitted by an apply patch tool call. + - `Error BetaResponseInjectFailedEventError` - - `ID string` + Information about why the input was not committed. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `Code string` - - `CallID string` + A machine-readable error code. - The unique ID of the apply patch tool call generated by the model. + - `const BetaResponseInjectFailedEventErrorCodeResponseAlreadyCompleted BetaResponseInjectFailedEventErrorCode = "response_already_completed"` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + - `const BetaResponseInjectFailedEventErrorCodeResponseNotFound BetaResponseInjectFailedEventErrorCode = "response_not_found"` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `Message string` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + A human-readable description of the error. - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `Input []BetaResponseInputItemUnion` - - `Type ApplyPatchCallOutput` + The raw input items that were not committed. - The type of the item. Always `apply_patch_call_output`. + - `type BetaEasyInputMessage struct{…}` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `type BetaResponseInputItemMessage struct{…}` - The agent that produced this item. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - - `AgentName string` + - `type BetaResponseOutputMessage struct{…}` - The canonical name of the agent that produced this item. + An output message from the model. - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `type BetaResponseFileSearchToolCall struct{…}` - The execution context that produced this tool call. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `type BetaResponseComputerToolCall struct{…}` - - `Type Direct` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - - `const DirectDirect Direct = "direct"` + - `type BetaResponseInputItemComputerCallOutput struct{…}` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + The output of a computer tool call. - - `CallerID string` + - `type BetaResponseFunctionWebSearch struct{…}` - The call ID of the program item that produced this tool call. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `Type Program` + - `type BetaResponseFunctionToolCall struct{…}` - - `const ProgramProgram Program = "program"` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `CreatedBy string` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - The ID of the entity that created this tool call output. + The output of a function tool call. - - `Output string` + - `type BetaResponseInputItemAgentMessage struct{…}` - Optional textual output returned by the apply patch tool. + A message routed between agents. - - `type BetaResponseOutputItemMcpCall struct{…}` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - An invocation of a tool on an MCP server. + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - - `ID string` + - `type BetaResponseInputItemToolSearchCall struct{…}` - The unique ID of the tool call. + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - - `Arguments string` + - `type BetaResponseInputItemAdditionalTools struct{…}` - A JSON string of the arguments passed to the tool. + - `type BetaResponseReasoningItem struct{…}` - - `Name string` + 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](https://platform.openai.com/docs/guides/conversation-state). - The name of the tool that was run. + - `type BetaResponseCompactionItemParamResp struct{…}` - - `ServerLabel string` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - The label of the MCP server running the tool. + - `type BetaResponseInputItemImageGenerationCall struct{…}` - - `Type McpCall` + An image generation request made by the model. - The type of the item. Always `mcp_call`. + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `const McpCallMcpCall McpCall = "mcp_call"` + A tool call to run code. - - `Agent BetaResponseOutputItemMcpCallAgent` + - `type BetaResponseInputItemLocalShellCall struct{…}` - The agent that produced this item. + A tool call to run a command on the local shell. - - `AgentName string` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - The canonical name of the agent that produced this item. + The output of a local shell tool call. - - `ApprovalRequestID string` + - `type BetaResponseInputItemShellCall struct{…}` - 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. + A tool representing a request to execute one or more shell commands. - - `Error string` + - `type BetaResponseInputItemShellCallOutput struct{…}` - The error from the tool call, if any. + The streamed output items emitted by a shell tool call. - - `Output string` + - `type BetaResponseInputItemApplyPatchCall struct{…}` - The output from the tool call. + A tool call representing a request to create, delete, or update files using diff patches. - - `Status string` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + The streamed output emitted by an apply patch tool call. - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + - `type BetaResponseInputItemMcpListTools struct{…}` - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + A list of tools available on an MCP server. - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + A request for human approval of a tool invocation. - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - - `type BetaResponseOutputItemMcpListTools struct{…}` + A response to an MCP approval request. - A list of tools available on an MCP server. + - `type BetaResponseInputItemMcpCall struct{…}` - - `ID string` + An invocation of a tool on an MCP server. - The unique ID of the list. + - `type BetaResponseCustomToolCallOutput struct{…}` - - `ServerLabel string` + The output of a custom tool call from your code, being sent back to the model. - The label of the MCP server. + - `type BetaResponseCustomToolCall struct{…}` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + A call to a custom tool created by the model. - The tools available on the server. + - `type BetaResponseInputItemCompactionTrigger struct{…}` - - `InputSchema any` + Compacts the current context. Must be the final input item. - The JSON schema describing the tool's input. + - `type BetaResponseInputItemItemReference struct{…}` - - `Name string` + An internal identifier for an item to reference. - The name of the tool. + - `type BetaResponseInputItemProgram struct{…}` - - `Annotations any` + - `type BetaResponseInputItemProgramOutput struct{…}` - Additional annotations about the tool. + - `ResponseID string` - - `Description string` + The ID of the response that rejected the input. - The description of the tool. + - `SequenceNumber int64` - - `Type McpListTools` + The sequence number for this event. - The type of the item. Always `mcp_list_tools`. + - `Type ResponseInjectFailed` - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + The event discriminator. Always `response.inject.failed`. - - `Agent BetaResponseOutputItemMcpListToolsAgent` + - `const ResponseInjectFailedResponseInjectFailed ResponseInjectFailed = "response.inject.failed"` - The agent that produced this item. + - `StreamID string` - - `AgentName string` + The multiplexed WebSocket stream that emitted the event. This field is + present only when WebSocket multiplexing is enabled separately. - The canonical name of the agent that produced this item. +### Beta Skill Reference - - `Error string` +- `type BetaSkillReference struct{…}` - Error message if the server could not list tools. + - `SkillID string` - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + The ID of the referenced skill. - A request for human approval of a tool invocation. + - `Type SkillReference` - - `ID string` + References a skill created with the /v1/skills endpoint. - The unique ID of the approval request. + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `Arguments string` + - `Version string` - A JSON string of arguments for the tool. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `Name string` +### Beta Tool - The name of the tool to run. +- `type BetaToolUnion interface{…}` - - `ServerLabel string` + A tool that can be used to generate a response. - The label of the MCP server making the request. + - `type BetaFunctionTool struct{…}` - - `Type McpApprovalRequest` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The type of the item. Always `mcp_approval_request`. + - `Name string` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + The name of the function to call. - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `Parameters map[string, any]` - The agent that produced this item. + A JSON schema object describing the parameters of the function. - - `AgentName string` + - `Strict bool` - The canonical name of the agent that produced this item. + Whether strict parameter validation is enforced for this function tool. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `Type Function` - A response to an MCP approval request. + The type of the function tool. Always `function`. - - `ID string` + - `const FunctionFunction Function = "function"` - The unique ID of the approval response + - `AllowedCallers []string` - - `ApprovalRequestID string` + The tool invocation context(s). - The ID of the approval request being answered. + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `Approve bool` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - Whether the request was approved. + - `DeferLoading bool` - - `Type McpApprovalResponse` + Whether this function is deferred and loaded via tool search. - The type of the item. Always `mcp_approval_response`. + - `Description string` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + A description of the function. Used by the model to determine whether or not to call the function. - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + - `OutputSchema map[string, any]` - The agent that produced this item. + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `AgentName string` + - `type BetaFileSearchTool struct{…}` - The canonical name of the agent that produced this item. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Reason string` + - `Type FileSearch` - Optional reason for the decision. + The type of the file search tool. Always `file_search`. - - `type BetaResponseCustomToolCall struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - A call to a custom tool created by the model. + - `VectorStoreIDs []string` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + The IDs of the vector stores to search. - The output of a custom tool call from your code, being sent back to the model. + - `Filters BetaFileSearchToolFiltersUnion` - - `ID string` + A filter to apply. - The unique ID of the custom tool call output item. + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - - `Status string` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Key string` - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + The key to compare against the value. - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + - `Type string` - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `CreatedBy string` + - `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 - The identifier of the actor that created the item. + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - `ParallelToolCalls bool` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - Whether to allow the model to run tool calls in parallel. + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `Temperature float64` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `ToolChoice BetaResponseToolChoiceUnion` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `type BetaToolChoiceOptions string` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - Controls which (if any) tool is called by the model. + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - `none` means the model will not call any tool and instead generates a message. + The value to compare against the attribute key; supports string, number, or boolean types. - `auto` means the model can pick between generating a message or calling one or - more tools. + - `string` - `required` means the model must call one or more tools. + - `float64` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + - `bool` - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + - `string` - - `type BetaToolChoiceAllowed struct{…}` + - `float64` - Constrains the tools available to the model to a pre-defined set. + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - `Mode BetaToolChoiceAllowedMode` + Combine multiple filters using `and` or `or`. - Constrains the tools available to the model to a pre-defined set. + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - `auto` allows the model to pick from among the allowed tools and generate a - message. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - `required` requires the model to call one or more of the allowed tools. + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + - `Key string` - - `Tools []map[string, any]` + The key to compare against the value. - A list of tool definitions that the model should be allowed to call. + - `Type string` - For the Responses API, the list of tool definitions might look like: + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `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 - - `Type AllowedTools` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - Allowed tool configuration type. Always `allowed_tools`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `type BetaToolChoiceTypes struct{…}` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `Type BetaToolChoiceTypesType` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - Allowed values are: + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + The value to compare against the attribute key; supports string, number, or boolean types. - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + - `string` - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + - `float64` - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `bool` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `string` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + - `float64` - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `Type string` - - `type BetaToolChoiceFunction struct{…}` + Type of operation: `and` or `or`. - Use this option to force the model to call a specific function. + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `Name string` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - The name of the function to call. + - `MaxNumResults int64` - - `Type Function` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - For function calling, the type is always `function`. + - `RankingOptions BetaFileSearchToolRankingOptions` - - `const FunctionFunction Function = "function"` + Ranking options for search. - - `type BetaToolChoiceMcp struct{…}` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - Use this option to force the model to call a specific tool on a remote MCP server. + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `ServerLabel string` + - `EmbeddingWeight float64` - The label of the MCP server to use. + The weight of the embedding in the reciprocal ranking fusion. - - `Type Mcp` + - `TextWeight float64` - For MCP tools, the type is always `mcp`. + The weight of the text in the reciprocal ranking fusion. - - `const McpMcp Mcp = "mcp"` + - `Ranker string` - - `Name string` + The ranker to use for the file search. - The name of the tool to call on the server. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `type BetaToolChoiceCustom struct{…}` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - Use this option to force the model to call a specific custom tool. + - `ScoreThreshold float64` - - `Name string` + 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. - The name of the custom tool to call. + - `type BetaComputerTool struct{…}` - - `Type Custom` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - For custom tool calling, the type is always `custom`. + - `Type Computer` - - `const CustomCustom Custom = "custom"` + The type of the computer tool. Always `computer`. - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `const ComputerComputer Computer = "computer"` - - `Type ProgrammaticToolCalling` + - `type BetaComputerUsePreviewTool struct{…}` - The tool to call. Always `programmatic_tool_calling`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `DisplayHeight int64` - - `type BetaToolChoiceApplyPatch struct{…}` + The height of the computer display. - Forces the model to call the apply_patch tool when executing a tool call. + - `DisplayWidth int64` - - `Type ApplyPatch` + The width of the computer display. - The tool to call. Always `apply_patch`. + - `Environment BetaComputerUsePreviewToolEnvironment` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + The type of computer environment to control. - - `type BetaToolChoiceShell struct{…}` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - Forces the model to call the shell tool when a tool call is required. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `Type Shell` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - The tool to call. Always `shell`. + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - `const ShellShell Shell = "shell"` + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `Tools []BetaToolUnion` + - `Type ComputerUsePreview` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + The type of the computer use tool. Always `computer_use_preview`. - We support the following categories of tools: + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + - `type BetaWebSearchTool struct{…}` - - `type BetaFunctionTool struct{…}` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Type BetaWebSearchToolType` - - `type BetaFileSearchTool struct{…}` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `type BetaComputerTool struct{…}` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Filters BetaWebSearchToolFilters` - - `type BetaComputerUsePreviewTool struct{…}` + Filters for the search. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `AllowedDomains []string` - - `type BetaWebSearchTool struct{…}` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `type BetaToolMcp struct{…}` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + 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. - - `type BetaToolCodeInterpreter struct{…}` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - A tool that runs Python code to help generate a response to a prompt. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - - `type BetaToolImageGeneration struct{…}` + - `UserLocation BetaWebSearchToolUserLocation` - A tool that generates images using the GPT image models. + The approximate location of the user. - - `type BetaToolLocalShell struct{…}` + - `City string` - A tool that allows the model to execute shell commands in a local environment. + Free text input for the city of the user, e.g. `San Francisco`. - - `type BetaFunctionShellTool struct{…}` + - `Country string` - A tool that allows the model to execute shell commands. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `type BetaCustomTool struct{…}` + - `Region string` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + Free text input for the region of the user, e.g. `California`. - - `type BetaNamespaceTool struct{…}` + - `Timezone string` - Groups function/custom tools under a shared namespace. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `type BetaToolSearchTool struct{…}` + - `Type string` - Hosted or BYOT tool search configuration for deferred tools. + The type of location approximation. Always `approximate`. - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `type BetaToolMcp struct{…}` - - `type BetaApplyPatchTool struct{…}` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - Allows the assistant to create, delete, or update files using unified diffs. + - `ServerLabel string` - - `TopP float64` + A label for this MCP server, used to identify it in tool calls. - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + - `Type Mcp` - We generally recommend altering this or `temperature` but not both. + The type of the MCP tool. Always `mcp`. - - `Background bool` + - `const McpMcp Mcp = "mcp"` - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + - `AllowedCallers []string` - - `CompletedAt float64` + The tool invocation context(s). - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - - `Conversation BetaResponseConversation` + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + - `AllowedTools BetaToolMcpAllowedToolsUnion` - - `ID string` + List of allowed tool names or a filter object. - The unique ID of the conversation that this response was associated with. + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - - `MaxOutputTokens int64` + A string array of allowed tool names - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `MaxToolCalls int64` + A filter object to specify which tools are allowed. - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + - `ReadOnly bool` - - `Moderation BetaResponseModeration` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - Moderation results for the response input and output, if moderated completions were requested. + - `ToolNames []string` - - `Input BetaResponseModerationInputUnion` + List of allowed tool names. - Moderation for the response input. + - `Authorization string` - - `type BetaResponseModerationInputModerationResult struct{…}` + 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. - A moderation result produced for the response input or output. + - `ConnectorID string` - - `Categories map[string, bool]` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + Currently supported `connector_id` values are: - - `CategoryAppliedInputTypes map[string, []string]` + - 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` - Which modalities of input are reflected by the score for each category. + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `CategoryScores map[string, float64]` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - A dictionary of moderation categories to scores. + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - - `Flagged bool` + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - A boolean indicating whether the content was flagged by any category. + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - - `Model string` + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - The moderation model that produced this result. + - `DeferLoading bool` - - `Type ModerationResult` + Whether this MCP tool is deferred and discovered via tool search. - The object type, which was always `moderation_result` for successful moderation results. + - `Headers map[string, string]` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `type BetaResponseModerationInputError struct{…}` + - `RequireApproval BetaToolMcpRequireApprovalUnion` - An error produced while attempting moderation for the response input or output. + Specify which of the MCP server's tools require approval. - - `Code string` + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - The error code. + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `Message string` + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - The error message. + A filter object to specify which tools are allowed. - - `Type Error` + - `ReadOnly bool` - The object type, which was always `error` for moderation failures. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const ErrorError Error = "error"` + - `ToolNames []string` - - `Output BetaResponseModerationOutputUnion` + List of allowed tool names. - Moderation for the response output. + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - - `type BetaResponseModerationOutputModerationResult struct{…}` + A filter object to specify which tools are allowed. - A moderation result produced for the response input or output. + - `ReadOnly bool` - - `Categories map[string, bool]` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `ToolNames []string` - - `CategoryAppliedInputTypes map[string, []string]` + List of allowed tool names. - Which modalities of input are reflected by the score for each category. + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + 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 BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - - `CategoryScores map[string, float64]` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - A dictionary of moderation categories to scores. + - `ServerDescription string` - - `Flagged bool` + Optional description of the MCP server, used to provide more context. - A boolean indicating whether the content was flagged by any category. + - `ServerURL string` - - `Model string` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - The moderation model that produced this result. + - `TunnelID string` - - `Type ModerationResult` + 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. - The object type, which was always `moderation_result` for successful moderation results. + - `type BetaToolCodeInterpreter struct{…}` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + A tool that runs Python code to help generate a response to a prompt. - - `type BetaResponseModerationOutputError struct{…}` + - `Container BetaToolCodeInterpreterContainerUnion` - An error produced while attempting moderation for the response input or output. + 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. - - `Code string` + - `string` - The error code. + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `Message string` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - The error message. + - `Type Auto` - - `Type Error` + Always `auto`. - The object type, which was always `error` for moderation failures. + - `const AutoAuto Auto = "auto"` - - `const ErrorError Error = "error"` + - `FileIDs []string` - - `PreviousResponseID string` + An optional list of uploaded files to make available to your code. - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + - `MemoryLimit string` - - `Prompt BetaResponsePrompt` + The memory limit for the code interpreter container. - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - - `ID string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - The unique identifier of the prompt template to use. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - - `Variables map[string, BetaResponsePromptVariableUnion]` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - - `string` + Network access policy for the container. - - `type BetaResponseInputText struct{…}` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - A text input to the model. + - `Type Disabled` - - `type BetaResponseInputImage struct{…}` + Disable outbound network access. Always `disabled`. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const DisabledDisabled Disabled = "disabled"` - - `type BetaResponseInputFile struct{…}` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - A file input to the model. + - `AllowedDomains []string` - - `Version string` + A list of allowed domains when type is `allowlist`. - Optional version of the prompt template. + - `Type Allowlist` - - `PromptCacheKey string` + Allow outbound network access only to specified domains. Always `allowlist`. - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + - `const AllowlistAllowlist Allowlist = "allowlist"` - - `PromptCacheOptions BetaResponsePromptCacheOptions` + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + Optional domain-scoped secrets for allowlisted domains. - - `Mode string` + - `Domain string` - Whether implicit prompt-cache breakpoints were enabled. + The domain associated with the secret. - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `Name string` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + The name of the secret to inject for the domain. - - `Ttl string` + - `Value string` - The minimum lifetime applied to each cache breakpoint. + The secret value to inject for the domain. - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + - `Type CodeInterpreter` - - `PromptCacheRetention BetaResponsePromptCacheRetention` + The type of the code interpreter tool. Always `code_interpreter`. - Deprecated. Use `prompt_cache_options.ttl` instead. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + - `AllowedCallers []string` - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + The tool invocation context(s). - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + - `type BetaToolProgrammaticToolCalling struct{…}` - - `Reasoning BetaResponseReasoning` + - `Type ProgrammaticToolCalling` - **gpt-5 and o-series models only** + The type of the tool. Always `programmatic_tool_calling`. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `Context string` + - `type BetaToolImageGeneration struct{…}` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + A tool that generates images using the GPT image models. - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + - `Type ImageGeneration` - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + The type of the image generation tool. Always `image_generation`. - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `Effort string` + - `Action string` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + - `Background string` - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + 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. - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + `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. - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - - `GenerateSummary string` + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - **Deprecated:** use `summary` instead. + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` + - `InputFidelity string` - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` + 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 BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - - `Mode string` + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - Controls the reasoning execution mode for the request. + - `InputImageMask BetaToolImageGenerationInputImageMask` - When returned on a response, this is the effective execution mode. + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `string` + - `FileID string` - - `string` + File ID for the mask image. - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` + - `ImageURL string` - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` + Base64-encoded mask image. - - `Summary string` + - `Model string` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + The image generation model to use. Default: `gpt-image-1`. - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `string` - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + - `string` - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `SafetyIdentifier string` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `ServiceTier BetaResponseServiceTier` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - Specifies the processing type used for serving the request. + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `Moderation string` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + Moderation level for the generated image. Default: `auto`. - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + - `OutputCompression int64` - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + Compression level for the output image. Default: 100. - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + - `OutputFormat string` - - `Status BetaResponseStatus` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + - `PartialImages int64` - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `Quality string` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `Text BetaResponseTextConfig` + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `Format BetaResponseFormatTextConfigUnion` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - An object specifying the format that the model must output. + - `Size string` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + 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`. - The default format is `{ "type": "text" }` with no additional options. + - `string` - **Not recommended for gpt-4o and newer models:** + - `string` - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - - `type BetaResponseFormatTextConfigText struct{…}` + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - Default response format. Used to generate text responses. + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - - `Type Text` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - The type of response format being defined. Always `text`. + - `type BetaToolLocalShell struct{…}` - - `const TextText Text = "text"` + A tool that allows the model to execute shell commands in a local environment. - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + - `Type LocalShell` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + The type of the local shell tool. Always `local_shell`. - - `Name string` + - `const LocalShellLocalShell LocalShell = "local_shell"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `type BetaFunctionShellTool struct{…}` + + A tool that allows the model to execute shell commands. + + - `Type Shell` - - `Schema map[string, any]` + The type of the shell tool. Always `shell`. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const ShellShell Shell = "shell"` - - `Type JSONSchema` + - `AllowedCallers []string` - The type of response format being defined. Always `json_schema`. + The tool invocation context(s). - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - - `Description string` + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `Environment BetaFunctionShellToolEnvironmentUnion` - - `Strict bool` + - `type BetaContainerAuto struct{…}` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Type ContainerAuto` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + Automatically creates a container for this request - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `Type JSONObject` + - `FileIDs []string` - The type of response format being defined. Always `json_object`. + An optional list of uploaded files to make available to your code. - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `MemoryLimit BetaContainerAutoMemoryLimit` - - `Verbosity BetaResponseTextConfigVerbosity` + The memory limit for the container. - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `TopLogprobs int64` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + Network access policy for the container. - - `Truncation BetaResponseTruncation` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - The truncation strategy to use for the model response. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `Skills []BetaContainerAutoSkillUnion` - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + An optional list of skills referenced by id or inline data. - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + - `type BetaSkillReference struct{…}` - - `Usage BetaResponseUsage` + - `SkillID string` - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + The ID of the referenced skill. - - `InputTokens int64` + - `Type SkillReference` - The number of input tokens. + References a skill created with the /v1/skills endpoint. - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - A detailed breakdown of the input tokens. + - `Version string` - - `CacheWriteTokens int64` + Optional skill version. Use a positive integer or 'latest'. Omit for default. - The number of input tokens that were written to the cache. + - `type BetaInlineSkill struct{…}` - - `CachedTokens int64` + - `Description string` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + The description of the skill. - - `OutputTokens int64` + - `Name string` - The number of output tokens. + The name of the skill. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `Source BetaInlineSkillSource` - A detailed breakdown of the output tokens. + Inline skill payload - - `ReasoningTokens int64` + - `Data string` - The number of reasoning tokens. + Base64-encoded skill zip bundle. - - `TotalTokens int64` + - `MediaType ApplicationZip` - The total number of tokens used. + The media type of the inline skill payload. Must be `application/zip`. - - `User string` + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `Type Base64` - - `SequenceNumber int64` + The type of the inline skill source. Must be `base64`. - The sequence number for this event. + - `const Base64Base64 Base64 = "base64"` - - `Type ResponseCompleted` + - `Type Inline` - The type of the event. Always `response.completed`. + Defines an inline skill for this request. - - `const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"` + - `const InlineInline Inline = "inline"` - - `Agent BetaResponseCompletedEventAgent` + - `type BetaLocalEnvironment struct{…}` - The agent that owns this multi-agent streaming event. + - `Type Local` - - `AgentName string` + Use a local computer environment. - The canonical name of the agent that produced this item. + - `const LocalLocal Local = "local"` - - `type BetaResponseContentPartAddedEvent struct{…}` + - `Skills []BetaLocalSkill` - Emitted when a new content part is added. + An optional list of skills. - - `ContentIndex int64` + - `Description string` - The index of the content part that was added. + The description of the skill. - - `ItemID string` + - `Name string` - The ID of the output item that the content part was added to. + The name of the skill. - - `OutputIndex int64` + - `Path string` - The index of the output item that the content part was added to. + The path to the directory containing the skill. - - `Part BetaResponseContentPartAddedEventPartUnion` + - `type BetaContainerReference struct{…}` - The content part that was added. + - `ContainerID string` - - `type BetaResponseOutputText struct{…}` + The ID of the referenced container. - A text output from the model. + - `Type ContainerReference` - - `type BetaResponseOutputRefusal struct{…}` + References a container created with the /v1/containers endpoint - A refusal from the model. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `type BetaResponseContentPartAddedEventPartReasoningText struct{…}` + - `type BetaCustomTool struct{…}` - Reasoning text from the model. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `Text string` + - `Name string` - The reasoning text from the model. + The name of the custom tool, used to identify it in tool calls. - - `Type ReasoningText` + - `Type Custom` - The type of the reasoning text. Always `reasoning_text`. + The type of the custom tool. Always `custom`. - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `const CustomCustom Custom = "custom"` - - `SequenceNumber int64` + - `AllowedCallers []string` - The sequence number of this event. + The tool invocation context(s). - - `Type ResponseContentPartAdded` + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - The type of the event. Always `response.content_part.added`. + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - - `const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"` + - `DeferLoading bool` - - `Agent BetaResponseContentPartAddedEventAgent` + Whether this tool should be deferred and discovered via tool search. - The agent that owns this multi-agent streaming event. + - `Description string` - - `AgentName string` + Optional description of the custom tool, used to provide more context. - The canonical name of the agent that produced this item. + - `Format BetaCustomToolFormatUnion` - - `type BetaResponseContentPartDoneEvent struct{…}` + The input format for the custom tool. Default is unconstrained text. - Emitted when a content part is done. + - `type BetaCustomToolFormatText struct{…}` - - `ContentIndex int64` + Unconstrained free-form text. - The index of the content part that is done. + - `Type Text` - - `ItemID string` + Unconstrained text format. Always `text`. - The ID of the output item that the content part was added to. + - `const TextText Text = "text"` - - `OutputIndex int64` + - `type BetaCustomToolFormatGrammar struct{…}` - The index of the output item that the content part was added to. + A grammar defined by the user. - - `Part BetaResponseContentPartDoneEventPartUnion` + - `Definition string` - The content part that is done. + The grammar definition. - - `type BetaResponseOutputText struct{…}` + - `Syntax string` - A text output from the model. + The syntax of the grammar definition. One of `lark` or `regex`. - - `type BetaResponseOutputRefusal struct{…}` + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - A refusal from the model. + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `type BetaResponseContentPartDoneEventPartReasoningText struct{…}` + - `Type Grammar` - Reasoning text from the model. + Grammar format. Always `grammar`. - - `Text string` + - `const GrammarGrammar Grammar = "grammar"` - The reasoning text from the model. + - `type BetaNamespaceTool struct{…}` - - `Type ReasoningText` + Groups function/custom tools under a shared namespace. - The type of the reasoning text. Always `reasoning_text`. + - `Description string` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + A description of the namespace shown to the model. - - `SequenceNumber int64` + - `Name string` - The sequence number of this event. + The namespace name used in tool calls (for example, `crm`). - - `Type ResponseContentPartDone` + - `Tools []BetaNamespaceToolToolUnion` - The type of the event. Always `response.content_part.done`. + The function/custom tools available inside this namespace. - - `const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"` + - `type BetaNamespaceToolToolFunction struct{…}` - - `Agent BetaResponseContentPartDoneEventAgent` + - `Name string` - The agent that owns this multi-agent streaming event. + - `Type Function` - - `AgentName string` + - `const FunctionFunction Function = "function"` - The canonical name of the agent that produced this item. + - `AllowedCallers []string` - - `type BetaResponseCreatedEvent struct{…}` + The tool invocation context(s). - An event that is emitted when a response is created. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `Response BetaResponse` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - The response that was created. + - `DeferLoading bool` - - `SequenceNumber int64` + Whether this function should be deferred and discovered via tool search. - The sequence number for this event. + - `Description string` - - `Type ResponseCreated` + - `OutputSchema map[string, any]` - The type of the event. Always `response.created`. + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `const ResponseCreatedResponseCreated ResponseCreated = "response.created"` + - `Parameters any` - - `Agent BetaResponseCreatedEventAgent` + - `Strict bool` - The agent that owns this multi-agent streaming event. + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `AgentName string` + - `type BetaCustomTool struct{…}` - The canonical name of the agent that produced this item. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `type BetaResponseErrorEvent struct{…}` + - `Type Namespace` - Emitted when an error occurs. + The type of the tool. Always `namespace`. - - `Code string` + - `const NamespaceNamespace Namespace = "namespace"` - The error code. + - `type BetaToolSearchTool struct{…}` - - `Message string` + Hosted or BYOT tool search configuration for deferred tools. - The error message. + - `Type ToolSearch` - - `Param string` + The type of the tool. Always `tool_search`. - The error parameter. + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `SequenceNumber int64` + - `Description string` - The sequence number of this event. + Description shown to the model for a client-executed tool search tool. - - `Type Error` + - `Execution BetaToolSearchToolExecution` - The type of the event. Always `error`. + Whether tool search is executed by the server or by the client. - - `const ErrorError Error = "error"` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `Agent BetaResponseErrorEventAgent` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - The agent that owns this multi-agent streaming event. + - `Parameters any` - - `AgentName string` + Parameter schema for a client-executed tool search tool. - The canonical name of the agent that produced this item. + - `type BetaWebSearchPreviewTool struct{…}` - - `type BetaResponseFileSearchCallCompletedEvent struct{…}` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - Emitted when a file search call is completed (results found). + - `Type BetaWebSearchPreviewToolType` - - `ItemID string` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The ID of the output item that the file search call is initiated. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `OutputIndex int64` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - The index of the output item that the file search call is initiated. + - `SearchContentTypes []string` - - `SequenceNumber int64` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - The sequence number of this event. + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `Type ResponseFileSearchCallCompleted` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - The type of the event. Always `response.file_search_call.completed`. + 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 ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"` + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - - `Agent BetaResponseFileSearchCallCompletedEventAgent` + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - The agent that owns this multi-agent streaming event. + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - `AgentName string` + - `UserLocation BetaWebSearchPreviewToolUserLocation` - The canonical name of the agent that produced this item. + The user's location. - - `type BetaResponseFileSearchCallInProgressEvent struct{…}` + - `Type Approximate` - Emitted when a file search call is initiated. + The type of location approximation. Always `approximate`. - - `ItemID string` + - `const ApproximateApproximate Approximate = "approximate"` - The ID of the output item that the file search call is initiated. + - `City string` - - `OutputIndex int64` + Free text input for the city of the user, e.g. `San Francisco`. - The index of the output item that the file search call is initiated. + - `Country string` - - `SequenceNumber int64` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The sequence number of this event. + - `Region string` - - `Type ResponseFileSearchCallInProgress` + Free text input for the region of the user, e.g. `California`. - The type of the event. Always `response.file_search_call.in_progress`. + - `Timezone string` - - `const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `Agent BetaResponseFileSearchCallInProgressEventAgent` + - `type BetaApplyPatchTool struct{…}` - The agent that owns this multi-agent streaming event. + Allows the assistant to create, delete, or update files using unified diffs. - - `AgentName string` + - `Type ApplyPatch` - The canonical name of the agent that produced this item. + The type of the tool. Always `apply_patch`. - - `type BetaResponseFileSearchCallSearchingEvent struct{…}` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - Emitted when a file search is currently searching. + - `AllowedCallers []string` - - `ItemID string` + The tool invocation context(s). - The ID of the output item that the file search call is initiated. + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - - `OutputIndex int64` + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - The index of the output item that the file search call is searching. +### Beta Tool Choice Allowed - - `SequenceNumber int64` +- `type BetaToolChoiceAllowed struct{…}` - The sequence number of this event. + Constrains the tools available to the model to a pre-defined set. - - `Type ResponseFileSearchCallSearching` + - `Mode BetaToolChoiceAllowedMode` - The type of the event. Always `response.file_search_call.searching`. + Constrains the tools available to the model to a pre-defined set. - - `const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"` + `auto` allows the model to pick from among the allowed tools and generate a + message. - - `Agent BetaResponseFileSearchCallSearchingEventAgent` + `required` requires the model to call one or more of the allowed tools. - The agent that owns this multi-agent streaming event. + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - - `AgentName string` + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - The canonical name of the agent that produced this item. + - `Tools []map[string, any]` - - `type BetaResponseFunctionCallArgumentsDeltaEvent struct{…}` + A list of tool definitions that the model should be allowed to call. - Emitted when there is a partial function-call arguments delta. + For the Responses API, the list of tool definitions might look like: - - `Delta string` + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - The function-call arguments delta that is added. + - `Type AllowedTools` - - `ItemID string` + Allowed tool configuration type. Always `allowed_tools`. - The ID of the output item that the function-call arguments delta is added to. + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `OutputIndex int64` +### Beta Tool Choice Apply Patch - The index of the output item that the function-call arguments delta is added to. +- `type BetaToolChoiceApplyPatch struct{…}` - - `SequenceNumber int64` + Forces the model to call the apply_patch tool when executing a tool call. - The sequence number of this event. + - `Type ApplyPatch` - - `Type ResponseFunctionCallArgumentsDelta` + The tool to call. Always `apply_patch`. - The type of the event. Always `response.function_call_arguments.delta`. + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"` +### Beta Tool Choice Custom - - `Agent BetaResponseFunctionCallArgumentsDeltaEventAgent` +- `type BetaToolChoiceCustom struct{…}` - The agent that owns this multi-agent streaming event. + Use this option to force the model to call a specific custom tool. - - `AgentName string` + - `Name string` - The canonical name of the agent that produced this item. + The name of the custom tool to call. - - `type BetaResponseFunctionCallArgumentsDoneEvent struct{…}` + - `Type Custom` - Emitted when function-call arguments are finalized. + For custom tool calling, the type is always `custom`. - - `Arguments string` + - `const CustomCustom Custom = "custom"` - The function-call arguments. +### Beta Tool Choice Function - - `ItemID string` +- `type BetaToolChoiceFunction struct{…}` - The ID of the item. + Use this option to force the model to call a specific function. - `Name string` - The name of the function that was called. + The name of the function to call. - - `OutputIndex int64` + - `Type Function` - The index of the output item. + For function calling, the type is always `function`. - - `SequenceNumber int64` + - `const FunctionFunction Function = "function"` - The sequence number of this event. +### Beta Tool Choice Mcp - - `Type ResponseFunctionCallArgumentsDone` +- `type BetaToolChoiceMcp struct{…}` - - `const ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"` + Use this option to force the model to call a specific tool on a remote MCP server. - - `Agent BetaResponseFunctionCallArgumentsDoneEventAgent` + - `ServerLabel string` - The agent that owns this multi-agent streaming event. + The label of the MCP server to use. - - `AgentName string` + - `Type Mcp` - The canonical name of the agent that produced this item. + For MCP tools, the type is always `mcp`. - - `type BetaResponseInProgressEvent struct{…}` + - `const McpMcp Mcp = "mcp"` - Emitted when the response is in progress. + - `Name string` - - `Response BetaResponse` + The name of the tool to call on the server. - The response that is in progress. +### Beta Tool Choice Options - - `SequenceNumber int64` +- `type BetaToolChoiceOptions string` - The sequence number of this event. + Controls which (if any) tool is called by the model. - - `Type ResponseInProgress` + `none` means the model will not call any tool and instead generates a message. - The type of the event. Always `response.in_progress`. + `auto` means the model can pick between generating a message or calling one or + more tools. - - `const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"` + `required` means the model must call one or more tools. - - `Agent BetaResponseInProgressEventAgent` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - The agent that owns this multi-agent streaming event. + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - - `AgentName string` + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - The canonical name of the agent that produced this item. +### Beta Tool Choice Shell - - `type BetaResponseFailedEvent struct{…}` +- `type BetaToolChoiceShell struct{…}` - An event that is emitted when a response fails. + Forces the model to call the shell tool when a tool call is required. - - `Response BetaResponse` + - `Type Shell` - The response that failed. + The tool to call. Always `shell`. - - `SequenceNumber int64` + - `const ShellShell Shell = "shell"` - The sequence number of this event. +### Beta Tool Choice Types - - `Type ResponseFailed` +- `type BetaToolChoiceTypes struct{…}` - The type of the event. Always `response.failed`. + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - - `const ResponseFailedResponseFailed ResponseFailed = "response.failed"` + - `Type BetaToolChoiceTypesType` - - `Agent BetaResponseFailedEventAgent` + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - The agent that owns this multi-agent streaming event. + Allowed values are: - - `AgentName string` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - The canonical name of the agent that produced this item. + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - `type BetaResponseIncompleteEvent struct{…}` + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - An event that is emitted when a response finishes as incomplete. + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `Response BetaResponse` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - The response that was incomplete. + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - - `SequenceNumber int64` + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - The sequence number of this event. + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - - `Type ResponseIncomplete` + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - The type of the event. Always `response.incomplete`. +### Beta Tool Search Tool - - `const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"` +- `type BetaToolSearchTool struct{…}` - - `Agent BetaResponseIncompleteEventAgent` + Hosted or BYOT tool search configuration for deferred tools. - The agent that owns this multi-agent streaming event. + - `Type ToolSearch` - - `AgentName string` + The type of the tool. Always `tool_search`. - The canonical name of the agent that produced this item. + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - - `type BetaResponseOutputItemAddedEvent struct{…}` + - `Description string` - Emitted when a new output item is added. + Description shown to the model for a client-executed tool search tool. - - `Item BetaResponseOutputItemUnion` + - `Execution BetaToolSearchToolExecution` - The output item that was added. + Whether tool search is executed by the server or by the client. - - `type BetaResponseOutputMessage struct{…}` + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - An output message from the model. + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - `type BetaResponseFileSearchToolCall struct{…}` + - `Parameters any` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + Parameter schema for a client-executed tool search tool. - - `type BetaResponseFunctionToolCall struct{…}` +### Beta Web Search Preview Tool - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. +- `type BetaWebSearchPreviewTool struct{…}` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `Type BetaWebSearchPreviewToolType` - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `type BetaResponseFunctionWebSearch struct{…}` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `SearchContentTypes []string` - - `type BetaResponseComputerToolCall struct{…}` + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - `type BetaResponseReasoningItem struct{…}` + 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. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - - `type BetaResponseOutputItemProgram struct{…}` + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - `type BetaResponseToolSearchCall struct{…}` + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `type BetaResponseToolSearchOutputItem struct{…}` + The user's location. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `Type Approximate` - - `type BetaResponseCompactionItem struct{…}` + The type of location approximation. Always `approximate`. - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `const ApproximateApproximate Approximate = "approximate"` - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `City string` - An image generation request made by the model. + Free text input for the city of the user, e.g. `San Francisco`. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `Country string` - A tool call to run code. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `type BetaResponseOutputItemLocalShellCall struct{…}` + - `Region string` - A tool call to run a command on the local shell. + Free text input for the region of the user, e.g. `California`. - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + - `Timezone string` - The output of a local shell tool call. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `type BetaResponseFunctionShellToolCall struct{…}` +### Beta Web Search Tool - A tool call that executes one or more shell commands in a managed environment. +- `type BetaWebSearchTool struct{…}` - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The output of a shell tool call that was emitted. + - `Type BetaWebSearchToolType` - - `type BetaResponseApplyPatchToolCall struct{…}` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - A tool call that applies file diffs by creating, deleting, or updating files. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - The output emitted by an apply patch tool call. + - `Filters BetaWebSearchToolFilters` - - `type BetaResponseOutputItemMcpCall struct{…}` + Filters for the search. - An invocation of a tool on an MCP server. + - `AllowedDomains []string` - - `type BetaResponseOutputItemMcpListTools struct{…}` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - A list of tools available on an MCP server. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - A request for human approval of a tool invocation. + 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. - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - A response to an MCP approval request. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `type BetaResponseCustomToolCall struct{…}` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - A call to a custom tool created by the model. + - `UserLocation BetaWebSearchToolUserLocation` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + The approximate location of the user. - The output of a custom tool call from your code, being sent back to the model. + - `City string` - - `OutputIndex int64` + Free text input for the city of the user, e.g. `San Francisco`. - The index of the output item that was added. + - `Country string` - - `SequenceNumber int64` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The sequence number of this event. + - `Region string` - - `Type ResponseOutputItemAdded` + Free text input for the region of the user, e.g. `California`. - The type of the event. Always `response.output_item.added`. + - `Timezone string` - - `const ResponseOutputItemAddedResponseOutputItemAdded ResponseOutputItemAdded = "response.output_item.added"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `Agent BetaResponseOutputItemAddedEventAgent` + - `Type string` - The agent that owns this multi-agent streaming event. + The type of location approximation. Always `approximate`. - - `AgentName string` + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - The canonical name of the agent that produced this item. +# Input Items - - `type BetaResponseOutputItemDoneEvent struct{…}` +## List input items - Emitted when an output item is marked done. +`client.Beta.Responses.InputItems.List(ctx, responseID, params) (*CursorPage[BetaResponseItemUnion], error)` - - `Item BetaResponseOutputItemUnion` +**get** `/responses/{response_id}/input_items?beta=true` - The output item that was marked done. +Returns a list of input items for a given response. - - `OutputIndex int64` +### Parameters - The index of the output item that was marked done. +- `responseID string` - - `SequenceNumber int64` +- `params BetaResponseInputItemListParams` - The sequence number of this event. + - `After param.Field[string]` - - `Type ResponseOutputItemDone` + Query param: An item ID to list items after, used in pagination. - The type of the event. Always `response.output_item.done`. + - `Include param.Field[[]BetaResponseIncludable]` - - `const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"` + Query param: Additional fields to include in the response. See the `include` + parameter for Response creation above for more information. - - `Agent BetaResponseOutputItemDoneEventAgent` + - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` - The agent that owns this multi-agent streaming event. + - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` - - `AgentName string` + - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` - The canonical name of the agent that produced this item. + - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` - - `type BetaResponseReasoningSummaryPartAddedEvent struct{…}` + - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` - Emitted when a new reasoning summary part is added. + - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` - - `ItemID string` + - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` - The ID of the item this summary part is associated with. + - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` - - `OutputIndex int64` + - `Limit param.Field[int64]` - The index of the output item this summary part is associated with. + Query param: A limit on the number of objects to be returned. Limit can range between + 1 and 100, and the default is 20. - - `Part BetaResponseReasoningSummaryPartAddedEventPart` + - `Order param.Field[BetaResponseInputItemListParamsOrder]` - The summary part that was added. + Query param: The order to return the input items in. Default is `desc`. - - `Text string` + - `asc`: Return the input items in ascending order. + - `desc`: Return the input items in descending order. - The text of the summary part. + - `const BetaResponseInputItemListParamsOrderAsc BetaResponseInputItemListParamsOrder = "asc"` - - `Type SummaryText` + - `const BetaResponseInputItemListParamsOrderDesc BetaResponseInputItemListParamsOrder = "desc"` - The type of the summary part. Always `summary_text`. + - `Betas param.Field[[]string]` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + Header param: Optional beta features to enable for this request. - - `SequenceNumber int64` + - `const BetaResponseInputItemListParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseInputItemListParamsOpenAIBeta = "responses_multi_agent=v1"` - The sequence number of this event. +### Returns - - `SummaryIndex int64` +- `type BetaResponseItemUnion interface{…}` - The index of the summary part within the reasoning summary. + Content item used to generate a response. - - `Type ResponseReasoningSummaryPartAdded` + - `type BetaResponseInputMessageItem struct{…}` - The type of the event. Always `response.reasoning_summary_part.added`. + - `ID string` - - `const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"` + The unique ID of the message input. - - `Agent BetaResponseReasoningSummaryPartAddedEventAgent` + - `Content BetaResponseInputMessageContentList` - The agent that owns this multi-agent streaming event. + A list of one or many input items to the model, containing different content + types. - - `AgentName string` + - `type BetaResponseInputText struct{…}` - The canonical name of the agent that produced this item. + A text input to the model. - - `type BetaResponseReasoningSummaryPartDoneEvent struct{…}` + - `Text string` - Emitted when a reasoning summary part is completed. + The text input to the model. - - `ItemID string` + - `Type InputText` - The ID of the item this summary part is associated with. + The type of the input item. Always `input_text`. - - `OutputIndex int64` + - `const InputTextInputText InputText = "input_text"` - The index of the output item this summary part is associated with. + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `Part BetaResponseReasoningSummaryPartDoneEventPart` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The completed summary part. + - `Mode Explicit` - - `Text string` + The breakpoint mode. Always `explicit`. - The text of the summary part. + - `const ExplicitExplicit Explicit = "explicit"` - - `Type SummaryText` + - `type BetaResponseInputImage struct{…}` - The type of the summary part. Always `summary_text`. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `Detail BetaResponseInputImageDetail` - - `SequenceNumber int64` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The sequence number of this event. + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - - `SummaryIndex int64` + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - The index of the summary part within the reasoning summary. + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - - `Type ResponseReasoningSummaryPartDone` + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - The type of the event. Always `response.reasoning_summary_part.done`. + - `Type InputImage` - - `const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"` + The type of the input item. Always `input_image`. - - `Agent BetaResponseReasoningSummaryPartDoneEventAgent` + - `const InputImageInputImage InputImage = "input_image"` - The agent that owns this multi-agent streaming event. + - `FileID string` - - `AgentName string` + The ID of the file to be sent to the model. - The canonical name of the agent that produced this item. + - `ImageURL string` - - `Status BetaResponseReasoningSummaryPartDoneEventStatus` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - The completion status of the summary part. Omitted when the part completed - normally and set to `incomplete` when generation was interrupted. + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - - `const BetaResponseReasoningSummaryPartDoneEventStatusIncomplete BetaResponseReasoningSummaryPartDoneEventStatus = "incomplete"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `type BetaResponseReasoningSummaryTextDeltaEvent struct{…}` + - `Mode Explicit` - Emitted when a delta is added to a reasoning summary text. + The breakpoint mode. Always `explicit`. - - `Delta string` + - `const ExplicitExplicit Explicit = "explicit"` - The text delta that was added to the summary. + - `type BetaResponseInputFile struct{…}` - - `ItemID string` + A file input to the model. - The ID of the item this summary text delta is associated with. + - `Type InputFile` - - `OutputIndex int64` + The type of the input item. Always `input_file`. - The index of the output item this summary text delta is associated with. + - `const InputFileInputFile InputFile = "input_file"` - - `SequenceNumber int64` + - `Detail BetaResponseInputFileDetail` - The sequence number of this event. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `SummaryIndex int64` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - The index of the summary part within the reasoning summary. + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `Type ResponseReasoningSummaryTextDelta` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - The type of the event. Always `response.reasoning_summary_text.delta`. + - `FileData string` - - `const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"` + The content of the file to be sent to the model. - - `Agent BetaResponseReasoningSummaryTextDeltaEventAgent` + - `FileID string` - The agent that owns this multi-agent streaming event. + The ID of the file to be sent to the model. - - `AgentName string` + - `FileURL string` - The canonical name of the agent that produced this item. + The URL of the file to be sent to the model. - - `type BetaResponseReasoningSummaryTextDoneEvent struct{…}` + - `Filename string` - Emitted when a reasoning summary text is completed. + The name of the file to be sent to the model. - - `ItemID string` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - The ID of the item this summary text is associated with. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `OutputIndex int64` + - `Mode Explicit` - The index of the output item this summary text is associated with. + The breakpoint mode. Always `explicit`. - - `SequenceNumber int64` + - `const ExplicitExplicit Explicit = "explicit"` - The sequence number of this event. + - `Role BetaResponseInputMessageItemRole` - - `SummaryIndex int64` + The role of the message input. One of `user`, `system`, or `developer`. - The index of the summary part within the reasoning summary. + - `const BetaResponseInputMessageItemRoleUser BetaResponseInputMessageItemRole = "user"` - - `Text string` + - `const BetaResponseInputMessageItemRoleSystem BetaResponseInputMessageItemRole = "system"` - The full text of the completed reasoning summary. + - `const BetaResponseInputMessageItemRoleDeveloper BetaResponseInputMessageItemRole = "developer"` - - `Type ResponseReasoningSummaryTextDone` + - `Type Message` - The type of the event. Always `response.reasoning_summary_text.done`. + The type of the message input. Always set to `message`. - - `const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"` + - `const MessageMessage Message = "message"` - - `Agent BetaResponseReasoningSummaryTextDoneEventAgent` + - `Agent BetaResponseInputMessageItemAgent` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseReasoningTextDeltaEvent struct{…}` + - `Status BetaResponseInputMessageItemStatus` - Emitted when a delta is added to a reasoning text. + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `ContentIndex int64` + - `const BetaResponseInputMessageItemStatusInProgress BetaResponseInputMessageItemStatus = "in_progress"` - The index of the reasoning content part this delta is associated with. + - `const BetaResponseInputMessageItemStatusCompleted BetaResponseInputMessageItemStatus = "completed"` - - `Delta string` + - `const BetaResponseInputMessageItemStatusIncomplete BetaResponseInputMessageItemStatus = "incomplete"` - The text delta that was added to the reasoning content. + - `type BetaResponseOutputMessage struct{…}` - - `ItemID string` + An output message from the model. - The ID of the item this reasoning text delta is associated with. + - `ID string` - - `OutputIndex int64` + The unique ID of the output message. - The index of the output item this reasoning text delta is associated with. + - `Content []BetaResponseOutputMessageContentUnion` - - `SequenceNumber int64` + The content of the output message. - The sequence number of this event. + - `type BetaResponseOutputText struct{…}` - - `Type ResponseReasoningTextDelta` + A text output from the model. - The type of the event. Always `response.reasoning_text.delta`. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"` + The annotations of the text output. - - `Agent BetaResponseReasoningTextDeltaEventAgent` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - The agent that owns this multi-agent streaming event. + A citation to a file. - - `AgentName string` + - `FileID string` - The canonical name of the agent that produced this item. + The ID of the file. - - `type BetaResponseReasoningTextDoneEvent struct{…}` + - `Filename string` - Emitted when a reasoning text is completed. + The filename of the file cited. - - `ContentIndex int64` + - `Index int64` - The index of the reasoning content part. + The index of the file in the list of files. - - `ItemID string` + - `Type FileCitation` - The ID of the item this reasoning text is associated with. + The type of the file citation. Always `file_citation`. - - `OutputIndex int64` + - `const FileCitationFileCitation FileCitation = "file_citation"` - The index of the output item this reasoning text is associated with. + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - - `SequenceNumber int64` + A citation for a web resource used to generate a model response. - The sequence number of this event. + - `EndIndex int64` - - `Text string` + The index of the last character of the URL citation in the message. - The full text of the completed reasoning content. + - `StartIndex int64` - - `Type ResponseReasoningTextDone` + The index of the first character of the URL citation in the message. - The type of the event. Always `response.reasoning_text.done`. + - `Title string` - - `const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"` + The title of the web resource. - - `Agent BetaResponseReasoningTextDoneEventAgent` + - `Type URLCitation` - The agent that owns this multi-agent streaming event. + The type of the URL citation. Always `url_citation`. - - `AgentName string` + - `const URLCitationURLCitation URLCitation = "url_citation"` - The canonical name of the agent that produced this item. + - `URL string` - - `type BetaResponseRefusalDeltaEvent struct{…}` + The URL of the web resource. - Emitted when there is a partial refusal text. + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `ContentIndex int64` + A citation for a container file used to generate a model response. - The index of the content part that the refusal text is added to. + - `ContainerID string` - - `Delta string` + The ID of the container file. - The refusal text that is added. + - `EndIndex int64` - - `ItemID string` + The index of the last character of the container file citation in the message. - The ID of the output item that the refusal text is added to. + - `FileID string` - - `OutputIndex int64` + The ID of the file. - The index of the output item that the refusal text is added to. + - `Filename string` - - `SequenceNumber int64` + The filename of the container file cited. - The sequence number of this event. + - `StartIndex int64` - - `Type ResponseRefusalDelta` + The index of the first character of the container file citation in the message. - The type of the event. Always `response.refusal.delta`. + - `Type ContainerFileCitation` - - `const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"` + The type of the container file citation. Always `container_file_citation`. - - `Agent BetaResponseRefusalDeltaEventAgent` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + + A path to a file. - The agent that owns this multi-agent streaming event. + - `FileID string` - - `AgentName string` + The ID of the file. - The canonical name of the agent that produced this item. + - `Index int64` - - `type BetaResponseRefusalDoneEvent struct{…}` + The index of the file in the list of files. - Emitted when refusal text is finalized. + - `Type FilePath` - - `ContentIndex int64` + The type of the file path. Always `file_path`. - The index of the content part that the refusal text is finalized. + - `const FilePathFilePath FilePath = "file_path"` - - `ItemID string` + - `Text string` - The ID of the output item that the refusal text is finalized. + The text output from the model. - - `OutputIndex int64` + - `Type OutputText` - The index of the output item that the refusal text is finalized. + The type of the output text. Always `output_text`. - - `Refusal string` + - `const OutputTextOutputText OutputText = "output_text"` - The refusal text that is finalized. + - `Logprobs []BetaResponseOutputTextLogprob` - - `SequenceNumber int64` + - `Token string` - The sequence number of this event. + - `Bytes []int64` - - `Type ResponseRefusalDone` + - `Logprob float64` - The type of the event. Always `response.refusal.done`. + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - - `const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"` + - `Token string` - - `Agent BetaResponseRefusalDoneEventAgent` + - `Bytes []int64` - The agent that owns this multi-agent streaming event. + - `Logprob float64` - - `AgentName string` + - `type BetaResponseOutputRefusal struct{…}` - The canonical name of the agent that produced this item. + A refusal from the model. - - `type BetaResponseTextDeltaEvent struct{…}` + - `Refusal string` - Emitted when there is an additional text delta. + The refusal explanation from the model. - - `ContentIndex int64` + - `Type Refusal` - The index of the content part that the text delta was added to. + The type of the refusal. Always `refusal`. - - `Delta string` + - `const RefusalRefusal Refusal = "refusal"` - The text delta that was added. + - `Role Assistant` - - `ItemID string` + The role of the output message. Always `assistant`. - The ID of the output item that the text delta was added to. + - `const AssistantAssistant Assistant = "assistant"` - - `Logprobs []BetaResponseTextDeltaEventLogprob` + - `Status BetaResponseOutputMessageStatus` - The log probabilities of the tokens in the delta. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `Token string` + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - A possible text token. + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - - `Logprob float64` + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - The log probability of this token. + - `Type Message` - - `TopLogprobs []BetaResponseTextDeltaEventLogprobTopLogprob` + The type of the output message. Always `message`. - The log probabilities of up to 20 of the most likely tokens. + - `const MessageMessage Message = "message"` - - `Token string` + - `Agent BetaResponseOutputMessageAgent` - A possible text token. + The agent that produced this item. - - `Logprob float64` + - `AgentName string` - The log probability of this token. + The canonical name of the agent that produced this item. - - `OutputIndex int64` + - `Phase BetaResponseOutputMessagePhase` - The index of the output item that the text delta was added to. + 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. - - `SequenceNumber int64` + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - The sequence number for this event. + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - - `Type ResponseOutputTextDelta` + - `type BetaResponseFileSearchToolCall struct{…}` - The type of the event. Always `response.output_text.delta`. + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"` + - `ID string` - - `Agent BetaResponseTextDeltaEventAgent` + The unique ID of the file search tool call. - The agent that owns this multi-agent streaming event. + - `Queries []string` - - `AgentName string` + The queries used to search for files. - The canonical name of the agent that produced this item. + - `Status BetaResponseFileSearchToolCallStatus` - - `type BetaResponseTextDoneEvent struct{…}` + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - Emitted when text content is finalized. + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - - `ContentIndex int64` + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - The index of the content part that the text content is finalized. + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - - `ItemID string` + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - The ID of the output item that the text content is finalized. + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - - `Logprobs []BetaResponseTextDoneEventLogprob` + - `Type FileSearchCall` - The log probabilities of the tokens in the delta. + The type of the file search tool call. Always `file_search_call`. - - `Token string` + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - A possible text token. + - `Agent BetaResponseFileSearchToolCallAgent` - - `Logprob float64` + The agent that produced this item. - The log probability of this token. + - `AgentName string` - - `TopLogprobs []BetaResponseTextDoneEventLogprobTopLogprob` + The canonical name of the agent that produced this item. - The log probabilities of up to 20 of the most likely tokens. + - `Results []BetaResponseFileSearchToolCallResult` - - `Token string` + The results of the file search tool call. - A possible text token. + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - - `Logprob float64` + 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. - The log probability of this token. + - `string` - - `OutputIndex int64` + - `float64` - The index of the output item that the text content is finalized. + - `bool` - - `SequenceNumber int64` + - `FileID string` - The sequence number for this event. + The unique ID of the file. - - `Text string` + - `Filename string` - The text content that is finalized. + The name of the file. - - `Type ResponseOutputTextDone` + - `Score float64` - The type of the event. Always `response.output_text.done`. + The relevance score of the file - a value between 0 and 1. - - `const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"` + - `Text string` - - `Agent BetaResponseTextDoneEventAgent` + The text that was retrieved from the file. - The agent that owns this multi-agent streaming event. + - `type BetaResponseComputerToolCall struct{…}` - - `AgentName string` + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - The canonical name of the agent that produced this item. + - `ID string` - - `type BetaResponseWebSearchCallCompletedEvent struct{…}` + The unique ID of the computer call. - Emitted when a web search call is completed. + - `CallID string` - - `ItemID string` + An identifier used when responding to the tool call with output. - Unique ID for the output item associated with the web search call. + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `OutputIndex int64` + The pending safety checks for the computer call. - The index of the output item that the web search call is associated with. + - `ID string` - - `SequenceNumber int64` + The ID of the pending safety check. - The sequence number of the web search call being processed. + - `Code string` - - `Type ResponseWebSearchCallCompleted` + The type of the pending safety check. - The type of the event. Always `response.web_search_call.completed`. + - `Message string` - - `const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"` + Details about the pending safety check. - - `Agent BetaResponseWebSearchCallCompletedEventAgent` + - `Status BetaResponseComputerToolCallStatus` - The agent that owns this multi-agent streaming event. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `AgentName string` + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - The canonical name of the agent that produced this item. + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - - `type BetaResponseWebSearchCallInProgressEvent struct{…}` + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - Emitted when a web search call is initiated. + - `Type BetaResponseComputerToolCallType` - - `ItemID string` + The type of the computer call. Always `computer_call`. - Unique ID for the output item associated with the web search call. + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `OutputIndex int64` + - `Action BetaComputerActionUnion` - The index of the output item that the web search call is associated with. + A click action. - - `SequenceNumber int64` + - `type BetaComputerActionClick struct{…}` - The sequence number of the web search call being processed. + A click action. - - `Type ResponseWebSearchCallInProgress` + - `Button string` - The type of the event. Always `response.web_search_call.in_progress`. + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"` + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - - `Agent BetaResponseWebSearchCallInProgressEventAgent` + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - The agent that owns this multi-agent streaming event. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `AgentName string` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - The canonical name of the agent that produced this item. + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `type BetaResponseWebSearchCallSearchingEvent struct{…}` + - `Type Click` - Emitted when a web search call is executing. + Specifies the event type. For a click action, this property is always `click`. - - `ItemID string` + - `const ClickClick Click = "click"` - Unique ID for the output item associated with the web search call. + - `X int64` - - `OutputIndex int64` + The x-coordinate where the click occurred. - The index of the output item that the web search call is associated with. + - `Y int64` - - `SequenceNumber int64` + The y-coordinate where the click occurred. - The sequence number of the web search call being processed. + - `Keys []string` - - `Type ResponseWebSearchCallSearching` + The keys being held while clicking. - The type of the event. Always `response.web_search_call.searching`. + - `type BetaComputerActionDoubleClick struct{…}` - - `const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"` + A double click action. - - `Agent BetaResponseWebSearchCallSearchingEventAgent` + - `Keys []string` - The agent that owns this multi-agent streaming event. + The keys being held while double-clicking. - - `AgentName string` + - `Type DoubleClick` - The canonical name of the agent that produced this item. + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `type BetaResponseImageGenCallCompletedEvent struct{…}` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - Emitted when an image generation tool call has completed and the final image is available. + - `X int64` - - `ItemID string` + The x-coordinate where the double click occurred. - The unique identifier of the image generation item being processed. + - `Y int64` - - `OutputIndex int64` + The y-coordinate where the double click occurred. - The index of the output item in the response's output array. + - `type BetaComputerActionDrag struct{…}` - - `SequenceNumber int64` + A drag action. - The sequence number of this event. + - `Path []BetaComputerActionDragPath` - - `Type ResponseImageGenerationCallCompleted` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - The type of the event. Always 'response.image_generation_call.completed'. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"` + - `X int64` - - `Agent BetaResponseImageGenCallCompletedEventAgent` + The x-coordinate. - The agent that owns this multi-agent streaming event. + - `Y int64` - - `AgentName string` + The y-coordinate. - The canonical name of the agent that produced this item. + - `Type Drag` - - `type BetaResponseImageGenCallGeneratingEvent struct{…}` + Specifies the event type. For a drag action, this property is always set to `drag`. - Emitted when an image generation tool call is actively generating an image (intermediate state). + - `const DragDrag Drag = "drag"` - - `ItemID string` + - `Keys []string` - The unique identifier of the image generation item being processed. + The keys being held while dragging the mouse. - - `OutputIndex int64` + - `type BetaComputerActionKeypress struct{…}` - The index of the output item in the response's output array. + A collection of keypresses the model would like to perform. - - `SequenceNumber int64` + - `Keys []string` - The sequence number of the image generation item being processed. + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `Type ResponseImageGenerationCallGenerating` + - `Type Keypress` - The type of the event. Always 'response.image_generation_call.generating'. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - `const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"` + - `const KeypressKeypress Keypress = "keypress"` - - `Agent BetaResponseImageGenCallGeneratingEventAgent` + - `type BetaComputerActionMove struct{…}` - The agent that owns this multi-agent streaming event. + A mouse move action. - - `AgentName string` + - `Type Move` - The canonical name of the agent that produced this item. + Specifies the event type. For a move action, this property is always set to `move`. - - `type BetaResponseImageGenCallInProgressEvent struct{…}` + - `const MoveMove Move = "move"` - Emitted when an image generation tool call is in progress. + - `X int64` - - `ItemID string` + The x-coordinate to move to. - The unique identifier of the image generation item being processed. + - `Y int64` - - `OutputIndex int64` + The y-coordinate to move to. - The index of the output item in the response's output array. + - `Keys []string` - - `SequenceNumber int64` + The keys being held while moving the mouse. - The sequence number of the image generation item being processed. + - `type BetaComputerActionScreenshot struct{…}` - - `Type ResponseImageGenerationCallInProgress` + A screenshot action. - The type of the event. Always 'response.image_generation_call.in_progress'. + - `Type Screenshot` - - `const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `Agent BetaResponseImageGenCallInProgressEventAgent` + - `const ScreenshotScreenshot Screenshot = "screenshot"` - The agent that owns this multi-agent streaming event. + - `type BetaComputerActionScroll struct{…}` - - `AgentName string` + A scroll action. - The canonical name of the agent that produced this item. + - `ScrollX int64` - - `type BetaResponseImageGenCallPartialImageEvent struct{…}` + The horizontal scroll distance. - Emitted when a partial image is available during image generation streaming. + - `ScrollY int64` - - `ItemID string` + The vertical scroll distance. - The unique identifier of the image generation item being processed. + - `Type Scroll` - - `OutputIndex int64` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - The index of the output item in the response's output array. + - `const ScrollScroll Scroll = "scroll"` - - `PartialImageB64 string` + - `X int64` - Base64-encoded partial image data, suitable for rendering as an image. + The x-coordinate where the scroll occurred. - - `PartialImageIndex int64` + - `Y int64` - 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + The y-coordinate where the scroll occurred. - - `SequenceNumber int64` + - `Keys []string` - The sequence number of the image generation item being processed. + The keys being held while scrolling. - - `Type ResponseImageGenerationCallPartialImage` + - `type BetaComputerActionType struct{…}` - The type of the event. Always 'response.image_generation_call.partial_image'. + An action to type in text. - - `const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"` + - `Text string` - - `Agent BetaResponseImageGenCallPartialImageEventAgent` + The text to type. - The agent that owns this multi-agent streaming event. + - `Type Type` - - `AgentName string` + Specifies the event type. For a type action, this property is always set to `type`. - The canonical name of the agent that produced this item. + - `const TypeType Type = "type"` - - `type BetaResponseMcpCallArgumentsDeltaEvent struct{…}` + - `type BetaComputerActionWait struct{…}` - Emitted when there is a delta (partial update) to the arguments of an MCP tool call. + A wait action. - - `Delta string` + - `Type Wait` - A JSON string containing the partial update to the arguments for the MCP tool call. + Specifies the event type. For a wait action, this property is always set to `wait`. - - `ItemID string` + - `const WaitWait Wait = "wait"` - The unique identifier of the MCP tool call item being processed. + - `Actions BetaComputerActionList` - - `OutputIndex int64` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - The index of the output item in the response's output array. + - `type BetaComputerActionClick struct{…}` - - `SequenceNumber int64` + A click action. - The sequence number of this event. + - `type BetaComputerActionDoubleClick struct{…}` - - `Type ResponseMcpCallArgumentsDelta` + A double click action. - The type of the event. Always 'response.mcp_call_arguments.delta'. + - `type BetaComputerActionDrag struct{…}` - - `const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"` + A drag action. - - `Agent BetaResponseMcpCallArgumentsDeltaEventAgent` + - `type BetaComputerActionKeypress struct{…}` - The agent that owns this multi-agent streaming event. + A collection of keypresses the model would like to perform. - - `AgentName string` + - `type BetaComputerActionMove struct{…}` - The canonical name of the agent that produced this item. + A mouse move action. - - `type BetaResponseMcpCallArgumentsDoneEvent struct{…}` + - `type BetaComputerActionScreenshot struct{…}` - Emitted when the arguments for an MCP tool call are finalized. + A screenshot action. - - `Arguments string` + - `type BetaComputerActionScroll struct{…}` - A JSON string containing the finalized arguments for the MCP tool call. + A scroll action. - - `ItemID string` + - `type BetaComputerActionType struct{…}` - The unique identifier of the MCP tool call item being processed. + An action to type in text. - - `OutputIndex int64` + - `type BetaComputerActionWait struct{…}` - The index of the output item in the response's output array. + A wait action. - - `SequenceNumber int64` + - `Agent BetaResponseComputerToolCallAgent` - The sequence number of this event. + The agent that produced this item. - - `Type ResponseMcpCallArgumentsDone` + - `AgentName string` - The type of the event. Always 'response.mcp_call_arguments.done'. + The canonical name of the agent that produced this item. - - `const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - - `Agent BetaResponseMcpCallArgumentsDoneEventAgent` + - `ID string` - The agent that owns this multi-agent streaming event. + The unique ID of the computer call tool output. - - `AgentName string` + - `CallID string` - The canonical name of the agent that produced this item. + The ID of the computer tool call that produced the output. - - `type BetaResponseMcpCallCompletedEvent struct{…}` + - `Output BetaResponseComputerToolCallOutputScreenshot` - Emitted when an MCP tool call has completed successfully. + A computer screenshot image used with the computer use tool. - - `ItemID string` + - `Type ComputerScreenshot` - The ID of the MCP tool call item that completed. + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `OutputIndex int64` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - The index of the output item that completed. + - `FileID string` - - `SequenceNumber int64` + The identifier of an uploaded file that contains the screenshot. - The sequence number of this event. + - `ImageURL string` - - `Type ResponseMcpCallCompleted` + The URL of the screenshot image. - The type of the event. Always 'response.mcp_call.completed'. + - `Status BetaResponseComputerToolCallOutputItemStatus` - - `const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `Agent BetaResponseMcpCallCompletedEventAgent` + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` - The agent that owns this multi-agent streaming event. + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` - - `AgentName string` + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` - The canonical name of the agent that produced this item. + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` - - `type BetaResponseMcpCallFailedEvent struct{…}` + - `Type ComputerCallOutput` - Emitted when an MCP tool call has failed. + The type of the computer tool call output. Always `computer_call_output`. - - `ItemID string` + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - The ID of the MCP tool call item that failed. + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - - `OutputIndex int64` + The safety checks reported by the API that have been acknowledged by the + developer. - The index of the output item that failed. + - `ID string` - - `SequenceNumber int64` + The ID of the pending safety check. - The sequence number of this event. + - `Code string` - - `Type ResponseMcpCallFailed` + The type of the pending safety check. - The type of the event. Always 'response.mcp_call.failed'. + - `Message string` - - `const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"` + Details about the pending safety check. - - `Agent BetaResponseMcpCallFailedEventAgent` + - `Agent BetaResponseComputerToolCallOutputItemAgent` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseMcpCallInProgressEvent struct{…}` - - Emitted when an MCP tool call is in progress. - - - `ItemID string` + - `CreatedBy string` - The unique identifier of the MCP tool call item being processed. + The identifier of the actor that created the item. - - `OutputIndex int64` + - `type BetaResponseFunctionWebSearch struct{…}` - The index of the output item in the response's output array. + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - - `SequenceNumber int64` + - `ID string` - The sequence number of this event. + The unique ID of the web search tool call. - - `Type ResponseMcpCallInProgress` + - `Action BetaResponseFunctionWebSearchActionUnion` - The type of the event. Always 'response.mcp_call.in_progress'. + 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). - - `const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"` + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - - `Agent BetaResponseMcpCallInProgressEventAgent` + Action type "search" - Performs a web search query. - The agent that owns this multi-agent streaming event. + - `Type Search` - - `AgentName string` + The action type. - The canonical name of the agent that produced this item. + - `const SearchSearch Search = "search"` - - `type BetaResponseMcpListToolsCompletedEvent struct{…}` + - `Queries []string` - Emitted when the list of available MCP tools has been successfully retrieved. + The search queries. - - `ItemID string` + - `Query string` - The ID of the MCP tool call item that produced this output. + The search query. - - `OutputIndex int64` + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - The index of the output item that was processed. + The sources used in the search. - - `SequenceNumber int64` + - `Type URL` - The sequence number of this event. + The type of source. Always `url`. - - `Type ResponseMcpListToolsCompleted` + - `const URLURL URL = "url"` - The type of the event. Always 'response.mcp_list_tools.completed'. + - `URL string` - - `const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"` + The URL of the source. - - `Agent BetaResponseMcpListToolsCompletedEventAgent` + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - The agent that owns this multi-agent streaming event. + Action type "open_page" - Opens a specific URL from search results. - - `AgentName string` + - `Type OpenPage` - The canonical name of the agent that produced this item. + The action type. - - `type BetaResponseMcpListToolsFailedEvent struct{…}` + - `const OpenPageOpenPage OpenPage = "open_page"` - Emitted when the attempt to list available MCP tools has failed. + - `URL string` - - `ItemID string` + The URL opened by the model. - The ID of the MCP tool call item that failed. + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - - `OutputIndex int64` + Action type "find_in_page": Searches for a pattern within a loaded page. - The index of the output item that failed. + - `Pattern string` - - `SequenceNumber int64` + The pattern or text to search for within the page. - The sequence number of this event. + - `Type FindInPage` - - `Type ResponseMcpListToolsFailed` + The action type. - The type of the event. Always 'response.mcp_list_tools.failed'. + - `const FindInPageFindInPage FindInPage = "find_in_page"` - - `const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"` + - `URL string` - - `Agent BetaResponseMcpListToolsFailedEventAgent` + The URL of the page searched for the pattern. - The agent that owns this multi-agent streaming event. + - `Status BetaResponseFunctionWebSearchStatus` - - `AgentName string` + The status of the web search tool call. - The canonical name of the agent that produced this item. + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - - `type BetaResponseMcpListToolsInProgressEvent struct{…}` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - Emitted when the system is in the process of retrieving the list of available MCP tools. + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - - `ItemID string` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - The ID of the MCP tool call item that is being processed. + - `Type WebSearchCall` - - `OutputIndex int64` + The type of the web search tool call. Always `web_search_call`. - The index of the output item that is being processed. + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `SequenceNumber int64` + - `Agent BetaResponseFunctionWebSearchAgent` - The sequence number of this event. + The agent that produced this item. - - `Type ResponseMcpListToolsInProgress` + - `AgentName string` - The type of the event. Always 'response.mcp_list_tools.in_progress'. + The canonical name of the agent that produced this item. - - `const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"` + - `type BetaResponseFunctionToolCallItem struct{…}` - - `Agent BetaResponseMcpListToolsInProgressEventAgent` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - The agent that owns this multi-agent streaming event. + - `ID string` - - `AgentName string` + The unique ID of the function tool call. - The canonical name of the agent that produced this item. + - `Status string` - - `type BetaResponseOutputTextAnnotationAddedEvent struct{…}` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Emitted when an annotation is added to output text content. + - `const BetaResponseFunctionToolCallItemStatusInProgress BetaResponseFunctionToolCallItemStatus = "in_progress"` - - `Annotation any` + - `const BetaResponseFunctionToolCallItemStatusCompleted BetaResponseFunctionToolCallItemStatus = "completed"` - The annotation object being added. (See annotation schema for details.) + - `const BetaResponseFunctionToolCallItemStatusIncomplete BetaResponseFunctionToolCallItemStatus = "incomplete"` - - `AnnotationIndex int64` + - `CreatedBy string` - The index of the annotation within the content part. + The identifier of the actor that created the item. - - `ContentIndex int64` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - The index of the content part within the output item. + - `ID string` - - `ItemID string` + The unique ID of the function call tool output. - The unique identifier of the item to which the annotation is being added. + - `CallID string` - - `OutputIndex int64` + The unique ID of the function tool call generated by the model. - The index of the output item in the response's output array. + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - - `SequenceNumber int64` + The output from the function call generated by your code. + Can be a string or an list of output content. - The sequence number of this event. + - `string` - - `Type ResponseOutputTextAnnotationAdded` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - The type of the event. Always 'response.output_text.annotation.added'. + Text, image, or file output of the function call. - - `const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"` + - `type BetaResponseInputText struct{…}` - - `Agent BetaResponseOutputTextAnnotationAddedEventAgent` + A text input to the model. - The agent that owns this multi-agent streaming event. + - `type BetaResponseInputImage struct{…}` - - `AgentName string` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - The canonical name of the agent that produced this item. + - `type BetaResponseInputFile struct{…}` - - `type BetaResponseQueuedEvent struct{…}` + A file input to the model. - Emitted when a response is queued and waiting to be processed. + - `Status BetaResponseFunctionToolCallOutputItemStatus` - - `Response BetaResponse` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The full response object that is queued. + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `SequenceNumber int64` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - The sequence number for this event. + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `Type ResponseQueued` + - `Type FunctionCallOutput` - The type of the event. Always 'response.queued'. + The type of the function tool call output. Always `function_call_output`. - - `const ResponseQueuedResponseQueued ResponseQueued = "response.queued"` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `Agent BetaResponseQueuedEventAgent` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseCustomToolCallInputDeltaEvent struct{…}` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - Event representing a delta (partial update) to the input of a custom tool call. + The execution context that produced this tool call. - - `Delta string` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - The incremental input data (delta) for the custom tool call. + - `Type Direct` - - `ItemID string` + The caller type. Always `direct`. - Unique identifier for the API item associated with this event. + - `const DirectDirect Direct = "direct"` - - `OutputIndex int64` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - The index of the output this delta applies to. + - `CallerID string` - - `SequenceNumber int64` + The call ID of the program item that produced this tool call. - The sequence number of this event. + - `Type Program` - - `Type ResponseCustomToolCallInputDelta` + The caller type. Always `program`. - The event type identifier. + - `const ProgramProgram Program = "program"` - - `const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"` + - `CreatedBy string` - - `Agent BetaResponseCustomToolCallInputDeltaEventAgent` + The identifier of the actor that created the item. - The agent that owns this multi-agent streaming event. + - `type BetaResponseItemAgentMessage struct{…}` - - `AgentName string` + - `ID string` - The canonical name of the agent that produced this item. + The unique ID of the agent message. - - `type BetaResponseCustomToolCallInputDoneEvent struct{…}` + - `Author string` - Event indicating that input for a custom tool call is complete. + The sending agent identity. - - `Input string` + - `Content []BetaResponseItemAgentMessageContentUnion` - The complete input data for the custom tool call. + Encrypted content sent between agents. - - `ItemID string` + - `type BetaResponseInputText struct{…}` - Unique identifier for the API item associated with this event. + A text input to the model. - - `OutputIndex int64` + - `type BetaResponseOutputText struct{…}` - The index of the output this event applies to. + A text output from the model. - - `SequenceNumber int64` + - `type BetaResponseItemAgentMessageContentText struct{…}` - The sequence number of this event. + A text content. - - `Type ResponseCustomToolCallInputDone` + - `Text string` - The event type identifier. + - `Type Text` - - `const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"` + - `const TextText Text = "text"` - - `Agent BetaResponseCustomToolCallInputDoneEventAgent` + - `type BetaResponseItemAgentMessageContentSummaryText struct{…}` - The agent that owns this multi-agent streaming event. + A summary text from the model. - - `AgentName string` + - `Text string` - The canonical name of the agent that produced this item. + A summary of the reasoning output from the model so far. -### Beta Response Text Config + - `Type SummaryText` -- `type BetaResponseTextConfig struct{…}` + The type of the object. Always `summary_text`. - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `type BetaResponseItemAgentMessageContentReasoningText struct{…}` - - `Format BetaResponseFormatTextConfigUnion` + Reasoning text from the model. - An object specifying the format that the model must output. + - `Text string` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The reasoning text from the model. - The default format is `{ "type": "text" }` with no additional options. + - `Type ReasoningText` - **Not recommended for gpt-4o and newer models:** + The type of the reasoning text. Always `reasoning_text`. - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `type BetaResponseFormatTextConfigText struct{…}` + - `type BetaResponseOutputRefusal struct{…}` - Default response format. Used to generate text responses. + A refusal from the model. - - `Type Text` + - `type BetaResponseInputImage struct{…}` - The type of response format being defined. Always `text`. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const TextText Text = "text"` + - `type BetaResponseItemAgentMessageContentComputerScreenshot struct{…}` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + A screenshot of a computer. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `Detail string` - - `Name string` + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailLow BetaResponseItemAgentMessageContentComputerScreenshotDetail = "low"` - - `Schema map[string, any]` + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseItemAgentMessageContentComputerScreenshotDetail = "high"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `Type JSONSchema` + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseItemAgentMessageContentComputerScreenshotDetail = "original"` - The type of response format being defined. Always `json_schema`. + - `FileID string` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The identifier of an uploaded file that contains the screenshot. - - `Description string` + - `ImageURL string` - A description of what the response format is for, used by the model to - determine how to respond in the format. + The URL of the screenshot image. - - `Strict bool` + - `Type ComputerScreenshot` - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `PromptCacheBreakpoint BetaResponseItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - - `Type JSONObject` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The type of response format being defined. Always `json_object`. + - `Mode Explicit` - - `const JSONObjectJSONObject JSONObject = "json_object"` + The breakpoint mode. Always `explicit`. - - `Verbosity BetaResponseTextConfigVerbosity` + - `const ExplicitExplicit Explicit = "explicit"` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + - `type BetaResponseInputFile struct{…}` - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + A file input to the model. - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + - `type BetaResponseItemAgentMessageContentEncryptedContent struct{…}` - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + Opaque encrypted content that Responses API decrypts inside trusted model execution. -### Beta Response Text Delta Event + - `EncryptedContent string` -- `type BetaResponseTextDeltaEvent struct{…}` + Opaque encrypted content. - Emitted when there is an additional text delta. + - `Type EncryptedContent` - - `ContentIndex int64` + The type of the input item. Always `encrypted_content`. - The index of the content part that the text delta was added to. + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - - `Delta string` + - `Recipient string` - The text delta that was added. + The destination agent identity. - - `ItemID string` + - `Type AgentMessage` - The ID of the output item that the text delta was added to. + The type of the item. Always `agent_message`. - - `Logprobs []BetaResponseTextDeltaEventLogprob` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - The log probabilities of the tokens in the delta. + - `Agent BetaResponseItemAgentMessageAgent` - - `Token string` + The agent that produced this item. - A possible text token. + - `AgentName string` - - `Logprob float64` + The canonical name of the agent that produced this item. - The log probability of this token. + - `type BetaResponseItemMultiAgentCall struct{…}` - - `TopLogprobs []BetaResponseTextDeltaEventLogprobTopLogprob` + - `ID string` - The log probabilities of up to 20 of the most likely tokens. + The unique ID of the multi-agent call item. - - `Token string` + - `Action string` - A possible text token. + The multi-agent action to execute. - - `Logprob float64` + - `const BetaResponseItemMultiAgentCallActionSpawnAgent BetaResponseItemMultiAgentCallAction = "spawn_agent"` - The log probability of this token. + - `const BetaResponseItemMultiAgentCallActionInterruptAgent BetaResponseItemMultiAgentCallAction = "interrupt_agent"` - - `OutputIndex int64` + - `const BetaResponseItemMultiAgentCallActionListAgents BetaResponseItemMultiAgentCallAction = "list_agents"` - The index of the output item that the text delta was added to. + - `const BetaResponseItemMultiAgentCallActionSendMessage BetaResponseItemMultiAgentCallAction = "send_message"` - - `SequenceNumber int64` + - `const BetaResponseItemMultiAgentCallActionFollowupTask BetaResponseItemMultiAgentCallAction = "followup_task"` - The sequence number for this event. + - `const BetaResponseItemMultiAgentCallActionWaitAgent BetaResponseItemMultiAgentCallAction = "wait_agent"` - - `Type ResponseOutputTextDelta` + - `Arguments string` - The type of the event. Always `response.output_text.delta`. + The JSON string of arguments generated for the action. - - `const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"` + - `CallID string` - - `Agent BetaResponseTextDeltaEventAgent` + The unique ID linking this call to its output. - The agent that owns this multi-agent streaming event. + - `Type MultiAgentCall` - - `AgentName string` + The type of the multi-agent call. Always `multi_agent_call`. - The canonical name of the agent that produced this item. + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` -### Beta Response Text Done Event + - `Agent BetaResponseItemMultiAgentCallAgent` -- `type BetaResponseTextDoneEvent struct{…}` + The agent that produced this item. - Emitted when text content is finalized. + - `AgentName string` - - `ContentIndex int64` + The canonical name of the agent that produced this item. - The index of the content part that the text content is finalized. + - `type BetaResponseItemMultiAgentCallOutput struct{…}` - - `ItemID string` + - `ID string` - The ID of the output item that the text content is finalized. + The unique ID of the multi-agent call output item. - - `Logprobs []BetaResponseTextDoneEventLogprob` + - `Action string` - The log probabilities of the tokens in the delta. + The multi-agent action that produced this result. - - `Token string` + - `const BetaResponseItemMultiAgentCallOutputActionSpawnAgent BetaResponseItemMultiAgentCallOutputAction = "spawn_agent"` - A possible text token. + - `const BetaResponseItemMultiAgentCallOutputActionInterruptAgent BetaResponseItemMultiAgentCallOutputAction = "interrupt_agent"` - - `Logprob float64` + - `const BetaResponseItemMultiAgentCallOutputActionListAgents BetaResponseItemMultiAgentCallOutputAction = "list_agents"` - The log probability of this token. + - `const BetaResponseItemMultiAgentCallOutputActionSendMessage BetaResponseItemMultiAgentCallOutputAction = "send_message"` - - `TopLogprobs []BetaResponseTextDoneEventLogprobTopLogprob` + - `const BetaResponseItemMultiAgentCallOutputActionFollowupTask BetaResponseItemMultiAgentCallOutputAction = "followup_task"` - The log probabilities of up to 20 of the most likely tokens. + - `const BetaResponseItemMultiAgentCallOutputActionWaitAgent BetaResponseItemMultiAgentCallOutputAction = "wait_agent"` - - `Token string` + - `CallID string` - A possible text token. + The unique ID of the multi-agent call. - - `Logprob float64` + - `Output []BetaResponseOutputText` - The log probability of this token. + Text output returned by the multi-agent action. - - `OutputIndex int64` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - The index of the output item that the text content is finalized. + The annotations of the text output. - - `SequenceNumber int64` + - `Text string` - The sequence number for this event. + The text output from the model. - - `Text string` + - `Type OutputText` - The text content that is finalized. + The type of the output text. Always `output_text`. - - `Type ResponseOutputTextDone` + - `Logprobs []BetaResponseOutputTextLogprob` - The type of the event. Always `response.output_text.done`. + - `Type MultiAgentCallOutput` - - `const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"` + The type of the multi-agent result. Always `multi_agent_call_output`. - - `Agent BetaResponseTextDoneEventAgent` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - The agent that owns this multi-agent streaming event. + - `Agent BetaResponseItemMultiAgentCallOutputAgent` + + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response Tool Search Call - -- `type BetaResponseToolSearchCall struct{…}` + - `type BetaResponseToolSearchCall struct{…}` - `ID string` @@ -132322,9 +144894,7 @@ func main() { The identifier of the actor that created the item. -### Beta Response Tool Search Output Item - -- `type BetaResponseToolSearchOutputItem struct{…}` + - `type BetaResponseToolSearchOutputItem struct{…}` - `ID string` @@ -132463,7 +145033,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -132520,7 +145094,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -133452,1377 +146030,1186 @@ func main() { The identifier of the actor that created the item. -### Beta Response Tool Search Output Item Param - -- `type BetaResponseToolSearchOutputItemParamResp struct{…}` - - - `Tools []BetaToolUnion` - - The loaded tool definitions returned by the tool search output. - - - `type BetaFunctionTool struct{…}` - - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - - `Name string` - - The name of the function to call. - - - `Parameters map[string, any]` + - `type BetaResponseItemAdditionalTools struct{…}` - A JSON schema object describing the parameters of the function. + - `ID string` - - `Strict bool` + The unique ID of the additional tools item. - Whether strict parameter validation is enforced for this function tool. + - `Role string` - - `Type Function` + The role that provided the additional tools. - The type of the function tool. Always `function`. + - `const BetaResponseItemAdditionalToolsRoleUnknown BetaResponseItemAdditionalToolsRole = "unknown"` - - `const FunctionFunction Function = "function"` + - `const BetaResponseItemAdditionalToolsRoleUser BetaResponseItemAdditionalToolsRole = "user"` - - `AllowedCallers []string` + - `const BetaResponseItemAdditionalToolsRoleAssistant BetaResponseItemAdditionalToolsRole = "assistant"` - The tool invocation context(s). + - `const BetaResponseItemAdditionalToolsRoleSystem BetaResponseItemAdditionalToolsRole = "system"` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `const BetaResponseItemAdditionalToolsRoleCritic BetaResponseItemAdditionalToolsRole = "critic"` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `const BetaResponseItemAdditionalToolsRoleDiscriminator BetaResponseItemAdditionalToolsRole = "discriminator"` - - `DeferLoading bool` + - `const BetaResponseItemAdditionalToolsRoleDeveloper BetaResponseItemAdditionalToolsRole = "developer"` - Whether this function is deferred and loaded via tool search. + - `const BetaResponseItemAdditionalToolsRoleTool BetaResponseItemAdditionalToolsRole = "tool"` - - `Description string` + - `Tools []BetaToolUnion` - A description of the function. Used by the model to determine whether or not to call the function. + The additional tool definitions made available at this item. - - `OutputSchema map[string, any]` + - `type BetaFunctionTool struct{…}` - A JSON schema object describing the JSON value encoded in string outputs for this function. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - `type BetaFileSearchTool struct{…}` A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `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 BetaFileSearchToolFiltersUnion` - - A filter to apply. - - - `type BetaFileSearchToolFiltersComparisonFilter 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 string` - - 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 BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - The value to compare against the attribute key; supports string, number, or boolean types. - - - `string` - - - `float64` - - - `bool` - - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` - - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - - Combine multiple filters using `and` or `or`. - - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - - `type BetaFileSearchToolFiltersCompoundFilterFilter 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 string` - - 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 BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - - The value to compare against the attribute key; supports string, number, or boolean types. - - - `string` - - - `float64` - - - `bool` - - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` - - - `Type string` - - Type of operation: `and` or `or`. - - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - - - `MaxNumResults int64` - - The maximum number of results to return. This number should be between 1 and 50 inclusive. - - - `RankingOptions BetaFileSearchToolRankingOptions` - - Ranking options for search. - - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - 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 BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "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 BetaComputerTool struct{…}` A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Type Computer` - - The type of the computer tool. Always `computer`. - - - `const ComputerComputer Computer = "computer"` - - `type BetaComputerUsePreviewTool struct{…}` A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `DisplayHeight int64` - - The height of the computer display. - - - `DisplayWidth int64` - - The width of the computer display. - - - `Environment BetaComputerUsePreviewToolEnvironment` - - The type of computer environment to control. - - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - - `Type ComputerUsePreview` - - The type of the computer use tool. Always `computer_use_preview`. - - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - - `type BetaWebSearchTool struct{…}` Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type BetaWebSearchToolType` + - `type BetaToolMcp struct{…}` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `type BetaToolCodeInterpreter struct{…}` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + A tool that runs Python code to help generate a response to a prompt. - - `Filters BetaWebSearchToolFilters` + - `type BetaToolProgrammaticToolCalling struct{…}` - Filters for the search. + - `type BetaToolImageGeneration struct{…}` - - `AllowedDomains []string` + A tool that generates images using the GPT image models. - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `type BetaToolLocalShell struct{…}` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + A tool that allows the model to execute shell commands in a local environment. - - `SearchContextSize BetaWebSearchToolSearchContextSize` + - `type BetaFunctionShellTool struct{…}` - 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. + A tool that allows the model to execute shell commands. - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `type BetaCustomTool struct{…}` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `type BetaNamespaceTool struct{…}` - - `UserLocation BetaWebSearchToolUserLocation` + Groups function/custom tools under a shared namespace. - The approximate location of the user. + - `type BetaToolSearchTool struct{…}` - - `City string` + Hosted or BYOT tool search configuration for deferred tools. - Free text input for the city of the user, e.g. `San Francisco`. + - `type BetaWebSearchPreviewTool struct{…}` - - `Country string` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `type BetaApplyPatchTool struct{…}` - - `Region string` + Allows the assistant to create, delete, or update files using unified diffs. - Free text input for the region of the user, e.g. `California`. + - `Type AdditionalTools` - - `Timezone string` + The type of the item. Always `additional_tools`. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `Type string` + - `Agent BetaResponseItemAdditionalToolsAgent` - The type of location approximation. Always `approximate`. + The agent that produced this item. - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `AgentName string` - - `type BetaToolMcp struct{…}` + The canonical name of the agent that produced this item. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `type BetaResponseReasoningItem struct{…}` - - `ServerLabel string` + 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](https://platform.openai.com/docs/guides/conversation-state). - A label for this MCP server, used to identify it in tool calls. + - `ID string` - - `Type Mcp` + The unique identifier of the reasoning content. - The type of the MCP tool. Always `mcp`. + - `Summary []BetaResponseReasoningItemSummary` - - `const McpMcp Mcp = "mcp"` + Reasoning summary content. - - `AllowedCallers []string` + - `Text string` - The tool invocation context(s). + A summary of the reasoning output from the model so far. - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + - `Type SummaryText` - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + The type of the object. Always `summary_text`. - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - List of allowed tool names or a filter object. + - `Type Reasoning` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + The type of the object. Always `reasoning`. - A string array of allowed tool names + - `const ReasoningReasoning Reasoning = "reasoning"` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `Agent BetaResponseReasoningItemAgent` - A filter object to specify which tools are allowed. + The agent that produced this item. - - `ReadOnly bool` + - `AgentName string` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The canonical name of the agent that produced this item. - - `ToolNames []string` + - `Content []BetaResponseReasoningItemContent` - List of allowed tool names. + Reasoning text content. - - `Authorization string` + - `Text 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. + The reasoning text from the model. - - `ConnectorID string` + - `Type ReasoningText` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + The type of the reasoning text. Always `reasoning_text`. - Currently supported `connector_id` values are: + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - 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` + - `EncryptedContent string` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + - `Status BetaResponseReasoningItemStatus` - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `type BetaResponseItemProgram struct{…}` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + - `ID string` - - `DeferLoading bool` + The unique ID of the program item. - Whether this MCP tool is deferred and discovered via tool search. + - `CallID string` - - `Headers map[string, string]` + The stable call ID of the program item. - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `Code string` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + The JavaScript source executed by programmatic tool calling. - Specify which of the MCP server's tools require approval. + - `Fingerprint string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + Opaque program replay fingerprint that must be round-tripped. - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `Type Program` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + The type of the item. Always `program`. - A filter object to specify which tools are allowed. + - `const ProgramProgram Program = "program"` - - `ReadOnly bool` + - `Agent BetaResponseItemProgramAgent` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The agent that produced this item. - - `ToolNames []string` + - `AgentName string` - List of allowed tool names. + The canonical name of the agent that produced this item. - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `type BetaResponseItemProgramOutput struct{…}` - A filter object to specify which tools are allowed. + - `ID string` - - `ReadOnly bool` + The unique ID of the program output item. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `CallID string` - - `ToolNames []string` + The call ID of the program item. - List of allowed tool names. + - `Result string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + The result produced by the program item. - 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. + - `Status string` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + The terminal status of the program output item. - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + - `const BetaResponseItemProgramOutputStatusCompleted BetaResponseItemProgramOutputStatus = "completed"` - - `ServerDescription string` + - `const BetaResponseItemProgramOutputStatusIncomplete BetaResponseItemProgramOutputStatus = "incomplete"` - Optional description of the MCP server, used to provide more context. + - `Type ProgramOutput` - - `ServerURL string` + The type of the item. Always `program_output`. - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `TunnelID string` + - `Agent BetaResponseItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName 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. + The canonical name of the agent that produced this item. - - `type BetaToolCodeInterpreter struct{…}` + - `type BetaResponseCompactionItem struct{…}` - A tool that runs Python code to help generate a response to a prompt. + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `Container BetaToolCodeInterpreterContainerUnion` + - `ID string` - 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. + The unique ID of the compaction item. - - `string` + - `EncryptedContent string` - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + The encrypted content that was produced by compaction. - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `Type Compaction` - - `Type Auto` + The type of the item. Always `compaction`. - Always `auto`. + - `const CompactionCompaction Compaction = "compaction"` - - `const AutoAuto Auto = "auto"` + - `Agent BetaResponseCompactionItemAgent` - - `FileIDs []string` + The agent that produced this item. - An optional list of uploaded files to make available to your code. + - `AgentName string` - - `MemoryLimit string` + The canonical name of the agent that produced this item. - The memory limit for the code interpreter container. + - `CreatedBy string` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + The identifier of the actor that created the item. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `type BetaResponseItemImageGenerationCall struct{…}` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + An image generation request made by the model. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `ID string` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + The unique ID of the image generation call. - Network access policy for the container. + - `Result string` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + The generated image encoded in base64. - - `Type Disabled` + - `Status string` - Disable outbound network access. Always `disabled`. + The status of the image generation call. - - `const DisabledDisabled Disabled = "disabled"` + - `const BetaResponseItemImageGenerationCallStatusInProgress BetaResponseItemImageGenerationCallStatus = "in_progress"` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `const BetaResponseItemImageGenerationCallStatusCompleted BetaResponseItemImageGenerationCallStatus = "completed"` - - `AllowedDomains []string` + - `const BetaResponseItemImageGenerationCallStatusGenerating BetaResponseItemImageGenerationCallStatus = "generating"` - A list of allowed domains when type is `allowlist`. + - `const BetaResponseItemImageGenerationCallStatusFailed BetaResponseItemImageGenerationCallStatus = "failed"` - - `Type Allowlist` + - `Type ImageGenerationCall` - Allow outbound network access only to specified domains. Always `allowlist`. + The type of the image generation call. Always `image_generation_call`. - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + - `Agent BetaResponseItemImageGenerationCallAgent` - Optional domain-scoped secrets for allowlisted domains. + The agent that produced this item. - - `Domain string` + - `AgentName string` - The domain associated with the secret. + The canonical name of the agent that produced this item. - - `Name string` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - The name of the secret to inject for the domain. + A tool call to run code. - - `Value string` + - `ID string` - The secret value to inject for the domain. + The unique ID of the code interpreter tool call. - - `Type CodeInterpreter` + - `Code string` - The type of the code interpreter tool. Always `code_interpreter`. + The code to run, or null if not available. - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `ContainerID string` - - `AllowedCallers []string` + The ID of the container used to run the code. - The tool invocation context(s). + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `type BetaToolProgrammaticToolCalling struct{…}` + The logs output from the code interpreter. - - `Type ProgrammaticToolCalling` + - `Logs string` - The type of the tool. Always `programmatic_tool_calling`. + The logs output from the code interpreter. - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `Type Logs` - - `type BetaToolImageGeneration struct{…}` + The type of the output. Always `logs`. - A tool that generates images using the GPT image models. + - `const LogsLogs Logs = "logs"` - - `Type ImageGeneration` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - The type of the image generation tool. Always `image_generation`. + The image output from the code interpreter. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `Type Image` - - `Action string` + The type of the output. Always `image`. - Whether to generate a new image or edit an existing image. Default: `auto`. + - `const ImageImage Image = "image"` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + - `URL string` - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + The URL of the image output from the code interpreter. - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `Background string` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - 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. + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - `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. + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `Type CodeInterpreterCall` - - `InputFidelity string` + The type of the code interpreter tool call. Always `code_interpreter_call`. - 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 CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + The agent that produced this item. - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `AgentName string` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + The canonical name of the agent that produced this item. - - `FileID string` + - `type BetaResponseItemLocalShellCall struct{…}` - File ID for the mask image. + A tool call to run a command on the local shell. - - `ImageURL string` + - `ID string` - Base64-encoded mask image. + The unique ID of the local shell call. - - `Model string` + - `Action BetaResponseItemLocalShellCallAction` - The image generation model to use. Default: `gpt-image-1`. + Execute a shell command on the server. - - `string` + - `Command []string` - - `string` + The command to run. - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + - `Env map[string, string]` - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + Environment variables to set for the command. - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + - `Type Exec` - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + The type of the local shell action. Always `exec`. - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + - `const ExecExec Exec = "exec"` - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `TimeoutMs int64` - - `Moderation string` + Optional timeout in milliseconds for the command. - Moderation level for the generated image. Default: `auto`. + - `User string` - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + Optional user to run the command as. - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `WorkingDirectory string` - - `OutputCompression int64` + Optional working directory to run the command in. - Compression level for the output image. Default: 100. + - `CallID string` - - `OutputFormat string` + The unique ID of the local shell tool call generated by the model. - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `Status string` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + The status of the local shell call. - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + - `const BetaResponseItemLocalShellCallStatusInProgress BetaResponseItemLocalShellCallStatus = "in_progress"` - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + - `const BetaResponseItemLocalShellCallStatusCompleted BetaResponseItemLocalShellCallStatus = "completed"` - - `PartialImages int64` + - `const BetaResponseItemLocalShellCallStatusIncomplete BetaResponseItemLocalShellCallStatus = "incomplete"` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `Type LocalShellCall` - - `Quality string` + The type of the local shell call. Always `local_shell_call`. - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `Agent BetaResponseItemLocalShellCallAgent` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + The agent that produced this item. - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `AgentName string` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The canonical name of the agent that produced this item. - - `Size string` + - `type BetaResponseItemLocalShellCallOutput struct{…}` - 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`. + The output of a local shell tool call. - - `string` + - `ID string` - - `string` + The unique ID of the local shell tool call generated by the model. - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `Output string` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + A JSON string of the output of the local shell tool call. - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `Type LocalShellCallOutput` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + The type of the local shell tool call output. Always `local_shell_call_output`. - - `type BetaToolLocalShell struct{…}` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - A tool that allows the model to execute shell commands in a local environment. + - `Agent BetaResponseItemLocalShellCallOutputAgent` - - `Type LocalShell` + The agent that produced this item. - The type of the local shell tool. Always `local_shell`. + - `AgentName string` - - `const LocalShellLocalShell LocalShell = "local_shell"` + The canonical name of the agent that produced this item. - - `type BetaFunctionShellTool struct{…}` + - `Status string` - A tool that allows the model to execute shell commands. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `Type Shell` + - `const BetaResponseItemLocalShellCallOutputStatusInProgress BetaResponseItemLocalShellCallOutputStatus = "in_progress"` - The type of the shell tool. Always `shell`. + - `const BetaResponseItemLocalShellCallOutputStatusCompleted BetaResponseItemLocalShellCallOutputStatus = "completed"` - - `const ShellShell Shell = "shell"` + - `const BetaResponseItemLocalShellCallOutputStatusIncomplete BetaResponseItemLocalShellCallOutputStatus = "incomplete"` - - `AllowedCallers []string` + - `type BetaResponseFunctionShellToolCall struct{…}` - The tool invocation context(s). + A tool call that executes one or more shell commands in a managed environment. - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + - `ID string` - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + The unique ID of the shell tool call. Populated when this item is returned via API. - - `Environment BetaFunctionShellToolEnvironmentUnion` + - `Action BetaResponseFunctionShellToolCallAction` - - `type BetaContainerAuto struct{…}` + The shell commands and limits that describe how to run the tool call. - - `Type ContainerAuto` + - `Commands []string` - Automatically creates a container for this request + - `MaxOutputLength int64` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + Optional maximum number of characters to return from each command. - - `FileIDs []string` + - `TimeoutMs int64` - An optional list of uploaded files to make available to your code. + Optional timeout in milliseconds for the commands. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `CallID string` - The memory limit for the container. + The unique ID of the shell tool call generated by the model. - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + Represents the use of a local environment to perform shell actions. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `type BetaResponseLocalEnvironment struct{…}` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + Represents the use of a local environment to perform shell actions. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `Type Local` - Network access policy for the container. + The environment type. Always `local`. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `const LocalLocal Local = "local"` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `type BetaResponseContainerReference struct{…}` - - `Skills []BetaContainerAutoSkillUnion` + Represents a container created with /v1/containers. - An optional list of skills referenced by id or inline data. + - `ContainerID string` - - `type BetaSkillReference struct{…}` + - `Type ContainerReference` - - `SkillID string` + The environment type. Always `container_reference`. - The ID of the referenced skill. + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `Type SkillReference` + - `Status BetaResponseFunctionShellToolCallStatus` - References a skill created with the /v1/skills endpoint. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` - - `Version string` + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` - - `type BetaInlineSkill struct{…}` + - `Type ShellCall` - - `Description string` + The type of the item. Always `shell_call`. - The description of the skill. + - `const ShellCallShellCall ShellCall = "shell_call"` - - `Name string` + - `Agent BetaResponseFunctionShellToolCallAgent` - The name of the skill. + The agent that produced this item. - - `Source BetaInlineSkillSource` + - `AgentName string` - Inline skill payload + The canonical name of the agent that produced this item. - - `Data string` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` - Base64-encoded skill zip bundle. + The execution context that produced this tool call. - - `MediaType ApplicationZip` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - The media type of the inline skill payload. Must be `application/zip`. + - `Type Direct` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `const DirectDirect Direct = "direct"` - - `Type Base64` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - The type of the inline skill source. Must be `base64`. + - `CallerID string` - - `const Base64Base64 Base64 = "base64"` + The call ID of the program item that produced this tool call. - - `Type Inline` + - `Type Program` - Defines an inline skill for this request. + - `const ProgramProgram Program = "program"` - - `const InlineInline Inline = "inline"` + - `CreatedBy string` - - `type BetaLocalEnvironment struct{…}` + The ID of the entity that created this tool call. - - `Type Local` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - Use a local computer environment. + The output of a shell tool call that was emitted. - - `const LocalLocal Local = "local"` + - `ID string` - - `Skills []BetaLocalSkill` + The unique ID of the shell call output. Populated when this item is returned via API. - An optional list of skills. + - `CallID string` - - `Description string` + The unique ID of the shell tool call generated by the model. - The description of the skill. + - `MaxOutputLength int64` - - `Name string` + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - The name of the skill. + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - - `Path string` + An array of shell call output contents - The path to the directory containing the skill. + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` - - `type BetaContainerReference struct{…}` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - - `ContainerID string` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` - The ID of the referenced container. + Indicates that the shell call exceeded its configured time limit. - - `Type ContainerReference` + - `Type Timeout` - References a container created with the /v1/containers endpoint + The outcome type. Always `timeout`. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaCustomTool struct{…}` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + Indicates that the shell commands finished and returned an exit code. - - `Name string` + - `ExitCode int64` - The name of the custom tool, used to identify it in tool calls. + Exit code from the shell process. - - `Type Custom` + - `Type Exit` - The type of the custom tool. Always `custom`. + The outcome type. Always `exit`. - - `const CustomCustom Custom = "custom"` + - `const ExitExit Exit = "exit"` - - `AllowedCallers []string` + - `Stderr string` - The tool invocation context(s). + The standard error output that was captured. - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `Stdout string` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + The standard output that was captured. - - `DeferLoading bool` + - `CreatedBy string` - Whether this tool should be deferred and discovered via tool search. + The identifier of the actor that created the item. - - `Description string` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - Optional description of the custom tool, used to provide more context. + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - `Format BetaCustomToolFormatUnion` + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - The input format for the custom tool. Default is unconstrained text. + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` - - `type BetaCustomToolFormatText struct{…}` + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` - Unconstrained free-form text. + - `Type ShellCallOutput` - - `Type Text` + The type of the shell call output. Always `shell_call_output`. - Unconstrained text format. Always `text`. + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - - `const TextText Text = "text"` + - `Agent BetaResponseFunctionShellToolCallOutputAgent` - - `type BetaCustomToolFormatGrammar struct{…}` + The agent that produced this item. - A grammar defined by the user. + - `AgentName string` - - `Definition string` + The canonical name of the agent that produced this item. - The grammar definition. + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` - - `Syntax string` + The execution context that produced this tool call. - The syntax of the grammar definition. One of `lark` or `regex`. + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `Type Direct` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `const DirectDirect Direct = "direct"` - - `Type Grammar` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - Grammar format. Always `grammar`. + - `CallerID string` - - `const GrammarGrammar Grammar = "grammar"` + The call ID of the program item that produced this tool call. - - `type BetaNamespaceTool struct{…}` + - `Type Program` - Groups function/custom tools under a shared namespace. + - `const ProgramProgram Program = "program"` - - `Description string` + - `CreatedBy string` - A description of the namespace shown to the model. + The identifier of the actor that created the item. - - `Name string` + - `type BetaResponseApplyPatchToolCall struct{…}` - The namespace name used in tool calls (for example, `crm`). + A tool call that applies file diffs by creating, deleting, or updating files. - - `Tools []BetaNamespaceToolToolUnion` + - `ID string` - The function/custom tools available inside this namespace. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `type BetaNamespaceToolToolFunction struct{…}` + - `CallID string` - - `Name string` + The unique ID of the apply patch tool call generated by the model. - - `Type Function` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - - `const FunctionFunction Function = "function"` + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `AllowedCallers []string` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - The tool invocation context(s). + Instruction describing how to create a file via the apply_patch tool. - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `Diff string` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + Diff to apply. - - `DeferLoading bool` + - `Path string` - Whether this function should be deferred and discovered via tool search. + Path of the file to create. - - `Description string` + - `Type CreateFile` - - `OutputSchema map[string, any]` + Create a new file with the provided diff. - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `Parameters any` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - - `Strict bool` + Instruction describing how to delete a file via the apply_patch tool. - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + - `Path string` - - `type BetaCustomTool struct{…}` + Path of the file to delete. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Type DeleteFile` - - `Type Namespace` + Delete the specified file. - The type of the tool. Always `namespace`. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `const NamespaceNamespace Namespace = "namespace"` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - - `type BetaToolSearchTool struct{…}` + Instruction describing how to update a file via the apply_patch tool. - Hosted or BYOT tool search configuration for deferred tools. + - `Diff string` - - `Type ToolSearch` + Diff to apply. - The type of the tool. Always `tool_search`. + - `Path string` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + Path of the file to update. - - `Description string` + - `Type UpdateFile` - Description shown to the model for a client-executed tool search tool. + Update an existing file with the provided diff. - - `Execution BetaToolSearchToolExecution` + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - Whether tool search is executed by the server or by the client. + - `Status BetaResponseApplyPatchToolCallStatus` - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `Parameters any` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - Parameter schema for a client-executed tool search tool. + - `Type ApplyPatchCall` - - `type BetaWebSearchPreviewTool struct{…}` + The type of the item. Always `apply_patch_call`. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `Type BetaWebSearchPreviewToolType` + - `Agent BetaResponseApplyPatchToolCallAgent` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + The agent that produced this item. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `AgentName string` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + The canonical name of the agent that produced this item. - - `SearchContentTypes []string` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + The execution context that produced this tool call. - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `Type Direct` - 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 DirectDirect Direct = "direct"` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `CallerID string` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + The call ID of the program item that produced this tool call. - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `Type Program` - The user's location. + - `const ProgramProgram Program = "program"` - - `Type Approximate` + - `CreatedBy string` - The type of location approximation. Always `approximate`. + The ID of the entity that created this tool call. - - `const ApproximateApproximate Approximate = "approximate"` + - `type BetaResponseApplyPatchToolCallOutput struct{…}` - - `City string` + The output emitted by an apply patch tool call. - Free text input for the city of the user, e.g. `San Francisco`. + - `ID string` - - `Country string` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `CallID string` - - `Region string` + The unique ID of the apply patch tool call generated by the model. - Free text input for the region of the user, e.g. `California`. + - `Status BetaResponseApplyPatchToolCallOutputStatus` - - `Timezone string` + The status of the apply patch tool call output. One of `completed` or `failed`. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `type BetaApplyPatchTool struct{…}` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - Allows the assistant to create, delete, or update files using unified diffs. + - `Type ApplyPatchCallOutput` - - `Type ApplyPatch` + The type of the item. Always `apply_patch_call_output`. - The type of the tool. Always `apply_patch`. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` - - `AllowedCallers []string` + The agent that produced this item. - The tool invocation context(s). + - `AgentName string` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + The canonical name of the agent that produced this item. - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` - - `Type ToolSearchOutput` + The execution context that produced this tool call. - The item type. Always `tool_search_output`. + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `Type Direct` - - `ID string` + - `const DirectDirect Direct = "direct"` - The unique ID of this tool search output. + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - `CallerID string` - The agent that produced this item. + The call ID of the program item that produced this tool call. - - `AgentName string` + - `Type Program` - The canonical name of the agent that produced this item. + - `const ProgramProgram Program = "program"` - - `CallID string` + - `CreatedBy string` - The unique ID of the tool search call generated by the model. + The ID of the entity that created this tool call output. - - `Execution BetaResponseToolSearchOutputItemParamExecution` + - `Output string` - Whether tool search was executed by the server or by the client. + Optional textual output returned by the apply patch tool. - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + - `type BetaResponseItemMcpListTools struct{…}` - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + A list of tools available on an MCP server. - - `Status BetaResponseToolSearchOutputItemParamStatus` + - `ID string` - The status of the tool search output. + The unique ID of the list. - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + - `ServerLabel string` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + The label of the MCP server. - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `Tools []BetaResponseItemMcpListToolsTool` -### Beta Response Usage + The tools available on the server. -- `type BetaResponseUsage struct{…}` + - `InputSchema any` - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + The JSON schema describing the tool's input. - - `InputTokens int64` + - `Name string` - The number of input tokens. + The name of the tool. - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + - `Annotations any` - A detailed breakdown of the input tokens. + Additional annotations about the tool. - - `CacheWriteTokens int64` + - `Description string` - The number of input tokens that were written to the cache. + The description of the tool. - - `CachedTokens int64` + - `Type McpListTools` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + The type of the item. Always `mcp_list_tools`. - - `OutputTokens int64` + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - The number of output tokens. + - `Agent BetaResponseItemMcpListToolsAgent` - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + The agent that produced this item. - A detailed breakdown of the output tokens. + - `AgentName string` - - `ReasoningTokens int64` + The canonical name of the agent that produced this item. - The number of reasoning tokens. + - `Error string` - - `TotalTokens int64` + Error message if the server could not list tools. - The total number of tokens used. + - `type BetaResponseItemMcpApprovalRequest struct{…}` -### Beta Response Web Search Call Completed Event + A request for human approval of a tool invocation. -- `type BetaResponseWebSearchCallCompletedEvent struct{…}` + - `ID string` - Emitted when a web search call is completed. + The unique ID of the approval request. - - `ItemID string` + - `Arguments string` - Unique ID for the output item associated with the web search call. + A JSON string of arguments for the tool. - - `OutputIndex int64` + - `Name string` - The index of the output item that the web search call is associated with. + The name of the tool to run. - - `SequenceNumber int64` + - `ServerLabel string` - The sequence number of the web search call being processed. + The label of the MCP server making the request. - - `Type ResponseWebSearchCallCompleted` + - `Type McpApprovalRequest` - The type of the event. Always `response.web_search_call.completed`. + The type of the item. Always `mcp_approval_request`. - - `const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Agent BetaResponseWebSearchCallCompletedEventAgent` + - `Agent BetaResponseItemMcpApprovalRequestAgent` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response Web Search Call In Progress Event - -- `type BetaResponseWebSearchCallInProgressEvent struct{…}` + - `type BetaResponseItemMcpApprovalResponse struct{…}` - Emitted when a web search call is initiated. + A response to an MCP approval request. - - `ItemID string` + - `ID string` - Unique ID for the output item associated with the web search call. + The unique ID of the approval response - - `OutputIndex int64` + - `ApprovalRequestID string` - The index of the output item that the web search call is associated with. + The ID of the approval request being answered. - - `SequenceNumber int64` + - `Approve bool` - The sequence number of the web search call being processed. + Whether the request was approved. - - `Type ResponseWebSearchCallInProgress` + - `Type McpApprovalResponse` - The type of the event. Always `response.web_search_call.in_progress`. + The type of the item. Always `mcp_approval_response`. - - `const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"` + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `Agent BetaResponseWebSearchCallInProgressEventAgent` + - `Agent BetaResponseItemMcpApprovalResponseAgent` - The agent that owns this multi-agent streaming event. + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Response Web Search Call Searching Event + - `Reason string` -- `type BetaResponseWebSearchCallSearchingEvent struct{…}` + Optional reason for the decision. - Emitted when a web search call is executing. + - `type BetaResponseItemMcpCall struct{…}` - - `ItemID string` + An invocation of a tool on an MCP server. - Unique ID for the output item associated with the web search call. + - `ID string` - - `OutputIndex int64` + The unique ID of the tool call. - The index of the output item that the web search call is associated with. + - `Arguments string` - - `SequenceNumber int64` + A JSON string of the arguments passed to the tool. - The sequence number of the web search call being processed. + - `Name string` - - `Type ResponseWebSearchCallSearching` + The name of the tool that was run. - The type of the event. Always `response.web_search_call.searching`. + - `ServerLabel string` - - `const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"` + The label of the MCP server running the tool. - - `Agent BetaResponseWebSearchCallSearchingEventAgent` + - `Type McpCall` - The agent that owns this multi-agent streaming event. + The type of the item. Always `mcp_call`. + + - `const McpCallMcpCall McpCall = "mcp_call"` + + - `Agent BetaResponseItemMcpCallAgent` + + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. -### Beta Responses Client Event + - `ApprovalRequestID string` -- `type BetaResponsesClientEventUnion interface{…}` + 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. - Client events accepted by the Responses WebSocket server. + - `Error string` - - `BetaResponsesClientEventResponseCreate` + The error from the tool call, if any. - - `Type ResponseCreate` + - `Output string` - The type of the client event. Always `response.create`. + The output from the tool call. - - `const ResponseCreateResponseCreate ResponseCreate = "response.create"` + - `Status string` - - `Background bool` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + - `const BetaResponseItemMcpCallStatusInProgress BetaResponseItemMcpCallStatus = "in_progress"` - - `ContextManagement []BetaResponsesClientEventResponseCreateContextManagement` + - `const BetaResponseItemMcpCallStatusCompleted BetaResponseItemMcpCallStatus = "completed"` - Context management configuration for this request. + - `const BetaResponseItemMcpCallStatusIncomplete BetaResponseItemMcpCallStatus = "incomplete"` - - `Type string` + - `const BetaResponseItemMcpCallStatusCalling BetaResponseItemMcpCallStatus = "calling"` - The context management entry type. Currently only 'compaction' is supported. + - `const BetaResponseItemMcpCallStatusFailed BetaResponseItemMcpCallStatus = "failed"` - - `CompactThreshold int64` + - `type BetaResponseCustomToolCallItem struct{…}` - Token threshold at which compaction should be triggered for this entry. + A call to a custom tool created by the model. - - `Conversation BetaResponsesClientEventResponseCreateConversationUnion` + - `ID string` - The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. - Input items and output items from this response are automatically added to this conversation after this response completes. + The unique ID of the custom tool call item. - - `string` + - `Status string` - - `type BetaResponseConversationParamResp struct{…}` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The conversation that this response belongs to. + - `const BetaResponseCustomToolCallItemStatusInProgress BetaResponseCustomToolCallItemStatus = "in_progress"` + + - `const BetaResponseCustomToolCallItemStatusCompleted BetaResponseCustomToolCallItemStatus = "completed"` + + - `const BetaResponseCustomToolCallItemStatusIncomplete BetaResponseCustomToolCallItemStatus = "incomplete"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseCustomToolCallOutputItem struct{…}` + + The output of a custom tool call from your code, being sent back to the model. - `ID string` - The unique ID of the conversation. + The unique ID of the custom tool call output item. - - `Include []BetaResponseIncludable` + - `Status string` - Specify additional output data to include in the model response. Currently supported values are: + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `web_search_call.action.sources`: Include the sources of the web search tool call. - - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - - `computer_call_output.output.image_url`: Include image urls from the computer call output. - - `file_search_call.results`: Include the search results of the file search tool call. - - `message.input_image.image_url`: Include image urls from the input message. - - `message.output_text.logprobs`: Include logprobs with assistant messages. - - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` + - `CreatedBy string` - - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` + The identifier of the actor that created the item. - - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` +### Example - - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` +```go +package main - - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` +import ( + "context" + "fmt" - - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `Input BetaResponsesClientEventResponseCreateInputUnion` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + page, err := client.Beta.Responses.InputItems.List( + context.TODO(), + "response_id", + openai.BetaResponseInputItemListParams{ - Text, image, or file inputs to the model, used to generate a response. + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - Learn more: +#### Response - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Image inputs](https://platform.openai.com/docs/guides/images) - - [File inputs](https://platform.openai.com/docs/guides/pdf-files) - - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) - - [Function calling](https://platform.openai.com/docs/guides/function-calling) +```json +{ + "data": [ + { + "id": "id", + "content": [ + { + "text": "text", + "type": "input_text", + "prompt_cache_breakpoint": { + "mode": "explicit" + } + } + ], + "role": "user", + "type": "message", + "agent": { + "agent_name": "agent_name" + }, + "status": "in_progress" + } + ], + "first_id": "first_id", + "has_more": true, + "last_id": "last_id", + "object": "list" +} +``` - - `string` +## Domain Types - - `type BetaResponseInput []BetaResponseInputItemUnion` +### Beta Response Item List - A list of one or many input items to the model, containing - different content types. +- `type BetaResponseItemList struct{…}` - - `type BetaEasyInputMessage struct{…}` + A list of Response items. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `Data []BetaResponseItemUnion` - - `Content BetaEasyInputMessageContentUnion` + A list of items used to generate this response. - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `type BetaResponseInputMessageItem struct{…}` - - `string` + - `ID string` - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + The unique ID of the message input. + + - `Content BetaResponseInputMessageContentList` A list of one or many input items to the model, containing different content types. @@ -134937,55 +147324,23 @@ func main() { - `const ExplicitExplicit Explicit = "explicit"` - - `Role BetaEasyInputMessageRole` - - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. - - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - - - `Phase BetaEasyInputMessagePhase` - - 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 BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - - - `Type BetaEasyInputMessageType` - - The type of the message input. Always `message`. - - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - - - `type BetaResponseInputItemMessage struct{…}` - - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `Role BetaResponseInputMessageItemRole` - - `Content BetaResponseInputMessageContentList` + The role of the message input. One of `user`, `system`, or `developer`. - A list of one or many input items to the model, containing different content - types. + - `const BetaResponseInputMessageItemRoleUser BetaResponseInputMessageItemRole = "user"` - - `Role string` + - `const BetaResponseInputMessageItemRoleSystem BetaResponseInputMessageItemRole = "system"` - The role of the message input. One of `user`, `system`, or `developer`. + - `const BetaResponseInputMessageItemRoleDeveloper BetaResponseInputMessageItemRole = "developer"` - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + - `Type Message` - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + The type of the message input. Always set to `message`. - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + - `const MessageMessage Message = "message"` - - `Agent BetaResponseInputItemMessageAgent` + - `Agent BetaResponseInputMessageItemAgent` The agent that produced this item. @@ -134993,22 +147348,16 @@ func main() { The canonical name of the agent that produced this item. - - `Status string` + - `Status BetaResponseInputMessageItemStatus` The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - - - `Type string` + - `const BetaResponseInputMessageItemStatusInProgress BetaResponseInputMessageItemStatus = "in_progress"` - The type of the message input. Always set to `message`. + - `const BetaResponseInputMessageItemStatusCompleted BetaResponseInputMessageItemStatus = "completed"` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + - `const BetaResponseInputMessageItemStatusIncomplete BetaResponseInputMessageItemStatus = "incomplete"` - `type BetaResponseOutputMessage struct{…}` @@ -135205,6 +147554,8 @@ func main() { - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` + - `type BetaResponseFileSearchToolCall struct{…}` The results of a file search tool call. See the @@ -135571,9 +147922,11 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemComputerCallOutput struct{…}` + - `type BetaResponseComputerToolCallOutputItem struct{…}` - The output of a computer tool call. + - `ID string` + + The unique ID of the computer call tool output. - `CallID string` @@ -135598,19 +147951,29 @@ func main() { The URL of the screenshot image. + - `Status BetaResponseComputerToolCallOutputItemStatus` + + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + + - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + + - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + + - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + + - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `Type ComputerCallOutput` The type of the computer tool call output. Always `computer_call_output`. - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `ID string` - - The ID of the computer tool call output. - - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` - The safety checks reported by the API that have been acknowledged by the developer. + The safety checks reported by the API that have been acknowledged by the + developer. - `ID string` @@ -135624,7 +147987,7 @@ func main() { Details about the pending safety check. - - `Agent BetaResponseInputItemComputerCallOutputAgent` + - `Agent BetaResponseComputerToolCallOutputItemAgent` The agent that produced this item. @@ -135632,15 +147995,9 @@ func main() { The canonical name of the agent that produced this item. - - `Status string` - - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `CreatedBy string` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + The identifier of the actor that created the item. - `type BetaResponseFunctionWebSearch struct{…}` @@ -135746,277 +148103,229 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseFunctionToolCall struct{…}` + - `type BetaResponseFunctionToolCallItem struct{…}` A tool call to run a function. See the [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - - `Arguments string` - - A JSON string of the arguments to pass to the function. - - - `CallID string` - - The unique ID of the function tool call generated by the model. - - - `Name string` - - The name of the function to run. - - - `Type FunctionCall` - - The type of the function tool call. Always `function_call`. - - - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `ID string` The unique ID of the function tool call. - - `Agent BetaResponseFunctionToolCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseFunctionToolCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - - `Type Direct` - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. - - - `Type Program` - - - `const ProgramProgram Program = "program"` + - `Status string` - - `Namespace string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The namespace of the function to run. + - `const BetaResponseFunctionToolCallItemStatusInProgress BetaResponseFunctionToolCallItemStatus = "in_progress"` - - `Status BetaResponseFunctionToolCallStatus` + - `const BetaResponseFunctionToolCallItemStatusCompleted BetaResponseFunctionToolCallItemStatus = "completed"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const BetaResponseFunctionToolCallItemStatusIncomplete BetaResponseFunctionToolCallItemStatus = "incomplete"` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + - `CreatedBy string` - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + The identifier of the actor that created the item. - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `type BetaResponseFunctionToolCallOutputItem struct{…}` - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `ID string` - The output of a function tool call. + The unique ID of the function call tool output. - `CallID string` The unique ID of the function tool call generated by the model. - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` - Text, image, or file output of the function tool call. + The output from the function call generated by your code. + Can be a string or an list of output content. - `string` - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` - An array of content outputs (text, image, file) for the function tool call. + Text, image, or file output of the function call. - - `type BetaResponseInputTextContent struct{…}` + - `type BetaResponseInputText 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`. + - `type BetaResponseInputImage struct{…}` - - `const InputTextInputText InputText = "input_text"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + - `type BetaResponseInputFile struct{…}` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + A file input to the model. - - `Mode Explicit` + - `Status BetaResponseFunctionToolCallOutputItemStatus` - The breakpoint mode. Always `explicit`. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` - - `type BetaResponseInputImageContent struct{…}` + - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` - - `Type InputImage` + - `Type FunctionCallOutput` - The type of the input item. Always `input_image`. + The type of the function tool call output. Always `function_call_output`. - - `const InputImageInputImage InputImage = "input_image"` + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `Detail BetaResponseInputImageContentDetail` + - `Agent BetaResponseFunctionToolCallOutputItemAgent` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The agent that produced this item. - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `AgentName string` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + The canonical name of the agent that produced this item. - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + The execution context that produced this tool call. - - `FileID string` + - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` - The ID of the file to be sent to the model. + - `Type Direct` - - `ImageURL string` + The caller type. Always `direct`. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const DirectDirect Direct = "direct"` - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `CallerID string` - - `Mode Explicit` + The call ID of the program item that produced this tool call. - The breakpoint mode. Always `explicit`. + - `Type Program` - - `const ExplicitExplicit Explicit = "explicit"` + The caller type. Always `program`. - - `type BetaResponseInputFileContent struct{…}` + - `const ProgramProgram Program = "program"` - A file input to the model. + - `CreatedBy string` - - `Type InputFile` + The identifier of the actor that created the item. - The type of the input item. Always `input_file`. + - `type BetaResponseItemAgentMessage struct{…}` - - `const InputFileInputFile InputFile = "input_file"` + - `ID string` - - `Detail BetaResponseInputFileContentDetail` + The unique ID of the agent message. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Author string` - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + The sending agent identity. - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + - `Content []BetaResponseItemAgentMessageContentUnion` - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + Encrypted content sent between agents. - - `FileData string` + - `type BetaResponseInputText struct{…}` - The base64-encoded data of the file to be sent to the model. + A text input to the model. - - `FileID string` + - `type BetaResponseOutputText struct{…}` - The ID of the file to be sent to the model. + A text output from the model. - - `FileURL string` + - `type BetaResponseItemAgentMessageContentText struct{…}` - The URL of the file to be sent to the model. + A text content. - - `Filename string` + - `Text string` - The name of the file to be sent to the model. + - `Type Text` - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + - `const TextText Text = "text"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaResponseItemAgentMessageContentSummaryText struct{…}` - - `Mode Explicit` + A summary text from the model. - The breakpoint mode. Always `explicit`. + - `Text string` - - `const ExplicitExplicit Explicit = "explicit"` + A summary of the reasoning output from the model so far. - - `Type FunctionCallOutput` + - `Type SummaryText` - The type of the function tool call output. Always `function_call_output`. + The type of the object. Always `summary_text`. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `ID string` + - `type BetaResponseItemAgentMessageContentReasoningText struct{…}` - The unique ID of the function tool call output. Populated when this item is returned via API. + Reasoning text from the model. - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + - `Text string` - The agent that produced this item. + The reasoning text from the model. - - `AgentName string` + - `Type ReasoningText` - The canonical name of the agent that produced this item. + The type of the reasoning text. Always `reasoning_text`. - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - The execution context that produced this tool call. + - `type BetaResponseOutputRefusal struct{…}` - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + A refusal from the model. - - `Type Direct` + - `type BetaResponseInputImage struct{…}` - The caller type. Always `direct`. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const DirectDirect Direct = "direct"` + - `type BetaResponseItemAgentMessageContentComputerScreenshot struct{…}` - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + A screenshot of a computer. - - `CallerID string` + - `Detail string` - The call ID of the program item that produced this tool call. + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `Type Program` + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailLow BetaResponseItemAgentMessageContentComputerScreenshotDetail = "low"` - The caller type. Always `program`. + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseItemAgentMessageContentComputerScreenshotDetail = "high"` - - `const ProgramProgram Program = "program"` + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseItemAgentMessageContentComputerScreenshotDetail = "auto"` - - `Status string` + - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseItemAgentMessageContentComputerScreenshotDetail = "original"` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + - `FileID string` - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + The identifier of an uploaded file that contains the screenshot. - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + - `ImageURL string` - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + The URL of the screenshot image. - - `type BetaResponseInputItemAgentMessage struct{…}` + - `Type ComputerScreenshot` - A message routed between agents. + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `Author string` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - The sending agent identity. + - `PromptCacheBreakpoint BetaResponseItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` - - `Content []BetaResponseInputItemAgentMessageContentUnion` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Plaintext, image, or encrypted content sent between agents. + - `Mode Explicit` - - `type BetaResponseInputTextContent struct{…}` + The breakpoint mode. Always `explicit`. - A text input to the model. + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseInputImageContent struct{…}` + - `type BetaResponseInputFile struct{…}` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + A file input to the model. - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + - `type BetaResponseItemAgentMessageContentEncryptedContent struct{…}` Opaque encrypted content that Responses API decrypts inside trusted model execution. @@ -136036,15 +148345,11 @@ func main() { - `Type AgentMessage` - The item type. Always `agent_message`. + The type of the item. Always `agent_message`. - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - - `ID string` - - The unique ID of this agent message item. - - - `Agent BetaResponseInputItemAgentMessageAgent` + - `Agent BetaResponseItemAgentMessageAgent` The agent that produced this item. @@ -136052,27 +148357,31 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCall struct{…}` + - `type BetaResponseItemMultiAgentCall struct{…}` + + - `ID string` + + The unique ID of the multi-agent call item. - `Action string` - The multi-agent action that was executed. + The multi-agent action to execute. - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + - `const BetaResponseItemMultiAgentCallActionSpawnAgent BetaResponseItemMultiAgentCallAction = "spawn_agent"` - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + - `const BetaResponseItemMultiAgentCallActionInterruptAgent BetaResponseItemMultiAgentCallAction = "interrupt_agent"` - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + - `const BetaResponseItemMultiAgentCallActionListAgents BetaResponseItemMultiAgentCallAction = "list_agents"` - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + - `const BetaResponseItemMultiAgentCallActionSendMessage BetaResponseItemMultiAgentCallAction = "send_message"` - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `const BetaResponseItemMultiAgentCallActionFollowupTask BetaResponseItemMultiAgentCallAction = "followup_task"` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + - `const BetaResponseItemMultiAgentCallActionWaitAgent BetaResponseItemMultiAgentCallAction = "wait_agent"` - `Arguments string` - The action arguments as a JSON string. + The JSON string of arguments generated for the action. - `CallID string` @@ -136080,15 +148389,11 @@ func main() { - `Type MultiAgentCall` - The item type. Always `multi_agent_call`. + The type of the multi-agent call. Always `multi_agent_call`. - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` - - `ID string` - - The unique ID of this multi-agent call. - - - `Agent BetaResponseInputItemMultiAgentCallAgent` + - `Agent BetaResponseItemMultiAgentCallAgent` The agent that produced this item. @@ -136096,129 +148401,103 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `type BetaResponseItemMultiAgentCallOutput struct{…}` + + - `ID string` + + The unique ID of the multi-agent call output item. - `Action string` The multi-agent action that produced this result. - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + - `const BetaResponseItemMultiAgentCallOutputActionSpawnAgent BetaResponseItemMultiAgentCallOutputAction = "spawn_agent"` - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `const BetaResponseItemMultiAgentCallOutputActionInterruptAgent BetaResponseItemMultiAgentCallOutputAction = "interrupt_agent"` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + - `const BetaResponseItemMultiAgentCallOutputActionListAgents BetaResponseItemMultiAgentCallOutputAction = "list_agents"` - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `const BetaResponseItemMultiAgentCallOutputActionSendMessage BetaResponseItemMultiAgentCallOutputAction = "send_message"` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + - `const BetaResponseItemMultiAgentCallOutputActionFollowupTask BetaResponseItemMultiAgentCallOutputAction = "followup_task"` - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + - `const BetaResponseItemMultiAgentCallOutputActionWaitAgent BetaResponseItemMultiAgentCallOutputAction = "wait_agent"` - `CallID string` The unique ID of the multi-agent call. - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + - `Output []BetaResponseOutputText` Text output returned by the multi-agent action. - - `Text string` - - The text content. - - - `Type OutputText` - - The content type. Always `output_text`. - - - `const OutputTextOutputText OutputText = "output_text"` - - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - Citations associated with the text content. - - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - - `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 citation type. Always `file_citation`. + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `const FileCitationFileCitation FileCitation = "file_citation"` + The annotations of the text output. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + - `Text string` - - `EndIndex int64` + The text output from the model. - The index of the last character of the citation in the message. + - `Type OutputText` - - `StartIndex int64` + The type of the output text. Always `output_text`. - The index of the first character of the citation in the message. + - `Logprobs []BetaResponseOutputTextLogprob` - - `Title string` + - `Type MultiAgentCallOutput` - The title of the cited resource. + The type of the multi-agent result. Always `multi_agent_call_output`. - - `Type URLCitation` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - The citation type. Always `url_citation`. + - `Agent BetaResponseItemMultiAgentCallOutputAgent` - - `const URLCitationURLCitation URLCitation = "url_citation"` + The agent that produced this item. - - `URL string` + - `AgentName string` - The URL of the cited resource. + The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + - `type BetaResponseToolSearchCall struct{…}` - - `ContainerID string` + - `ID string` - The ID of the container. + The unique ID of the tool search call item. - - `EndIndex int64` + - `Arguments any` - The index of the last character of the citation in the message. + Arguments used for the tool search call. - - `FileID string` + - `CallID string` - The ID of the container file. + The unique ID of the tool search call generated by the model. - - `Filename string` + - `Execution BetaResponseToolSearchCallExecution` - The filename of the container file cited. + Whether tool search was executed by the server or by the client. - - `StartIndex int64` + - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` - The index of the first character of the citation in the message. + - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` - - `Type ContainerFileCitation` + - `Status BetaResponseToolSearchCallStatus` - The citation type. Always `container_file_citation`. + The status of the tool search call item that was recorded. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` - - `Type MultiAgentCallOutput` + - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` - The item type. Always `multi_agent_call_output`. + - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `Type ToolSearchCall` - - `ID string` + The type of the item. Always `tool_search_call`. - The unique ID of this multi-agent call output. + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + - `Agent BetaResponseToolSearchCallAgent` The agent that produced this item. @@ -136226,57 +148505,41 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemToolSearchCall struct{…}` - - - `Arguments any` - - The arguments supplied to the tool search call. - - - `Type ToolSearchCall` + - `CreatedBy string` - The item type. Always `tool_search_call`. + The identifier of the actor that created the item. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `type BetaResponseToolSearchOutputItem struct{…}` - `ID string` - The unique ID of this tool search call. - - - `Agent BetaResponseInputItemToolSearchCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. + The unique ID of the tool search output item. - `CallID string` The unique ID of the tool search call generated by the model. - - `Execution string` + - `Execution BetaResponseToolSearchOutputItemExecution` Whether tool search was executed by the server or by the client. - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` - - `Status string` + - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` - The status of the tool search call. + - `Status BetaResponseToolSearchOutputItemStatus` - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + The status of the tool search output item that was recorded. - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` - `Tools []BetaToolUnion` - The loaded tool definitions returned by the tool search output. + The loaded tool definitions returned by tool search. - `type BetaFunctionTool struct{…}` @@ -136385,7 +148648,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` + + - `string` + + - `float64` - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` @@ -136442,7 +148709,11 @@ func main() { - `bool` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` + + - `string` + + - `float64` - `Type string` @@ -137358,15 +149629,11 @@ func main() { - `Type ToolSearchOutput` - The item type. Always `tool_search_output`. + The type of the item. Always `tool_search_output`. - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - - `ID string` - - The unique ID of this tool search output. - - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - `Agent BetaResponseToolSearchOutputItemAgent` The agent that produced this item. @@ -137374,39 +149641,39 @@ func main() { The canonical name of the agent that produced this item. - - `CallID string` + - `CreatedBy string` - The unique ID of the tool search call generated by the model. + The identifier of the actor that created the item. - - `Execution BetaResponseToolSearchOutputItemParamExecution` + - `type BetaResponseItemAdditionalTools struct{…}` - Whether tool search was executed by the server or by the client. + - `ID string` - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + The unique ID of the additional tools item. - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + - `Role string` - - `Status BetaResponseToolSearchOutputItemParamStatus` + The role that provided the additional tools. - The status of the tool search output. + - `const BetaResponseItemAdditionalToolsRoleUnknown BetaResponseItemAdditionalToolsRole = "unknown"` - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + - `const BetaResponseItemAdditionalToolsRoleUser BetaResponseItemAdditionalToolsRole = "user"` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + - `const BetaResponseItemAdditionalToolsRoleAssistant BetaResponseItemAdditionalToolsRole = "assistant"` - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `const BetaResponseItemAdditionalToolsRoleSystem BetaResponseItemAdditionalToolsRole = "system"` - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `const BetaResponseItemAdditionalToolsRoleCritic BetaResponseItemAdditionalToolsRole = "critic"` - - `Role Developer` + - `const BetaResponseItemAdditionalToolsRoleDiscriminator BetaResponseItemAdditionalToolsRole = "discriminator"` - The role that provided the additional tools. Only `developer` is supported. + - `const BetaResponseItemAdditionalToolsRoleDeveloper BetaResponseItemAdditionalToolsRole = "developer"` - - `const DeveloperDeveloper Developer = "developer"` + - `const BetaResponseItemAdditionalToolsRoleTool BetaResponseItemAdditionalToolsRole = "tool"` - `Tools []BetaToolUnion` - A list of additional tools made available at this item. + The additional tool definitions made available at this item. - `type BetaFunctionTool struct{…}` @@ -137474,15 +149741,11 @@ func main() { - `Type AdditionalTools` - The item type. Always `additional_tools`. + The type of the item. Always `additional_tools`. - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - `ID string` - - The unique ID of this additional tools item. - - - `Agent BetaResponseInputItemAdditionalToolsAgent` + - `Agent BetaResponseItemAdditionalToolsAgent` The agent that produced this item. @@ -137559,13 +149822,85 @@ func main() { - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - - `type BetaResponseCompactionItemParamResp struct{…}` + - `type BetaResponseItemProgram struct{…}` + + - `ID string` + + The unique ID of the program item. + + - `CallID string` + + The stable call ID of the program item. + + - `Code string` + + The JavaScript source executed by programmatic tool calling. + + - `Fingerprint string` + + Opaque program replay fingerprint that must be round-tripped. + + - `Type Program` + + The type of the item. Always `program`. + + - `const ProgramProgram Program = "program"` + + - `Agent BetaResponseItemProgramAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseItemProgramOutput struct{…}` + + - `ID string` + + The unique ID of the program output item. + + - `CallID string` + + The call ID of the program item. + + - `Result string` + + The result produced by the program item. + + - `Status string` + + The terminal status of the program output item. + + - `const BetaResponseItemProgramOutputStatusCompleted BetaResponseItemProgramOutputStatus = "completed"` + + - `const BetaResponseItemProgramOutputStatusIncomplete BetaResponseItemProgramOutputStatus = "incomplete"` + + - `Type ProgramOutput` + + The type of the item. Always `program_output`. + + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + + - `Agent BetaResponseItemProgramOutputAgent` + + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `type BetaResponseCompactionItem struct{…}` A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `ID string` + + The unique ID of the compaction item. + - `EncryptedContent string` - The encrypted content of the compaction summary. + The encrypted content that was produced by compaction. - `Type Compaction` @@ -137573,11 +149908,7 @@ func main() { - `const CompactionCompaction Compaction = "compaction"` - - `ID string` - - The ID of the compaction item. - - - `Agent BetaResponseCompactionItemParamAgentResp` + - `Agent BetaResponseCompactionItemAgent` The agent that produced this item. @@ -137585,7 +149916,11 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemImageGenerationCall struct{…}` + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseItemImageGenerationCall struct{…}` An image generation request made by the model. @@ -137601,13 +149936,13 @@ func main() { The status of the image generation call. - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `const BetaResponseItemImageGenerationCallStatusInProgress BetaResponseItemImageGenerationCallStatus = "in_progress"` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + - `const BetaResponseItemImageGenerationCallStatusCompleted BetaResponseItemImageGenerationCallStatus = "completed"` - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + - `const BetaResponseItemImageGenerationCallStatusGenerating BetaResponseItemImageGenerationCallStatus = "generating"` - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` + - `const BetaResponseItemImageGenerationCallStatusFailed BetaResponseItemImageGenerationCallStatus = "failed"` - `Type ImageGenerationCall` @@ -137615,7 +149950,7 @@ func main() { - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseInputItemImageGenerationCallAgent` + - `Agent BetaResponseItemImageGenerationCallAgent` The agent that produced this item. @@ -137700,7 +150035,7 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `type BetaResponseItemLocalShellCall struct{…}` A tool call to run a command on the local shell. @@ -137708,7 +150043,7 @@ func main() { The unique ID of the local shell call. - - `Action BetaResponseInputItemLocalShellCallAction` + - `Action BetaResponseItemLocalShellCallAction` Execute a shell command on the server. @@ -137746,11 +150081,11 @@ func main() { The status of the local shell call. - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + - `const BetaResponseItemLocalShellCallStatusInProgress BetaResponseItemLocalShellCallStatus = "in_progress"` - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + - `const BetaResponseItemLocalShellCallStatusCompleted BetaResponseItemLocalShellCallStatus = "completed"` - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `const BetaResponseItemLocalShellCallStatusIncomplete BetaResponseItemLocalShellCallStatus = "incomplete"` - `Type LocalShellCall` @@ -137758,7 +150093,7 @@ func main() { - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` - - `Agent BetaResponseInputItemLocalShellCallAgent` + - `Agent BetaResponseItemLocalShellCallAgent` The agent that produced this item. @@ -137766,7 +150101,7 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `type BetaResponseItemLocalShellCallOutput struct{…}` The output of a local shell tool call. @@ -137784,7 +150119,7 @@ func main() { - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + - `Agent BetaResponseItemLocalShellCallOutputAgent` The agent that produced this item. @@ -137796,47 +150131,81 @@ func main() { The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + - `const BetaResponseItemLocalShellCallOutputStatusInProgress BetaResponseItemLocalShellCallOutputStatus = "in_progress"` - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + - `const BetaResponseItemLocalShellCallOutputStatusCompleted BetaResponseItemLocalShellCallOutputStatus = "completed"` - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `const BetaResponseItemLocalShellCallOutputStatusIncomplete BetaResponseItemLocalShellCallOutputStatus = "incomplete"` - - `type BetaResponseInputItemShellCall struct{…}` + - `type BetaResponseFunctionShellToolCall struct{…}` - A tool representing a request to execute one or more shell commands. + A tool call that executes one or more shell commands in a managed environment. - - `Action BetaResponseInputItemShellCallAction` + - `ID string` + + The unique ID of the shell tool call. Populated when this item is returned via API. + + - `Action BetaResponseFunctionShellToolCallAction` The shell commands and limits that describe how to run the tool call. - `Commands []string` - Ordered shell commands for the execution environment to run. - - `MaxOutputLength int64` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + Optional maximum number of characters to return from each command. - `TimeoutMs int64` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + Optional timeout in milliseconds for the commands. - `CallID string` The unique ID of the shell tool call generated by the model. + - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + + Represents the use of a local environment to perform shell actions. + + - `type BetaResponseLocalEnvironment struct{…}` + + Represents the use of a local environment to perform shell actions. + + - `Type Local` + + The environment type. Always `local`. + + - `const LocalLocal Local = "local"` + + - `type BetaResponseContainerReference struct{…}` + + Represents a container created with /v1/containers. + + - `ContainerID string` + + - `Type ContainerReference` + + The environment type. Always `container_reference`. + + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + + - `Status BetaResponseFunctionShellToolCallStatus` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + + - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `Type ShellCall` The type of the item. Always `shell_call`. - `const ShellCallShellCall ShellCall = "shell_call"` - - `ID string` - - The unique ID of the shell tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemShellCallAgent` + - `Agent BetaResponseFunctionShellToolCallAgent` The agent that produced this item. @@ -137844,19 +150213,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemShellCallCallerUnion` + - `Caller BetaResponseFunctionShellToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` - `CallerID string` @@ -137864,45 +150231,37 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - The environment to execute the shell commands in. - - - `type BetaLocalEnvironment struct{…}` - - - `type BetaContainerReference struct{…}` - - - `Status string` - - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `CreatedBy string` - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + The ID of the entity that created this tool call. - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + - `type BetaResponseFunctionShellToolCallOutput struct{…}` - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + The output of a shell tool call that was emitted. - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `ID string` - The streamed output items emitted by a shell tool call. + 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. - - `Output []BetaResponseFunctionShellCallOutputContent` + - `MaxOutputLength int64` - Captured chunks of stdout and stderr output, along with their associated outcomes. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + - `Output []BetaResponseFunctionShellToolCallOutputOutput` - The exit or timeout outcome associated with this shell call. + An array of shell call output contents - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` Indicates that the shell call exceeded its configured time limit. @@ -137912,13 +150271,13 @@ func main() { - `const TimeoutTimeout Timeout = "timeout"` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` Indicates that the shell commands finished and returned an exit code. - `ExitCode int64` - The exit code returned by the shell process. + Exit code from the shell process. - `Type Exit` @@ -137928,23 +150287,33 @@ func main() { - `Stderr string` - Captured stderr output for the shell call. + The standard error output that was captured. - `Stdout string` - Captured stdout output for the shell call. + The standard output that was captured. - - `Type ShellCallOutput` + - `CreatedBy string` - The type of the item. Always `shell_call_output`. + The identifier of the actor that created the item. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `Status BetaResponseFunctionShellToolCallOutputStatus` - - `ID string` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + + - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + + - `Type ShellCallOutput` + + The type of the shell call output. Always `shell_call_output`. + + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + + - `Agent BetaResponseFunctionShellToolCallOutputAgent` The agent that produced this item. @@ -137952,19 +150321,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` - `CallerID string` @@ -137972,93 +150339,85 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `MaxOutputLength int64` - - The maximum number of UTF-8 characters captured for this shell call's combined output. - - - `Status string` - - The status of the shell call output. + - `CreatedBy string` - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + The identifier of the actor that created the item. - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + - `type BetaResponseApplyPatchToolCall struct{…}` - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + A tool call that applies file diffs by creating, deleting, or updating files. - - `type BetaResponseInputItemApplyPatchCall struct{…}` + - `ID string` - A tool call representing a request to create, delete, or update files using diff patches. + 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 BetaResponseInputItemApplyPatchCallOperationUnion` + - `Operation BetaResponseApplyPatchToolCallOperationUnion` - The specific create, delete, or update instruction for the apply_patch tool call. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` - Instruction for creating a new file via the apply_patch tool. + Instruction describing how to create a file via the apply_patch tool. - `Diff string` - Unified diff content to apply when creating the file. + Diff to apply. - `Path string` - Path of the file to create relative to the workspace root. + Path of the file to create. - `Type CreateFile` - The operation type. Always `create_file`. + Create a new file with the provided diff. - `const CreateFileCreateFile CreateFile = "create_file"` - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` - Instruction for deleting an existing file via the apply_patch tool. + Instruction describing how to delete a file via the apply_patch tool. - `Path string` - Path of the file to delete relative to the workspace root. + Path of the file to delete. - `Type DeleteFile` - The operation type. Always `delete_file`. + Delete the specified file. - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` - Instruction for updating an existing file via the apply_patch tool. + Instruction describing how to update a file via the apply_patch tool. - `Diff string` - Unified diff content to apply to the existing file. + Diff to apply. - `Path string` - Path of the file to update relative to the workspace root. + Path of the file to update. - `Type UpdateFile` - The operation type. Always `update_file`. + Update an existing file with the provided diff. - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `Status string` + - `Status BetaResponseApplyPatchToolCallStatus` The status of the apply patch tool call. One of `in_progress` or `completed`. - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` - `Type ApplyPatchCall` @@ -138066,11 +150425,7 @@ func main() { - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `ID string` - - The unique ID of the apply patch tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemApplyPatchCallAgent` + - `Agent BetaResponseApplyPatchToolCallAgent` The agent that produced this item. @@ -138078,19 +150433,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + - `Caller BetaResponseApplyPatchToolCallCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` - `CallerID string` @@ -138098,25 +150451,31 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `CreatedBy string` - The streamed output emitted by an apply patch tool call. + The ID of the entity that created this tool call. + + - `type BetaResponseApplyPatchToolCallOutput 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 string` + - `Status BetaResponseApplyPatchToolCallOutputStatus` The status of the apply patch tool call output. One of `completed` or `failed`. - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` - `Type ApplyPatchCallOutput` @@ -138124,11 +150483,7 @@ func main() { - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `ID string` - - The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - `Agent BetaResponseApplyPatchToolCallOutputAgent` The agent that produced this item. @@ -138136,19 +150491,17 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` The execution context that produced this tool call. - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` - `Type Direct` - The caller type. Always `direct`. - - `const DirectDirect Direct = "direct"` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` - `CallerID string` @@ -138156,15 +150509,17 @@ func main() { - `Type Program` - The caller type. Always `program`. - - `const ProgramProgram Program = "program"` + - `CreatedBy string` + + The ID of the entity that created this tool call output. + - `Output string` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + Optional textual output returned by the apply patch tool. - - `type BetaResponseInputItemMcpListTools struct{…}` + - `type BetaResponseItemMcpListTools struct{…}` A list of tools available on an MCP server. @@ -138176,7 +150531,7 @@ func main() { The label of the MCP server. - - `Tools []BetaResponseInputItemMcpListToolsTool` + - `Tools []BetaResponseItemMcpListToolsTool` The tools available on the server. @@ -138202,7 +150557,7 @@ func main() { - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `Agent BetaResponseInputItemMcpListToolsAgent` + - `Agent BetaResponseItemMcpListToolsAgent` The agent that produced this item. @@ -138214,7 +150569,7 @@ func main() { Error message if the server could not list tools. - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + - `type BetaResponseItemMcpApprovalRequest struct{…}` A request for human approval of a tool invocation. @@ -138240,7 +150595,7 @@ func main() { - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `Agent BetaResponseItemMcpApprovalRequestAgent` The agent that produced this item. @@ -138248,10 +150603,14 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - `type BetaResponseItemMcpApprovalResponse 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. @@ -138266,11 +150625,7 @@ func main() { - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `ID string` - - The unique ID of the approval response - - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `Agent BetaResponseItemMcpApprovalResponseAgent` The agent that produced this item. @@ -138282,7 +150637,7 @@ func main() { Optional reason for the decision. - - `type BetaResponseInputItemMcpCall struct{…}` + - `type BetaResponseItemMcpCall struct{…}` An invocation of a tool on an MCP server. @@ -138308,7 +150663,7 @@ func main() { - `const McpCallMcpCall McpCall = "mcp_call"` - - `Agent BetaResponseInputItemMcpCallAgent` + - `Agent BetaResponseItemMcpCallAgent` The agent that produced this item. @@ -138333,248 +150688,302 @@ func main() { The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` + - `const BetaResponseItemMcpCallStatusInProgress BetaResponseItemMcpCallStatus = "in_progress"` - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` + - `const BetaResponseItemMcpCallStatusCompleted BetaResponseItemMcpCallStatus = "completed"` - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + - `const BetaResponseItemMcpCallStatusIncomplete BetaResponseItemMcpCallStatus = "incomplete"` - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + - `const BetaResponseItemMcpCallStatusCalling BetaResponseItemMcpCallStatus = "calling"` - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + - `const BetaResponseItemMcpCallStatusFailed BetaResponseItemMcpCallStatus = "failed"` - - `type BetaResponseCustomToolCallOutput struct{…}` + - `type BetaResponseCustomToolCallItem 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 BetaResponseCustomToolCallItemStatusInProgress BetaResponseCustomToolCallItemStatus = "in_progress"` + + - `const BetaResponseCustomToolCallItemStatusCompleted BetaResponseCustomToolCallItemStatus = "completed"` + + - `const BetaResponseCustomToolCallItemStatusIncomplete BetaResponseCustomToolCallItemStatus = "incomplete"` + + - `CreatedBy string` + + The identifier of the actor that created the item. + + - `type BetaResponseCustomToolCallOutputItem struct{…}` The output of a custom tool call from your code, being sent back to the model. - - `CallID string` + - `ID string` - The call ID, used to map this custom tool call output to a custom tool call. + The unique ID of the custom tool call output item. - - `Output BetaResponseCustomToolCallOutputOutputUnion` + - `Status string` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `string` + - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` - Text, image, or file output of the custom tool call. + - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` - - `type BetaResponseInputText struct{…}` + - `CreatedBy string` - A text input to the model. + The identifier of the actor that created the item. - - `type BetaResponseInputImage struct{…}` + - `FirstID string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The ID of the first item in the list. - - `type BetaResponseInputFile struct{…}` + - `HasMore bool` - A file input to the model. + Whether there are more items available. - - `Type CustomToolCallOutput` + - `LastID string` - The type of the custom tool call output. Always `custom_tool_call_output`. + The ID of the last item in the list. - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `Object List` - - `ID string` + The type of object returned, must be `list`. - The unique ID of the custom tool call output in the OpenAI platform. + - `const ListList List = "list"` - - `Agent BetaResponseCustomToolCallOutputAgent` +# Input Tokens - The agent that produced this item. +## Get input token counts - - `AgentName string` +`client.Beta.Responses.InputTokens.Count(ctx, params) (*BetaResponseInputTokenCountResponse, error)` - The canonical name of the agent that produced this item. +**post** `/responses/input_tokens?beta=true` - - `Caller BetaResponseCustomToolCallOutputCallerUnion` +Returns input token counts of the request. - The execution context that produced this tool call. +Returns an object with `object` set to `response.input_tokens` and an `input_tokens` count. - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` +### Parameters - - `Type Direct` +- `params BetaResponseInputTokenCountParams` - The caller type. Always `direct`. + - `Conversation param.Field[BetaResponseInputTokenCountParamsConversationUnion]` - - `const DirectDirect Direct = "direct"` + Body param: The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. + Input items and output items from this response are automatically added to this conversation after this response completes. - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `string` - - `CallerID string` + - `type BetaResponseConversationParamResp struct{…}` - The call ID of the program item that produced this tool call. + The conversation that this response belongs to. - - `Type Program` + - `ID string` - The caller type. Always `program`. + The unique ID of the conversation. - - `const ProgramProgram Program = "program"` + - `Input param.Field[BetaResponseInputTokenCountParamsInputUnion]` - - `type BetaResponseCustomToolCall struct{…}` + Body param: Text, image, or file inputs to the model, used to generate a response - A call to a custom tool created by the model. + - `string` - - `CallID string` + - `type BetaResponseInputTokenCountParamsInputArray []BetaResponseInputItemUnion` - An identifier used to map this custom tool call to a tool call output. + A list of one or many input items to the model, containing different content types. - - `Input string` + - `type BetaEasyInputMessage struct{…}` - The input for the custom tool call generated by the model. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `Name string` + - `Content BetaEasyInputMessageContentUnion` - The name of the custom tool being called. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - - `Type CustomToolCall` + - `string` - The type of the custom tool call. Always `custom_tool_call`. + - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + A list of one or many input items to the model, containing different content + types. - - `ID string` + - `type BetaResponseInputText struct{…}` - The unique ID of the custom tool call in the OpenAI platform. + A text input to the model. - - `Agent BetaResponseCustomToolCallAgent` + - `Text string` - The agent that produced this item. + The text input to the model. - - `AgentName string` + - `Type InputText` - The canonical name of the agent that produced this item. + The type of the input item. Always `input_text`. - - `Caller BetaResponseCustomToolCallCallerUnion` + - `const InputTextInputText InputText = "input_text"` - The execution context that produced this tool call. + - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Type Direct` + - `Mode Explicit` - - `const DirectDirect Direct = "direct"` + The breakpoint mode. Always `explicit`. - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `const ExplicitExplicit Explicit = "explicit"` - - `CallerID string` + - `type BetaResponseInputImage struct{…}` - The call ID of the program item that produced this tool call. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `Type Program` + - `Detail BetaResponseInputImageDetail` - - `const ProgramProgram Program = "program"` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `Namespace string` + - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` - The namespace of the custom tool being called. + - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` - Compacts the current context. Must be the final input item. + - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` - - `Type CompactionTrigger` + - `Type InputImage` - The type of the item. Always `compaction_trigger`. + The type of the input item. Always `input_image`. - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `const InputImageInputImage InputImage = "input_image"` - - `Agent BetaResponseInputItemCompactionTriggerAgent` + - `FileID string` - The agent that produced this item. + The ID of the file to be sent to the model. - - `AgentName string` + - `ImageURL string` - The canonical name of the agent that produced this item. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `type BetaResponseInputItemItemReference struct{…}` + - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` - An internal identifier for an item to reference. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `ID string` + - `Mode Explicit` - The ID of the item to reference. + The breakpoint mode. Always `explicit`. - - `Agent BetaResponseInputItemItemReferenceAgent` + - `const ExplicitExplicit Explicit = "explicit"` - The agent that produced this item. + - `type BetaResponseInputFile struct{…}` - - `AgentName string` + A file input to the model. - The canonical name of the agent that produced this item. + - `Type InputFile` - - `Type string` + The type of the input item. Always `input_file`. - The type of item to reference. Always `item_reference`. + - `const InputFileInputFile InputFile = "input_file"` - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` + - `Detail BetaResponseInputFileDetail` - - `type BetaResponseInputItemProgram struct{…}` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `ID string` + - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` - The unique ID of this program item. + - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` - - `CallID string` + - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` - The stable call ID of the program item. + - `FileData string` - - `Code string` + The content of the file to be sent to the model. - The JavaScript source executed by programmatic tool calling. + - `FileID string` - - `Fingerprint string` + The ID of the file to be sent to the model. - Opaque program replay fingerprint that must be round-tripped. + - `FileURL string` - - `Type Program` + The URL of the file to be sent to the model. - The item type. Always `program`. + - `Filename string` - - `const ProgramProgram Program = "program"` + The name of the file to be sent to the model. - - `Agent BetaResponseInputItemProgramAgent` + - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` - The agent that produced this item. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `AgentName string` + - `Mode Explicit` - The canonical name of the agent that produced this item. + The breakpoint mode. Always `explicit`. - - `type BetaResponseInputItemProgramOutput struct{…}` + - `const ExplicitExplicit Explicit = "explicit"` - - `ID string` + - `Role BetaEasyInputMessageRole` - The unique ID of this program output item. + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - - `CallID string` + - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` - The call ID of the program item. + - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` - - `Result string` + - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` - The result produced by the program item. + - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` - - `Status string` + - `Phase BetaEasyInputMessagePhase` - The terminal status of the program output. + 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 BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + - `const BetaEasyInputMessagePhaseFinalAnswer BetaEasyInputMessagePhase = "final_answer"` - - `Type ProgramOutput` + - `Type BetaEasyInputMessageType` - The item type. Always `program_output`. + The type of the message input. Always `message`. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` - - `Agent BetaResponseInputItemProgramOutputAgent` + - `type BetaResponseInputItemMessage struct{…}` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + + - `Content BetaResponseInputMessageContentList` + + A list of one or many input items to the model, containing different content + types. + + - `Role string` + + The role of the message input. One of `user`, `system`, or `developer`. + + - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + + - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + + - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + + - `Agent BetaResponseInputItemMessageAgent` The agent that produced this item. @@ -138582,2542 +150991,2506 @@ func main() { The canonical name of the agent that produced this item. - - `Instructions string` + - `Status string` - A system (or developer) message inserted into the model's context. + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` - - `MaxOutputTokens int64` + - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` - - `MaxToolCalls int64` + - `Type string` - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + The type of the message input. Always set to `message`. - - `Metadata map[string, string]` + - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` - 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. + - `type BetaResponseOutputMessage struct{…}` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + An output message from the model. - - `Model BetaResponsesClientEventResponseCreateModel` + - `ID string` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + The unique ID of the output message. - - `BetaResponsesClientEventResponseCreateModel` + - `Content []BetaResponseOutputMessageContentUnion` - - `const BetaResponsesClientEventResponseCreateModelGPT5_6Sol BetaResponsesClientEventResponseCreateModel = "gpt-5.6-sol"` + The content of the output message. - - `const BetaResponsesClientEventResponseCreateModelGPT5_6Terra BetaResponsesClientEventResponseCreateModel = "gpt-5.6-terra"` + - `type BetaResponseOutputText struct{…}` - - `const BetaResponsesClientEventResponseCreateModelGPT5_6Luna BetaResponsesClientEventResponseCreateModel = "gpt-5.6-luna"` + A text output from the model. - - `const BetaResponsesClientEventResponseCreateModelGPT5_4 BetaResponsesClientEventResponseCreateModel = "gpt-5.4"` + - `Annotations []BetaResponseOutputTextAnnotationUnion` - - `const BetaResponsesClientEventResponseCreateModelGPT5_4Mini BetaResponsesClientEventResponseCreateModel = "gpt-5.4-mini"` + The annotations of the text output. - - `const BetaResponsesClientEventResponseCreateModelGPT5_4Nano BetaResponsesClientEventResponseCreateModel = "gpt-5.4-nano"` + - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` - - `const BetaResponsesClientEventResponseCreateModelGPT5_4Mini2026_03_17 BetaResponsesClientEventResponseCreateModel = "gpt-5.4-mini-2026-03-17"` + A citation to a file. - - `const BetaResponsesClientEventResponseCreateModelGPT5_4Nano2026_03_17 BetaResponsesClientEventResponseCreateModel = "gpt-5.4-nano-2026-03-17"` + - `FileID string` - - `const BetaResponsesClientEventResponseCreateModelGPT5_3ChatLatest BetaResponsesClientEventResponseCreateModel = "gpt-5.3-chat-latest"` + The ID of the file. - - `const BetaResponsesClientEventResponseCreateModelGPT5_2 BetaResponsesClientEventResponseCreateModel = "gpt-5.2"` + - `Filename string` - - `const BetaResponsesClientEventResponseCreateModelGPT5_2_2025_12_11 BetaResponsesClientEventResponseCreateModel = "gpt-5.2-2025-12-11"` + The filename of the file cited. - - `const BetaResponsesClientEventResponseCreateModelGPT5_2ChatLatest BetaResponsesClientEventResponseCreateModel = "gpt-5.2-chat-latest"` + - `Index int64` - - `const BetaResponsesClientEventResponseCreateModelGPT5_2Pro BetaResponsesClientEventResponseCreateModel = "gpt-5.2-pro"` + The index of the file in the list of files. - - `const BetaResponsesClientEventResponseCreateModelGPT5_2Pro2025_12_11 BetaResponsesClientEventResponseCreateModel = "gpt-5.2-pro-2025-12-11"` + - `Type FileCitation` - - `const BetaResponsesClientEventResponseCreateModelGPT5_1 BetaResponsesClientEventResponseCreateModel = "gpt-5.1"` + The type of the file citation. Always `file_citation`. - - `const BetaResponsesClientEventResponseCreateModelGPT5_1_2025_11_13 BetaResponsesClientEventResponseCreateModel = "gpt-5.1-2025-11-13"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaResponsesClientEventResponseCreateModelGPT5_1Codex BetaResponsesClientEventResponseCreateModel = "gpt-5.1-codex"` + - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` - - `const BetaResponsesClientEventResponseCreateModelGPT5_1Mini BetaResponsesClientEventResponseCreateModel = "gpt-5.1-mini"` + A citation for a web resource used to generate a model response. - - `const BetaResponsesClientEventResponseCreateModelGPT5_1ChatLatest BetaResponsesClientEventResponseCreateModel = "gpt-5.1-chat-latest"` + - `EndIndex int64` - - `const BetaResponsesClientEventResponseCreateModelGPT5 BetaResponsesClientEventResponseCreateModel = "gpt-5"` + The index of the last character of the URL citation in the message. - - `const BetaResponsesClientEventResponseCreateModelGPT5Mini BetaResponsesClientEventResponseCreateModel = "gpt-5-mini"` + - `StartIndex int64` - - `const BetaResponsesClientEventResponseCreateModelGPT5Nano BetaResponsesClientEventResponseCreateModel = "gpt-5-nano"` + The index of the first character of the URL citation in the message. - - `const BetaResponsesClientEventResponseCreateModelGPT5_2025_08_07 BetaResponsesClientEventResponseCreateModel = "gpt-5-2025-08-07"` + - `Title string` - - `const BetaResponsesClientEventResponseCreateModelGPT5Mini2025_08_07 BetaResponsesClientEventResponseCreateModel = "gpt-5-mini-2025-08-07"` + The title of the web resource. - - `const BetaResponsesClientEventResponseCreateModelGPT5Nano2025_08_07 BetaResponsesClientEventResponseCreateModel = "gpt-5-nano-2025-08-07"` + - `Type URLCitation` - - `const BetaResponsesClientEventResponseCreateModelGPT5ChatLatest BetaResponsesClientEventResponseCreateModel = "gpt-5-chat-latest"` + The type of the URL citation. Always `url_citation`. - - `const BetaResponsesClientEventResponseCreateModelGPT4_1 BetaResponsesClientEventResponseCreateModel = "gpt-4.1"` + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `const BetaResponsesClientEventResponseCreateModelGPT4_1Mini BetaResponsesClientEventResponseCreateModel = "gpt-4.1-mini"` + - `URL string` - - `const BetaResponsesClientEventResponseCreateModelGPT4_1Nano BetaResponsesClientEventResponseCreateModel = "gpt-4.1-nano"` + The URL of the web resource. - - `const BetaResponsesClientEventResponseCreateModelGPT4_1_2025_04_14 BetaResponsesClientEventResponseCreateModel = "gpt-4.1-2025-04-14"` + - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` - - `const BetaResponsesClientEventResponseCreateModelGPT4_1Mini2025_04_14 BetaResponsesClientEventResponseCreateModel = "gpt-4.1-mini-2025-04-14"` + A citation for a container file used to generate a model response. - - `const BetaResponsesClientEventResponseCreateModelGPT4_1Nano2025_04_14 BetaResponsesClientEventResponseCreateModel = "gpt-4.1-nano-2025-04-14"` + - `ContainerID string` - - `const BetaResponsesClientEventResponseCreateModelO4Mini BetaResponsesClientEventResponseCreateModel = "o4-mini"` + The ID of the container file. - - `const BetaResponsesClientEventResponseCreateModelO4Mini2025_04_16 BetaResponsesClientEventResponseCreateModel = "o4-mini-2025-04-16"` + - `EndIndex int64` - - `const BetaResponsesClientEventResponseCreateModelO3 BetaResponsesClientEventResponseCreateModel = "o3"` + The index of the last character of the container file citation in the message. - - `const BetaResponsesClientEventResponseCreateModelO3_2025_04_16 BetaResponsesClientEventResponseCreateModel = "o3-2025-04-16"` + - `FileID string` - - `const BetaResponsesClientEventResponseCreateModelO3Mini BetaResponsesClientEventResponseCreateModel = "o3-mini"` + The ID of the file. - - `const BetaResponsesClientEventResponseCreateModelO3Mini2025_01_31 BetaResponsesClientEventResponseCreateModel = "o3-mini-2025-01-31"` + - `Filename string` - - `const BetaResponsesClientEventResponseCreateModelO1 BetaResponsesClientEventResponseCreateModel = "o1"` + The filename of the container file cited. - - `const BetaResponsesClientEventResponseCreateModelO1_2024_12_17 BetaResponsesClientEventResponseCreateModel = "o1-2024-12-17"` + - `StartIndex int64` - - `const BetaResponsesClientEventResponseCreateModelO1Preview BetaResponsesClientEventResponseCreateModel = "o1-preview"` + The index of the first character of the container file citation in the message. - - `const BetaResponsesClientEventResponseCreateModelO1Preview2024_09_12 BetaResponsesClientEventResponseCreateModel = "o1-preview-2024-09-12"` + - `Type ContainerFileCitation` - - `const BetaResponsesClientEventResponseCreateModelO1Mini BetaResponsesClientEventResponseCreateModel = "o1-mini"` + The type of the container file citation. Always `container_file_citation`. - - `const BetaResponsesClientEventResponseCreateModelO1Mini2024_09_12 BetaResponsesClientEventResponseCreateModel = "o1-mini-2024-09-12"` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - - `const BetaResponsesClientEventResponseCreateModelGPT4o BetaResponsesClientEventResponseCreateModel = "gpt-4o"` + - `type BetaResponseOutputTextAnnotationFilePath struct{…}` - - `const BetaResponsesClientEventResponseCreateModelGPT4o2024_11_20 BetaResponsesClientEventResponseCreateModel = "gpt-4o-2024-11-20"` + A path to a file. - - `const BetaResponsesClientEventResponseCreateModelGPT4o2024_08_06 BetaResponsesClientEventResponseCreateModel = "gpt-4o-2024-08-06"` + - `FileID string` - - `const BetaResponsesClientEventResponseCreateModelGPT4o2024_05_13 BetaResponsesClientEventResponseCreateModel = "gpt-4o-2024-05-13"` + The ID of the file. - - `const BetaResponsesClientEventResponseCreateModelGPT4oAudioPreview BetaResponsesClientEventResponseCreateModel = "gpt-4o-audio-preview"` + - `Index int64` - - `const BetaResponsesClientEventResponseCreateModelGPT4oAudioPreview2024_10_01 BetaResponsesClientEventResponseCreateModel = "gpt-4o-audio-preview-2024-10-01"` + The index of the file in the list of files. - - `const BetaResponsesClientEventResponseCreateModelGPT4oAudioPreview2024_12_17 BetaResponsesClientEventResponseCreateModel = "gpt-4o-audio-preview-2024-12-17"` + - `Type FilePath` - - `const BetaResponsesClientEventResponseCreateModelGPT4oAudioPreview2025_06_03 BetaResponsesClientEventResponseCreateModel = "gpt-4o-audio-preview-2025-06-03"` + The type of the file path. Always `file_path`. - - `const BetaResponsesClientEventResponseCreateModelGPT4oMiniAudioPreview BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-audio-preview"` + - `const FilePathFilePath FilePath = "file_path"` - - `const BetaResponsesClientEventResponseCreateModelGPT4oMiniAudioPreview2024_12_17 BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `Text string` - - `const BetaResponsesClientEventResponseCreateModelGPT4oSearchPreview BetaResponsesClientEventResponseCreateModel = "gpt-4o-search-preview"` + The text output from the model. - - `const BetaResponsesClientEventResponseCreateModelGPT4oMiniSearchPreview BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-search-preview"` + - `Type OutputText` - - `const BetaResponsesClientEventResponseCreateModelGPT4oSearchPreview2025_03_11 BetaResponsesClientEventResponseCreateModel = "gpt-4o-search-preview-2025-03-11"` + The type of the output text. Always `output_text`. - - `const BetaResponsesClientEventResponseCreateModelGPT4oMiniSearchPreview2025_03_11 BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `const OutputTextOutputText OutputText = "output_text"` - - `const BetaResponsesClientEventResponseCreateModelChatgpt4oLatest BetaResponsesClientEventResponseCreateModel = "chatgpt-4o-latest"` + - `Logprobs []BetaResponseOutputTextLogprob` - - `const BetaResponsesClientEventResponseCreateModelCodexMiniLatest BetaResponsesClientEventResponseCreateModel = "codex-mini-latest"` + - `Token string` - - `const BetaResponsesClientEventResponseCreateModelGPT4oMini BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini"` + - `Bytes []int64` - - `const BetaResponsesClientEventResponseCreateModelGPT4oMini2024_07_18 BetaResponsesClientEventResponseCreateModel = "gpt-4o-mini-2024-07-18"` + - `Logprob float64` - - `const BetaResponsesClientEventResponseCreateModelGPT4Turbo BetaResponsesClientEventResponseCreateModel = "gpt-4-turbo"` + - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` - - `const BetaResponsesClientEventResponseCreateModelGPT4Turbo2024_04_09 BetaResponsesClientEventResponseCreateModel = "gpt-4-turbo-2024-04-09"` + - `Token string` - - `const BetaResponsesClientEventResponseCreateModelGPT4_0125Preview BetaResponsesClientEventResponseCreateModel = "gpt-4-0125-preview"` + - `Bytes []int64` - - `const BetaResponsesClientEventResponseCreateModelGPT4TurboPreview BetaResponsesClientEventResponseCreateModel = "gpt-4-turbo-preview"` + - `Logprob float64` - - `const BetaResponsesClientEventResponseCreateModelGPT4_1106Preview BetaResponsesClientEventResponseCreateModel = "gpt-4-1106-preview"` + - `type BetaResponseOutputRefusal struct{…}` - - `const BetaResponsesClientEventResponseCreateModelGPT4VisionPreview BetaResponsesClientEventResponseCreateModel = "gpt-4-vision-preview"` + A refusal from the model. - - `const BetaResponsesClientEventResponseCreateModelGPT4 BetaResponsesClientEventResponseCreateModel = "gpt-4"` + - `Refusal string` - - `const BetaResponsesClientEventResponseCreateModelGPT4_0314 BetaResponsesClientEventResponseCreateModel = "gpt-4-0314"` + The refusal explanation from the model. - - `const BetaResponsesClientEventResponseCreateModelGPT4_0613 BetaResponsesClientEventResponseCreateModel = "gpt-4-0613"` + - `Type Refusal` - - `const BetaResponsesClientEventResponseCreateModelGPT4_32k BetaResponsesClientEventResponseCreateModel = "gpt-4-32k"` + The type of the refusal. Always `refusal`. - - `const BetaResponsesClientEventResponseCreateModelGPT4_32k0314 BetaResponsesClientEventResponseCreateModel = "gpt-4-32k-0314"` + - `const RefusalRefusal Refusal = "refusal"` - - `const BetaResponsesClientEventResponseCreateModelGPT4_32k0613 BetaResponsesClientEventResponseCreateModel = "gpt-4-32k-0613"` + - `Role Assistant` - - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo"` + The role of the output message. Always `assistant`. - - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo16k BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-16k"` + - `const AssistantAssistant Assistant = "assistant"` - - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo0301 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-0301"` + - `Status BetaResponseOutputMessageStatus` - - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo0613 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-0613"` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo1106 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-1106"` + - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` - - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo0125 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-0125"` + - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` - - `const BetaResponsesClientEventResponseCreateModelGPT3_5Turbo16k0613 BetaResponsesClientEventResponseCreateModel = "gpt-3.5-turbo-16k-0613"` + - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` - - `const BetaResponsesClientEventResponseCreateModelO1Pro BetaResponsesClientEventResponseCreateModel = "o1-pro"` + - `Type Message` - - `const BetaResponsesClientEventResponseCreateModelO1Pro2025_03_19 BetaResponsesClientEventResponseCreateModel = "o1-pro-2025-03-19"` + The type of the output message. Always `message`. - - `const BetaResponsesClientEventResponseCreateModelO3Pro BetaResponsesClientEventResponseCreateModel = "o3-pro"` + - `const MessageMessage Message = "message"` - - `const BetaResponsesClientEventResponseCreateModelO3Pro2025_06_10 BetaResponsesClientEventResponseCreateModel = "o3-pro-2025-06-10"` + - `Agent BetaResponseOutputMessageAgent` - - `const BetaResponsesClientEventResponseCreateModelO3DeepResearch BetaResponsesClientEventResponseCreateModel = "o3-deep-research"` + The agent that produced this item. - - `const BetaResponsesClientEventResponseCreateModelO3DeepResearch2025_06_26 BetaResponsesClientEventResponseCreateModel = "o3-deep-research-2025-06-26"` + - `AgentName string` - - `const BetaResponsesClientEventResponseCreateModelO4MiniDeepResearch BetaResponsesClientEventResponseCreateModel = "o4-mini-deep-research"` + The canonical name of the agent that produced this item. - - `const BetaResponsesClientEventResponseCreateModelO4MiniDeepResearch2025_06_26 BetaResponsesClientEventResponseCreateModel = "o4-mini-deep-research-2025-06-26"` + - `Phase BetaResponseOutputMessagePhase` - - `const BetaResponsesClientEventResponseCreateModelComputerUsePreview BetaResponsesClientEventResponseCreateModel = "computer-use-preview"` + 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 BetaResponsesClientEventResponseCreateModelComputerUsePreview2025_03_11 BetaResponsesClientEventResponseCreateModel = "computer-use-preview-2025-03-11"` + - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` - - `const BetaResponsesClientEventResponseCreateModelGPT5Codex BetaResponsesClientEventResponseCreateModel = "gpt-5-codex"` + - `const BetaResponseOutputMessagePhaseFinalAnswer BetaResponseOutputMessagePhase = "final_answer"` - - `const BetaResponsesClientEventResponseCreateModelGPT5Pro BetaResponsesClientEventResponseCreateModel = "gpt-5-pro"` + - `type BetaResponseFileSearchToolCall struct{…}` - - `const BetaResponsesClientEventResponseCreateModelGPT5Pro2025_10_06 BetaResponsesClientEventResponseCreateModel = "gpt-5-pro-2025-10-06"` + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - - `const BetaResponsesClientEventResponseCreateModelGPT5_1CodexMax BetaResponsesClientEventResponseCreateModel = "gpt-5.1-codex-max"` + - `ID string` - - `string` + The unique ID of the file search tool call. - - `Moderation BetaResponsesClientEventResponseCreateModeration` + - `Queries []string` - Configuration for running moderation on the input and output of this response. + The queries used to search for files. - - `Model string` + - `Status BetaResponseFileSearchToolCallStatus` - The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `Policy BetaResponsesClientEventResponseCreateModerationPolicy` + - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` - The policy to apply to moderated response input and output. + - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` - - `Input BetaResponsesClientEventResponseCreateModerationPolicyInput` + - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` - The moderation policy for the response input. + - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` - - `Mode string` + - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` - - `const BetaResponsesClientEventResponseCreateModerationPolicyInputModeScore BetaResponsesClientEventResponseCreateModerationPolicyInputMode = "score"` + - `Type FileSearchCall` - - `const BetaResponsesClientEventResponseCreateModerationPolicyInputModeBlock BetaResponsesClientEventResponseCreateModerationPolicyInputMode = "block"` + The type of the file search tool call. Always `file_search_call`. - - `Output BetaResponsesClientEventResponseCreateModerationPolicyOutput` + - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` - The moderation policy for the response output. + - `Agent BetaResponseFileSearchToolCallAgent` - - `Mode string` + The agent that produced this item. - - `const BetaResponsesClientEventResponseCreateModerationPolicyOutputModeScore BetaResponsesClientEventResponseCreateModerationPolicyOutputMode = "score"` + - `AgentName string` - - `const BetaResponsesClientEventResponseCreateModerationPolicyOutputModeBlock BetaResponsesClientEventResponseCreateModerationPolicyOutputMode = "block"` + The canonical name of the agent that produced this item. - - `MultiAgent BetaResponsesClientEventResponseCreateMultiAgent` + - `Results []BetaResponseFileSearchToolCallResult` - Configuration for server-hosted multi-agent execution. + The results of the file search tool call. - - `Enabled bool` + - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` - Whether to enable server-hosted multi-agent execution for this response. + 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. - - `MaxConcurrentSubagents int64` + - `string` - `max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent. - The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run. + - `float64` - - `ParallelToolCalls bool` + - `bool` - Whether to allow the model to run tool calls in parallel. + - `FileID string` - - `PreviousResponseID string` + The unique ID of the file. - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + - `Filename string` - - `Prompt BetaResponsePrompt` + The name of the file. - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + - `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 BetaResponseComputerToolCall struct{…}` + + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - `ID string` - The unique identifier of the prompt template to use. + The unique ID of the computer call. - - `Variables map[string, BetaResponsePromptVariableUnion]` + - `CallID string` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + An identifier used when responding to the tool call with output. - - `string` + - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` - - `type BetaResponseInputText struct{…}` + The pending safety checks for the computer call. - A text input to the model. + - `ID string` - - `type BetaResponseInputImage struct{…}` + The ID of the pending safety check. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Code string` - - `type BetaResponseInputFile struct{…}` + The type of the pending safety check. - A file input to the model. + - `Message string` - - `Version string` + Details about the pending safety check. - Optional version of the prompt template. + - `Status BetaResponseComputerToolCallStatus` - - `PromptCacheKey string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` - - `PromptCacheOptions BetaResponsesClientEventResponseCreatePromptCacheOptions` + - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` - Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details. + - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` - - `Mode string` + - `Type BetaResponseComputerToolCallType` - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. + The type of the computer call. Always `computer_call`. - - `const BetaResponsesClientEventResponseCreatePromptCacheOptionsModeImplicit BetaResponsesClientEventResponseCreatePromptCacheOptionsMode = "implicit"` + - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` - - `const BetaResponsesClientEventResponseCreatePromptCacheOptionsModeExplicit BetaResponsesClientEventResponseCreatePromptCacheOptionsMode = "explicit"` + - `Action BetaComputerActionUnion` - - `Ttl string` + A click action. - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. + - `type BetaComputerActionClick struct{…}` - - `const BetaResponsesClientEventResponseCreatePromptCacheOptionsTtl30m BetaResponsesClientEventResponseCreatePromptCacheOptionsTtl = "30m"` + A click action. - - `PromptCacheRetention string` + - `Button string` - Deprecated. Use `prompt_cache_options.ttl` instead. + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` - - `const BetaResponsesClientEventResponseCreatePromptCacheRetentionInMemory BetaResponsesClientEventResponseCreatePromptCacheRetention = "in_memory"` + - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` - - `const BetaResponsesClientEventResponseCreatePromptCacheRetention24h BetaResponsesClientEventResponseCreatePromptCacheRetention = "24h"` + - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` - - `Reasoning BetaResponsesClientEventResponseCreateReasoning` + - `Type Click` - **gpt-5 and o-series models only** + Specifies the event type. For a click action, this property is always `click`. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `const ClickClick Click = "click"` - - `Context string` + - `X int64` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + The x-coordinate where the click occurred. - - `const BetaResponsesClientEventResponseCreateReasoningContextAuto BetaResponsesClientEventResponseCreateReasoningContext = "auto"` + - `Y int64` - - `const BetaResponsesClientEventResponseCreateReasoningContextCurrentTurn BetaResponsesClientEventResponseCreateReasoningContext = "current_turn"` + The y-coordinate where the click occurred. - - `const BetaResponsesClientEventResponseCreateReasoningContextAllTurns BetaResponsesClientEventResponseCreateReasoningContext = "all_turns"` + - `Keys []string` - - `Effort string` + The keys being held while clicking. - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `type BetaComputerActionDoubleClick struct{…}` - - `const BetaResponsesClientEventResponseCreateReasoningEffortNone BetaResponsesClientEventResponseCreateReasoningEffort = "none"` + A double click action. - - `const BetaResponsesClientEventResponseCreateReasoningEffortMinimal BetaResponsesClientEventResponseCreateReasoningEffort = "minimal"` + - `Keys []string` - - `const BetaResponsesClientEventResponseCreateReasoningEffortLow BetaResponsesClientEventResponseCreateReasoningEffort = "low"` + The keys being held while double-clicking. - - `const BetaResponsesClientEventResponseCreateReasoningEffortMedium BetaResponsesClientEventResponseCreateReasoningEffort = "medium"` + - `Type DoubleClick` - - `const BetaResponsesClientEventResponseCreateReasoningEffortHigh BetaResponsesClientEventResponseCreateReasoningEffort = "high"` + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `const BetaResponsesClientEventResponseCreateReasoningEffortXhigh BetaResponsesClientEventResponseCreateReasoningEffort = "xhigh"` + - `const DoubleClickDoubleClick DoubleClick = "double_click"` - - `const BetaResponsesClientEventResponseCreateReasoningEffortMax BetaResponsesClientEventResponseCreateReasoningEffort = "max"` + - `X int64` - - `GenerateSummary string` + The x-coordinate where the double click occurred. - **Deprecated:** use `summary` instead. + - `Y int64` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + The y-coordinate where the double click occurred. - - `const BetaResponsesClientEventResponseCreateReasoningGenerateSummaryAuto BetaResponsesClientEventResponseCreateReasoningGenerateSummary = "auto"` + - `type BetaComputerActionDrag struct{…}` - - `const BetaResponsesClientEventResponseCreateReasoningGenerateSummaryConcise BetaResponsesClientEventResponseCreateReasoningGenerateSummary = "concise"` + A drag action. - - `const BetaResponsesClientEventResponseCreateReasoningGenerateSummaryDetailed BetaResponsesClientEventResponseCreateReasoningGenerateSummary = "detailed"` + - `Path []BetaComputerActionDragPath` - - `Mode string` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - Controls the reasoning execution mode for the request. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - When returned on a response, this is the effective execution mode. + - `X int64` - - `string` + The x-coordinate. - - `string` + - `Y int64` - - `const BetaResponsesClientEventResponseCreateReasoningModeStandard BetaResponsesClientEventResponseCreateReasoningMode = "standard"` + The y-coordinate. - - `const BetaResponsesClientEventResponseCreateReasoningModePro BetaResponsesClientEventResponseCreateReasoningMode = "pro"` + - `Type Drag` - - `Summary string` + Specifies the event type. For a drag action, this property is always set to `drag`. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `const DragDrag Drag = "drag"` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `Keys []string` - - `const BetaResponsesClientEventResponseCreateReasoningSummaryAuto BetaResponsesClientEventResponseCreateReasoningSummary = "auto"` + The keys being held while dragging the mouse. - - `const BetaResponsesClientEventResponseCreateReasoningSummaryConcise BetaResponsesClientEventResponseCreateReasoningSummary = "concise"` + - `type BetaComputerActionKeypress struct{…}` - - `const BetaResponsesClientEventResponseCreateReasoningSummaryDetailed BetaResponsesClientEventResponseCreateReasoningSummary = "detailed"` + A collection of keypresses the model would like to perform. - - `SafetyIdentifier string` + - `Keys []string` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - - `ServiceTier string` + - `Type Keypress` - Specifies the processing type used for serving the request. + Specifies the event type. For a keypress action, this property is always set to `keypress`. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `const KeypressKeypress Keypress = "keypress"` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + - `type BetaComputerActionMove struct{…}` - - `const BetaResponsesClientEventResponseCreateServiceTierAuto BetaResponsesClientEventResponseCreateServiceTier = "auto"` + A mouse move action. - - `const BetaResponsesClientEventResponseCreateServiceTierDefault BetaResponsesClientEventResponseCreateServiceTier = "default"` + - `Type Move` - - `const BetaResponsesClientEventResponseCreateServiceTierFlex BetaResponsesClientEventResponseCreateServiceTier = "flex"` + Specifies the event type. For a move action, this property is always set to `move`. - - `const BetaResponsesClientEventResponseCreateServiceTierScale BetaResponsesClientEventResponseCreateServiceTier = "scale"` + - `const MoveMove Move = "move"` - - `const BetaResponsesClientEventResponseCreateServiceTierPriority BetaResponsesClientEventResponseCreateServiceTier = "priority"` + - `X int64` - - `Store bool` + The x-coordinate to move to. - Whether to store the generated model response for later retrieval via - API. + - `Y int64` - - `Stream bool` + The y-coordinate to move to. - If set to true, the model response data will be streamed to the client - as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). - See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) - for more information. + - `Keys []string` - - `StreamOptions BetaResponsesClientEventResponseCreateStreamOptions` + The keys being held while moving the mouse. - Options for streaming responses. Only set this when you set `stream: true`. + - `type BetaComputerActionScreenshot struct{…}` - - `IncludeObfuscation bool` + A screenshot action. - When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events to - normalize payload sizes as a mitigation to certain side-channel attacks. - These obfuscation fields are included by default, but add a small amount - of overhead to the data stream. You can set `include_obfuscation` to - false to optimize for bandwidth if you trust the network links between - your application and the OpenAI API. + - `Type Screenshot` - - `Temperature float64` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `const ScreenshotScreenshot Screenshot = "screenshot"` - - `Text BetaResponseTextConfig` + - `type BetaComputerActionScroll struct{…}` - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + A scroll action. - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `ScrollX int64` - - `Format BetaResponseFormatTextConfigUnion` + The horizontal scroll distance. - An object specifying the format that the model must output. + - `ScrollY int64` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The vertical scroll distance. - The default format is `{ "type": "text" }` with no additional options. + - `Type Scroll` - **Not recommended for gpt-4o and newer models:** + Specifies the event type. For a scroll action, this property is always set to `scroll`. - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `const ScrollScroll Scroll = "scroll"` - - `type BetaResponseFormatTextConfigText struct{…}` + - `X int64` - Default response format. Used to generate text responses. + The x-coordinate where the scroll occurred. - - `Type Text` + - `Y int64` - The type of response format being defined. Always `text`. + The y-coordinate where the scroll occurred. - - `const TextText Text = "text"` + - `Keys []string` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + The keys being held while scrolling. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `type BetaComputerActionType struct{…}` - - `Name string` + An action to type in text. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `Text string` - - `Schema map[string, any]` + The text to type. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `Type Type` - - `Type JSONSchema` + Specifies the event type. For a type action, this property is always set to `type`. - The type of response format being defined. Always `json_schema`. + - `const TypeType Type = "type"` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + - `type BetaComputerActionWait struct{…}` - - `Description string` + A wait action. - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `Type Wait` - - `Strict bool` + Specifies the event type. For a wait action, this property is always set to `wait`. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const WaitWait Wait = "wait"` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + - `Actions BetaComputerActionList` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `Type JSONObject` + - `type BetaComputerActionClick struct{…}` - The type of response format being defined. Always `json_object`. + A click action. - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `type BetaComputerActionDoubleClick struct{…}` - - `Verbosity BetaResponseTextConfigVerbosity` + A double click action. - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + - `type BetaComputerActionDrag struct{…}` - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + A drag action. - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + - `type BetaComputerActionKeypress struct{…}` - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + A collection of keypresses the model would like to perform. - - `ToolChoice BetaResponsesClientEventResponseCreateToolChoiceUnion` + - `type BetaComputerActionMove struct{…}` - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + A mouse move action. - - `type BetaToolChoiceOptions string` + - `type BetaComputerActionScreenshot struct{…}` - Controls which (if any) tool is called by the model. + A screenshot action. - `none` means the model will not call any tool and instead generates a message. + - `type BetaComputerActionScroll struct{…}` - `auto` means the model can pick between generating a message or calling one or - more tools. + A scroll action. - `required` means the model must call one or more tools. + - `type BetaComputerActionType struct{…}` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + An action to type in text. - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + - `type BetaComputerActionWait struct{…}` - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + A wait action. - - `type BetaToolChoiceAllowed struct{…}` + - `Agent BetaResponseComputerToolCallAgent` - Constrains the tools available to the model to a pre-defined set. + The agent that produced this item. - - `Mode BetaToolChoiceAllowedMode` + - `AgentName string` - Constrains the tools available to the model to a pre-defined set. + The canonical name of the agent that produced this item. - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `type BetaResponseInputItemComputerCallOutput struct{…}` - `required` requires the model to call one or more of the allowed tools. + The output of a computer tool call. - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + - `CallID string` - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + The ID of the computer tool call that produced the output. - - `Tools []map[string, any]` + - `Output BetaResponseComputerToolCallOutputScreenshot` - A list of tool definitions that the model should be allowed to call. + A computer screenshot image used with the computer use tool. - For the Responses API, the list of tool definitions might look like: + - `Type ComputerScreenshot` - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `Type AllowedTools` + - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` - Allowed tool configuration type. Always `allowed_tools`. + - `FileID string` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + The identifier of an uploaded file that contains the screenshot. - - `type BetaToolChoiceTypes struct{…}` + - `ImageURL string` - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + The URL of the screenshot image. - - `Type BetaToolChoiceTypesType` + - `Type ComputerCallOutput` - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + The type of the computer tool call output. Always `computer_call_output`. - Allowed values are: + - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + - `ID string` + + The ID of the computer tool call output. + + - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + + The safety checks reported by the API that have been acknowledged by the developer. + + - `ID string` - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + The ID of the pending safety check. - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + - `Code string` - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + The type of the pending safety check. - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `Message string` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + Details about the pending safety check. - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `Agent BetaResponseInputItemComputerCallOutputAgent` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + The agent that produced this item. - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `AgentName string` - - `type BetaToolChoiceFunction struct{…}` + The canonical name of the agent that produced this item. - Use this option to force the model to call a specific function. + - `Status string` - - `Name string` + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - The name of the function to call. + - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` - - `Type Function` + - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` - For function calling, the type is always `function`. + - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` - - `const FunctionFunction Function = "function"` + - `type BetaResponseFunctionWebSearch struct{…}` - - `type BetaToolChoiceMcp struct{…}` + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - Use this option to force the model to call a specific tool on a remote MCP server. + - `ID string` - - `ServerLabel string` + The unique ID of the web search tool call. - The label of the MCP server to use. + - `Action BetaResponseFunctionWebSearchActionUnion` - - `Type Mcp` + 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). - For MCP tools, the type is always `mcp`. + - `type BetaResponseFunctionWebSearchActionSearch struct{…}` - - `const McpMcp Mcp = "mcp"` + Action type "search" - Performs a web search query. - - `Name string` + - `Type Search` - The name of the tool to call on the server. + The action type. - - `type BetaToolChoiceCustom struct{…}` + - `const SearchSearch Search = "search"` - Use this option to force the model to call a specific custom tool. + - `Queries []string` - - `Name string` + The search queries. - The name of the custom tool to call. + - `Query string` - - `Type Custom` + The search query. - For custom tool calling, the type is always `custom`. + - `Sources []BetaResponseFunctionWebSearchActionSearchSource` - - `const CustomCustom Custom = "custom"` + The sources used in the search. - - `BetaResponsesClientEventResponseCreateToolChoiceBetaSpecificProgrammaticToolCallingParam` + - `Type URL` - - `Type ProgrammaticToolCalling` + The type of source. Always `url`. - The tool to call. Always `programmatic_tool_calling`. + - `const URLURL URL = "url"` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `URL string` - - `type BetaToolChoiceApplyPatch struct{…}` + The URL of the source. - Forces the model to call the apply_patch tool when executing a tool call. + - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` - - `Type ApplyPatch` + Action type "open_page" - Opens a specific URL from search results. - The tool to call. Always `apply_patch`. + - `Type OpenPage` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + The action type. - - `type BetaToolChoiceShell struct{…}` + - `const OpenPageOpenPage OpenPage = "open_page"` - Forces the model to call the shell tool when a tool call is required. + - `URL string` - - `Type Shell` + The URL opened by the model. - The tool to call. Always `shell`. + - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` - - `const ShellShell Shell = "shell"` + Action type "find_in_page": Searches for a pattern within a loaded page. - - `Tools []BetaToolUnion` + - `Pattern string` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + The pattern or text to search for within the page. - We support the following categories of tools: + - `Type FindInPage` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + The action type. - - `type BetaFunctionTool struct{…}` + - `const FindInPageFindInPage FindInPage = "find_in_page"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `URL string` - - `type BetaFileSearchTool struct{…}` + The URL of the page searched for the pattern. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `Status BetaResponseFunctionWebSearchStatus` - - `type BetaComputerTool struct{…}` + The status of the web search tool call. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` - - `type BetaComputerUsePreviewTool struct{…}` + - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` - - `type BetaWebSearchTool struct{…}` + - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Type WebSearchCall` - - `type BetaToolMcp struct{…}` + The type of the web search tool call. Always `web_search_call`. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` - - `type BetaToolCodeInterpreter struct{…}` + - `Agent BetaResponseFunctionWebSearchAgent` - A tool that runs Python code to help generate a response to a prompt. + The agent that produced this item. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `AgentName string` - - `type BetaToolImageGeneration struct{…}` + The canonical name of the agent that produced this item. - A tool that generates images using the GPT image models. + - `type BetaResponseFunctionToolCall struct{…}` - - `type BetaToolLocalShell struct{…}` + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - A tool that allows the model to execute shell commands in a local environment. + - `Arguments string` - - `type BetaFunctionShellTool struct{…}` + A JSON string of the arguments to pass to the function. - A tool that allows the model to execute shell commands. + - `CallID string` - - `type BetaCustomTool struct{…}` + The unique ID of the function tool call generated by the model. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Name string` - - `type BetaNamespaceTool struct{…}` + The name of the function to run. - Groups function/custom tools under a shared namespace. + - `Type FunctionCall` - - `type BetaToolSearchTool struct{…}` + The type of the function tool call. Always `function_call`. - Hosted or BYOT tool search configuration for deferred tools. + - `const FunctionCallFunctionCall FunctionCall = "function_call"` - - `type BetaWebSearchPreviewTool struct{…}` + - `ID string` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The unique ID of the function tool call. - - `type BetaApplyPatchTool struct{…}` + - `Agent BetaResponseFunctionToolCallAgent` - Allows the assistant to create, delete, or update files using unified diffs. + The agent that produced this item. - - `TopLogprobs int64` + - `AgentName string` - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + The canonical name of the agent that produced this item. - - `TopP float64` + - `Caller BetaResponseFunctionToolCallCallerUnion` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + The execution context that produced this tool call. - We generally recommend altering this or `temperature` but not both. + - `type BetaResponseFunctionToolCallCallerDirect struct{…}` - - `Truncation string` + - `Type Direct` - The truncation strategy to use for the model response. + - `const DirectDirect Direct = "direct"` - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `type BetaResponseFunctionToolCallCallerProgram struct{…}` - - `const BetaResponsesClientEventResponseCreateTruncationAuto BetaResponsesClientEventResponseCreateTruncation = "auto"` + - `CallerID string` - - `const BetaResponsesClientEventResponseCreateTruncationDisabled BetaResponsesClientEventResponseCreateTruncation = "disabled"` + The call ID of the program item that produced this tool call. - - `User string` + - `Type Program` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + - `const ProgramProgram Program = "program"` - - `BetaResponsesClientEventResponseInject` + - `Namespace string` - - `Input []BetaResponseInputItemUnion` + The namespace of the function to run. - Input items to inject into the active response. + - `Status BetaResponseFunctionToolCallStatus` - - `type BetaEasyInputMessage struct{…}` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` - - `type BetaResponseInputItemMessage struct{…}` + - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` - - `type BetaResponseOutputMessage struct{…}` + - `type BetaResponseInputItemFunctionCallOutput struct{…}` - An output message from the model. + The output of a function tool call. - - `type BetaResponseFileSearchToolCall struct{…}` + - `CallID string` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The unique ID of the function tool call generated by the model. - - `type BetaResponseComputerToolCall struct{…}` + - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + Text, image, or file output of the function tool call. - - `type BetaResponseInputItemComputerCallOutput struct{…}` + - `string` - The output of a computer tool call. + - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` - - `type BetaResponseFunctionWebSearch struct{…}` + An array of content outputs (text, image, file) for the function tool call. - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `type BetaResponseInputTextContent struct{…}` - - `type BetaResponseFunctionToolCall struct{…}` + A text input to the model. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `Text string` - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + The text input to the model. - The output of a function tool call. + - `Type InputText` - - `type BetaResponseInputItemAgentMessage struct{…}` + The type of the input item. Always `input_text`. - A message routed between agents. + - `const InputTextInputText InputText = "input_text"` - - `type BetaResponseInputItemMultiAgentCall struct{…}` + - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `type BetaResponseInputItemToolSearchCall struct{…}` + - `Mode Explicit` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + The breakpoint mode. Always `explicit`. - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseReasoningItem struct{…}` + - `type BetaResponseInputImageContent 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](https://platform.openai.com/docs/guides/conversation-state). + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `type BetaResponseCompactionItemParamResp struct{…}` + - `Type InputImage` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The type of the input item. Always `input_image`. - - `type BetaResponseInputItemImageGenerationCall struct{…}` + - `const InputImageInputImage InputImage = "input_image"` - An image generation request made by the model. + - `Detail BetaResponseInputImageContentDetail` - - `type BetaResponseCodeInterpreterToolCall struct{…}` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - A tool call to run code. + - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` - A tool call to run a command on the local shell. + - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` - The output of a local shell tool call. + - `FileID string` - - `type BetaResponseInputItemShellCall struct{…}` + The ID of the file to be sent to the model. - A tool representing a request to execute one or more shell commands. + - `ImageURL string` - - `type BetaResponseInputItemShellCallOutput struct{…}` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - The streamed output items emitted by a shell tool call. + - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` - - `type BetaResponseInputItemApplyPatchCall struct{…}` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A tool call representing a request to create, delete, or update files using diff patches. + - `Mode Explicit` - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + The breakpoint mode. Always `explicit`. - The streamed output emitted by an apply patch tool call. + - `const ExplicitExplicit Explicit = "explicit"` - - `type BetaResponseInputItemMcpListTools struct{…}` + - `type BetaResponseInputFileContent struct{…}` - A list of tools available on an MCP server. + A file input to the model. - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + - `Type InputFile` - A request for human approval of a tool invocation. + The type of the input item. Always `input_file`. - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + - `const InputFileInputFile InputFile = "input_file"` - A response to an MCP approval request. + - `Detail BetaResponseInputFileContentDetail` - - `type BetaResponseInputItemMcpCall struct{…}` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - An invocation of a tool on an MCP server. + - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` - - `type BetaResponseCustomToolCallOutput struct{…}` + - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` - The output of a custom tool call from your code, being sent back to the model. + - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` - - `type BetaResponseCustomToolCall struct{…}` + - `FileData string` - A call to a custom tool created by the model. + The base64-encoded data of the file to be sent to the model. - - `type BetaResponseInputItemCompactionTrigger struct{…}` + - `FileID string` - Compacts the current context. Must be the final input item. + The ID of the file to be sent to the model. - - `type BetaResponseInputItemItemReference struct{…}` + - `FileURL string` - An internal identifier for an item to reference. + The URL of the file to be sent to the model. - - `type BetaResponseInputItemProgram struct{…}` + - `Filename string` - - `type BetaResponseInputItemProgramOutput struct{…}` + The name of the file to be sent to the model. - - `ResponseID string` + - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` - The ID of the active response that should receive the input. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `Type ResponseInject` + - `Mode Explicit` - The event discriminator. Always `response.inject`. + The breakpoint mode. Always `explicit`. - - `const ResponseInjectResponseInject ResponseInject = "response.inject"` + - `const ExplicitExplicit Explicit = "explicit"` -### Beta Responses Server Event + - `Type FunctionCallOutput` -- `type BetaResponsesServerEventUnion interface{…}` + The type of the function tool call output. Always `function_call_output`. - Server events emitted by the Responses WebSocket server. + - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` - - `type BetaResponseAudioDeltaEvent struct{…}` + - `ID string` - Emitted when there is a partial audio response. + The unique ID of the function tool call output. Populated when this item is returned via API. - - `Delta string` + - `Agent BetaResponseInputItemFunctionCallOutputAgent` - A chunk of Base64 encoded response audio bytes. + The agent that produced this item. - - `SequenceNumber int64` + - `AgentName string` - A sequence number for this chunk of the stream response. + The canonical name of the agent that produced this item. - - `Type ResponseAudioDelta` + - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` - The type of the event. Always `response.audio.delta`. + The execution context that produced this tool call. - - `const ResponseAudioDeltaResponseAudioDelta ResponseAudioDelta = "response.audio.delta"` + - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` - - `Agent BetaResponseAudioDeltaEventAgent` + - `Type Direct` - The agent that owns this multi-agent streaming event. + The caller type. Always `direct`. - - `AgentName string` + - `const DirectDirect Direct = "direct"` - The canonical name of the agent that produced this item. + - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` - - `type BetaResponseAudioDoneEvent struct{…}` + - `CallerID string` - Emitted when the audio response is complete. + The call ID of the program item that produced this tool call. - - `SequenceNumber int64` + - `Type Program` - The sequence number of the delta. + The caller type. Always `program`. - - `Type ResponseAudioDone` + - `const ProgramProgram Program = "program"` - The type of the event. Always `response.audio.done`. + - `Status string` - - `const ResponseAudioDoneResponseAudioDone ResponseAudioDone = "response.audio.done"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `Agent BetaResponseAudioDoneEventAgent` + - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` - The agent that owns this multi-agent streaming event. + - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` - - `AgentName string` + - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` - The canonical name of the agent that produced this item. + - `type BetaResponseInputItemAgentMessage struct{…}` - - `type BetaResponseAudioTranscriptDeltaEvent struct{…}` + A message routed between agents. - Emitted when there is a partial transcript of audio. + - `Author string` - - `Delta string` + The sending agent identity. - The partial transcript of the audio response. + - `Content []BetaResponseInputItemAgentMessageContentUnion` - - `SequenceNumber int64` + Plaintext, image, or encrypted content sent between agents. - The sequence number of this event. + - `type BetaResponseInputTextContent struct{…}` - - `Type ResponseAudioTranscriptDelta` + A text input to the model. - The type of the event. Always `response.audio.transcript.delta`. + - `type BetaResponseInputImageContent struct{…}` - - `const ResponseAudioTranscriptDeltaResponseAudioTranscriptDelta ResponseAudioTranscriptDelta = "response.audio.transcript.delta"` + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) - - `Agent BetaResponseAudioTranscriptDeltaEventAgent` + - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` - The agent that owns this multi-agent streaming event. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `AgentName string` + - `EncryptedContent string` - The canonical name of the agent that produced this item. + Opaque encrypted content. - - `type BetaResponseAudioTranscriptDoneEvent struct{…}` + - `Type EncryptedContent` - Emitted when the full audio transcript is completed. + The type of the input item. Always `encrypted_content`. - - `SequenceNumber int64` + - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` - The sequence number of this event. + - `Recipient string` - - `Type ResponseAudioTranscriptDone` + The destination agent identity. - The type of the event. Always `response.audio.transcript.done`. + - `Type AgentMessage` - - `const ResponseAudioTranscriptDoneResponseAudioTranscriptDone ResponseAudioTranscriptDone = "response.audio.transcript.done"` + The item type. Always `agent_message`. - - `Agent BetaResponseAudioTranscriptDoneEventAgent` + - `const AgentMessageAgentMessage AgentMessage = "agent_message"` - The agent that owns this multi-agent streaming event. + - `ID string` + + The unique ID of this agent message item. + + - `Agent BetaResponseInputItemAgentMessageAgent` + + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterCallCodeDeltaEvent struct{…}` + - `type BetaResponseInputItemMultiAgentCall struct{…}` - Emitted when a partial code snippet is streamed by the code interpreter. + - `Action string` - - `Delta string` + The multi-agent action that was executed. - The partial code snippet being streamed by the code interpreter. + - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` - - `ItemID string` + - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` - The unique identifier of the code interpreter tool call item. + - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` - - `OutputIndex int64` + - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` - The index of the output item in the response for which the code is being streamed. + - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` - - `SequenceNumber int64` + - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` - The sequence number of this event, used to order streaming events. + - `Arguments string` - - `Type ResponseCodeInterpreterCallCodeDelta` + The action arguments as a JSON string. - The type of the event. Always `response.code_interpreter_call_code.delta`. + - `CallID string` - - `const ResponseCodeInterpreterCallCodeDeltaResponseCodeInterpreterCallCodeDelta ResponseCodeInterpreterCallCodeDelta = "response.code_interpreter_call_code.delta"` + The unique ID linking this call to its output. - - `Agent BetaResponseCodeInterpreterCallCodeDeltaEventAgent` + - `Type MultiAgentCall` - The agent that owns this multi-agent streaming event. + The item type. Always `multi_agent_call`. + + - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + + - `ID string` + + The unique ID of this multi-agent call. + + - `Agent BetaResponseInputItemMultiAgentCallAgent` + + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseCodeInterpreterCallCodeDoneEvent struct{…}` + - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` - Emitted when the code snippet is finalized by the code interpreter. + - `Action string` - - `Code string` + The multi-agent action that produced this result. - The final code snippet output by the code interpreter. + - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` - - `ItemID string` + - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` - The unique identifier of the code interpreter tool call item. + - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` - - `OutputIndex int64` + - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` - The index of the output item in the response for which the code is finalized. + - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` - - `SequenceNumber int64` + - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` - The sequence number of this event, used to order streaming events. + - `CallID string` - - `Type ResponseCodeInterpreterCallCodeDone` + The unique ID of the multi-agent call. - The type of the event. Always `response.code_interpreter_call_code.done`. + - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` - - `const ResponseCodeInterpreterCallCodeDoneResponseCodeInterpreterCallCodeDone ResponseCodeInterpreterCallCodeDone = "response.code_interpreter_call_code.done"` + Text output returned by the multi-agent action. - - `Agent BetaResponseCodeInterpreterCallCodeDoneEventAgent` + - `Text string` - The agent that owns this multi-agent streaming event. + The text content. - - `AgentName string` + - `Type OutputText` - The canonical name of the agent that produced this item. + The content type. Always `output_text`. - - `type BetaResponseCodeInterpreterCallCompletedEvent struct{…}` + - `const OutputTextOutputText OutputText = "output_text"` - Emitted when the code interpreter call is completed. + - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` - - `ItemID string` + Citations associated with the text content. - The unique identifier of the code interpreter tool call item. + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` - - `OutputIndex int64` + - `FileID string` - The index of the output item in the response for which the code interpreter call is completed. + The ID of the file. - - `SequenceNumber int64` + - `Filename string` - The sequence number of this event, used to order streaming events. + The filename of the file cited. - - `Type ResponseCodeInterpreterCallCompleted` + - `Index int64` - The type of the event. Always `response.code_interpreter_call.completed`. + The index of the file in the list of files. - - `const ResponseCodeInterpreterCallCompletedResponseCodeInterpreterCallCompleted ResponseCodeInterpreterCallCompleted = "response.code_interpreter_call.completed"` + - `Type FileCitation` - - `Agent BetaResponseCodeInterpreterCallCompletedEventAgent` + The citation type. Always `file_citation`. - The agent that owns this multi-agent streaming event. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `AgentName string` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` - The canonical name of the agent that produced this item. + - `EndIndex int64` - - `type BetaResponseCodeInterpreterCallInProgressEvent struct{…}` + The index of the last character of the citation in the message. - Emitted when a code interpreter call is in progress. + - `StartIndex int64` - - `ItemID string` + The index of the first character of the citation in the message. - The unique identifier of the code interpreter tool call item. + - `Title string` - - `OutputIndex int64` + The title of the cited resource. - The index of the output item in the response for which the code interpreter call is in progress. + - `Type URLCitation` - - `SequenceNumber int64` + The citation type. Always `url_citation`. - The sequence number of this event, used to order streaming events. + - `const URLCitationURLCitation URLCitation = "url_citation"` - - `Type ResponseCodeInterpreterCallInProgress` + - `URL string` - The type of the event. Always `response.code_interpreter_call.in_progress`. + The URL of the cited resource. - - `const ResponseCodeInterpreterCallInProgressResponseCodeInterpreterCallInProgress ResponseCodeInterpreterCallInProgress = "response.code_interpreter_call.in_progress"` + - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` - - `Agent BetaResponseCodeInterpreterCallInProgressEventAgent` + - `ContainerID string` - The agent that owns this multi-agent streaming event. + The ID of the container. - - `AgentName string` + - `EndIndex int64` - The canonical name of the agent that produced this item. + The index of the last character of the citation in the message. - - `type BetaResponseCodeInterpreterCallInterpretingEvent struct{…}` + - `FileID string` - Emitted when the code interpreter is actively interpreting the code snippet. + The ID of the container file. - - `ItemID string` + - `Filename string` - The unique identifier of the code interpreter tool call item. + The filename of the container file cited. - - `OutputIndex int64` + - `StartIndex int64` - The index of the output item in the response for which the code interpreter is interpreting code. + The index of the first character of the citation in the message. - - `SequenceNumber int64` + - `Type ContainerFileCitation` - The sequence number of this event, used to order streaming events. + The citation type. Always `container_file_citation`. - - `Type ResponseCodeInterpreterCallInterpreting` + - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` - The type of the event. Always `response.code_interpreter_call.interpreting`. + - `Type MultiAgentCallOutput` - - `const ResponseCodeInterpreterCallInterpretingResponseCodeInterpreterCallInterpreting ResponseCodeInterpreterCallInterpreting = "response.code_interpreter_call.interpreting"` + The item type. Always `multi_agent_call_output`. - - `Agent BetaResponseCodeInterpreterCallInterpretingEventAgent` + - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` - The agent that owns this multi-agent streaming event. + - `ID string` + + The unique ID of this multi-agent call output. + + - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + + The agent that produced this item. - `AgentName string` The canonical name of the agent that produced this item. - - `type BetaResponseCompletedEvent struct{…}` + - `type BetaResponseInputItemToolSearchCall struct{…}` - Emitted when the model response is complete. + - `Arguments any` - - `Response BetaResponse` + The arguments supplied to the tool search call. - Properties of the completed response. + - `Type ToolSearchCall` + + The item type. Always `tool_search_call`. + + - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` - `ID string` - Unique identifier for this Response. + The unique ID of this tool search call. - - `CreatedAt float64` + - `Agent BetaResponseInputItemToolSearchCallAgent` - Unix timestamp (in seconds) of when this Response was created. + The agent that produced this item. - - `Error BetaResponseError` + - `AgentName string` - An error object returned when the model fails to generate a Response. + The canonical name of the agent that produced this item. - - `Code BetaResponseErrorCode` + - `CallID string` - The error code for the response. + The unique ID of the tool search call generated by the model. - - `const BetaResponseErrorCodeServerError BetaResponseErrorCode = "server_error"` + - `Execution string` - - `const BetaResponseErrorCodeRateLimitExceeded BetaResponseErrorCode = "rate_limit_exceeded"` + Whether tool search was executed by the server or by the client. - - `const BetaResponseErrorCodeInvalidPrompt BetaResponseErrorCode = "invalid_prompt"` + - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` - - `const BetaResponseErrorCodeBioPolicy BetaResponseErrorCode = "bio_policy"` + - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` - - `const BetaResponseErrorCodeVectorStoreTimeout BetaResponseErrorCode = "vector_store_timeout"` + - `Status string` - - `const BetaResponseErrorCodeInvalidImage BetaResponseErrorCode = "invalid_image"` + The status of the tool search call. - - `const BetaResponseErrorCodeInvalidImageFormat BetaResponseErrorCode = "invalid_image_format"` + - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` - - `const BetaResponseErrorCodeInvalidBase64Image BetaResponseErrorCode = "invalid_base64_image"` + - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` - - `const BetaResponseErrorCodeInvalidImageURL BetaResponseErrorCode = "invalid_image_url"` + - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` - - `const BetaResponseErrorCodeImageTooLarge BetaResponseErrorCode = "image_too_large"` + - `type BetaResponseToolSearchOutputItemParamResp struct{…}` - - `const BetaResponseErrorCodeImageTooSmall BetaResponseErrorCode = "image_too_small"` + - `Tools []BetaToolUnion` - - `const BetaResponseErrorCodeImageParseError BetaResponseErrorCode = "image_parse_error"` + The loaded tool definitions returned by the tool search output. - - `const BetaResponseErrorCodeImageContentPolicyViolation BetaResponseErrorCode = "image_content_policy_violation"` + - `type BetaFunctionTool struct{…}` - - `const BetaResponseErrorCodeInvalidImageMode BetaResponseErrorCode = "invalid_image_mode"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `const BetaResponseErrorCodeImageFileTooLarge BetaResponseErrorCode = "image_file_too_large"` + - `Name string` - - `const BetaResponseErrorCodeUnsupportedImageMediaType BetaResponseErrorCode = "unsupported_image_media_type"` + The name of the function to call. - - `const BetaResponseErrorCodeEmptyImageFile BetaResponseErrorCode = "empty_image_file"` + - `Parameters map[string, any]` - - `const BetaResponseErrorCodeFailedToDownloadImage BetaResponseErrorCode = "failed_to_download_image"` + A JSON schema object describing the parameters of the function. - - `const BetaResponseErrorCodeImageFileNotFound BetaResponseErrorCode = "image_file_not_found"` + - `Strict bool` - - `Message string` + Whether strict parameter validation is enforced for this function tool. - A human-readable description of the error. + - `Type Function` - - `IncompleteDetails BetaResponseIncompleteDetails` + The type of the function tool. Always `function`. - Details about why the response is incomplete. + - `const FunctionFunction Function = "function"` - - `Reason string` + - `AllowedCallers []string` - The reason why the response is incomplete. + The tool invocation context(s). - - `const BetaResponseIncompleteDetailsReasonMaxOutputTokens BetaResponseIncompleteDetailsReason = "max_output_tokens"` + - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` - - `const BetaResponseIncompleteDetailsReasonContentFilter BetaResponseIncompleteDetailsReason = "content_filter"` + - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` - - `Instructions BetaResponseInstructionsUnion` + - `DeferLoading bool` - A system (or developer) message inserted into the model's context. + Whether this function is deferred and loaded via tool search. - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + - `Description string` - - `string` + A description of the function. Used by the model to determine whether or not to call the function. - - `type BetaResponseInstructionsInputItemList []BetaResponseInputItemUnion` + - `OutputSchema map[string, any]` - A list of one or many input items to the model, containing - different content types. + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `type BetaEasyInputMessage struct{…}` + - `type BetaFileSearchTool struct{…}` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `Content BetaEasyInputMessageContentUnion` + - `Type FileSearch` - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + The type of the file search tool. Always `file_search`. - - `string` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `VectorStoreIDs []string` - A list of one or many input items to the model, containing different content - types. + The IDs of the vector stores to search. - - `type BetaResponseInputText struct{…}` + - `Filters BetaFileSearchToolFiltersUnion` - A text input to the model. + A filter to apply. - - `Text string` + - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` - The text input to the model. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `Type InputText` + - `Key string` - The type of the input item. Always `input_text`. + The key to compare against the value. - - `const InputTextInputText InputText = "input_text"` + - `Type string` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `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 - - `Mode Explicit` + - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` - The breakpoint mode. Always `explicit`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` - - `type BetaResponseInputImage struct{…}` + - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` - - `Detail BetaResponseInputImageDetail` + - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + The value to compare against the attribute key; supports string, number, or boolean types. - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `string` - - `Type InputImage` + - `float64` - The type of the input item. Always `input_image`. + - `bool` - - `const InputImageInputImage InputImage = "input_image"` + - `type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion` - - `FileID string` + - `string` - The ID of the file to be sent to the model. + - `float64` - - `ImageURL string` + - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + Combine multiple filters using `and` or `or`. - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `Mode Explicit` + - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` - The breakpoint mode. Always `explicit`. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `const ExplicitExplicit Explicit = "explicit"` + - `Key string` - - `type BetaResponseInputFile struct{…}` + The key to compare against the value. - A file input to the model. + - `Type string` - - `Type InputFile` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - The type of the input item. Always `input_file`. + - `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 InputFileInputFile InputFile = "input_file"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` - - `Detail BetaResponseInputFileDetail` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` - - `FileData string` + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` - The content of the file to be sent to the model. + - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` - - `FileID string` + - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` - The ID of the file to be sent to the model. + The value to compare against the attribute key; supports string, number, or boolean types. - - `FileURL string` + - `string` - The URL of the file to be sent to the model. + - `float64` - - `Filename string` + - `bool` - The name of the file to be sent to the model. + - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `float64` - - `Mode Explicit` + - `Type string` - The breakpoint mode. Always `explicit`. + Type of operation: `and` or `or`. - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` - - `Role BetaEasyInputMessageRole` + - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + - `MaxNumResults int64` - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + - `RankingOptions BetaFileSearchToolRankingOptions` - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + Ranking options for search. - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` - - `Phase BetaEasyInputMessagePhase` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - 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. + - `EmbeddingWeight float64` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + The weight of the embedding in the reciprocal ranking fusion. - - `Type BetaEasyInputMessageType` + - `TextWeight float64` - The type of the message input. Always `message`. + The weight of the text in the reciprocal ranking fusion. - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + - `Ranker string` - - `type BetaResponseInputItemMessage struct{…}` + The ranker to use for the file search. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` - - `Content BetaResponseInputMessageContentList` + - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` - A list of one or many input items to the model, containing different content - types. + - `ScoreThreshold float64` - - `Role string` + 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. - The role of the message input. One of `user`, `system`, or `developer`. + - `type BetaComputerTool struct{…}` - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + - `Type Computer` - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + The type of the computer tool. Always `computer`. - - `Agent BetaResponseInputItemMessageAgent` + - `const ComputerComputer Computer = "computer"` - The agent that produced this item. + - `type BetaComputerUsePreviewTool struct{…}` - - `AgentName string` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The canonical name of the agent that produced this item. + - `DisplayHeight int64` - - `Status string` + The height of the computer display. - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `DisplayWidth int64` - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + The width of the computer display. - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + - `Environment BetaComputerUsePreviewToolEnvironment` - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + The type of computer environment to control. - - `Type string` + - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` - The type of the message input. Always set to `message`. + - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` - - `type BetaResponseOutputMessage struct{…}` + - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` - An output message from the model. + - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` - - `ID string` + - `Type ComputerUsePreview` - The unique ID of the output message. + The type of the computer use tool. Always `computer_use_preview`. - - `Content []BetaResponseOutputMessageContentUnion` + - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` - The content of the output message. + - `type BetaWebSearchTool struct{…}` - - `type BetaResponseOutputText struct{…}` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - A text output from the model. + - `Type BetaWebSearchToolType` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - The annotations of the text output. + - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` - A citation to a file. + - `Filters BetaWebSearchToolFilters` - - `FileID string` + Filters for the search. - The ID of the file. + - `AllowedDomains []string` - - `Filename string` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - The filename of the file cited. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `Index int64` + - `SearchContextSize BetaWebSearchToolSearchContextSize` - The index of the file in the list of files. + 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. - - `Type FileCitation` + - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` - The type of the file citation. Always `file_citation`. + - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + - `UserLocation BetaWebSearchToolUserLocation` - A citation for a web resource used to generate a model response. + The approximate location of the user. - - `EndIndex int64` + - `City string` - The index of the last character of the URL citation in the message. + Free text input for the city of the user, e.g. `San Francisco`. - - `StartIndex int64` + - `Country string` - The index of the first character of the URL citation in the message. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `Title string` + - `Region string` - The title of the web resource. + Free text input for the region of the user, e.g. `California`. - - `Type URLCitation` + - `Timezone string` - The type of the URL citation. Always `url_citation`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Type string` - - `URL string` + The type of location approximation. Always `approximate`. - The URL of the web resource. + - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `type BetaToolMcp struct{…}` - A citation for a container file used to generate a model response. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + + - `ServerLabel string` - - `ContainerID string` + A label for this MCP server, used to identify it in tool calls. - The ID of the container file. + - `Type Mcp` - - `EndIndex int64` + The type of the MCP tool. Always `mcp`. - The index of the last character of the container file citation in the message. + - `const McpMcp Mcp = "mcp"` - - `FileID string` + - `AllowedCallers []string` - The ID of the file. + The tool invocation context(s). - - `Filename string` + - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` - The filename of the container file cited. + - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` - - `StartIndex int64` + - `AllowedTools BetaToolMcpAllowedToolsUnion` - The index of the first character of the container file citation in the message. + List of allowed tool names or a filter object. - - `Type ContainerFileCitation` + - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` - The type of the container file citation. Always `container_file_citation`. + A string array of allowed tool names - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + A filter object to specify which tools are allowed. - A path to a file. + - `ReadOnly bool` - - `FileID string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The ID of the file. + - `ToolNames []string` - - `Index int64` + List of allowed tool names. - The index of the file in the list of files. + - `Authorization string` - - `Type FilePath` + 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. - The type of the file path. Always `file_path`. + - `ConnectorID string` - - `const FilePathFilePath FilePath = "file_path"` + 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - - `Text string` + Currently supported `connector_id` values are: - The text output from the model. + - 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` - - `Type OutputText` + - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` - The type of the output text. Always `output_text`. + - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` - - `const OutputTextOutputText OutputText = "output_text"` + - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` - - `Logprobs []BetaResponseOutputTextLogprob` + - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` - - `Token string` + - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` - - `Bytes []int64` + - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` - - `Logprob float64` + - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` - - `Token string` + - `DeferLoading bool` - - `Bytes []int64` + Whether this MCP tool is deferred and discovered via tool search. - - `Logprob float64` + - `Headers map[string, string]` - - `type BetaResponseOutputRefusal struct{…}` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - A refusal from the model. + - `RequireApproval BetaToolMcpRequireApprovalUnion` - - `Refusal string` + Specify which of the MCP server's tools require approval. - The refusal explanation from the model. + - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` - - `Type Refusal` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - The type of the refusal. Always `refusal`. + - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` - - `const RefusalRefusal Refusal = "refusal"` + A filter object to specify which tools are allowed. - - `Role Assistant` + - `ReadOnly bool` - The role of the output message. Always `assistant`. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `const AssistantAssistant Assistant = "assistant"` + - `ToolNames []string` - - `Status BetaResponseOutputMessageStatus` + List of allowed tool names. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + A filter object to specify which tools are allowed. - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `ReadOnly bool` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `Type Message` + - `ToolNames []string` - The type of the output message. Always `message`. + List of allowed tool names. - - `const MessageMessage Message = "message"` + - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` - - `Agent BetaResponseOutputMessageAgent` + 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. - The agent that produced this item. + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` - - `AgentName string` + - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` - The canonical name of the agent that produced this item. + - `ServerDescription string` - - `Phase BetaResponseOutputMessagePhase` + Optional description of the MCP server, used to provide more context. - 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. + - `ServerURL string` - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `type BetaResponseFileSearchToolCall struct{…}` + - `TunnelID string` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + 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. - - `ID string` + - `type BetaToolCodeInterpreter struct{…}` - The unique ID of the file search tool call. + A tool that runs Python code to help generate a response to a prompt. - - `Queries []string` + - `Container BetaToolCodeInterpreterContainerUnion` - The queries used to search for files. + 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. - - `Status BetaResponseFileSearchToolCallStatus` + - `string` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `Type Auto` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + Always `auto`. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `const AutoAuto Auto = "auto"` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + - `FileIDs []string` - - `Type FileSearchCall` + An optional list of uploaded files to make available to your code. - The type of the file search tool call. Always `file_search_call`. + - `MemoryLimit string` - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + The memory limit for the code interpreter container. - - `Agent BetaResponseFileSearchToolCallAgent` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` - The agent that produced this item. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` - - `AgentName string` + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` - The canonical name of the agent that produced this item. + - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` - - `Results []BetaResponseFileSearchToolCallResult` + - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` - The results of the file search tool call. + Network access policy for the container. - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - 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. + - `Type Disabled` - - `string` + Disable outbound network access. Always `disabled`. - - `float64` + - `const DisabledDisabled Disabled = "disabled"` - - `bool` + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `FileID string` + - `AllowedDomains []string` - The unique ID of the file. + A list of allowed domains when type is `allowlist`. - - `Filename string` + - `Type Allowlist` - The name of the file. + Allow outbound network access only to specified domains. Always `allowlist`. - - `Score float64` + - `const AllowlistAllowlist Allowlist = "allowlist"` - The relevance score of the file - a value between 0 and 1. + - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` - - `Text string` + Optional domain-scoped secrets for allowlisted domains. - The text that was retrieved from the file. + - `Domain string` - - `type BetaResponseComputerToolCall struct{…}` + The domain associated with the secret. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `Name string` - - `ID string` + The name of the secret to inject for the domain. - The unique ID of the computer call. + - `Value string` - - `CallID string` + The secret value to inject for the domain. - An identifier used when responding to the tool call with output. + - `Type CodeInterpreter` - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + The type of the code interpreter tool. Always `code_interpreter`. - The pending safety checks for the computer call. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `ID string` + - `AllowedCallers []string` - The ID of the pending safety check. + The tool invocation context(s). - - `Code string` + - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` - The type of the pending safety check. + - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` - - `Message string` + - `type BetaToolProgrammaticToolCalling struct{…}` - Details about the pending safety check. + - `Type ProgrammaticToolCalling` - - `Status BetaResponseComputerToolCallStatus` + The type of the tool. Always `programmatic_tool_calling`. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `type BetaToolImageGeneration struct{…}` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + A tool that generates images using the GPT image models. - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `Type ImageGeneration` - - `Type BetaResponseComputerToolCallType` + The type of the image generation tool. Always `image_generation`. - The type of the computer call. Always `computer_call`. + - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `Action string` - - `Action BetaComputerActionUnion` + Whether to generate a new image or edit an existing image. Default: `auto`. - A click action. + - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` - - `type BetaComputerActionClick struct{…}` + - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` - A click action. + - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` - - `Button string` + - `Background string` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + 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. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + `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. - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + If `transparent`, the output format needs to support transparency, + so it should be set to either `png` (default value) or `webp`. - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` - - `Type Click` + - `InputFidelity string` - Specifies the event type. For a click action, this property is always `click`. + 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 ClickClick Click = "click"` + - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` - - `X int64` + - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` - The x-coordinate where the click occurred. + - `InputImageMask BetaToolImageGenerationInputImageMask` - - `Y int64` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - The y-coordinate where the click occurred. + - `FileID string` - - `Keys []string` + File ID for the mask image. - The keys being held while clicking. + - `ImageURL string` - - `type BetaComputerActionDoubleClick struct{…}` + Base64-encoded mask image. - A double click action. + - `Model string` - - `Keys []string` + The image generation model to use. Default: `gpt-image-1`. - The keys being held while double-clicking. + - `string` - - `Type DoubleClick` + - `string` - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` - - `X int64` + - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` - The x-coordinate where the double click occurred. + - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` - - `Y int64` + - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` - The y-coordinate where the double click occurred. + - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` - - `type BetaComputerActionDrag struct{…}` + - `Moderation string` - A drag action. + Moderation level for the generated image. Default: `auto`. - - `Path []BetaComputerActionDragPath` + - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `OutputCompression int64` - - `X int64` + Compression level for the output image. Default: 100. - The x-coordinate. + - `OutputFormat string` - - `Y int64` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - The y-coordinate. + - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` - - `Type Drag` + - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` - Specifies the event type. For a drag action, this property is always set to `drag`. + - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` - - `const DragDrag Drag = "drag"` + - `PartialImages int64` - - `Keys []string` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The keys being held while dragging the mouse. + - `Quality string` - - `type BetaComputerActionKeypress struct{…}` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - A collection of keypresses the model would like to perform. + - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` - - `Keys []string` + - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` - - `Type Keypress` + - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `Size string` - - `const KeypressKeypress Keypress = "keypress"` + 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`. - - `type BetaComputerActionMove struct{…}` + - `string` - A mouse move action. + - `string` - - `Type Move` + - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` - Specifies the event type. For a move action, this property is always set to `move`. + - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` - - `const MoveMove Move = "move"` + - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` - - `X int64` + - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` - The x-coordinate to move to. + - `type BetaToolLocalShell struct{…}` - - `Y int64` + A tool that allows the model to execute shell commands in a local environment. - The y-coordinate to move to. + - `Type LocalShell` - - `Keys []string` + The type of the local shell tool. Always `local_shell`. - The keys being held while moving the mouse. + - `const LocalShellLocalShell LocalShell = "local_shell"` - - `type BetaComputerActionScreenshot struct{…}` + - `type BetaFunctionShellTool struct{…}` - A screenshot action. + A tool that allows the model to execute shell commands. - - `Type Screenshot` + - `Type Shell` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + The type of the shell tool. Always `shell`. - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `const ShellShell Shell = "shell"` - - `type BetaComputerActionScroll struct{…}` + - `AllowedCallers []string` - A scroll action. + The tool invocation context(s). - - `ScrollX int64` + - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` - The horizontal scroll distance. + - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` - - `ScrollY int64` + - `Environment BetaFunctionShellToolEnvironmentUnion` - The vertical scroll distance. + - `type BetaContainerAuto struct{…}` - - `Type Scroll` + - `Type ContainerAuto` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + Automatically creates a container for this request - - `const ScrollScroll Scroll = "scroll"` + - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` - - `X int64` + - `FileIDs []string` - The x-coordinate where the scroll occurred. + An optional list of uploaded files to make available to your code. - - `Y int64` + - `MemoryLimit BetaContainerAutoMemoryLimit` - The y-coordinate where the scroll occurred. + The memory limit for the container. - - `Keys []string` + - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` - The keys being held while scrolling. + - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` - - `type BetaComputerActionType struct{…}` + - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` - An action to type in text. + - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` - - `Text string` + - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` - The text to type. + Network access policy for the container. - - `Type Type` + - `type BetaContainerNetworkPolicyDisabled struct{…}` - Specifies the event type. For a type action, this property is always set to `type`. + - `type BetaContainerNetworkPolicyAllowlist struct{…}` - - `const TypeType Type = "type"` + - `Skills []BetaContainerAutoSkillUnion` - - `type BetaComputerActionWait struct{…}` + An optional list of skills referenced by id or inline data. - A wait action. + - `type BetaSkillReference struct{…}` - - `Type Wait` + - `SkillID string` - Specifies the event type. For a wait action, this property is always set to `wait`. + The ID of the referenced skill. - - `const WaitWait Wait = "wait"` + - `Type SkillReference` - - `Actions BetaComputerActionList` + References a skill created with the /v1/skills endpoint. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `const SkillReferenceSkillReference SkillReference = "skill_reference"` - - `type BetaComputerActionClick struct{…}` + - `Version string` - A click action. + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `type BetaComputerActionDoubleClick struct{…}` + - `type BetaInlineSkill struct{…}` - A double click action. + - `Description string` - - `type BetaComputerActionDrag struct{…}` + The description of the skill. - A drag action. + - `Name string` - - `type BetaComputerActionKeypress struct{…}` + The name of the skill. - A collection of keypresses the model would like to perform. + - `Source BetaInlineSkillSource` - - `type BetaComputerActionMove struct{…}` + Inline skill payload - A mouse move action. + - `Data string` - - `type BetaComputerActionScreenshot struct{…}` + Base64-encoded skill zip bundle. - A screenshot action. + - `MediaType ApplicationZip` - - `type BetaComputerActionScroll struct{…}` + The media type of the inline skill payload. Must be `application/zip`. - A scroll action. + - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` - - `type BetaComputerActionType struct{…}` + - `Type Base64` - An action to type in text. + The type of the inline skill source. Must be `base64`. - - `type BetaComputerActionWait struct{…}` + - `const Base64Base64 Base64 = "base64"` - A wait action. + - `Type Inline` - - `Agent BetaResponseComputerToolCallAgent` + Defines an inline skill for this request. - The agent that produced this item. + - `const InlineInline Inline = "inline"` - - `AgentName string` + - `type BetaLocalEnvironment struct{…}` - The canonical name of the agent that produced this item. + - `Type Local` - - `type BetaResponseInputItemComputerCallOutput struct{…}` + Use a local computer environment. - The output of a computer tool call. + - `const LocalLocal Local = "local"` - - `CallID string` + - `Skills []BetaLocalSkill` - The ID of the computer tool call that produced the output. + An optional list of skills. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Description string` - A computer screenshot image used with the computer use tool. + The description of the skill. - - `Type ComputerScreenshot` + - `Name string` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + The name of the skill. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `Path string` - - `FileID string` + The path to the directory containing the skill. - The identifier of an uploaded file that contains the screenshot. + - `type BetaContainerReference struct{…}` - - `ImageURL string` + - `ContainerID string` - The URL of the screenshot image. + The ID of the referenced container. - - `Type ComputerCallOutput` + - `Type ContainerReference` - The type of the computer tool call output. Always `computer_call_output`. + References a container created with the /v1/containers endpoint - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` - - `ID string` + - `type BetaCustomTool struct{…}` - The ID of the computer tool call output. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + - `Name string` - The safety checks reported by the API that have been acknowledged by the developer. + The name of the custom tool, used to identify it in tool calls. - - `ID string` + - `Type Custom` - The ID of the pending safety check. + The type of the custom tool. Always `custom`. - - `Code string` + - `const CustomCustom Custom = "custom"` - The type of the pending safety check. + - `AllowedCallers []string` - - `Message string` + The tool invocation context(s). - Details about the pending safety check. + - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` - - `Agent BetaResponseInputItemComputerCallOutputAgent` + - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` - The agent that produced this item. + - `DeferLoading bool` - - `AgentName string` + Whether this tool should be deferred and discovered via tool search. - The canonical name of the agent that produced this item. + - `Description string` - - `Status string` + Optional description of the custom tool, used to provide more context. - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + - `Format BetaCustomToolFormatUnion` - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + The input format for the custom tool. Default is unconstrained text. - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `type BetaCustomToolFormatText struct{…}` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + Unconstrained free-form text. - - `type BetaResponseFunctionWebSearch struct{…}` + - `Type Text` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + Unconstrained text format. Always `text`. - - `ID string` + - `const TextText Text = "text"` - The unique ID of the web search tool call. + - `type BetaCustomToolFormatGrammar struct{…}` - - `Action BetaResponseFunctionWebSearchActionUnion` + A grammar defined by the user. - 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). + - `Definition string` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + The grammar definition. - Action type "search" - Performs a web search query. + - `Syntax string` - - `Type Search` + The syntax of the grammar definition. One of `lark` or `regex`. - The action type. + - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` - - `const SearchSearch Search = "search"` + - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` - - `Queries []string` + - `Type Grammar` - The search queries. + Grammar format. Always `grammar`. - - `Query string` + - `const GrammarGrammar Grammar = "grammar"` - The search query. + - `type BetaNamespaceTool struct{…}` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + Groups function/custom tools under a shared namespace. - The sources used in the search. + - `Description string` - - `Type URL` + A description of the namespace shown to the model. - The type of source. Always `url`. + - `Name string` - - `const URLURL URL = "url"` + The namespace name used in tool calls (for example, `crm`). - - `URL string` + - `Tools []BetaNamespaceToolToolUnion` - The URL of the source. + The function/custom tools available inside this namespace. - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + - `type BetaNamespaceToolToolFunction struct{…}` - Action type "open_page" - Opens a specific URL from search results. + - `Name string` - - `Type OpenPage` + - `Type Function` - The action type. + - `const FunctionFunction Function = "function"` - - `const OpenPageOpenPage OpenPage = "open_page"` + - `AllowedCallers []string` - - `URL string` + The tool invocation context(s). - The URL opened by the model. + - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` - Action type "find_in_page": Searches for a pattern within a loaded page. + - `DeferLoading bool` - - `Pattern string` + Whether this function should be deferred and discovered via tool search. - The pattern or text to search for within the page. + - `Description string` - - `Type FindInPage` + - `OutputSchema map[string, any]` - The action type. + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `const FindInPageFindInPage FindInPage = "find_in_page"` + - `Parameters any` - - `URL string` + - `Strict bool` - The URL of the page searched for the pattern. + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `Status BetaResponseFunctionWebSearchStatus` + - `type BetaCustomTool struct{…}` - The status of the web search tool call. + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `Type Namespace` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + The type of the tool. Always `namespace`. - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `const NamespaceNamespace Namespace = "namespace"` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `type BetaToolSearchTool struct{…}` - - `Type WebSearchCall` + Hosted or BYOT tool search configuration for deferred tools. - The type of the web search tool call. Always `web_search_call`. + - `Type ToolSearch` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + The type of the tool. Always `tool_search`. - - `Agent BetaResponseFunctionWebSearchAgent` + - `const ToolSearchToolSearch ToolSearch = "tool_search"` - The agent that produced this item. + - `Description string` - - `AgentName string` + Description shown to the model for a client-executed tool search tool. - The canonical name of the agent that produced this item. + - `Execution BetaToolSearchToolExecution` - - `type BetaResponseFunctionToolCall struct{…}` + Whether tool search is executed by the server or by the client. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - `Arguments string` + - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - A JSON string of the arguments to pass to the function. + - `Parameters any` - - `CallID string` + Parameter schema for a client-executed tool search tool. - The unique ID of the function tool call generated by the model. + - `type BetaWebSearchPreviewTool struct{…}` - - `Name string` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The name of the function to run. + - `Type BetaWebSearchPreviewToolType` - - `Type FunctionCall` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The type of the function tool call. Always `function_call`. + - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` - - `const FunctionCallFunctionCall FunctionCall = "function_call"` + - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` - - `ID string` + - `SearchContentTypes []string` - The unique ID of the function tool call. + - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` - - `Agent BetaResponseFunctionToolCallAgent` + - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` - The agent that produced this item. + - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` - - `AgentName string` + 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. - The canonical name of the agent that produced this item. + - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` - The execution context that produced this tool call. + - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `UserLocation BetaWebSearchPreviewToolUserLocation` - - `Type Direct` + The user's location. - - `const DirectDirect Direct = "direct"` + - `Type Approximate` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + The type of location approximation. Always `approximate`. - - `CallerID string` + - `const ApproximateApproximate Approximate = "approximate"` - The call ID of the program item that produced this tool call. + - `City string` - - `Type Program` + Free text input for the city of the user, e.g. `San Francisco`. - - `const ProgramProgram Program = "program"` + - `Country string` - - `Namespace string` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The namespace of the function to run. + - `Region string` - - `Status BetaResponseFunctionToolCallStatus` + Free text input for the region of the user, e.g. `California`. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Timezone string` - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `type BetaApplyPatchTool struct{…}` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + Allows the assistant to create, delete, or update files using unified diffs. - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `Type ApplyPatch` - The output of a function tool call. + The type of the tool. Always `apply_patch`. - - `CallID string` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - The unique ID of the function tool call generated by the model. + - `AllowedCallers []string` - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + The tool invocation context(s). - Text, image, or file output of the function tool call. + - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` - - `string` + - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `Type ToolSearchOutput` - An array of content outputs (text, image, file) for the function tool call. + The item type. Always `tool_search_output`. - - `type BetaResponseInputTextContent struct{…}` + - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` - A text input to the model. + - `ID string` - - `Text string` + The unique ID of this tool search output. - The text input to the model. + - `Agent BetaResponseToolSearchOutputItemParamAgentResp` - - `Type InputText` + The agent that produced this item. - The type of the input item. Always `input_text`. + - `AgentName string` - - `const InputTextInputText InputText = "input_text"` + The canonical name of the agent that produced this item. - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + - `CallID string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The unique ID of the tool search call generated by the model. - - `Mode Explicit` + - `Execution BetaResponseToolSearchOutputItemParamExecution` - The breakpoint mode. Always `explicit`. + Whether tool search was executed by the server or by the client. - - `const ExplicitExplicit Explicit = "explicit"` + - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` - - `type BetaResponseInputImageContent struct{…}` + - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + - `Status BetaResponseToolSearchOutputItemParamStatus` - - `Type InputImage` + The status of the tool search output. - The type of the input item. Always `input_image`. + - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` - - `const InputImageInputImage InputImage = "input_image"` + - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` - - `Detail BetaResponseInputImageContentDetail` + - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `type BetaResponseInputItemAdditionalTools struct{…}` - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + - `Role Developer` - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + The role that provided the additional tools. Only `developer` is supported. - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + - `const DeveloperDeveloper Developer = "developer"` - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `Tools []BetaToolUnion` - - `FileID string` + A list of additional tools made available at this item. - The ID of the file to be sent to the model. + - `type BetaFunctionTool struct{…}` - - `ImageURL string` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `type BetaFileSearchTool struct{…}` - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaComputerTool struct{…}` - - `Mode Explicit` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The breakpoint mode. Always `explicit`. + - `type BetaComputerUsePreviewTool struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type BetaResponseInputFileContent struct{…}` + - `type BetaWebSearchTool struct{…}` - A file input to the model. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `Type InputFile` + - `type BetaToolMcp struct{…}` - The type of the input item. Always `input_file`. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - - `const InputFileInputFile InputFile = "input_file"` + - `type BetaToolCodeInterpreter struct{…}` - - `Detail BetaResponseInputFileContentDetail` + A tool that runs Python code to help generate a response to a prompt. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `type BetaToolProgrammaticToolCalling struct{…}` - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `type BetaToolImageGeneration struct{…}` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + A tool that generates images using the GPT image models. - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + - `type BetaToolLocalShell struct{…}` - - `FileData string` + A tool that allows the model to execute shell commands in a local environment. - The base64-encoded data of the file to be sent to the model. + - `type BetaFunctionShellTool struct{…}` - - `FileID string` + A tool that allows the model to execute shell commands. - The ID of the file to be sent to the model. + - `type BetaCustomTool struct{…}` - - `FileURL string` + A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - The URL of the file to be sent to the model. + - `type BetaNamespaceTool struct{…}` - - `Filename string` + Groups function/custom tools under a shared namespace. - The name of the file to be sent to the model. + - `type BetaToolSearchTool struct{…}` - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` + Hosted or BYOT tool search configuration for deferred tools. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type BetaWebSearchPreviewTool struct{…}` - - `Mode Explicit` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The breakpoint mode. Always `explicit`. + - `type BetaApplyPatchTool struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + Allows the assistant to create, delete, or update files using unified diffs. - - `Type FunctionCallOutput` + - `Type AdditionalTools` - The type of the function tool call output. Always `function_call_output`. + The item type. Always `additional_tools`. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - `ID string` - The unique ID of the function tool call output. Populated when this item is returned via API. + The unique ID of this additional tools item. - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + - `Agent BetaResponseInputItemAdditionalToolsAgent` The agent that produced this item. @@ -141125,89 +153498,94 @@ func main() { The canonical name of the agent that produced this item. - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `type BetaResponseReasoningItem struct{…}` - The execution context that produced this tool call. + 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](https://platform.openai.com/docs/guides/conversation-state). - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + - `ID string` - - `Type Direct` + The unique identifier of the reasoning content. - The caller type. Always `direct`. + - `Summary []BetaResponseReasoningItemSummary` - - `const DirectDirect Direct = "direct"` + Reasoning summary content. - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + - `Text string` - - `CallerID string` + A summary of the reasoning output from the model so far. - The call ID of the program item that produced this tool call. + - `Type SummaryText` - - `Type Program` + The type of the object. Always `summary_text`. - The caller type. Always `program`. + - `const SummaryTextSummaryText SummaryText = "summary_text"` - - `const ProgramProgram Program = "program"` + - `Type Reasoning` - - `Status string` + The type of the object. Always `reasoning`. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + - `const ReasoningReasoning Reasoning = "reasoning"` - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + - `Agent BetaResponseReasoningItemAgent` - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + The agent that produced this item. - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + - `AgentName string` - - `type BetaResponseInputItemAgentMessage struct{…}` + The canonical name of the agent that produced this item. - A message routed between agents. + - `Content []BetaResponseReasoningItemContent` - - `Author string` + Reasoning text content. - The sending agent identity. + - `Text string` - - `Content []BetaResponseInputItemAgentMessageContentUnion` + The reasoning text from the model. - Plaintext, image, or encrypted content sent between agents. + - `Type ReasoningText` - - `type BetaResponseInputTextContent struct{…}` + The type of the reasoning text. Always `reasoning_text`. - A text input to the model. + - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` - - `type BetaResponseInputImageContent struct{…}` + - `EncryptedContent string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + - `Status BetaResponseReasoningItemStatus` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `EncryptedContent string` + - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` - Opaque encrypted content. + - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` - - `Type EncryptedContent` + - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` - The type of the input item. Always `encrypted_content`. + - `type BetaResponseCompactionItemParamResp struct{…}` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - - `Recipient string` + - `EncryptedContent string` - The destination agent identity. + The encrypted content of the compaction summary. - - `Type AgentMessage` + - `Type Compaction` - The item type. Always `agent_message`. + The type of the item. Always `compaction`. - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const CompactionCompaction Compaction = "compaction"` - `ID string` - The unique ID of this agent message item. + The ID of the compaction item. - - `Agent BetaResponseInputItemAgentMessageAgent` + - `Agent BetaResponseCompactionItemParamAgentResp` The agent that produced this item. @@ -141215,43 +153593,37 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCall struct{…}` - - - `Action string` - - The multi-agent action that was executed. - - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + - `type BetaResponseInputItemImageGenerationCall struct{…}` - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + An image generation request made by the model. - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + - `ID string` - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + The unique ID of the image generation call. - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + - `Result string` - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + The generated image encoded in base64. - - `Arguments string` + - `Status string` - The action arguments as a JSON string. + The status of the image generation call. - - `CallID string` + - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` - The unique ID linking this call to its output. + - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` - - `Type MultiAgentCall` + - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` - The item type. Always `multi_agent_call`. + - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `Type ImageGenerationCall` - - `ID string` + The type of the image generation call. Always `image_generation_call`. - The unique ID of this multi-agent call. + - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` - - `Agent BetaResponseInputItemMultiAgentCallAgent` + - `Agent BetaResponseInputItemImageGenerationCallAgent` The agent that produced this item. @@ -141259,129 +153631,142 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `type BetaResponseCodeInterpreterToolCall struct{…}` - - `Action string` + A tool call to run code. - The multi-agent action that produced this result. + - `ID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + The unique ID of the code interpreter tool call. - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + - `Code string` - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + The code to run, or null if not available. - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `ContainerID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + The ID of the container used to run the code. - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` - - `CallID string` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - The unique ID of the multi-agent call. + - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + The logs output from the code interpreter. - Text output returned by the multi-agent action. + - `Logs string` - - `Text string` + The logs output from the code interpreter. - The text content. + - `Type Logs` - - `Type OutputText` + The type of the output. Always `logs`. - The content type. Always `output_text`. + - `const LogsLogs Logs = "logs"` - - `const OutputTextOutputText OutputText = "output_text"` + - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + The image output from the code interpreter. - Citations associated with the text content. + - `Type Image` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + The type of the output. Always `image`. - - `FileID string` + - `const ImageImage Image = "image"` - The ID of the file. + - `URL string` - - `Filename string` + The URL of the image output from the code interpreter. - The filename of the file cited. + - `Status BetaResponseCodeInterpreterToolCallStatus` - - `Index int64` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - The index of the file in the list of files. + - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` - - `Type FileCitation` + - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` - The citation type. Always `file_citation`. + - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` - - `EndIndex int64` + - `Type CodeInterpreterCall` - The index of the last character of the citation in the message. + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `StartIndex int64` + - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` - The index of the first character of the citation in the message. + - `Agent BetaResponseCodeInterpreterToolCallAgent` - - `Title string` + The agent that produced this item. - The title of the cited resource. + - `AgentName string` - - `Type URLCitation` + The canonical name of the agent that produced this item. - The citation type. Always `url_citation`. + - `type BetaResponseInputItemLocalShellCall struct{…}` - - `const URLCitationURLCitation URLCitation = "url_citation"` + A tool call to run a command on the local shell. - - `URL string` + - `ID string` - The URL of the cited resource. + The unique ID of the local shell call. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + - `Action BetaResponseInputItemLocalShellCallAction` - - `ContainerID string` + Execute a shell command on the server. - The ID of the container. + - `Command []string` - - `EndIndex int64` + The command to run. - The index of the last character of the citation in the message. + - `Env map[string, string]` - - `FileID string` + Environment variables to set for the command. - The ID of the container file. + - `Type Exec` - - `Filename string` + The type of the local shell action. Always `exec`. - The filename of the container file cited. + - `const ExecExec Exec = "exec"` - - `StartIndex int64` + - `TimeoutMs int64` - The index of the first character of the citation in the message. + Optional timeout in milliseconds for the command. - - `Type ContainerFileCitation` + - `User string` - The citation type. Always `container_file_citation`. + Optional user to run the command as. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `WorkingDirectory string` - - `Type MultiAgentCallOutput` + Optional working directory to run the command in. - The item type. Always `multi_agent_call_output`. + - `CallID string` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + The unique ID of the local shell tool call generated by the model. - - `ID string` + - `Status string` - The unique ID of this multi-agent call output. + The status of the local shell call. - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` + - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + + - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + + - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + + - `Type LocalShellCall` + + The type of the local shell call. Always `local_shell_call`. + + - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + + - `Agent BetaResponseInputItemLocalShellCallAgent` The agent that produced this item. @@ -141389,23 +153774,25 @@ func main() { The canonical name of the agent that produced this item. - - `type BetaResponseInputItemToolSearchCall struct{…}` + - `type BetaResponseInputItemLocalShellCallOutput struct{…}` - - `Arguments any` + The output of a local shell tool call. - The arguments supplied to the tool search call. + - `ID string` - - `Type ToolSearchCall` + The unique ID of the local shell tool call generated by the model. - The item type. Always `tool_search_call`. + - `Output string` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + A JSON string of the output of the local shell tool call. - - `ID string` + - `Type LocalShellCallOutput` - The unique ID of this tool search call. + The type of the local shell tool call output. Always `local_shell_call_output`. - - `Agent BetaResponseInputItemToolSearchCallAgent` + - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + + - `Agent BetaResponseInputItemLocalShellCallOutputAgent` The agent that produced this item. @@ -141413,1163 +153800,1173 @@ func main() { The canonical name of the agent that produced this item. - - `CallID string` + - `Status string` - The unique ID of the tool search call generated by the model. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `Execution string` + - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` - Whether tool search was executed by the server or by the client. + - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + - `type BetaResponseInputItemShellCall struct{…}` - - `Status string` + A tool representing a request to execute one or more shell commands. - The status of the tool search call. + - `Action BetaResponseInputItemShellCallAction` - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + The shell commands and limits that describe how to run the tool call. - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + - `Commands []string` - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + Ordered shell commands for the execution environment to run. - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + - `MaxOutputLength int64` - - `Tools []BetaToolUnion` + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - The loaded tool definitions returned by the tool search output. + - `TimeoutMs int64` - - `type BetaFunctionTool struct{…}` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `CallID string` - - `Name string` + The unique ID of the shell tool call generated by the model. - The name of the function to call. + - `Type ShellCall` - - `Parameters map[string, any]` + The type of the item. Always `shell_call`. - A JSON schema object describing the parameters of the function. + - `const ShellCallShellCall ShellCall = "shell_call"` - - `Strict bool` + - `ID string` - Whether strict parameter validation is enforced for this function tool. + The unique ID of the shell tool call. Populated when this item is returned via API. - - `Type Function` + - `Agent BetaResponseInputItemShellCallAgent` - The type of the function tool. Always `function`. + The agent that produced this item. - - `const FunctionFunction Function = "function"` + - `AgentName string` - - `AllowedCallers []string` + The canonical name of the agent that produced this item. - The tool invocation context(s). + - `Caller BetaResponseInputItemShellCallCallerUnion` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + The execution context that produced this tool call. - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - `DeferLoading bool` + - `Type Direct` - Whether this function is deferred and loaded via tool search. + The caller type. Always `direct`. - - `Description string` + - `const DirectDirect Direct = "direct"` - A description of the function. Used by the model to determine whether or not to call the function. + - `type BetaResponseInputItemShellCallCallerProgram struct{…}` - - `OutputSchema map[string, any]` + - `CallerID string` - A JSON schema object describing the JSON value encoded in string outputs for this function. + The call ID of the program item that produced this tool call. - - `type BetaFileSearchTool struct{…}` + - `Type Program` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The caller type. Always `program`. - - `Type FileSearch` + - `const ProgramProgram Program = "program"` - The type of the file search tool. Always `file_search`. + - `Environment BetaResponseInputItemShellCallEnvironmentUnion` - - `const FileSearchFileSearch FileSearch = "file_search"` + The environment to execute the shell commands in. - - `VectorStoreIDs []string` + - `type BetaLocalEnvironment struct{…}` - The IDs of the vector stores to search. + - `type BetaContainerReference struct{…}` - - `Filters BetaFileSearchToolFiltersUnion` + - `Status string` - A filter to apply. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` - - `Key string` + - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` - The key to compare against the value. + - `type BetaResponseInputItemShellCallOutput struct{…}` - - `Type string` + The streamed output items emitted by a shell tool call. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `CallID string` - - `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 + The unique ID of the shell tool call generated by the model. - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `Output []BetaResponseFunctionShellCallOutputContent` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + The exit or timeout outcome associated with this shell call. - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + Indicates that the shell call exceeded its configured time limit. - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + - `Type Timeout` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + The outcome type. Always `timeout`. - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + - `const TimeoutTimeout Timeout = "timeout"` - The value to compare against the attribute key; supports string, number, or boolean types. + - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` - - `string` + Indicates that the shell commands finished and returned an exit code. - - `float64` + - `ExitCode int64` - - `bool` + The exit code returned by the shell process. - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `Type Exit` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + The outcome type. Always `exit`. - Combine multiple filters using `and` or `or`. + - `const ExitExit Exit = "exit"` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + - `Stderr string` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + Captured stderr output for the shell call. - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `Stdout string` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + Captured stdout output for the shell call. - - `Key string` + - `Type ShellCallOutput` - The key to compare against the value. + The type of the item. Always `shell_call_output`. - - `Type string` + - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `ID string` - - `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 + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `Agent BetaResponseInputItemShellCallOutputAgent` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + The agent that produced this item. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `AgentName string` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + The canonical name of the agent that produced this item. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + The execution context that produced this tool call. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `Type Direct` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + The caller type. Always `direct`. - The value to compare against the attribute key; supports string, number, or boolean types. + - `const DirectDirect Direct = "direct"` - - `string` + - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - `float64` + - `CallerID string` - - `bool` + The call ID of the program item that produced this tool call. - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `Type Program` - - `Type string` + The caller type. Always `program`. - Type of operation: `and` or `or`. + - `const ProgramProgram Program = "program"` - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + - `MaxOutputLength int64` - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `MaxNumResults int64` + - `Status string` - The maximum number of results to return. This number should be between 1 and 50 inclusive. + The status of the shell call output. - - `RankingOptions BetaFileSearchToolRankingOptions` + - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` - Ranking options for search. + - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + - `type BetaResponseInputItemApplyPatchCall struct{…}` - - `EmbeddingWeight float64` + A tool call representing a request to create, delete, or update files using diff patches. - The weight of the embedding in the reciprocal ranking fusion. + - `CallID string` - - `TextWeight float64` + The unique ID of the apply patch tool call generated by the model. - The weight of the text in the reciprocal ranking fusion. + - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` - - `Ranker string` + The specific create, delete, or update instruction for the apply_patch tool call. - The ranker to use for the file search. + - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + Instruction for creating a new file via the apply_patch tool. - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + - `Diff string` - - `ScoreThreshold float64` + Unified diff content to apply when creating the file. - 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. + - `Path string` - - `type BetaComputerTool struct{…}` + Path of the file to create relative to the workspace root. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Type CreateFile` - - `Type Computer` + The operation type. Always `create_file`. - The type of the computer tool. Always `computer`. + - `const CreateFileCreateFile CreateFile = "create_file"` - - `const ComputerComputer Computer = "computer"` + - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` - - `type BetaComputerUsePreviewTool struct{…}` + Instruction for deleting an existing file via the apply_patch tool. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Path string` - - `DisplayHeight int64` + Path of the file to delete relative to the workspace root. - The height of the computer display. + - `Type DeleteFile` - - `DisplayWidth int64` + The operation type. Always `delete_file`. - The width of the computer display. + - `const DeleteFileDeleteFile DeleteFile = "delete_file"` - - `Environment BetaComputerUsePreviewToolEnvironment` + - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` - The type of computer environment to control. + Instruction for updating an existing file via the apply_patch tool. - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `Diff string` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + Unified diff content to apply to the existing file. - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `Path string` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + Path of the file to update relative to the workspace root. - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + - `Type UpdateFile` - - `Type ComputerUsePreview` + The operation type. Always `update_file`. - The type of the computer use tool. Always `computer_use_preview`. + - `const UpdateFileUpdateFile UpdateFile = "update_file"` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `Status string` - - `type BetaWebSearchTool struct{…}` + The status of the apply patch tool call. One of `in_progress` or `completed`. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` - - `Type BetaWebSearchToolType` + - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `Type ApplyPatchCall` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + The type of the item. Always `apply_patch_call`. - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` - - `Filters BetaWebSearchToolFilters` + - `ID string` - Filters for the search. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `AllowedDomains []string` + - `Agent BetaResponseInputItemApplyPatchCallAgent` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + The agent that produced this item. - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `AgentName string` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + The canonical name of the agent that produced this item. - 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. + - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + The execution context that produced this tool call. - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `Type Direct` - - `UserLocation BetaWebSearchToolUserLocation` + The caller type. Always `direct`. - The approximate location of the user. + - `const DirectDirect Direct = "direct"` - - `City string` + - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` - Free text input for the city of the user, e.g. `San Francisco`. + - `CallerID string` - - `Country string` + The call ID of the program item that produced this tool call. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `Type Program` - - `Region string` + The caller type. Always `program`. - Free text input for the region of the user, e.g. `California`. + - `const ProgramProgram Program = "program"` - - `Timezone string` + - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + The streamed output emitted by an apply patch tool call. - - `Type string` + - `CallID string` - The type of location approximation. Always `approximate`. + The unique ID of the apply patch tool call generated by the model. - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `Status string` - - `type BetaToolMcp struct{…}` + The status of the apply patch tool call output. One of `completed` or `failed`. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` - - `ServerLabel string` + - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` - A label for this MCP server, used to identify it in tool calls. + - `Type ApplyPatchCallOutput` - - `Type Mcp` + The type of the item. Always `apply_patch_call_output`. - The type of the MCP tool. Always `mcp`. + - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` - - `const McpMcp Mcp = "mcp"` + - `ID string` - - `AllowedCallers []string` + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - The tool invocation context(s). + - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + The agent that produced this item. - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + - `AgentName string` - - `AllowedTools BetaToolMcpAllowedToolsUnion` + The canonical name of the agent that produced this item. - List of allowed tool names or a filter object. + - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + The execution context that produced this tool call. - A string array of allowed tool names + - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `Type Direct` - A filter object to specify which tools are allowed. + The caller type. Always `direct`. - - `ReadOnly bool` + - `const DirectDirect Direct = "direct"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` - - `ToolNames []string` + - `CallerID string` - List of allowed tool names. + The call ID of the program item that produced this tool call. - - `Authorization string` + - `Type Program` - 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. + The caller type. Always `program`. - - `ConnectorID string` + - `const ProgramProgram Program = "program"` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `Output string` - Currently supported `connector_id` values are: + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - 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` + - `type BetaResponseInputItemMcpListTools struct{…}` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + A list of tools available on an MCP server. - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + - `ID string` - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + The unique ID of the list. - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + - `ServerLabel string` - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + The label of the MCP server. - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + - `Tools []BetaResponseInputItemMcpListToolsTool` - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + The tools available on the server. - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + - `InputSchema any` - - `DeferLoading bool` + The JSON schema describing the tool's input. - Whether this MCP tool is deferred and discovered via tool search. + - `Name string` - - `Headers map[string, string]` + The name of the tool. - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `Annotations any` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + Additional annotations about the tool. - Specify which of the MCP server's tools require approval. + - `Description string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + The description of the tool. - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `Type McpListTools` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + The type of the item. Always `mcp_list_tools`. - A filter object to specify which tools are allowed. + - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` - - `ReadOnly bool` + - `Agent BetaResponseInputItemMcpListToolsAgent` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The agent that produced this item. - - `ToolNames []string` + - `AgentName string` - List of allowed tool names. + The canonical name of the agent that produced this item. - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `Error string` - A filter object to specify which tools are allowed. + Error message if the server could not list tools. - - `ReadOnly bool` + - `type BetaResponseInputItemMcpApprovalRequest struct{…}` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + A request for human approval of a tool invocation. - - `ToolNames []string` + - `ID string` - List of allowed tool names. + The unique ID of the approval request. - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `Arguments 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. + A JSON string of arguments for the tool. - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `Name string` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + The name of the tool to run. - - `ServerDescription string` + - `ServerLabel string` - Optional description of the MCP server, used to provide more context. + The label of the MCP server making the request. - - `ServerURL string` + - `Type McpApprovalRequest` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + The type of the item. Always `mcp_approval_request`. - - `TunnelID string` + - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` - 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. + - `Agent BetaResponseInputItemMcpApprovalRequestAgent` - - `type BetaToolCodeInterpreter struct{…}` + The agent that produced this item. - A tool that runs Python code to help generate a response to a prompt. + - `AgentName string` - - `Container BetaToolCodeInterpreterContainerUnion` + The canonical name of the agent that produced this item. - 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. + - `type BetaResponseInputItemMcpApprovalResponse struct{…}` - - `string` + A response to an MCP approval request. - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + - `ApprovalRequestID string` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + The ID of the approval request being answered. - - `Type Auto` + - `Approve bool` - Always `auto`. + Whether the request was approved. - - `const AutoAuto Auto = "auto"` + - `Type McpApprovalResponse` - - `FileIDs []string` + The type of the item. Always `mcp_approval_response`. - An optional list of uploaded files to make available to your code. + - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` - - `MemoryLimit string` + - `ID string` - The memory limit for the code interpreter container. + The unique ID of the approval response - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + - `Agent BetaResponseInputItemMcpApprovalResponseAgent` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + The agent that produced this item. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `AgentName string` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + The canonical name of the agent that produced this item. - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `Reason string` - Network access policy for the container. + Optional reason for the decision. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `type BetaResponseInputItemMcpCall struct{…}` - - `Type Disabled` + An invocation of a tool on an MCP server. - Disable outbound network access. Always `disabled`. + - `ID string` - - `const DisabledDisabled Disabled = "disabled"` + The unique ID of the tool call. - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `Arguments string` - - `AllowedDomains []string` + A JSON string of the arguments passed to the tool. - A list of allowed domains when type is `allowlist`. + - `Name string` - - `Type Allowlist` + The name of the tool that was run. - Allow outbound network access only to specified domains. Always `allowlist`. + - `ServerLabel string` - - `const AllowlistAllowlist Allowlist = "allowlist"` + The label of the MCP server running the tool. - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + - `Type McpCall` - Optional domain-scoped secrets for allowlisted domains. + The type of the item. Always `mcp_call`. - - `Domain string` + - `const McpCallMcpCall McpCall = "mcp_call"` - The domain associated with the secret. + - `Agent BetaResponseInputItemMcpCallAgent` - - `Name string` + The agent that produced this item. - The name of the secret to inject for the domain. + - `AgentName string` - - `Value string` + The canonical name of the agent that produced this item. - The secret value to inject for the domain. + - `ApprovalRequestID string` - - `Type CodeInterpreter` + 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. - The type of the code interpreter tool. Always `code_interpreter`. + - `Error string` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + The error from the tool call, if any. - - `AllowedCallers []string` + - `Output string` - The tool invocation context(s). + The output from the tool call. - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `Status string` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - `Type ProgrammaticToolCalling` + - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - The type of the tool. Always `programmatic_tool_calling`. + - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - `type BetaToolImageGeneration struct{…}` + - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - A tool that generates images using the GPT image models. + - `type BetaResponseCustomToolCallOutput struct{…}` - - `Type ImageGeneration` + The output of a custom tool call from your code, being sent back to the model. - The type of the image generation tool. Always `image_generation`. + - `CallID string` - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + The call ID, used to map this custom tool call output to a custom tool call. - - `Action string` + - `Output BetaResponseCustomToolCallOutputOutputUnion` - Whether to generate a new image or edit an existing image. Default: `auto`. + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + - `string` - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + Text, image, or file output of the custom tool call. - - `Background string` + - `type BetaResponseInputText struct{…}` - 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. + A text input to the model. - `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. + - `type BetaResponseInputImage struct{…}` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `type BetaResponseInputFile struct{…}` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + A file input to the model. - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `Type CustomToolCallOutput` - - `InputFidelity string` + The type of the custom tool call output. Always `custom_tool_call_output`. - 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 CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + - `ID string` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + The unique ID of the custom tool call output in the OpenAI platform. - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `Agent BetaResponseCustomToolCallOutputAgent` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + The agent that produced this item. - - `FileID string` + - `AgentName string` - File ID for the mask image. + The canonical name of the agent that produced this item. - - `ImageURL string` + - `Caller BetaResponseCustomToolCallOutputCallerUnion` - Base64-encoded mask image. + The execution context that produced this tool call. - - `Model string` + - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` - The image generation model to use. Default: `gpt-image-1`. + - `Type Direct` - - `string` + The caller type. Always `direct`. - - `string` + - `const DirectDirect Direct = "direct"` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `CallerID string` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + The call ID of the program item that produced this tool call. - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `Type Program` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + The caller type. Always `program`. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `const ProgramProgram Program = "program"` - - `Moderation string` + - `type BetaResponseCustomToolCall struct{…}` - Moderation level for the generated image. Default: `auto`. + A call to a custom tool created by the model. - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `CallID string` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + An identifier used to map this custom tool call to a tool call output. - - `OutputCompression int64` + - `Input string` - Compression level for the output image. Default: 100. + The input for the custom tool call generated by the model. - - `OutputFormat string` + - `Name string` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + The name of the custom tool being called. - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + - `Type CustomToolCall` - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + The type of the custom tool call. Always `custom_tool_call`. - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` - - `PartialImages int64` + - `ID string` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + The unique ID of the custom tool call in the OpenAI platform. - - `Quality string` + - `Agent BetaResponseCustomToolCallAgent` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + The agent that produced this item. - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `AgentName string` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + The canonical name of the agent that produced this item. - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `Caller BetaResponseCustomToolCallCallerUnion` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The execution context that produced this tool call. - - `Size string` + - `type BetaResponseCustomToolCallCallerDirect struct{…}` - 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`. + - `Type Direct` - - `string` + - `const DirectDirect Direct = "direct"` - - `string` + - `type BetaResponseCustomToolCallCallerProgram struct{…}` - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `CallerID string` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + The call ID of the program item that produced this tool call. - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `Type Program` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + - `const ProgramProgram Program = "program"` - - `type BetaToolLocalShell struct{…}` + - `Namespace string` - A tool that allows the model to execute shell commands in a local environment. + The namespace of the custom tool being called. - - `Type LocalShell` + - `type BetaResponseInputItemCompactionTrigger struct{…}` - The type of the local shell tool. Always `local_shell`. + Compacts the current context. Must be the final input item. - - `const LocalShellLocalShell LocalShell = "local_shell"` + - `Type CompactionTrigger` - - `type BetaFunctionShellTool struct{…}` + The type of the item. Always `compaction_trigger`. - A tool that allows the model to execute shell commands. + - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` - - `Type Shell` + - `Agent BetaResponseInputItemCompactionTriggerAgent` - The type of the shell tool. Always `shell`. + The agent that produced this item. - - `const ShellShell Shell = "shell"` + - `AgentName string` - - `AllowedCallers []string` + The canonical name of the agent that produced this item. - The tool invocation context(s). + - `type BetaResponseInputItemItemReference struct{…}` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + An internal identifier for an item to reference. - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `ID string` - - `Environment BetaFunctionShellToolEnvironmentUnion` + The ID of the item to reference. - - `type BetaContainerAuto struct{…}` + - `Agent BetaResponseInputItemItemReferenceAgent` - - `Type ContainerAuto` + The agent that produced this item. - Automatically creates a container for this request + - `AgentName string` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + The canonical name of the agent that produced this item. - - `FileIDs []string` + - `Type string` - An optional list of uploaded files to make available to your code. + The type of item to reference. Always `item_reference`. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` - The memory limit for the container. + - `type BetaResponseInputItemProgram struct{…}` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `ID string` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The unique ID of this program item. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `CallID string` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + The stable call ID of the program item. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `Code string` - Network access policy for the container. + The JavaScript source executed by programmatic tool calling. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `Fingerprint string` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + Opaque program replay fingerprint that must be round-tripped. - - `Skills []BetaContainerAutoSkillUnion` + - `Type Program` - An optional list of skills referenced by id or inline data. + The item type. Always `program`. - - `type BetaSkillReference struct{…}` + - `const ProgramProgram Program = "program"` - - `SkillID string` + - `Agent BetaResponseInputItemProgramAgent` - The ID of the referenced skill. + The agent that produced this item. - - `Type SkillReference` + - `AgentName string` - References a skill created with the /v1/skills endpoint. + The canonical name of the agent that produced this item. - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + - `type BetaResponseInputItemProgramOutput struct{…}` - - `Version string` + - `ID string` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + The unique ID of this program output item. - - `type BetaInlineSkill struct{…}` + - `CallID string` - - `Description string` + The call ID of the program item. - The description of the skill. + - `Result string` - - `Name string` + The result produced by the program item. - The name of the skill. + - `Status string` - - `Source BetaInlineSkillSource` + The terminal status of the program output. - Inline skill payload + - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` - - `Data string` + - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` - Base64-encoded skill zip bundle. + - `Type ProgramOutput` - - `MediaType ApplicationZip` + The item type. Always `program_output`. - The media type of the inline skill payload. Must be `application/zip`. + - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `Agent BetaResponseInputItemProgramOutputAgent` - - `Type Base64` + The agent that produced this item. + + - `AgentName string` + + The canonical name of the agent that produced this item. + + - `Instructions param.Field[string]` + + Body param: A system (or developer) message inserted into the model's context. + When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. + + - `Model param.Field[string]` + + Body param: Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models. + + - `ParallelToolCalls param.Field[bool]` + + Body param: Whether to allow the model to run tool calls in parallel. - The type of the inline skill source. Must be `base64`. + - `Personality param.Field[BetaResponseInputTokenCountParamsPersonality]` - - `const Base64Base64 Base64 = "base64"` + Body param: A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters. - - `Type Inline` + - `string` - Defines an inline skill for this request. + - `type BetaResponseInputTokenCountParamsPersonality string` - - `const InlineInline Inline = "inline"` + A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters. - - `type BetaLocalEnvironment struct{…}` + - `const BetaResponseInputTokenCountParamsPersonalityFriendly BetaResponseInputTokenCountParamsPersonality = "friendly"` - - `Type Local` + - `const BetaResponseInputTokenCountParamsPersonalityPragmatic BetaResponseInputTokenCountParamsPersonality = "pragmatic"` - Use a local computer environment. + - `PreviousResponseID param.Field[string]` - - `const LocalLocal Local = "local"` + Body param: The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - - `Skills []BetaLocalSkill` + - `Reasoning param.Field[BetaResponseInputTokenCountParamsReasoning]` - An optional list of skills. + Body param: **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning). - - `Description string` + - `Context string` - The description of the skill. + Controls which reasoning items are rendered back to the model on later turns. + When returned on a response, this is the effective reasoning context mode + used for the response. - - `Name string` + - `const BetaResponseInputTokenCountParamsReasoningContextAuto BetaResponseInputTokenCountParamsReasoningContext = "auto"` - The name of the skill. + - `const BetaResponseInputTokenCountParamsReasoningContextCurrentTurn BetaResponseInputTokenCountParamsReasoningContext = "current_turn"` - - `Path string` + - `const BetaResponseInputTokenCountParamsReasoningContextAllTurns BetaResponseInputTokenCountParamsReasoningContext = "all_turns"` - The path to the directory containing the skill. + - `Effort string` - - `type BetaContainerReference struct{…}` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - - `ContainerID string` + - `const BetaResponseInputTokenCountParamsReasoningEffortNone BetaResponseInputTokenCountParamsReasoningEffort = "none"` - The ID of the referenced container. + - `const BetaResponseInputTokenCountParamsReasoningEffortMinimal BetaResponseInputTokenCountParamsReasoningEffort = "minimal"` - - `Type ContainerReference` + - `const BetaResponseInputTokenCountParamsReasoningEffortLow BetaResponseInputTokenCountParamsReasoningEffort = "low"` - References a container created with the /v1/containers endpoint + - `const BetaResponseInputTokenCountParamsReasoningEffortMedium BetaResponseInputTokenCountParamsReasoningEffort = "medium"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const BetaResponseInputTokenCountParamsReasoningEffortHigh BetaResponseInputTokenCountParamsReasoningEffort = "high"` - - `type BetaCustomTool struct{…}` + - `const BetaResponseInputTokenCountParamsReasoningEffortXhigh BetaResponseInputTokenCountParamsReasoningEffort = "xhigh"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const BetaResponseInputTokenCountParamsReasoningEffortMax BetaResponseInputTokenCountParamsReasoningEffort = "max"` - - `Name string` + - `GenerateSummary string` - The name of the custom tool, used to identify it in tool calls. + **Deprecated:** use `summary` instead. - - `Type Custom` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - The type of the custom tool. Always `custom`. + - `const BetaResponseInputTokenCountParamsReasoningGenerateSummaryAuto BetaResponseInputTokenCountParamsReasoningGenerateSummary = "auto"` - - `const CustomCustom Custom = "custom"` + - `const BetaResponseInputTokenCountParamsReasoningGenerateSummaryConcise BetaResponseInputTokenCountParamsReasoningGenerateSummary = "concise"` - - `AllowedCallers []string` + - `const BetaResponseInputTokenCountParamsReasoningGenerateSummaryDetailed BetaResponseInputTokenCountParamsReasoningGenerateSummary = "detailed"` - The tool invocation context(s). + - `Mode string` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + Controls the reasoning execution mode for the request. - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + When returned on a response, this is the effective execution mode. - - `DeferLoading bool` + - `string` - Whether this tool should be deferred and discovered via tool search. + - `string` - - `Description string` + - `const BetaResponseInputTokenCountParamsReasoningModeStandard BetaResponseInputTokenCountParamsReasoningMode = "standard"` - Optional description of the custom tool, used to provide more context. + - `const BetaResponseInputTokenCountParamsReasoningModePro BetaResponseInputTokenCountParamsReasoningMode = "pro"` - - `Format BetaCustomToolFormatUnion` + - `Summary string` - The input format for the custom tool. Default is unconstrained text. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `type BetaCustomToolFormatText struct{…}` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - Unconstrained free-form text. + - `const BetaResponseInputTokenCountParamsReasoningSummaryAuto BetaResponseInputTokenCountParamsReasoningSummary = "auto"` - - `Type Text` + - `const BetaResponseInputTokenCountParamsReasoningSummaryConcise BetaResponseInputTokenCountParamsReasoningSummary = "concise"` - Unconstrained text format. Always `text`. + - `const BetaResponseInputTokenCountParamsReasoningSummaryDetailed BetaResponseInputTokenCountParamsReasoningSummary = "detailed"` - - `const TextText Text = "text"` + - `Text param.Field[BetaResponseInputTokenCountParamsText]` - - `type BetaCustomToolFormatGrammar struct{…}` + Body param: Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - A grammar defined by the user. + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - - `Definition string` + - `Format BetaResponseFormatTextConfigUnion` - The grammar definition. + An object specifying the format that the model must output. - - `Syntax string` + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The syntax of the grammar definition. One of `lark` or `regex`. + The default format is `{ "type": "text" }` with no additional options. - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + **Not recommended for gpt-4o and newer models:** - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - - `Type Grammar` + - `type BetaResponseFormatTextConfigText struct{…}` - Grammar format. Always `grammar`. + Default response format. Used to generate text responses. - - `const GrammarGrammar Grammar = "grammar"` + - `Type Text` - - `type BetaNamespaceTool struct{…}` + The type of response format being defined. Always `text`. - Groups function/custom tools under a shared namespace. + - `const TextText Text = "text"` - - `Description string` + - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` - A description of the namespace shown to the model. + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - `Name string` - The namespace name used in tool calls (for example, `crm`). - - - `Tools []BetaNamespaceToolToolUnion` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The function/custom tools available inside this namespace. + - `Schema map[string, any]` - - `type BetaNamespaceToolToolFunction struct{…}` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `Name string` + - `Type JSONSchema` - - `Type Function` + The type of response format being defined. Always `json_schema`. - - `const FunctionFunction Function = "function"` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `AllowedCallers []string` + - `Description string` - The tool invocation context(s). + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `Strict bool` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `DeferLoading bool` + - `type BetaResponseFormatTextConfigJSONObject struct{…}` - Whether this function should be deferred and discovered via tool search. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `Description string` + - `Type JSONObject` - - `OutputSchema map[string, any]` + The type of response format being defined. Always `json_object`. - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `Parameters any` + - `Verbosity string` - - `Strict bool` + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + - `const BetaResponseInputTokenCountParamsTextVerbosityLow BetaResponseInputTokenCountParamsTextVerbosity = "low"` - - `type BetaCustomTool struct{…}` + - `const BetaResponseInputTokenCountParamsTextVerbosityMedium BetaResponseInputTokenCountParamsTextVerbosity = "medium"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const BetaResponseInputTokenCountParamsTextVerbosityHigh BetaResponseInputTokenCountParamsTextVerbosity = "high"` - - `Type Namespace` + - `ToolChoice param.Field[BetaResponseInputTokenCountParamsToolChoiceUnion]` - The type of the tool. Always `namespace`. + Body param: Controls which tool the model should use, if any. - - `const NamespaceNamespace Namespace = "namespace"` + - `type BetaToolChoiceOptions string` - - `type BetaToolSearchTool struct{…}` + Controls which (if any) tool is called by the model. - Hosted or BYOT tool search configuration for deferred tools. + `none` means the model will not call any tool and instead generates a message. - - `Type ToolSearch` + `auto` means the model can pick between generating a message or calling one or + more tools. - The type of the tool. Always `tool_search`. + `required` means the model must call one or more tools. - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` - - `Description string` + - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` - Description shown to the model for a client-executed tool search tool. + - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` - - `Execution BetaToolSearchToolExecution` + - `type BetaToolChoiceAllowed struct{…}` - Whether tool search is executed by the server or by the client. + Constrains the tools available to the model to a pre-defined set. - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `Mode BetaToolChoiceAllowedMode` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + Constrains the tools available to the model to a pre-defined set. - - `Parameters any` + `auto` allows the model to pick from among the allowed tools and generate a + message. - Parameter schema for a client-executed tool search tool. + `required` requires the model to call one or more of the allowed tools. - - `type BetaWebSearchPreviewTool struct{…}` + - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` - - `Type BetaWebSearchPreviewToolType` + - `Tools []map[string, any]` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + A list of tool definitions that the model should be allowed to call. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + For the Responses API, the list of tool definitions might look like: - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - - `SearchContentTypes []string` + - `Type AllowedTools` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + Allowed tool configuration type. Always `allowed_tools`. - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `type BetaToolChoiceTypes struct{…}` - 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. + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `Type BetaToolChoiceTypesType` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + The type of hosted tool the model should to use. Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + Allowed values are: - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - The user's location. + - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` - - `Type Approximate` + - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` - The type of location approximation. Always `approximate`. + - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` - - `const ApproximateApproximate Approximate = "approximate"` + - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` - - `City string` + - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` - Free text input for the city of the user, e.g. `San Francisco`. + - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` - - `Country string` + - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` - - `Region string` + - `type BetaToolChoiceFunction struct{…}` - Free text input for the region of the user, e.g. `California`. + Use this option to force the model to call a specific function. - - `Timezone string` + - `Name string` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + The name of the function to call. - - `type BetaApplyPatchTool struct{…}` + - `Type Function` - Allows the assistant to create, delete, or update files using unified diffs. + For function calling, the type is always `function`. - - `Type ApplyPatch` + - `const FunctionFunction Function = "function"` - The type of the tool. Always `apply_patch`. + - `type BetaToolChoiceMcp struct{…}` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + Use this option to force the model to call a specific tool on a remote MCP server. - - `AllowedCallers []string` + - `ServerLabel string` - The tool invocation context(s). + The label of the MCP server to use. - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `Type Mcp` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + For MCP tools, the type is always `mcp`. - - `Type ToolSearchOutput` + - `const McpMcp Mcp = "mcp"` - The item type. Always `tool_search_output`. + - `Name string` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + The name of the tool to call on the server. - - `ID string` + - `type BetaToolChoiceCustom struct{…}` - The unique ID of this tool search output. + Use this option to force the model to call a specific custom tool. - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + - `Name string` - The agent that produced this item. + The name of the custom tool to call. - - `AgentName string` + - `Type Custom` - The canonical name of the agent that produced this item. + For custom tool calling, the type is always `custom`. - - `CallID string` + - `const CustomCustom Custom = "custom"` - The unique ID of the tool search call generated by the model. + - `type BetaResponseInputTokenCountParamsToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` - - `Execution BetaResponseToolSearchOutputItemParamExecution` + - `Type ProgrammaticToolCalling` - Whether tool search was executed by the server or by the client. + The tool to call. Always `programmatic_tool_calling`. - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + - `type BetaToolChoiceApplyPatch struct{…}` - - `Status BetaResponseToolSearchOutputItemParamStatus` + Forces the model to call the apply_patch tool when executing a tool call. - The status of the tool search output. + - `Type ApplyPatch` - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` + The tool to call. Always `apply_patch`. - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `type BetaToolChoiceShell struct{…}` - - `type BetaResponseInputItemAdditionalTools struct{…}` + Forces the model to call the shell tool when a tool call is required. - - `Role Developer` + - `Type Shell` - The role that provided the additional tools. Only `developer` is supported. + The tool to call. Always `shell`. - - `const DeveloperDeveloper Developer = "developer"` + - `const ShellShell Shell = "shell"` - - `Tools []BetaToolUnion` + - `Tools param.Field[[]BetaToolUnion]` - A list of additional tools made available at this item. + Body param: An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. - `type BetaFunctionTool struct{…}` @@ -142635,18512 +155032,19850 @@ func main() { Allows the assistant to create, delete, or update files using unified diffs. - - `Type AdditionalTools` - - The item type. Always `additional_tools`. - - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` - - - `ID string` - - The unique ID of this additional tools item. - - - `Agent BetaResponseInputItemAdditionalToolsAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `type BetaResponseReasoningItem 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](https://platform.openai.com/docs/guides/conversation-state). - - - `ID string` - - The unique identifier of the reasoning content. - - - `Summary []BetaResponseReasoningItemSummary` - - Reasoning summary content. - - - `Text string` - - A summary of the reasoning output from the model so far. + - `Truncation param.Field[BetaResponseInputTokenCountParamsTruncation]` - - `Type SummaryText` + Body param: The truncation strategy to use for the model response. - `auto`: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. - `disabled` (default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. - The type of the object. Always `summary_text`. + - `const BetaResponseInputTokenCountParamsTruncationAuto BetaResponseInputTokenCountParamsTruncation = "auto"` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `const BetaResponseInputTokenCountParamsTruncationDisabled BetaResponseInputTokenCountParamsTruncation = "disabled"` - - `Type Reasoning` + - `Betas param.Field[[]string]` - The type of the object. Always `reasoning`. + Header param: Optional beta features to enable for this request. - - `const ReasoningReasoning Reasoning = "reasoning"` + - `const BetaResponseInputTokenCountParamsOpenAIBetaResponsesMultiAgentV1 BetaResponseInputTokenCountParamsOpenAIBeta = "responses_multi_agent=v1"` - - `Agent BetaResponseReasoningItemAgent` +### Returns - The agent that produced this item. +- `type BetaResponseInputTokenCountResponse struct{…}` - - `AgentName string` + - `InputTokens int64` - The canonical name of the agent that produced this item. + - `Object ResponseInputTokens` - - `Content []BetaResponseReasoningItemContent` + - `const ResponseInputTokensResponseInputTokens ResponseInputTokens = "response.input_tokens"` - Reasoning text content. +### Example - - `Text string` +```go +package main - The reasoning text from the model. +import ( + "context" + "fmt" - - `Type ReasoningText` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The type of the reasoning text. Always `reasoning_text`. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + response, err := client.Beta.Responses.InputTokens.Count(context.TODO(), openai.BetaResponseInputTokenCountParams{ - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", response.InputTokens) +} +``` - - `EncryptedContent string` +#### Response - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. +```json +{ + "input_tokens": 123, + "object": "response.input_tokens" +} +``` - - `Status BetaResponseReasoningItemStatus` +### Example - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. +```go +package main - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` +import ( + "context" + "fmt" - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + "github.com/openai/openai-go" + "github.com/openai/openai-go/responses" +) - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` +func main() { + client := openai.NewClient() + response, err := client.Responses.InputTokens.Count(context.TODO(), responses.InputTokenCountParams{ + Model: "gpt-5", + Input: "Tell me a joke.", + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", response.InputTokens) +} +``` - - `type BetaResponseCompactionItemParamResp struct{…}` +#### Response - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). +```json +{ + "object": "response.input_tokens", + "input_tokens": 11 +} +``` - - `EncryptedContent string` +# ChatKit - The encrypted content of the compaction summary. +## Domain Types - - `Type Compaction` +### ChatKit Workflow - The type of the item. Always `compaction`. +- `type ChatKitWorkflow struct{…}` - - `const CompactionCompaction Compaction = "compaction"` + Workflow metadata and state returned for the session. - `ID string` - The ID of the compaction item. - - - `Agent BetaResponseCompactionItemParamAgentResp` - - The agent that produced this item. - - - `AgentName string` + Identifier of the workflow backing the session. - The canonical name of the agent that produced this item. + - `StateVariables map[string, ChatKitWorkflowStateVariableUnion]` - - `type BetaResponseInputItemImageGenerationCall struct{…}` + State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided. - An image generation request made by the model. + - `string` - - `ID string` + - `bool` - The unique ID of the image generation call. + - `float64` - - `Result string` + - `Tracing ChatKitWorkflowTracing` - The generated image encoded in base64. + Tracing settings applied to the workflow. - - `Status string` + - `Enabled bool` - The status of the image generation call. + Indicates whether tracing is enabled. - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `Version string` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + Specific workflow version used for the session. Defaults to null when using the latest deployment. - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` +# Sessions - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` +## Cancel chat session - - `Type ImageGenerationCall` +`client.Beta.ChatKit.Sessions.Cancel(ctx, sessionID) (*ChatSession, error)` - The type of the image generation call. Always `image_generation_call`. +**post** `/chatkit/sessions/{session_id}/cancel` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` +Cancel an active ChatKit session and return its most recent metadata. - - `Agent BetaResponseInputItemImageGenerationCallAgent` +Cancelling prevents new requests from using the issued client secret. - The agent that produced this item. +### Parameters - - `AgentName string` +- `sessionID string` - The canonical name of the agent that produced this item. +### Returns - - `type BetaResponseCodeInterpreterToolCall struct{…}` +- `type ChatSession struct{…}` - A tool call to run code. + Represents a ChatKit session and its resolved configuration. - `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 []BetaResponseCodeInterpreterToolCallOutputUnion` - - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. - - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` - - The logs output from the code interpreter. - - - `Logs string` - - The logs output from the code interpreter. - - - `Type Logs` + Identifier for the ChatKit session. - The type of the output. Always `logs`. + - `ChatKitConfiguration ChatSessionChatKitConfiguration` - - `const LogsLogs Logs = "logs"` + Resolved ChatKit feature configuration for the session. - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + - `AutomaticThreadTitling ChatSessionAutomaticThreadTitling` - The image output from the code interpreter. + Automatic thread titling preferences. - - `Type Image` + - `Enabled bool` - The type of the output. Always `image`. + Whether automatic thread titling is enabled. - - `const ImageImage Image = "image"` + - `FileUpload ChatSessionFileUpload` - - `URL string` + Upload settings for the session. - The URL of the image output from the code interpreter. + - `Enabled bool` - - `Status BetaResponseCodeInterpreterToolCallStatus` + Indicates if uploads are enabled for the session. - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `MaxFileSize int64` - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + Maximum upload size in megabytes. - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + - `MaxFiles int64` - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + Maximum number of uploads allowed during the session. - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + - `History ChatSessionHistory` - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + History retention configuration. - - `Type CodeInterpreterCall` + - `Enabled bool` - The type of the code interpreter tool call. Always `code_interpreter_call`. + Indicates if chat history is persisted for the session. - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + - `RecentThreads int64` - - `Agent BetaResponseCodeInterpreterToolCallAgent` + Number of prior threads surfaced in history views. Defaults to null when all history is retained. - The agent that produced this item. + - `ClientSecret string` - - `AgentName string` + Ephemeral client secret that authenticates session requests. - The canonical name of the agent that produced this item. + - `ExpiresAt int64` - - `type BetaResponseInputItemLocalShellCall struct{…}` + Unix timestamp (in seconds) for when the session expires. - A tool call to run a command on the local shell. + - `MaxRequestsPer1Minute int64` - - `ID string` + Convenience copy of the per-minute request limit. - The unique ID of the local shell call. + - `Object ChatKitSession` - - `Action BetaResponseInputItemLocalShellCallAction` + Type discriminator that is always `chatkit.session`. - Execute a shell command on the server. + - `const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"` - - `Command []string` + - `RateLimits ChatSessionRateLimits` - The command to run. + Resolved rate limit values. - - `Env map[string, string]` + - `MaxRequestsPer1Minute int64` - Environment variables to set for the command. + Maximum allowed requests per one-minute window. - - `Type Exec` + - `Status ChatSessionStatus` - The type of the local shell action. Always `exec`. + Current lifecycle state of the session. - - `const ExecExec Exec = "exec"` + - `const ChatSessionStatusActive ChatSessionStatus = "active"` - - `TimeoutMs int64` + - `const ChatSessionStatusExpired ChatSessionStatus = "expired"` - Optional timeout in milliseconds for the command. + - `const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"` - `User string` - Optional user to run the command as. - - - `WorkingDirectory string` + User identifier associated with the session. - Optional working directory to run the command in. + - `Workflow ChatKitWorkflow` - - `CallID string` + Workflow metadata for the session. - The unique ID of the local shell tool call generated by the model. + - `ID string` - - `Status string` + Identifier of the workflow backing the session. - The status of the local shell call. + - `StateVariables map[string, ChatKitWorkflowStateVariableUnion]` - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided. - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + - `string` - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `bool` - - `Type LocalShellCall` + - `float64` - The type of the local shell call. Always `local_shell_call`. + - `Tracing ChatKitWorkflowTracing` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + Tracing settings applied to the workflow. - - `Agent BetaResponseInputItemLocalShellCallAgent` + - `Enabled bool` - The agent that produced this item. + Indicates whether tracing is enabled. - - `AgentName string` + - `Version string` - The canonical name of the agent that produced this item. + Specific workflow version used for the session. Defaults to null when using the latest deployment. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` +### Example - The output of a local shell tool call. +```go +package main - - `ID string` +import ( + "context" + "fmt" - The unique ID of the local shell tool call generated by the model. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `Output string` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + chatSession, err := client.Beta.ChatKit.Sessions.Cancel(context.TODO(), "cksess_123") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", chatSession.ID) +} +``` - A JSON string of the output of the local shell tool call. +#### Response - - `Type LocalShellCallOutput` +```json +{ + "id": "id", + "chatkit_configuration": { + "automatic_thread_titling": { + "enabled": true + }, + "file_upload": { + "enabled": true, + "max_file_size": 0, + "max_files": 0 + }, + "history": { + "enabled": true, + "recent_threads": 0 + } + }, + "client_secret": "client_secret", + "expires_at": 0, + "max_requests_per_1_minute": 0, + "object": "chatkit.session", + "rate_limits": { + "max_requests_per_1_minute": 0 + }, + "status": "active", + "user": "user", + "workflow": { + "id": "id", + "state_variables": { + "foo": "string" + }, + "tracing": { + "enabled": true + }, + "version": "version" + } +} +``` - The type of the local shell tool call output. Always `local_shell_call_output`. +### Example - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` +```go +package main - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` +import ( + "context" + "fmt" - The agent that produced this item. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `AgentName string` +func main() { + client := openai.NewClient() + chatSession, err := client.Beta.ChatKit.Sessions.Cancel(context.TODO(), "cksess_123") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", chatSession.ID) +} +``` - The canonical name of the agent that produced this item. +#### Response - - `Status string` +```json +{ + "id": "cksess_123", + "object": "chatkit.session", + "workflow": { + "id": "workflow_alpha", + "version": "1" + }, + "scope": { + "customer_id": "cust_456" + }, + "max_requests_per_1_minute": 30, + "ttl_seconds": 900, + "status": "cancelled", + "cancelled_at": 1712345678 +} +``` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. +## Create ChatKit session - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` +`client.Beta.ChatKit.Sessions.New(ctx, body) (*ChatSession, error)` - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` +**post** `/chatkit/sessions` - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` +Create a ChatKit session. - - `type BetaResponseInputItemShellCall struct{…}` +### Parameters - A tool representing a request to execute one or more shell commands. +- `body BetaChatKitSessionNewParams` - - `Action BetaResponseInputItemShellCallAction` + - `User param.Field[string]` - The shell commands and limits that describe how to run the tool call. + A free-form string that identifies your end user; ensures this Session can access other objects that have the same `user` scope. - - `Commands []string` + - `Workflow param.Field[ChatSessionWorkflowParamResp]` - Ordered shell commands for the execution environment to run. + Workflow that powers the session. - - `MaxOutputLength int64` + - `ChatKitConfiguration param.Field[ChatSessionChatKitConfigurationParamResp]` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + Optional overrides for ChatKit runtime configuration features - - `TimeoutMs int64` + - `ExpiresAfter param.Field[ChatSessionExpiresAfterParamResp]` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + Optional override for session expiration timing in seconds from creation. Defaults to 10 minutes. - - `CallID string` + - `RateLimits param.Field[ChatSessionRateLimitsParamResp]` - The unique ID of the shell tool call generated by the model. + Optional override for per-minute request limits. When omitted, defaults to 10. - - `Type ShellCall` +### Returns - The type of the item. Always `shell_call`. +- `type ChatSession struct{…}` - - `const ShellCallShellCall ShellCall = "shell_call"` + Represents a ChatKit session and its resolved configuration. - `ID string` - The unique ID of the shell tool call. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemShellCallAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseInputItemShellCallCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` + Identifier for the ChatKit session. - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `ChatKitConfiguration ChatSessionChatKitConfiguration` - - `CallerID string` + Resolved ChatKit feature configuration for the session. - The call ID of the program item that produced this tool call. + - `AutomaticThreadTitling ChatSessionAutomaticThreadTitling` - - `Type Program` + Automatic thread titling preferences. - The caller type. Always `program`. + - `Enabled bool` - - `const ProgramProgram Program = "program"` + Whether automatic thread titling is enabled. - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + - `FileUpload ChatSessionFileUpload` - The environment to execute the shell commands in. + Upload settings for the session. - - `type BetaLocalEnvironment struct{…}` + - `Enabled bool` - - `type BetaContainerReference struct{…}` + Indicates if uploads are enabled for the session. - - `Status string` + - `MaxFileSize int64` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + Maximum upload size in megabytes. - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + - `MaxFiles int64` - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + Maximum number of uploads allowed during the session. - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + - `History ChatSessionHistory` - - `type BetaResponseInputItemShellCallOutput struct{…}` + History retention configuration. - The streamed output items emitted by a shell tool call. + - `Enabled bool` - - `CallID string` + Indicates if chat history is persisted for the session. - The unique ID of the shell tool call generated by the model. + - `RecentThreads int64` - - `Output []BetaResponseFunctionShellCallOutputContent` + Number of prior threads surfaced in history views. Defaults to null when all history is retained. - Captured chunks of stdout and stderr output, along with their associated outcomes. + - `ClientSecret string` - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + Ephemeral client secret that authenticates session requests. - The exit or timeout outcome associated with this shell call. + - `ExpiresAt int64` - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + Unix timestamp (in seconds) for when the session expires. - Indicates that the shell call exceeded its configured time limit. + - `MaxRequestsPer1Minute int64` - - `Type Timeout` + Convenience copy of the per-minute request limit. - The outcome type. Always `timeout`. + - `Object ChatKitSession` - - `const TimeoutTimeout Timeout = "timeout"` + Type discriminator that is always `chatkit.session`. - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + - `const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"` - Indicates that the shell commands finished and returned an exit code. + - `RateLimits ChatSessionRateLimits` - - `ExitCode int64` + Resolved rate limit values. - The exit code returned by the shell process. + - `MaxRequestsPer1Minute int64` - - `Type Exit` + Maximum allowed requests per one-minute window. - The outcome type. Always `exit`. + - `Status ChatSessionStatus` - - `const ExitExit Exit = "exit"` + Current lifecycle state of the session. - - `Stderr string` + - `const ChatSessionStatusActive ChatSessionStatus = "active"` - Captured stderr output for the shell call. + - `const ChatSessionStatusExpired ChatSessionStatus = "expired"` - - `Stdout string` + - `const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"` - Captured stdout output for the shell call. + - `User string` - - `Type ShellCallOutput` + User identifier associated with the session. - The type of the item. Always `shell_call_output`. + - `Workflow ChatKitWorkflow` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + Workflow metadata for the session. - `ID string` - The unique ID of the shell tool call output. Populated when this item is returned via API. - - - `Agent BetaResponseInputItemShellCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` - - - `Type Direct` - - The caller type. Always `direct`. - - - `const DirectDirect Direct = "direct"` - - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` - - - `CallerID string` - - The call ID of the program item that produced this tool call. + Identifier of the workflow backing the session. - - `Type Program` + - `StateVariables map[string, ChatKitWorkflowStateVariableUnion]` - The caller type. Always `program`. + State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided. - - `const ProgramProgram Program = "program"` + - `string` - - `MaxOutputLength int64` + - `bool` - The maximum number of UTF-8 characters captured for this shell call's combined output. + - `float64` - - `Status string` + - `Tracing ChatKitWorkflowTracing` - The status of the shell call output. + Tracing settings applied to the workflow. - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + - `Enabled bool` - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + Indicates whether tracing is enabled. - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + - `Version string` - - `type BetaResponseInputItemApplyPatchCall struct{…}` + Specific workflow version used for the session. Defaults to null when using the latest deployment. - A tool call representing a request to create, delete, or update files using diff patches. +### Example - - `CallID string` +```go +package main - The unique ID of the apply patch tool call generated by the model. +import ( + "context" + "fmt" - - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The specific create, delete, or update instruction for the apply_patch tool call. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + chatSession, err := client.Beta.ChatKit.Sessions.New(context.TODO(), openai.BetaChatKitSessionNewParams{ + User: "x", + Workflow: openai.ChatSessionWorkflowParam{ + ID: "id", + }, + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", chatSession.ID) +} +``` - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` +#### Response - Instruction for creating a new file via the apply_patch tool. +```json +{ + "id": "id", + "chatkit_configuration": { + "automatic_thread_titling": { + "enabled": true + }, + "file_upload": { + "enabled": true, + "max_file_size": 0, + "max_files": 0 + }, + "history": { + "enabled": true, + "recent_threads": 0 + } + }, + "client_secret": "client_secret", + "expires_at": 0, + "max_requests_per_1_minute": 0, + "object": "chatkit.session", + "rate_limits": { + "max_requests_per_1_minute": 0 + }, + "status": "active", + "user": "user", + "workflow": { + "id": "id", + "state_variables": { + "foo": "string" + }, + "tracing": { + "enabled": true + }, + "version": "version" + } +} +``` - - `Diff string` +### Example - Unified diff content to apply when creating the file. +```go +package main - - `Path string` +import ( + "context" + "fmt" - Path of the file to create relative to the workspace root. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `Type CreateFile` +func main() { + client := openai.NewClient() + chatSession, err := client.Beta.ChatKit.Sessions.New(context.TODO(), openai.BetaChatKitSessionNewParams{ + User: "user", + Workflow: openai.ChatSessionWorkflowParam{ + ID: "id", + }, + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", chatSession.ID) +} +``` - The operation type. Always `create_file`. +#### Response - - `const CreateFileCreateFile CreateFile = "create_file"` +```json +{ + "client_secret": "chatkit_token_123", + "expires_at": 1735689600, + "workflow": { + "id": "workflow_alpha", + "version": "2024-10-01" + }, + "scope": { + "project": "alpha", + "environment": "staging" + }, + "max_requests_per_1_minute": 60, + "max_requests_per_session": 500, + "status": "active" +} +``` - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` +# Threads - Instruction for deleting an existing file via the apply_patch tool. +## List ChatKit thread items - - `Path string` +`client.Beta.ChatKit.Threads.ListItems(ctx, threadID, query) (*ConversationCursorPage[ChatKitThreadItemListDataUnion], error)` - Path of the file to delete relative to the workspace root. +**get** `/chatkit/threads/{thread_id}/items` - - `Type DeleteFile` +List items that belong to a ChatKit thread. - The operation type. Always `delete_file`. +### Parameters - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` +- `threadID string` - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` +- `query BetaChatKitThreadListItemsParams` - Instruction for updating an existing file via the apply_patch tool. + - `After param.Field[string]` - - `Diff string` + List items created after this thread item ID. Defaults to null for the first page. - Unified diff content to apply to the existing file. + - `Before param.Field[string]` - - `Path string` + List items created before this thread item ID. Defaults to null for the newest results. - Path of the file to update relative to the workspace root. + - `Limit param.Field[int64]` - - `Type UpdateFile` + Maximum number of thread items to return. Defaults to 20. - The operation type. Always `update_file`. + - `Order param.Field[BetaChatKitThreadListItemsParamsOrder]` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + Sort order for results by creation time. Defaults to `desc`. - - `Status string` + - `const BetaChatKitThreadListItemsParamsOrderAsc BetaChatKitThreadListItemsParamsOrder = "asc"` - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `const BetaChatKitThreadListItemsParamsOrderDesc BetaChatKitThreadListItemsParamsOrder = "desc"` - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` +### Returns - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` +- `type ChatKitThreadItemListDataUnion interface{…}` - - `Type ApplyPatchCall` + User-authored messages within a thread. - The type of the item. Always `apply_patch_call`. + - `type ChatKitThreadUserMessageItem struct{…}` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + User-authored messages within a thread. - `ID string` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + Identifier of the thread item. - - `Agent BetaResponseInputItemApplyPatchCallAgent` + - `Attachments []ChatKitAttachment` - The agent that produced this item. + Attachments associated with the user message. Defaults to an empty list. - - `AgentName string` + - `ID string` - The canonical name of the agent that produced this item. + Identifier for the attachment. - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + - `MimeType string` - The execution context that produced this tool call. + MIME type of the attachment. - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + - `Name string` - - `Type Direct` + Original display name for the attachment. - The caller type. Always `direct`. + - `PreviewURL string` - - `const DirectDirect Direct = "direct"` + Preview URL for rendering the attachment inline. - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `Type ChatKitAttachmentType` - - `CallerID string` + Attachment discriminator. - The call ID of the program item that produced this tool call. + - `const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image"` - - `Type Program` + - `const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"` - The caller type. Always `program`. + - `Content []ChatKitThreadUserMessageItemContentUnion` - - `const ProgramProgram Program = "program"` + Ordered content elements supplied by the user. - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `type ChatKitThreadUserMessageItemContentInputText struct{…}` - The streamed output emitted by an apply patch tool call. + Text block that a user contributed to the thread. - - `CallID string` + - `Text string` - The unique ID of the apply patch tool call generated by the model. + Plain-text content supplied by the user. - - `Status string` + - `Type InputText` - The status of the apply patch tool call output. One of `completed` or `failed`. + Type discriminator that is always `input_text`. - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `const InputTextInputText InputText = "input_text"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + - `type ChatKitThreadUserMessageItemContentQuotedText struct{…}` - - `Type ApplyPatchCallOutput` + Quoted snippet that the user referenced in their message. - The type of the item. Always `apply_patch_call_output`. + - `Text string` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + Quoted text content. - - `ID string` + - `Type QuotedText` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + Type discriminator that is always `quoted_text`. - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - `const QuotedTextQuotedText QuotedText = "quoted_text"` - The agent that produced this item. + - `CreatedAt int64` - - `AgentName string` + Unix timestamp (in seconds) for when the item was created. - The canonical name of the agent that produced this item. + - `InferenceOptions ChatKitThreadUserMessageItemInferenceOptions` - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + Inference overrides applied to the message. Defaults to null when unset. - The execution context that produced this tool call. + - `Model string` - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + Model name that generated the response. Defaults to null when using the session default. - - `Type Direct` + - `ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoice` - The caller type. Always `direct`. + Preferred tool to invoke. Defaults to null when ChatKit should auto-select. - - `const DirectDirect Direct = "direct"` + - `ID string` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + Identifier of the requested tool. - - `CallerID string` + - `Object ChatKitThreadItem` - The call ID of the program item that produced this tool call. + Type discriminator that is always `chatkit.thread_item`. - - `Type Program` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - The caller type. Always `program`. + - `ThreadID string` - - `const ProgramProgram Program = "program"` + Identifier of the parent thread. - - `Output string` + - `Type ChatKitUserMessage` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + - `const ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"` - - `type BetaResponseInputItemMcpListTools struct{…}` + - `type ChatKitThreadAssistantMessageItem struct{…}` - A list of tools available on an MCP server. + Assistant-authored message within a thread. - `ID string` - The unique ID of the list. - - - `ServerLabel string` - - The label of the MCP server. + Identifier of the thread item. - - `Tools []BetaResponseInputItemMcpListToolsTool` + - `Content []ChatKitResponseOutputText` - The tools available on the server. + Ordered assistant response segments. - - `InputSchema any` + - `Annotations []ChatKitResponseOutputTextAnnotationUnion` - The JSON schema describing the tool's input. + Ordered list of annotations attached to the response text. - - `Name string` + - `type ChatKitResponseOutputTextAnnotationFile struct{…}` - The name of the tool. + Annotation that references an uploaded file. - - `Annotations any` + - `Source ChatKitResponseOutputTextAnnotationFileSource` - Additional annotations about the tool. + File attachment referenced by the annotation. - - `Description string` + - `Filename string` - The description of the tool. + Filename referenced by the annotation. - - `Type McpListTools` + - `Type File` - The type of the item. Always `mcp_list_tools`. + Type discriminator that is always `file`. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `const FileFile File = "file"` - - `Agent BetaResponseInputItemMcpListToolsAgent` + - `Type File` - The agent that produced this item. + Type discriminator that is always `file` for this annotation. - - `AgentName string` + - `const FileFile File = "file"` - The canonical name of the agent that produced this item. + - `type ChatKitResponseOutputTextAnnotationURL struct{…}` - - `Error string` + Annotation that references a URL. - Error message if the server could not list tools. + - `Source ChatKitResponseOutputTextAnnotationURLSource` - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + URL referenced by the annotation. - A request for human approval of a tool invocation. + - `Type URL` - - `ID string` + Type discriminator that is always `url`. - The unique ID of the approval request. + - `const URLURL URL = "url"` - - `Arguments string` + - `URL string` - A JSON string of arguments for the tool. + URL referenced by the annotation. - - `Name string` + - `Type URL` - The name of the tool to run. + Type discriminator that is always `url` for this annotation. - - `ServerLabel string` + - `const URLURL URL = "url"` - The label of the MCP server making the request. + - `Text string` - - `Type McpApprovalRequest` + Assistant generated text. - The type of the item. Always `mcp_approval_request`. + - `Type OutputText` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + Type discriminator that is always `output_text`. - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `const OutputTextOutputText OutputText = "output_text"` - The agent that produced this item. + - `CreatedAt int64` - - `AgentName string` + Unix timestamp (in seconds) for when the item was created. - The canonical name of the agent that produced this item. + - `Object ChatKitThreadItem` - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + Type discriminator that is always `chatkit.thread_item`. - A response to an MCP approval request. + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - - `ApprovalRequestID string` + - `ThreadID string` - The ID of the approval request being answered. + Identifier of the parent thread. - - `Approve bool` + - `Type ChatKitAssistantMessage` - Whether the request was approved. + Type discriminator that is always `chatkit.assistant_message`. - - `Type McpApprovalResponse` + - `const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"` - The type of the item. Always `mcp_approval_response`. + - `type ChatKitWidgetItem struct{…}` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + Thread item that renders a widget payload. - `ID string` - The unique ID of the approval response + Identifier of the thread item. - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `CreatedAt int64` - The agent that produced this item. + Unix timestamp (in seconds) for when the item was created. - - `AgentName string` + - `Object ChatKitThreadItem` - The canonical name of the agent that produced this item. + Type discriminator that is always `chatkit.thread_item`. - - `Reason string` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - Optional reason for the decision. + - `ThreadID string` - - `type BetaResponseInputItemMcpCall struct{…}` + Identifier of the parent thread. - An invocation of a tool on an MCP server. + - `Type ChatKitWidget` - - `ID string` + Type discriminator that is always `chatkit.widget`. - The unique ID of the tool call. + - `const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"` - - `Arguments string` + - `Widget string` - A JSON string of the arguments passed to the tool. + Serialized widget payload rendered in the UI. - - `Name string` + - `type ChatKitThreadItemListDataChatKitClientToolCall struct{…}` - The name of the tool that was run. + Record of a client side tool invocation initiated by the assistant. - - `ServerLabel string` + - `ID string` - The label of the MCP server running the tool. + Identifier of the thread item. - - `Type McpCall` + - `Arguments string` - The type of the item. Always `mcp_call`. + JSON-encoded arguments that were sent to the tool. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `CallID string` - - `Agent BetaResponseInputItemMcpCallAgent` + Identifier for the client tool call. - The agent that produced this item. + - `CreatedAt int64` - - `AgentName string` + Unix timestamp (in seconds) for when the item was created. - The canonical name of the agent that produced this item. + - `Name string` - - `ApprovalRequestID string` + Tool name that was invoked. - 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. + - `Object ChatKitThreadItem` - - `Error string` + Type discriminator that is always `chatkit.thread_item`. - The error from the tool call, if any. + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - `Output string` - The output from the tool call. + JSON-encoded output captured from the tool. Defaults to null while execution is in progress. - `Status string` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` - - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` - - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` - - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` - - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` - - - `type BetaResponseCustomToolCallOutput struct{…}` - - The output of a custom tool call from your code, being sent back to the model. - - - `CallID string` - - The call ID, used to map this custom tool call output to a custom tool call. - - - `Output BetaResponseCustomToolCallOutputOutputUnion` - - The output from the custom tool call generated by your code. - Can be a string or an list of output content. - - - `string` - - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` - - Text, image, or file output of the custom tool call. + Execution status for the tool call. - - `type BetaResponseInputText struct{…}` + - `const ChatKitThreadItemListDataChatKitClientToolCallStatusInProgress ChatKitThreadItemListDataChatKitClientToolCallStatus = "in_progress"` - A text input to the model. + - `const ChatKitThreadItemListDataChatKitClientToolCallStatusCompleted ChatKitThreadItemListDataChatKitClientToolCallStatus = "completed"` - - `type BetaResponseInputImage struct{…}` + - `ThreadID string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + Identifier of the parent thread. - - `type BetaResponseInputFile struct{…}` + - `Type ChatKitClientToolCall` - A file input to the model. + Type discriminator that is always `chatkit.client_tool_call`. - - `Type CustomToolCallOutput` + - `const ChatKitClientToolCallChatKitClientToolCall ChatKitClientToolCall = "chatkit.client_tool_call"` - The type of the custom tool call output. Always `custom_tool_call_output`. + - `type ChatKitThreadItemListDataChatKitTask struct{…}` - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + Task emitted by the workflow to show progress and status updates. - `ID string` - The unique ID of the custom tool call output in the OpenAI platform. - - - `Agent BetaResponseCustomToolCallOutputAgent` - - The agent that produced this item. - - - `AgentName string` - - The canonical name of the agent that produced this item. - - - `Caller BetaResponseCustomToolCallOutputCallerUnion` - - The execution context that produced this tool call. - - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + Identifier of the thread item. - - `Type Direct` + - `CreatedAt int64` - The caller type. Always `direct`. + Unix timestamp (in seconds) for when the item was created. - - `const DirectDirect Direct = "direct"` + - `Heading string` - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + Optional heading for the task. Defaults to null when not provided. - - `CallerID string` + - `Object ChatKitThreadItem` - The call ID of the program item that produced this tool call. + Type discriminator that is always `chatkit.thread_item`. - - `Type Program` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - The caller type. Always `program`. + - `Summary string` - - `const ProgramProgram Program = "program"` + Optional summary that describes the task. Defaults to null when omitted. - - `type BetaResponseCustomToolCall struct{…}` + - `TaskType string` - A call to a custom tool created by the model. + Subtype for the task. - - `CallID string` + - `const ChatKitThreadItemListDataChatKitTaskTaskTypeCustom ChatKitThreadItemListDataChatKitTaskTaskType = "custom"` - An identifier used to map this custom tool call to a tool call output. + - `const ChatKitThreadItemListDataChatKitTaskTaskTypeThought ChatKitThreadItemListDataChatKitTaskTaskType = "thought"` - - `Input string` + - `ThreadID string` - The input for the custom tool call generated by the model. + Identifier of the parent thread. - - `Name string` + - `Type ChatKitTask` - The name of the custom tool being called. + Type discriminator that is always `chatkit.task`. - - `Type CustomToolCall` + - `const ChatKitTaskChatKitTask ChatKitTask = "chatkit.task"` - The type of the custom tool call. Always `custom_tool_call`. + - `type ChatKitThreadItemListDataChatKitTaskGroup struct{…}` - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + Collection of workflow tasks grouped together in the thread. - `ID string` - The unique ID of the custom tool call in the OpenAI platform. - - - `Agent BetaResponseCustomToolCallAgent` + Identifier of the thread item. - The agent that produced this item. + - `CreatedAt int64` - - `AgentName string` + Unix timestamp (in seconds) for when the item was created. - The canonical name of the agent that produced this item. + - `Object ChatKitThreadItem` - - `Caller BetaResponseCustomToolCallCallerUnion` + Type discriminator that is always `chatkit.thread_item`. - The execution context that produced this tool call. + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + - `Tasks []ChatKitThreadItemListDataChatKitTaskGroupTask` - - `Type Direct` + Tasks included in the group. - - `const DirectDirect Direct = "direct"` + - `Heading string` - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + Optional heading for the grouped task. Defaults to null when not provided. - - `CallerID string` + - `Summary string` - The call ID of the program item that produced this tool call. + Optional summary that describes the grouped task. Defaults to null when omitted. - - `Type Program` + - `Type string` - - `const ProgramProgram Program = "program"` + Subtype for the grouped task. - - `Namespace string` + - `const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeCustom ChatKitThreadItemListDataChatKitTaskGroupTaskType = "custom"` - The namespace of the custom tool being called. + - `const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeThought ChatKitThreadItemListDataChatKitTaskGroupTaskType = "thought"` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + - `ThreadID string` - Compacts the current context. Must be the final input item. + Identifier of the parent thread. - - `Type CompactionTrigger` + - `Type ChatKitTaskGroup` - The type of the item. Always `compaction_trigger`. + Type discriminator that is always `chatkit.task_group`. - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + - `const ChatKitTaskGroupChatKitTaskGroup ChatKitTaskGroup = "chatkit.task_group"` - - `Agent BetaResponseInputItemCompactionTriggerAgent` +### Example - The agent that produced this item. +```go +package main - - `AgentName string` +import ( + "context" + "fmt" - The canonical name of the agent that produced this item. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `type BetaResponseInputItemItemReference struct{…}` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + page, err := client.Beta.ChatKit.Threads.ListItems( + context.TODO(), + "cthr_123", + openai.BetaChatKitThreadListItemsParams{ - An internal identifier for an item to reference. + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - - `ID string` +#### Response - The ID of the item to reference. +```json +{ + "data": [ + { + "id": "id", + "attachments": [ + { + "id": "id", + "mime_type": "mime_type", + "name": "name", + "preview_url": "https://example.com", + "type": "image" + } + ], + "content": [ + { + "text": "text", + "type": "input_text" + } + ], + "created_at": 0, + "inference_options": { + "model": "model", + "tool_choice": { + "id": "id" + } + }, + "object": "chatkit.thread_item", + "thread_id": "thread_id", + "type": "chatkit.user_message" + } + ], + "first_id": "first_id", + "has_more": true, + "last_id": "last_id", + "object": "list" +} +``` - - `Agent BetaResponseInputItemItemReferenceAgent` +### Example - The agent that produced this item. +```go +package main - - `AgentName string` +import ( + "context" + "fmt" - The canonical name of the agent that produced this item. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `Type string` +func main() { + client := openai.NewClient() + page, err := client.Beta.ChatKit.Threads.ListItems( + context.TODO(), + "cthr_123", + openai.BetaChatKitThreadListItemsParams{ - The type of item to reference. Always `item_reference`. + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` +#### Response - - `type BetaResponseInputItemProgram struct{…}` +```json +{ + "data": [ + { + "id": "cthi_user_001", + "object": "chatkit.thread_item", + "type": "user_message", + "content": [ + { + "type": "input_text", + "text": "I need help debugging an onboarding issue." + } + ], + "attachments": [] + }, + { + "id": "cthi_assistant_002", + "object": "chatkit.thread_item", + "type": "assistant_message", + "content": [ + { + "type": "output_text", + "text": "Let's start by confirming the workflow version you deployed." + } + ] + } + ], + "has_more": false, + "object": "list" +} +``` - - `ID string` +## Retrieve ChatKit thread - The unique ID of this program item. +`client.Beta.ChatKit.Threads.Get(ctx, threadID) (*ChatKitThread, error)` - - `CallID string` +**get** `/chatkit/threads/{thread_id}` - The stable call ID of the program item. +Retrieve a ChatKit thread by its identifier. - - `Code string` +### Parameters - The JavaScript source executed by programmatic tool calling. +- `threadID string` - - `Fingerprint string` +### Returns - Opaque program replay fingerprint that must be round-tripped. +- `type ChatKitThread struct{…}` - - `Type Program` + Represents a ChatKit thread and its current status. - The item type. Always `program`. + - `ID string` - - `const ProgramProgram Program = "program"` + Identifier of the thread. - - `Agent BetaResponseInputItemProgramAgent` + - `CreatedAt int64` - The agent that produced this item. + Unix timestamp (in seconds) for when the thread was created. - - `AgentName string` + - `Object ChatKitThread` - The canonical name of the agent that produced this item. + Type discriminator that is always `chatkit.thread`. - - `type BetaResponseInputItemProgramOutput struct{…}` + - `const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"` - - `ID string` + - `Status ChatKitThreadStatusUnion` - The unique ID of this program output item. + Current status for the thread. Defaults to `active` for newly created threads. - - `CallID string` + - `type ChatKitThreadStatusActive struct{…}` - The call ID of the program item. + Indicates that a thread is active. - - `Result string` + - `Type Active` - The result produced by the program item. + Status discriminator that is always `active`. - - `Status string` + - `const ActiveActive Active = "active"` - The terminal status of the program output. + - `type ChatKitThreadStatusLocked struct{…}` - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + Indicates that a thread is locked and cannot accept new input. - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + - `Reason string` - - `Type ProgramOutput` + Reason that the thread was locked. Defaults to null when no reason is recorded. - The item type. Always `program_output`. + - `Type Locked` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + Status discriminator that is always `locked`. - - `Agent BetaResponseInputItemProgramOutputAgent` + - `const LockedLocked Locked = "locked"` - The agent that produced this item. + - `type ChatKitThreadStatusClosed struct{…}` - - `AgentName string` + Indicates that a thread has been closed. - The canonical name of the agent that produced this item. + - `Reason string` - - `Metadata map[string, string]` + Reason that the thread was closed. Defaults to null when no reason is recorded. - 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. + - `Type Closed` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + Status discriminator that is always `closed`. - - `Model BetaResponseModel` + - `const ClosedClosed Closed = "closed"` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `Title string` - - `type BetaResponseModel string` + Optional human-readable title for the thread. Defaults to null when no title has been generated. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. + - `User string` - - `const BetaResponseModelGPT5_6Sol BetaResponseModel = "gpt-5.6-sol"` + Free-form string that identifies your end user who owns the thread. - - `const BetaResponseModelGPT5_6Terra BetaResponseModel = "gpt-5.6-terra"` +### Example - - `const BetaResponseModelGPT5_6Luna BetaResponseModel = "gpt-5.6-luna"` +```go +package main - - `const BetaResponseModelGPT5_4 BetaResponseModel = "gpt-5.4"` +import ( + "context" + "fmt" - - `const BetaResponseModelGPT5_4Mini BetaResponseModel = "gpt-5.4-mini"` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `const BetaResponseModelGPT5_4Nano BetaResponseModel = "gpt-5.4-nano"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + chatkitThread, err := client.Beta.ChatKit.Threads.Get(context.TODO(), "cthr_123") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", chatkitThread.ID) +} +``` - - `const BetaResponseModelGPT5_4Mini2026_03_17 BetaResponseModel = "gpt-5.4-mini-2026-03-17"` +#### Response - - `const BetaResponseModelGPT5_4Nano2026_03_17 BetaResponseModel = "gpt-5.4-nano-2026-03-17"` +```json +{ + "id": "cthr_def456", + "created_at": 1712345600, + "object": "chatkit.thread", + "status": { + "type": "active" + }, + "title": "Demo feedback", + "user": "user_456" +} +``` - - `const BetaResponseModelGPT5_3ChatLatest BetaResponseModel = "gpt-5.3-chat-latest"` +### Example - - `const BetaResponseModelGPT5_2 BetaResponseModel = "gpt-5.2"` +```go +package main - - `const BetaResponseModelGPT5_2_2025_12_11 BetaResponseModel = "gpt-5.2-2025-12-11"` +import ( + "context" + "fmt" - - `const BetaResponseModelGPT5_2ChatLatest BetaResponseModel = "gpt-5.2-chat-latest"` + "github.com/openai/openai-go" +) - - `const BetaResponseModelGPT5_2Pro BetaResponseModel = "gpt-5.2-pro"` +func main() { + client := openai.NewClient() + chatkitThread, err := client.Beta.ChatKit.Threads.Get(context.TODO(), "cthr_123") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", chatkitThread.ID) +} +``` - - `const BetaResponseModelGPT5_2Pro2025_12_11 BetaResponseModel = "gpt-5.2-pro-2025-12-11"` +#### Response - - `const BetaResponseModelGPT5_1 BetaResponseModel = "gpt-5.1"` +```json +{ + "id": "cthr_abc123", + "object": "chatkit.thread", + "title": "Customer escalation", + "items": { + "data": [ + { + "id": "cthi_user_001", + "object": "chatkit.thread_item", + "type": "user_message", + "content": [ + { + "type": "input_text", + "text": "I need help debugging an onboarding issue." + } + ], + "attachments": [] + }, + { + "id": "cthi_assistant_002", + "object": "chatkit.thread_item", + "type": "assistant_message", + "content": [ + { + "type": "output_text", + "text": "Let's start by confirming the workflow version you deployed." + } + ] + } + ], + "has_more": false + } +} +``` - - `const BetaResponseModelGPT5_1_2025_11_13 BetaResponseModel = "gpt-5.1-2025-11-13"` +## Delete ChatKit thread - - `const BetaResponseModelGPT5_1Codex BetaResponseModel = "gpt-5.1-codex"` +`client.Beta.ChatKit.Threads.Delete(ctx, threadID) (*BetaChatKitThreadDeleteResponse, error)` - - `const BetaResponseModelGPT5_1Mini BetaResponseModel = "gpt-5.1-mini"` +**delete** `/chatkit/threads/{thread_id}` - - `const BetaResponseModelGPT5_1ChatLatest BetaResponseModel = "gpt-5.1-chat-latest"` +Delete a ChatKit thread along with its items and stored attachments. - - `const BetaResponseModelGPT5 BetaResponseModel = "gpt-5"` +### Parameters - - `const BetaResponseModelGPT5Mini BetaResponseModel = "gpt-5-mini"` +- `threadID string` - - `const BetaResponseModelGPT5Nano BetaResponseModel = "gpt-5-nano"` +### Returns - - `const BetaResponseModelGPT5_2025_08_07 BetaResponseModel = "gpt-5-2025-08-07"` +- `type BetaChatKitThreadDeleteResponse struct{…}` - - `const BetaResponseModelGPT5Mini2025_08_07 BetaResponseModel = "gpt-5-mini-2025-08-07"` + Confirmation payload returned after deleting a thread. - - `const BetaResponseModelGPT5Nano2025_08_07 BetaResponseModel = "gpt-5-nano-2025-08-07"` + - `ID string` - - `const BetaResponseModelGPT5ChatLatest BetaResponseModel = "gpt-5-chat-latest"` + Identifier of the deleted thread. - - `const BetaResponseModelGPT4_1 BetaResponseModel = "gpt-4.1"` + - `Deleted bool` - - `const BetaResponseModelGPT4_1Mini BetaResponseModel = "gpt-4.1-mini"` + Indicates that the thread has been deleted. - - `const BetaResponseModelGPT4_1Nano BetaResponseModel = "gpt-4.1-nano"` + - `Object ChatKitThreadDeleted` - - `const BetaResponseModelGPT4_1_2025_04_14 BetaResponseModel = "gpt-4.1-2025-04-14"` + Type discriminator that is always `chatkit.thread.deleted`. - - `const BetaResponseModelGPT4_1Mini2025_04_14 BetaResponseModel = "gpt-4.1-mini-2025-04-14"` + - `const ChatKitThreadDeletedChatKitThreadDeleted ChatKitThreadDeleted = "chatkit.thread.deleted"` - - `const BetaResponseModelGPT4_1Nano2025_04_14 BetaResponseModel = "gpt-4.1-nano-2025-04-14"` +### Example - - `const BetaResponseModelO4Mini BetaResponseModel = "o4-mini"` +```go +package main - - `const BetaResponseModelO4Mini2025_04_16 BetaResponseModel = "o4-mini-2025-04-16"` +import ( + "context" + "fmt" - - `const BetaResponseModelO3 BetaResponseModel = "o3"` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `const BetaResponseModelO3_2025_04_16 BetaResponseModel = "o3-2025-04-16"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + thread, err := client.Beta.ChatKit.Threads.Delete(context.TODO(), "cthr_123") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", thread.ID) +} +``` - - `const BetaResponseModelO3Mini BetaResponseModel = "o3-mini"` +#### Response - - `const BetaResponseModelO3Mini2025_01_31 BetaResponseModel = "o3-mini-2025-01-31"` +```json +{ + "id": "id", + "deleted": true, + "object": "chatkit.thread.deleted" +} +``` - - `const BetaResponseModelO1 BetaResponseModel = "o1"` +### Example - - `const BetaResponseModelO1_2024_12_17 BetaResponseModel = "o1-2024-12-17"` +```go +package main - - `const BetaResponseModelO1Preview BetaResponseModel = "o1-preview"` +import ( + "context" + "fmt" - - `const BetaResponseModelO1Preview2024_09_12 BetaResponseModel = "o1-preview-2024-09-12"` + "github.com/openai/openai-go" +) - - `const BetaResponseModelO1Mini BetaResponseModel = "o1-mini"` +func main() { + client := openai.NewClient() + thread, err := client.Beta.ChatKit.Threads.Delete(context.TODO(), "cthr_123") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", thread.ID) +} +``` - - `const BetaResponseModelO1Mini2024_09_12 BetaResponseModel = "o1-mini-2024-09-12"` +## List ChatKit threads - - `const BetaResponseModelGPT4o BetaResponseModel = "gpt-4o"` +`client.Beta.ChatKit.Threads.List(ctx, query) (*ConversationCursorPage[ChatKitThread], error)` - - `const BetaResponseModelGPT4o2024_11_20 BetaResponseModel = "gpt-4o-2024-11-20"` +**get** `/chatkit/threads` - - `const BetaResponseModelGPT4o2024_08_06 BetaResponseModel = "gpt-4o-2024-08-06"` +List ChatKit threads with optional pagination and user filters. - - `const BetaResponseModelGPT4o2024_05_13 BetaResponseModel = "gpt-4o-2024-05-13"` +### Parameters - - `const BetaResponseModelGPT4oAudioPreview BetaResponseModel = "gpt-4o-audio-preview"` +- `query BetaChatKitThreadListParams` - - `const BetaResponseModelGPT4oAudioPreview2024_10_01 BetaResponseModel = "gpt-4o-audio-preview-2024-10-01"` + - `After param.Field[string]` - - `const BetaResponseModelGPT4oAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-audio-preview-2024-12-17"` + List items created after this thread item ID. Defaults to null for the first page. - - `const BetaResponseModelGPT4oAudioPreview2025_06_03 BetaResponseModel = "gpt-4o-audio-preview-2025-06-03"` + - `Before param.Field[string]` - - `const BetaResponseModelGPT4oMiniAudioPreview BetaResponseModel = "gpt-4o-mini-audio-preview"` + List items created before this thread item ID. Defaults to null for the newest results. - - `const BetaResponseModelGPT4oMiniAudioPreview2024_12_17 BetaResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"` + - `Limit param.Field[int64]` - - `const BetaResponseModelGPT4oSearchPreview BetaResponseModel = "gpt-4o-search-preview"` + Maximum number of thread items to return. Defaults to 20. - - `const BetaResponseModelGPT4oMiniSearchPreview BetaResponseModel = "gpt-4o-mini-search-preview"` + - `Order param.Field[BetaChatKitThreadListParamsOrder]` - - `const BetaResponseModelGPT4oSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-search-preview-2025-03-11"` + Sort order for results by creation time. Defaults to `desc`. - - `const BetaResponseModelGPT4oMiniSearchPreview2025_03_11 BetaResponseModel = "gpt-4o-mini-search-preview-2025-03-11"` + - `const BetaChatKitThreadListParamsOrderAsc BetaChatKitThreadListParamsOrder = "asc"` - - `const BetaResponseModelChatgpt4oLatest BetaResponseModel = "chatgpt-4o-latest"` + - `const BetaChatKitThreadListParamsOrderDesc BetaChatKitThreadListParamsOrder = "desc"` - - `const BetaResponseModelCodexMiniLatest BetaResponseModel = "codex-mini-latest"` + - `User param.Field[string]` - - `const BetaResponseModelGPT4oMini BetaResponseModel = "gpt-4o-mini"` + Filter threads that belong to this user identifier. Defaults to null to return all users. - - `const BetaResponseModelGPT4oMini2024_07_18 BetaResponseModel = "gpt-4o-mini-2024-07-18"` +### Returns - - `const BetaResponseModelGPT4Turbo BetaResponseModel = "gpt-4-turbo"` +- `type ChatKitThread struct{…}` - - `const BetaResponseModelGPT4Turbo2024_04_09 BetaResponseModel = "gpt-4-turbo-2024-04-09"` + Represents a ChatKit thread and its current status. - - `const BetaResponseModelGPT4_0125Preview BetaResponseModel = "gpt-4-0125-preview"` + - `ID string` - - `const BetaResponseModelGPT4TurboPreview BetaResponseModel = "gpt-4-turbo-preview"` + Identifier of the thread. - - `const BetaResponseModelGPT4_1106Preview BetaResponseModel = "gpt-4-1106-preview"` + - `CreatedAt int64` - - `const BetaResponseModelGPT4VisionPreview BetaResponseModel = "gpt-4-vision-preview"` + Unix timestamp (in seconds) for when the thread was created. - - `const BetaResponseModelGPT4 BetaResponseModel = "gpt-4"` + - `Object ChatKitThread` - - `const BetaResponseModelGPT4_0314 BetaResponseModel = "gpt-4-0314"` + Type discriminator that is always `chatkit.thread`. - - `const BetaResponseModelGPT4_0613 BetaResponseModel = "gpt-4-0613"` + - `const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"` - - `const BetaResponseModelGPT4_32k BetaResponseModel = "gpt-4-32k"` + - `Status ChatKitThreadStatusUnion` - - `const BetaResponseModelGPT4_32k0314 BetaResponseModel = "gpt-4-32k-0314"` + Current status for the thread. Defaults to `active` for newly created threads. - - `const BetaResponseModelGPT4_32k0613 BetaResponseModel = "gpt-4-32k-0613"` + - `type ChatKitThreadStatusActive struct{…}` - - `const BetaResponseModelGPT3_5Turbo BetaResponseModel = "gpt-3.5-turbo"` + Indicates that a thread is active. - - `const BetaResponseModelGPT3_5Turbo16k BetaResponseModel = "gpt-3.5-turbo-16k"` + - `Type Active` - - `const BetaResponseModelGPT3_5Turbo0301 BetaResponseModel = "gpt-3.5-turbo-0301"` + Status discriminator that is always `active`. - - `const BetaResponseModelGPT3_5Turbo0613 BetaResponseModel = "gpt-3.5-turbo-0613"` + - `const ActiveActive Active = "active"` - - `const BetaResponseModelGPT3_5Turbo1106 BetaResponseModel = "gpt-3.5-turbo-1106"` + - `type ChatKitThreadStatusLocked struct{…}` - - `const BetaResponseModelGPT3_5Turbo0125 BetaResponseModel = "gpt-3.5-turbo-0125"` + Indicates that a thread is locked and cannot accept new input. - - `const BetaResponseModelGPT3_5Turbo16k0613 BetaResponseModel = "gpt-3.5-turbo-16k-0613"` + - `Reason string` - - `const BetaResponseModelO1Pro BetaResponseModel = "o1-pro"` + Reason that the thread was locked. Defaults to null when no reason is recorded. - - `const BetaResponseModelO1Pro2025_03_19 BetaResponseModel = "o1-pro-2025-03-19"` + - `Type Locked` - - `const BetaResponseModelO3Pro BetaResponseModel = "o3-pro"` + Status discriminator that is always `locked`. - - `const BetaResponseModelO3Pro2025_06_10 BetaResponseModel = "o3-pro-2025-06-10"` + - `const LockedLocked Locked = "locked"` - - `const BetaResponseModelO3DeepResearch BetaResponseModel = "o3-deep-research"` + - `type ChatKitThreadStatusClosed struct{…}` - - `const BetaResponseModelO3DeepResearch2025_06_26 BetaResponseModel = "o3-deep-research-2025-06-26"` + Indicates that a thread has been closed. - - `const BetaResponseModelO4MiniDeepResearch BetaResponseModel = "o4-mini-deep-research"` + - `Reason string` - - `const BetaResponseModelO4MiniDeepResearch2025_06_26 BetaResponseModel = "o4-mini-deep-research-2025-06-26"` + Reason that the thread was closed. Defaults to null when no reason is recorded. - - `const BetaResponseModelComputerUsePreview BetaResponseModel = "computer-use-preview"` + - `Type Closed` - - `const BetaResponseModelComputerUsePreview2025_03_11 BetaResponseModel = "computer-use-preview-2025-03-11"` + Status discriminator that is always `closed`. - - `const BetaResponseModelGPT5Codex BetaResponseModel = "gpt-5-codex"` + - `const ClosedClosed Closed = "closed"` - - `const BetaResponseModelGPT5Pro BetaResponseModel = "gpt-5-pro"` + - `Title string` - - `const BetaResponseModelGPT5Pro2025_10_06 BetaResponseModel = "gpt-5-pro-2025-10-06"` + Optional human-readable title for the thread. Defaults to null when no title has been generated. - - `const BetaResponseModelGPT5_1CodexMax BetaResponseModel = "gpt-5.1-codex-max"` + - `User string` - - `string` + Free-form string that identifies your end user who owns the thread. - - `Object Response` +### Example - The object type of this resource - always set to `response`. +```go +package main - - `const ResponseResponse Response = "response"` +import ( + "context" + "fmt" - - `Output []BetaResponseOutputItemUnion` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - An array of content items generated by the model. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + page, err := client.Beta.ChatKit.Threads.List(context.TODO(), openai.BetaChatKitThreadListParams{ - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - - `type BetaResponseOutputMessage struct{…}` +#### Response - An output message from the model. +```json +{ + "data": [ + { + "id": "cthr_def456", + "created_at": 1712345600, + "object": "chatkit.thread", + "status": { + "type": "active" + }, + "title": "Demo feedback", + "user": "user_456" + } + ], + "first_id": "first_id", + "has_more": true, + "last_id": "last_id", + "object": "list" +} +``` - - `type BetaResponseFileSearchToolCall struct{…}` +### Example - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. +```go +package main - - `type BetaResponseFunctionToolCall struct{…}` +import ( + "context" + "fmt" - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + "github.com/openai/openai-go" +) - - `type BetaResponseFunctionToolCallOutputItem struct{…}` +func main() { + client := openai.NewClient() + page, err := client.Beta.ChatKit.Threads.List(context.TODO(), openai.BetaChatKitThreadListParams{ - - `ID string` + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - The unique ID of the function call tool output. +#### Response - - `CallID string` +```json +{ + "data": [ + { + "id": "cthr_abc123", + "object": "chatkit.thread", + "title": "Customer escalation" + }, + { + "id": "cthr_def456", + "object": "chatkit.thread", + "title": "Demo feedback" + } + ], + "has_more": false, + "object": "list" +} +``` - The unique ID of the function tool call generated by the model. +## Domain Types - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` +### Chat Session - The output from the function call generated by your code. - Can be a string or an list of output content. +- `type ChatSession struct{…}` - - `string` + Represents a ChatKit session and its resolved configuration. - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `ID string` - Text, image, or file output of the function call. + Identifier for the ChatKit session. - - `type BetaResponseInputText struct{…}` + - `ChatKitConfiguration ChatSessionChatKitConfiguration` - A text input to the model. + Resolved ChatKit feature configuration for the session. - - `type BetaResponseInputImage struct{…}` + - `AutomaticThreadTitling ChatSessionAutomaticThreadTitling` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + Automatic thread titling preferences. - - `type BetaResponseInputFile struct{…}` + - `Enabled bool` - A file input to the model. + Whether automatic thread titling is enabled. - - `Status BetaResponseFunctionToolCallOutputItemStatus` + - `FileUpload ChatSessionFileUpload` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Upload settings for the session. - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + - `Enabled bool` - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + Indicates if uploads are enabled for the session. - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `MaxFileSize int64` - - `Type FunctionCallOutput` + Maximum upload size in megabytes. - The type of the function tool call output. Always `function_call_output`. + - `MaxFiles int64` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + Maximum number of uploads allowed during the session. - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `History ChatSessionHistory` - The agent that produced this item. + History retention configuration. - - `AgentName string` + - `Enabled bool` - The canonical name of the agent that produced this item. + Indicates if chat history is persisted for the session. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `RecentThreads int64` - The execution context that produced this tool call. + Number of prior threads surfaced in history views. Defaults to null when all history is retained. - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `ClientSecret string` - - `Type Direct` + Ephemeral client secret that authenticates session requests. - The caller type. Always `direct`. + - `ExpiresAt int64` - - `const DirectDirect Direct = "direct"` + Unix timestamp (in seconds) for when the session expires. - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `MaxRequestsPer1Minute int64` - - `CallerID string` + Convenience copy of the per-minute request limit. - The call ID of the program item that produced this tool call. + - `Object ChatKitSession` - - `Type Program` + Type discriminator that is always `chatkit.session`. - The caller type. Always `program`. + - `const ChatKitSessionChatKitSession ChatKitSession = "chatkit.session"` - - `const ProgramProgram Program = "program"` + - `RateLimits ChatSessionRateLimits` - - `CreatedBy string` + Resolved rate limit values. - The identifier of the actor that created the item. + - `MaxRequestsPer1Minute int64` - - `type BetaResponseOutputItemAgentMessage struct{…}` + Maximum allowed requests per one-minute window. - - `ID string` + - `Status ChatSessionStatus` - The unique ID of the agent message. + Current lifecycle state of the session. - - `Author string` + - `const ChatSessionStatusActive ChatSessionStatus = "active"` - The sending agent identity. + - `const ChatSessionStatusExpired ChatSessionStatus = "expired"` - - `Content []BetaResponseOutputItemAgentMessageContentUnion` + - `const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"` - Encrypted content sent between agents. + - `User string` - - `type BetaResponseInputText struct{…}` + User identifier associated with the session. - A text input to the model. + - `Workflow ChatKitWorkflow` - - `type BetaResponseOutputText struct{…}` + Workflow metadata for the session. - A text output from the model. + - `ID string` - - `type BetaResponseOutputItemAgentMessageContentText struct{…}` + Identifier of the workflow backing the session. - A text content. + - `StateVariables map[string, ChatKitWorkflowStateVariableUnion]` - - `Text string` + State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided. - - `Type Text` + - `string` - - `const TextText Text = "text"` + - `bool` - - `type BetaResponseOutputItemAgentMessageContentSummaryText struct{…}` + - `float64` - A summary text from the model. + - `Tracing ChatKitWorkflowTracing` - - `Text string` + Tracing settings applied to the workflow. - A summary of the reasoning output from the model so far. + - `Enabled bool` - - `Type SummaryText` + Indicates whether tracing is enabled. - The type of the object. Always `summary_text`. + - `Version string` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + Specific workflow version used for the session. Defaults to null when using the latest deployment. - - `type BetaResponseOutputItemAgentMessageContentReasoningText struct{…}` +### Chat Session Automatic Thread Titling - Reasoning text from the model. +- `type ChatSessionAutomaticThreadTitling struct{…}` - - `Text string` + Automatic thread title preferences for the session. - The reasoning text from the model. + - `Enabled bool` - - `Type ReasoningText` + Whether automatic thread titling is enabled. - The type of the reasoning text. Always `reasoning_text`. +### Chat Session ChatKit Configuration - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` +- `type ChatSessionChatKitConfiguration struct{…}` - - `type BetaResponseOutputRefusal struct{…}` + ChatKit configuration for the session. - A refusal from the model. + - `AutomaticThreadTitling ChatSessionAutomaticThreadTitling` - - `type BetaResponseInputImage struct{…}` + Automatic thread titling preferences. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Enabled bool` - - `type BetaResponseOutputItemAgentMessageContentComputerScreenshot struct{…}` + Whether automatic thread titling is enabled. - A screenshot of a computer. + - `FileUpload ChatSessionFileUpload` - - `Detail string` + Upload settings for the session. - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Enabled bool` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailLow BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "low"` + Indicates if uploads are enabled for the session. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "high"` + - `MaxFileSize int64` - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "auto"` + Maximum upload size in megabytes. - - `const BetaResponseOutputItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseOutputItemAgentMessageContentComputerScreenshotDetail = "original"` + - `MaxFiles int64` - - `FileID string` + Maximum number of uploads allowed during the session. - The identifier of an uploaded file that contains the screenshot. + - `History ChatSessionHistory` - - `ImageURL string` + History retention configuration. - The URL of the screenshot image. + - `Enabled bool` - - `Type ComputerScreenshot` + Indicates if chat history is persisted for the session. - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `RecentThreads int64` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + Number of prior threads surfaced in history views. Defaults to null when all history is retained. - - `PromptCacheBreakpoint BetaResponseOutputItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` +### Chat Session ChatKit Configuration Param - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. +- `type ChatSessionChatKitConfigurationParamResp struct{…}` - - `Mode Explicit` + Optional per-session configuration settings for ChatKit behavior. - The breakpoint mode. Always `explicit`. + - `AutomaticThreadTitling ChatSessionChatKitConfigurationParamAutomaticThreadTitlingResp` - - `const ExplicitExplicit Explicit = "explicit"` + Configuration for automatic thread titling. When omitted, automatic thread titling is enabled by default. - - `type BetaResponseInputFile struct{…}` + - `Enabled bool` - A file input to the model. + Enable automatic thread title generation. Defaults to true. - - `type BetaResponseOutputItemAgentMessageContentEncryptedContent struct{…}` + - `FileUpload ChatSessionChatKitConfigurationParamFileUploadResp` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + Configuration for upload enablement and limits. When omitted, uploads are disabled by default (max_files 10, max_file_size 512 MB). - - `EncryptedContent string` + - `Enabled bool` - Opaque encrypted content. + Enable uploads for this session. Defaults to false. - - `Type EncryptedContent` + - `MaxFileSize int64` - The type of the input item. Always `encrypted_content`. + Maximum size in megabytes for each uploaded file. Defaults to 512 MB, which is the maximum allowable size. - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `MaxFiles int64` - - `Recipient string` + Maximum number of files that can be uploaded to the session. Defaults to 10. - The destination agent identity. + - `History ChatSessionChatKitConfigurationParamHistoryResp` - - `Type AgentMessage` + Configuration for chat history retention. When omitted, history is enabled by default with no limit on recent_threads (null). - The type of the item. Always `agent_message`. + - `Enabled bool` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + Enables chat users to access previous ChatKit threads. Defaults to true. - - `Agent BetaResponseOutputItemAgentMessageAgent` + - `RecentThreads int64` - The agent that produced this item. + Number of recent ChatKit threads users have access to. Defaults to unlimited when unset. - - `AgentName string` +### Chat Session Expires After Param - The canonical name of the agent that produced this item. +- `type ChatSessionExpiresAfterParamResp struct{…}` - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + Controls when the session expires relative to an anchor timestamp. - - `ID string` + - `Anchor CreatedAt` - The unique ID of the multi-agent call item. + Base timestamp used to calculate expiration. Currently fixed to `created_at`. - - `Action string` + - `const CreatedAtCreatedAt CreatedAt = "created_at"` - The multi-agent action to execute. + - `Seconds int64` - - `const BetaResponseOutputItemMultiAgentCallActionSpawnAgent BetaResponseOutputItemMultiAgentCallAction = "spawn_agent"` + Number of seconds after the anchor when the session expires. - - `const BetaResponseOutputItemMultiAgentCallActionInterruptAgent BetaResponseOutputItemMultiAgentCallAction = "interrupt_agent"` +### Chat Session File Upload - - `const BetaResponseOutputItemMultiAgentCallActionListAgents BetaResponseOutputItemMultiAgentCallAction = "list_agents"` +- `type ChatSessionFileUpload struct{…}` - - `const BetaResponseOutputItemMultiAgentCallActionSendMessage BetaResponseOutputItemMultiAgentCallAction = "send_message"` + Upload permissions and limits applied to the session. - - `const BetaResponseOutputItemMultiAgentCallActionFollowupTask BetaResponseOutputItemMultiAgentCallAction = "followup_task"` + - `Enabled bool` - - `const BetaResponseOutputItemMultiAgentCallActionWaitAgent BetaResponseOutputItemMultiAgentCallAction = "wait_agent"` + Indicates if uploads are enabled for the session. - - `Arguments string` + - `MaxFileSize int64` - The JSON string of arguments generated for the action. + Maximum upload size in megabytes. - - `CallID string` + - `MaxFiles int64` - The unique ID linking this call to its output. + Maximum number of uploads allowed during the session. - - `Type MultiAgentCall` +### Chat Session History - The type of the multi-agent call. Always `multi_agent_call`. +- `type ChatSessionHistory struct{…}` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + History retention preferences returned for the session. - - `Agent BetaResponseOutputItemMultiAgentCallAgent` + - `Enabled bool` - The agent that produced this item. + Indicates if chat history is persisted for the session. - - `AgentName string` + - `RecentThreads int64` - The canonical name of the agent that produced this item. + Number of prior threads surfaced in history views. Defaults to null when all history is retained. - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` +### Chat Session Rate Limits - - `ID string` +- `type ChatSessionRateLimits struct{…}` - The unique ID of the multi-agent call output item. + Active per-minute request limit for the session. - - `Action string` + - `MaxRequestsPer1Minute int64` - The multi-agent action that produced this result. + Maximum allowed requests per one-minute window. - - `const BetaResponseOutputItemMultiAgentCallOutputActionSpawnAgent BetaResponseOutputItemMultiAgentCallOutputAction = "spawn_agent"` +### Chat Session Rate Limits Param - - `const BetaResponseOutputItemMultiAgentCallOutputActionInterruptAgent BetaResponseOutputItemMultiAgentCallOutputAction = "interrupt_agent"` +- `type ChatSessionRateLimitsParamResp struct{…}` - - `const BetaResponseOutputItemMultiAgentCallOutputActionListAgents BetaResponseOutputItemMultiAgentCallOutputAction = "list_agents"` + Controls request rate limits for the session. - - `const BetaResponseOutputItemMultiAgentCallOutputActionSendMessage BetaResponseOutputItemMultiAgentCallOutputAction = "send_message"` + - `MaxRequestsPer1Minute int64` - - `const BetaResponseOutputItemMultiAgentCallOutputActionFollowupTask BetaResponseOutputItemMultiAgentCallOutputAction = "followup_task"` + Maximum number of requests allowed per minute for the session. Defaults to 10. - - `const BetaResponseOutputItemMultiAgentCallOutputActionWaitAgent BetaResponseOutputItemMultiAgentCallOutputAction = "wait_agent"` +### Chat Session Status - - `CallID string` +- `type ChatSessionStatus string` - The unique ID of the multi-agent call. + - `const ChatSessionStatusActive ChatSessionStatus = "active"` - - `Output []BetaResponseOutputText` + - `const ChatSessionStatusExpired ChatSessionStatus = "expired"` - Text output returned by the multi-agent action. + - `const ChatSessionStatusCancelled ChatSessionStatus = "cancelled"` - - `Annotations []BetaResponseOutputTextAnnotationUnion` +### Chat Session Workflow Param - The annotations of the text output. +- `type ChatSessionWorkflowParamResp struct{…}` - - `Text string` + Workflow reference and overrides applied to the chat session. - The text output from the model. + - `ID string` - - `Type OutputText` + Identifier for the workflow invoked by the session. - The type of the output text. Always `output_text`. + - `StateVariables map[string, ChatSessionWorkflowParamStateVariableUnionResp]` - - `Logprobs []BetaResponseOutputTextLogprob` + State variables forwarded to the workflow. Keys may be up to 64 characters, values must be primitive types, and the map defaults to an empty object. - - `Type MultiAgentCallOutput` + - `string` - The type of the multi-agent result. Always `multi_agent_call_output`. + - `bool` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `float64` - - `Agent BetaResponseOutputItemMultiAgentCallOutputAgent` + - `Tracing ChatSessionWorkflowParamTracingResp` - The agent that produced this item. + Optional tracing overrides for the workflow invocation. When omitted, tracing is enabled by default. - - `AgentName string` + - `Enabled bool` - The canonical name of the agent that produced this item. + Whether tracing is enabled during the session. Defaults to true. - - `type BetaResponseFunctionWebSearch struct{…}` + - `Version string` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + Specific workflow version to run. Defaults to the latest deployed version. - - `type BetaResponseComputerToolCall struct{…}` +### ChatKit Attachment - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. +- `type ChatKitAttachment struct{…}` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + Attachment metadata included on thread items. - `ID string` - The unique ID of the computer call tool output. + Identifier for the attachment. - - `CallID string` + - `MimeType string` - The ID of the computer tool call that produced the output. + MIME type of the attachment. - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `Name string` - A computer screenshot image used with the computer use tool. + Original display name for the attachment. - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `PreviewURL string` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + Preview URL for rendering the attachment inline. - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `Type ChatKitAttachmentType` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + Attachment discriminator. - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image"` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"` - - `Type ComputerCallOutput` +### ChatKit Response Output Text - The type of the computer tool call output. Always `computer_call_output`. +- `type ChatKitResponseOutputText struct{…}` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + Assistant response text accompanied by optional annotations. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `Annotations []ChatKitResponseOutputTextAnnotationUnion` - The safety checks reported by the API that have been acknowledged by the - developer. + Ordered list of annotations attached to the response text. - - `ID string` + - `type ChatKitResponseOutputTextAnnotationFile struct{…}` - The ID of the pending safety check. + Annotation that references an uploaded file. - - `Code string` + - `Source ChatKitResponseOutputTextAnnotationFileSource` - The type of the pending safety check. + File attachment referenced by the annotation. - - `Message string` + - `Filename string` - Details about the pending safety check. + Filename referenced by the annotation. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + - `Type File` - The agent that produced this item. + Type discriminator that is always `file`. - - `AgentName string` + - `const FileFile File = "file"` - The canonical name of the agent that produced this item. + - `Type File` - - `CreatedBy string` + Type discriminator that is always `file` for this annotation. - The identifier of the actor that created the item. + - `const FileFile File = "file"` - - `type BetaResponseReasoningItem struct{…}` + - `type ChatKitResponseOutputTextAnnotationURL 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](https://platform.openai.com/docs/guides/conversation-state). + Annotation that references a URL. - - `type BetaResponseOutputItemProgram struct{…}` + - `Source ChatKitResponseOutputTextAnnotationURLSource` - - `ID string` + URL referenced by the annotation. - The unique ID of the program item. + - `Type URL` - - `CallID string` + Type discriminator that is always `url`. - The stable call ID of the program item. + - `const URLURL URL = "url"` - - `Code string` + - `URL string` - The JavaScript source executed by programmatic tool calling. + URL referenced by the annotation. - - `Fingerprint string` + - `Type URL` - Opaque program replay fingerprint that must be round-tripped. + Type discriminator that is always `url` for this annotation. - - `Type Program` + - `const URLURL URL = "url"` - The type of the item. Always `program`. + - `Text string` - - `const ProgramProgram Program = "program"` + Assistant generated text. - - `Agent BetaResponseOutputItemProgramAgent` + - `Type OutputText` - The agent that produced this item. + Type discriminator that is always `output_text`. - - `AgentName string` + - `const OutputTextOutputText OutputText = "output_text"` - The canonical name of the agent that produced this item. +### ChatKit Thread - - `type BetaResponseOutputItemProgramOutput struct{…}` +- `type ChatKitThread struct{…}` - - `ID string` + Represents a ChatKit thread and its current status. - The unique ID of the program output item. + - `ID string` - - `CallID string` + Identifier of the thread. - The call ID of the program item. + - `CreatedAt int64` - - `Result string` + Unix timestamp (in seconds) for when the thread was created. - The result produced by the program item. + - `Object ChatKitThread` - - `Status string` + Type discriminator that is always `chatkit.thread`. - The terminal status of the program output item. + - `const ChatKitThreadChatKitThread ChatKitThread = "chatkit.thread"` - - `const BetaResponseOutputItemProgramOutputStatusCompleted BetaResponseOutputItemProgramOutputStatus = "completed"` + - `Status ChatKitThreadStatusUnion` - - `const BetaResponseOutputItemProgramOutputStatusIncomplete BetaResponseOutputItemProgramOutputStatus = "incomplete"` + Current status for the thread. Defaults to `active` for newly created threads. - - `Type ProgramOutput` + - `type ChatKitThreadStatusActive struct{…}` - The type of the item. Always `program_output`. + Indicates that a thread is active. - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `Type Active` - - `Agent BetaResponseOutputItemProgramOutputAgent` + Status discriminator that is always `active`. - The agent that produced this item. + - `const ActiveActive Active = "active"` - - `AgentName string` + - `type ChatKitThreadStatusLocked struct{…}` - The canonical name of the agent that produced this item. + Indicates that a thread is locked and cannot accept new input. - - `type BetaResponseToolSearchCall struct{…}` + - `Reason string` - - `ID string` + Reason that the thread was locked. Defaults to null when no reason is recorded. - The unique ID of the tool search call item. + - `Type Locked` - - `Arguments any` + Status discriminator that is always `locked`. - Arguments used for the tool search call. + - `const LockedLocked Locked = "locked"` - - `CallID string` + - `type ChatKitThreadStatusClosed struct{…}` - The unique ID of the tool search call generated by the model. + Indicates that a thread has been closed. - - `Execution BetaResponseToolSearchCallExecution` + - `Reason string` - Whether tool search was executed by the server or by the client. + Reason that the thread was closed. Defaults to null when no reason is recorded. - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `Type Closed` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + Status discriminator that is always `closed`. - - `Status BetaResponseToolSearchCallStatus` + - `const ClosedClosed Closed = "closed"` - The status of the tool search call item that was recorded. + - `Title string` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + Optional human-readable title for the thread. Defaults to null when no title has been generated. - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `User string` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + Free-form string that identifies your end user who owns the thread. - - `Type ToolSearchCall` +### ChatKit Thread Assistant Message Item - The type of the item. Always `tool_search_call`. +- `type ChatKitThreadAssistantMessageItem struct{…}` - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + Assistant-authored message within a thread. - - `Agent BetaResponseToolSearchCallAgent` + - `ID string` - The agent that produced this item. + Identifier of the thread item. - - `AgentName string` + - `Content []ChatKitResponseOutputText` - The canonical name of the agent that produced this item. + Ordered assistant response segments. - - `CreatedBy string` + - `Annotations []ChatKitResponseOutputTextAnnotationUnion` - The identifier of the actor that created the item. + Ordered list of annotations attached to the response text. - - `type BetaResponseToolSearchOutputItem struct{…}` + - `type ChatKitResponseOutputTextAnnotationFile struct{…}` - - `ID string` + Annotation that references an uploaded file. - The unique ID of the tool search output item. + - `Source ChatKitResponseOutputTextAnnotationFileSource` - - `CallID string` + File attachment referenced by the annotation. - The unique ID of the tool search call generated by the model. + - `Filename string` - - `Execution BetaResponseToolSearchOutputItemExecution` + Filename referenced by the annotation. - Whether tool search was executed by the server or by the client. + - `Type File` - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + Type discriminator that is always `file`. - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `const FileFile File = "file"` - - `Status BetaResponseToolSearchOutputItemStatus` + - `Type File` - The status of the tool search output item that was recorded. + Type discriminator that is always `file` for this annotation. - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `const FileFile File = "file"` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `type ChatKitResponseOutputTextAnnotationURL struct{…}` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + Annotation that references a URL. - - `Tools []BetaToolUnion` + - `Source ChatKitResponseOutputTextAnnotationURLSource` - The loaded tool definitions returned by tool search. + URL referenced by the annotation. - - `type BetaFunctionTool struct{…}` + - `Type URL` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + Type discriminator that is always `url`. - - `type BetaFileSearchTool struct{…}` + - `const URLURL URL = "url"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `URL string` - - `type BetaComputerTool struct{…}` + URL referenced by the annotation. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Type URL` - - `type BetaComputerUsePreviewTool struct{…}` + Type discriminator that is always `url` for this annotation. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const URLURL URL = "url"` - - `type BetaWebSearchTool struct{…}` + - `Text string` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + Assistant generated text. - - `type BetaToolMcp struct{…}` + - `Type OutputText` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + Type discriminator that is always `output_text`. - - `type BetaToolCodeInterpreter struct{…}` + - `const OutputTextOutputText OutputText = "output_text"` - A tool that runs Python code to help generate a response to a prompt. + - `CreatedAt int64` - - `type BetaToolProgrammaticToolCalling struct{…}` + Unix timestamp (in seconds) for when the item was created. - - `type BetaToolImageGeneration struct{…}` + - `Object ChatKitThreadItem` - A tool that generates images using the GPT image models. + Type discriminator that is always `chatkit.thread_item`. - - `type BetaToolLocalShell struct{…}` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - A tool that allows the model to execute shell commands in a local environment. + - `ThreadID string` - - `type BetaFunctionShellTool struct{…}` + Identifier of the parent thread. - A tool that allows the model to execute shell commands. + - `Type ChatKitAssistantMessage` - - `type BetaCustomTool struct{…}` + Type discriminator that is always `chatkit.assistant_message`. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"` - - `type BetaNamespaceTool struct{…}` +### ChatKit Thread Item List - Groups function/custom tools under a shared namespace. +- `type ChatKitThreadItemList struct{…}` - - `type BetaToolSearchTool struct{…}` + A paginated list of thread items rendered for the ChatKit API. - Hosted or BYOT tool search configuration for deferred tools. + - `Data []ChatKitThreadItemListDataUnion` - - `type BetaWebSearchPreviewTool struct{…}` + A list of items - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `type ChatKitThreadUserMessageItem struct{…}` - - `type BetaApplyPatchTool struct{…}` + User-authored messages within a thread. - Allows the assistant to create, delete, or update files using unified diffs. + - `ID string` - - `Type ToolSearchOutput` + Identifier of the thread item. - The type of the item. Always `tool_search_output`. + - `Attachments []ChatKitAttachment` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + Attachments associated with the user message. Defaults to an empty list. - - `Agent BetaResponseToolSearchOutputItemAgent` + - `ID string` - The agent that produced this item. + Identifier for the attachment. - - `AgentName string` + - `MimeType string` - The canonical name of the agent that produced this item. + MIME type of the attachment. - - `CreatedBy string` + - `Name string` - The identifier of the actor that created the item. + Original display name for the attachment. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `PreviewURL string` - - `ID string` + Preview URL for rendering the attachment inline. - The unique ID of the additional tools item. + - `Type ChatKitAttachmentType` - - `Role string` + Attachment discriminator. - The role that provided the additional tools. + - `const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image"` - - `const BetaResponseOutputItemAdditionalToolsRoleUnknown BetaResponseOutputItemAdditionalToolsRole = "unknown"` + - `const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"` - - `const BetaResponseOutputItemAdditionalToolsRoleUser BetaResponseOutputItemAdditionalToolsRole = "user"` + - `Content []ChatKitThreadUserMessageItemContentUnion` - - `const BetaResponseOutputItemAdditionalToolsRoleAssistant BetaResponseOutputItemAdditionalToolsRole = "assistant"` + Ordered content elements supplied by the user. - - `const BetaResponseOutputItemAdditionalToolsRoleSystem BetaResponseOutputItemAdditionalToolsRole = "system"` + - `type ChatKitThreadUserMessageItemContentInputText struct{…}` - - `const BetaResponseOutputItemAdditionalToolsRoleCritic BetaResponseOutputItemAdditionalToolsRole = "critic"` + Text block that a user contributed to the thread. - - `const BetaResponseOutputItemAdditionalToolsRoleDiscriminator BetaResponseOutputItemAdditionalToolsRole = "discriminator"` + - `Text string` - - `const BetaResponseOutputItemAdditionalToolsRoleDeveloper BetaResponseOutputItemAdditionalToolsRole = "developer"` + Plain-text content supplied by the user. - - `const BetaResponseOutputItemAdditionalToolsRoleTool BetaResponseOutputItemAdditionalToolsRole = "tool"` + - `Type InputText` - - `Tools []BetaToolUnion` + Type discriminator that is always `input_text`. - The additional tool definitions made available at this item. + - `const InputTextInputText InputText = "input_text"` - - `type BetaFunctionTool struct{…}` + - `type ChatKitThreadUserMessageItemContentQuotedText struct{…}` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + Quoted snippet that the user referenced in their message. - - `type BetaFileSearchTool struct{…}` + - `Text string` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + Quoted text content. - - `type BetaComputerTool struct{…}` + - `Type QuotedText` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + Type discriminator that is always `quoted_text`. - - `type BetaComputerUsePreviewTool struct{…}` + - `const QuotedTextQuotedText QuotedText = "quoted_text"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `CreatedAt int64` - - `type BetaWebSearchTool struct{…}` + Unix timestamp (in seconds) for when the item was created. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `InferenceOptions ChatKitThreadUserMessageItemInferenceOptions` - - `type BetaToolMcp struct{…}` + Inference overrides applied to the message. Defaults to null when unset. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Model string` - - `type BetaToolCodeInterpreter struct{…}` + Model name that generated the response. Defaults to null when using the session default. - A tool that runs Python code to help generate a response to a prompt. + - `ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoice` - - `type BetaToolProgrammaticToolCalling struct{…}` + Preferred tool to invoke. Defaults to null when ChatKit should auto-select. - - `type BetaToolImageGeneration struct{…}` + - `ID string` - A tool that generates images using the GPT image models. + Identifier of the requested tool. - - `type BetaToolLocalShell struct{…}` + - `Object ChatKitThreadItem` - A tool that allows the model to execute shell commands in a local environment. + Type discriminator that is always `chatkit.thread_item`. - - `type BetaFunctionShellTool struct{…}` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - A tool that allows the model to execute shell commands. + - `ThreadID string` - - `type BetaCustomTool struct{…}` + Identifier of the parent thread. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Type ChatKitUserMessage` - - `type BetaNamespaceTool struct{…}` + - `const ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"` - Groups function/custom tools under a shared namespace. + - `type ChatKitThreadAssistantMessageItem struct{…}` - - `type BetaToolSearchTool struct{…}` + Assistant-authored message within a thread. - Hosted or BYOT tool search configuration for deferred tools. + - `ID string` - - `type BetaWebSearchPreviewTool struct{…}` + Identifier of the thread item. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Content []ChatKitResponseOutputText` - - `type BetaApplyPatchTool struct{…}` + Ordered assistant response segments. - Allows the assistant to create, delete, or update files using unified diffs. + - `Annotations []ChatKitResponseOutputTextAnnotationUnion` - - `Type AdditionalTools` + Ordered list of annotations attached to the response text. - The type of the item. Always `additional_tools`. + - `type ChatKitResponseOutputTextAnnotationFile struct{…}` - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + Annotation that references an uploaded file. - - `Agent BetaResponseOutputItemAdditionalToolsAgent` + - `Source ChatKitResponseOutputTextAnnotationFileSource` - The agent that produced this item. + File attachment referenced by the annotation. - - `AgentName string` + - `Filename string` - The canonical name of the agent that produced this item. + Filename referenced by the annotation. - - `type BetaResponseCompactionItem struct{…}` + - `Type File` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + Type discriminator that is always `file`. - - `ID string` + - `const FileFile File = "file"` - The unique ID of the compaction item. + - `Type File` - - `EncryptedContent string` + Type discriminator that is always `file` for this annotation. - The encrypted content that was produced by compaction. + - `const FileFile File = "file"` - - `Type Compaction` + - `type ChatKitResponseOutputTextAnnotationURL struct{…}` - The type of the item. Always `compaction`. + Annotation that references a URL. - - `const CompactionCompaction Compaction = "compaction"` + - `Source ChatKitResponseOutputTextAnnotationURLSource` - - `Agent BetaResponseCompactionItemAgent` + URL referenced by the annotation. - The agent that produced this item. + - `Type URL` - - `AgentName string` + Type discriminator that is always `url`. - The canonical name of the agent that produced this item. + - `const URLURL URL = "url"` - - `CreatedBy string` + - `URL string` - The identifier of the actor that created the item. + URL referenced by the annotation. - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `Type URL` - An image generation request made by the model. + Type discriminator that is always `url` for this annotation. - - `ID string` + - `const URLURL URL = "url"` - The unique ID of the image generation call. + - `Text string` - - `Result string` + Assistant generated text. - The generated image encoded in base64. + - `Type OutputText` - - `Status string` + Type discriminator that is always `output_text`. - The status of the image generation call. + - `const OutputTextOutputText OutputText = "output_text"` - - `const BetaResponseOutputItemImageGenerationCallStatusInProgress BetaResponseOutputItemImageGenerationCallStatus = "in_progress"` + - `CreatedAt int64` - - `const BetaResponseOutputItemImageGenerationCallStatusCompleted BetaResponseOutputItemImageGenerationCallStatus = "completed"` + Unix timestamp (in seconds) for when the item was created. - - `const BetaResponseOutputItemImageGenerationCallStatusGenerating BetaResponseOutputItemImageGenerationCallStatus = "generating"` + - `Object ChatKitThreadItem` - - `const BetaResponseOutputItemImageGenerationCallStatusFailed BetaResponseOutputItemImageGenerationCallStatus = "failed"` + Type discriminator that is always `chatkit.thread_item`. - - `Type ImageGenerationCall` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - The type of the image generation call. Always `image_generation_call`. + - `ThreadID string` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + Identifier of the parent thread. - - `Agent BetaResponseOutputItemImageGenerationCallAgent` + - `Type ChatKitAssistantMessage` - The agent that produced this item. + Type discriminator that is always `chatkit.assistant_message`. - - `AgentName string` + - `const ChatKitAssistantMessageChatKitAssistantMessage ChatKitAssistantMessage = "chatkit.assistant_message"` - The canonical name of the agent that produced this item. + - `type ChatKitWidgetItem struct{…}` - - `type BetaResponseCodeInterpreterToolCall struct{…}` + Thread item that renders a widget payload. - A tool call to run code. + - `ID string` - - `type BetaResponseOutputItemLocalShellCall struct{…}` + Identifier of the thread item. - A tool call to run a command on the local shell. + - `CreatedAt int64` - - `ID string` + Unix timestamp (in seconds) for when the item was created. - The unique ID of the local shell call. + - `Object ChatKitThreadItem` - - `Action BetaResponseOutputItemLocalShellCallAction` + Type discriminator that is always `chatkit.thread_item`. - Execute a shell command on the server. + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - - `Command []string` + - `ThreadID string` - The command to run. + Identifier of the parent thread. - - `Env map[string, string]` + - `Type ChatKitWidget` - Environment variables to set for the command. + Type discriminator that is always `chatkit.widget`. - - `Type Exec` + - `const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"` - The type of the local shell action. Always `exec`. + - `Widget string` - - `const ExecExec Exec = "exec"` + Serialized widget payload rendered in the UI. - - `TimeoutMs int64` + - `type ChatKitThreadItemListDataChatKitClientToolCall struct{…}` - Optional timeout in milliseconds for the command. + Record of a client side tool invocation initiated by the assistant. - - `User string` + - `ID string` - Optional user to run the command as. + Identifier of the thread item. - - `WorkingDirectory string` + - `Arguments string` - Optional working directory to run the command in. + JSON-encoded arguments that were sent to the tool. - `CallID string` - The unique ID of the local shell tool call generated by the model. - - - `Status string` - - The status of the local shell call. + Identifier for the client tool call. - - `const BetaResponseOutputItemLocalShellCallStatusInProgress BetaResponseOutputItemLocalShellCallStatus = "in_progress"` + - `CreatedAt int64` - - `const BetaResponseOutputItemLocalShellCallStatusCompleted BetaResponseOutputItemLocalShellCallStatus = "completed"` + Unix timestamp (in seconds) for when the item was created. - - `const BetaResponseOutputItemLocalShellCallStatusIncomplete BetaResponseOutputItemLocalShellCallStatus = "incomplete"` + - `Name string` - - `Type LocalShellCall` + Tool name that was invoked. - The type of the local shell call. Always `local_shell_call`. + - `Object ChatKitThreadItem` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + Type discriminator that is always `chatkit.thread_item`. - - `Agent BetaResponseOutputItemLocalShellCallAgent` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - The agent that produced this item. + - `Output string` - - `AgentName string` + JSON-encoded output captured from the tool. Defaults to null while execution is in progress. - The canonical name of the agent that produced this item. + - `Status string` - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + Execution status for the tool call. - The output of a local shell tool call. + - `const ChatKitThreadItemListDataChatKitClientToolCallStatusInProgress ChatKitThreadItemListDataChatKitClientToolCallStatus = "in_progress"` - - `ID string` + - `const ChatKitThreadItemListDataChatKitClientToolCallStatusCompleted ChatKitThreadItemListDataChatKitClientToolCallStatus = "completed"` - The unique ID of the local shell tool call generated by the model. + - `ThreadID string` - - `Output string` + Identifier of the parent thread. - A JSON string of the output of the local shell tool call. + - `Type ChatKitClientToolCall` - - `Type LocalShellCallOutput` + Type discriminator that is always `chatkit.client_tool_call`. - The type of the local shell tool call output. Always `local_shell_call_output`. + - `const ChatKitClientToolCallChatKitClientToolCall ChatKitClientToolCall = "chatkit.client_tool_call"` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `type ChatKitThreadItemListDataChatKitTask struct{…}` - - `Agent BetaResponseOutputItemLocalShellCallOutputAgent` + Task emitted by the workflow to show progress and status updates. - The agent that produced this item. + - `ID string` - - `AgentName string` + Identifier of the thread item. - The canonical name of the agent that produced this item. + - `CreatedAt int64` - - `Status string` + Unix timestamp (in seconds) for when the item was created. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `Heading string` - - `const BetaResponseOutputItemLocalShellCallOutputStatusInProgress BetaResponseOutputItemLocalShellCallOutputStatus = "in_progress"` + Optional heading for the task. Defaults to null when not provided. - - `const BetaResponseOutputItemLocalShellCallOutputStatusCompleted BetaResponseOutputItemLocalShellCallOutputStatus = "completed"` + - `Object ChatKitThreadItem` - - `const BetaResponseOutputItemLocalShellCallOutputStatusIncomplete BetaResponseOutputItemLocalShellCallOutputStatus = "incomplete"` + Type discriminator that is always `chatkit.thread_item`. - - `type BetaResponseFunctionShellToolCall struct{…}` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - A tool call that executes one or more shell commands in a managed environment. + - `Summary string` - - `ID string` + Optional summary that describes the task. Defaults to null when omitted. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `TaskType string` - - `Action BetaResponseFunctionShellToolCallAction` + Subtype for the task. - The shell commands and limits that describe how to run the tool call. + - `const ChatKitThreadItemListDataChatKitTaskTaskTypeCustom ChatKitThreadItemListDataChatKitTaskTaskType = "custom"` - - `Commands []string` + - `const ChatKitThreadItemListDataChatKitTaskTaskTypeThought ChatKitThreadItemListDataChatKitTaskTaskType = "thought"` - - `MaxOutputLength int64` + - `ThreadID string` - Optional maximum number of characters to return from each command. + Identifier of the parent thread. - - `TimeoutMs int64` + - `Type ChatKitTask` - Optional timeout in milliseconds for the commands. + Type discriminator that is always `chatkit.task`. - - `CallID string` + - `const ChatKitTaskChatKitTask ChatKitTask = "chatkit.task"` - The unique ID of the shell tool call generated by the model. + - `type ChatKitThreadItemListDataChatKitTaskGroup struct{…}` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + Collection of workflow tasks grouped together in the thread. - Represents the use of a local environment to perform shell actions. + - `ID string` - - `type BetaResponseLocalEnvironment struct{…}` + Identifier of the thread item. - Represents the use of a local environment to perform shell actions. + - `CreatedAt int64` - - `Type Local` + Unix timestamp (in seconds) for when the item was created. - The environment type. Always `local`. + - `Object ChatKitThreadItem` - - `const LocalLocal Local = "local"` + Type discriminator that is always `chatkit.thread_item`. - - `type BetaResponseContainerReference struct{…}` + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - Represents a container created with /v1/containers. + - `Tasks []ChatKitThreadItemListDataChatKitTaskGroupTask` - - `ContainerID string` + Tasks included in the group. - - `Type ContainerReference` + - `Heading string` - The environment type. Always `container_reference`. + Optional heading for the grouped task. Defaults to null when not provided. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `Summary string` - - `Status BetaResponseFunctionShellToolCallStatus` + Optional summary that describes the grouped task. Defaults to null when omitted. - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `Type string` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + Subtype for the grouped task. - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeCustom ChatKitThreadItemListDataChatKitTaskGroupTaskType = "custom"` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + - `const ChatKitThreadItemListDataChatKitTaskGroupTaskTypeThought ChatKitThreadItemListDataChatKitTaskGroupTaskType = "thought"` - - `Type ShellCall` + - `ThreadID string` - The type of the item. Always `shell_call`. + Identifier of the parent thread. - - `const ShellCallShellCall ShellCall = "shell_call"` + - `Type ChatKitTaskGroup` - - `Agent BetaResponseFunctionShellToolCallAgent` + Type discriminator that is always `chatkit.task_group`. - The agent that produced this item. + - `const ChatKitTaskGroupChatKitTaskGroup ChatKitTaskGroup = "chatkit.task_group"` - - `AgentName string` + - `FirstID string` - The canonical name of the agent that produced this item. + The ID of the first item in the list. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `HasMore bool` - The execution context that produced this tool call. + Whether there are more items available. - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `LastID string` - - `Type Direct` + The ID of the last item in the list. - - `const DirectDirect Direct = "direct"` + - `Object List` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + The type of object returned, must be `list`. - - `CallerID string` + - `const ListList List = "list"` - The call ID of the program item that produced this tool call. +### ChatKit Thread User Message Item - - `Type Program` +- `type ChatKitThreadUserMessageItem struct{…}` - - `const ProgramProgram Program = "program"` + User-authored messages within a thread. - - `CreatedBy string` + - `ID string` - The ID of the entity that created this tool call. + Identifier of the thread item. - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `Attachments []ChatKitAttachment` - The output of a shell tool call that was emitted. + Attachments associated with the user message. Defaults to an empty list. - `ID string` - The unique ID of the shell call output. Populated when this item is returned via API. - - - `CallID string` + Identifier for the attachment. - The unique ID of the shell tool call generated by the model. + - `MimeType string` - - `MaxOutputLength int64` + MIME type of the attachment. - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `Name string` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + Original display name for the attachment. - An array of shell call output contents + - `PreviewURL string` - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + Preview URL for rendering the attachment inline. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Type ChatKitAttachmentType` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + Attachment discriminator. - Indicates that the shell call exceeded its configured time limit. + - `const ChatKitAttachmentTypeImage ChatKitAttachmentType = "image"` - - `Type Timeout` + - `const ChatKitAttachmentTypeFile ChatKitAttachmentType = "file"` - The outcome type. Always `timeout`. + - `Content []ChatKitThreadUserMessageItemContentUnion` - - `const TimeoutTimeout Timeout = "timeout"` + Ordered content elements supplied by the user. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `type ChatKitThreadUserMessageItemContentInputText struct{…}` - Indicates that the shell commands finished and returned an exit code. + Text block that a user contributed to the thread. - - `ExitCode int64` + - `Text string` - Exit code from the shell process. + Plain-text content supplied by the user. - - `Type Exit` + - `Type InputText` - The outcome type. Always `exit`. + Type discriminator that is always `input_text`. - - `const ExitExit Exit = "exit"` + - `const InputTextInputText InputText = "input_text"` - - `Stderr string` + - `type ChatKitThreadUserMessageItemContentQuotedText struct{…}` - The standard error output that was captured. + Quoted snippet that the user referenced in their message. - - `Stdout string` + - `Text string` - The standard output that was captured. + Quoted text content. - - `CreatedBy string` + - `Type QuotedText` - The identifier of the actor that created the item. + Type discriminator that is always `quoted_text`. - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `const QuotedTextQuotedText QuotedText = "quoted_text"` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `CreatedAt int64` - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + Unix timestamp (in seconds) for when the item was created. - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `InferenceOptions ChatKitThreadUserMessageItemInferenceOptions` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + Inference overrides applied to the message. Defaults to null when unset. - - `Type ShellCallOutput` + - `Model string` - The type of the shell call output. Always `shell_call_output`. + Model name that generated the response. Defaults to null when using the session default. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `ToolChoice ChatKitThreadUserMessageItemInferenceOptionsToolChoice` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + Preferred tool to invoke. Defaults to null when ChatKit should auto-select. - The agent that produced this item. + - `ID string` - - `AgentName string` + Identifier of the requested tool. - The canonical name of the agent that produced this item. + - `Object ChatKitThreadItem` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + Type discriminator that is always `chatkit.thread_item`. - The execution context that produced this tool call. + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `ThreadID string` - - `Type Direct` + Identifier of the parent thread. - - `const DirectDirect Direct = "direct"` + - `Type ChatKitUserMessage` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `const ChatKitUserMessageChatKitUserMessage ChatKitUserMessage = "chatkit.user_message"` - - `CallerID string` +### ChatKit Widget Item - The call ID of the program item that produced this tool call. +- `type ChatKitWidgetItem struct{…}` - - `Type Program` + Thread item that renders a widget payload. - - `const ProgramProgram Program = "program"` + - `ID string` - - `CreatedBy string` + Identifier of the thread item. - The identifier of the actor that created the item. + - `CreatedAt int64` - - `type BetaResponseApplyPatchToolCall struct{…}` + Unix timestamp (in seconds) for when the item was created. - A tool call that applies file diffs by creating, deleting, or updating files. + - `Object ChatKitThreadItem` - - `ID string` + Type discriminator that is always `chatkit.thread_item`. - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `const ChatKitThreadItemChatKitThreadItem ChatKitThreadItem = "chatkit.thread_item"` - - `CallID string` + - `ThreadID string` - The unique ID of the apply patch tool call generated by the model. + Identifier of the parent thread. - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `Type ChatKitWidget` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + Type discriminator that is always `chatkit.widget`. - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `const ChatKitWidgetChatKitWidget ChatKitWidget = "chatkit.widget"` - Instruction describing how to create a file via the apply_patch tool. + - `Widget string` - - `Diff string` + Serialized widget payload rendered in the UI. - Diff to apply. +# Assistants - - `Path string` +## List assistants - Path of the file to create. +`client.Beta.Assistants.List(ctx, query) (*CursorPage[Assistant], error)` - - `Type CreateFile` +**get** `/assistants` - Create a new file with the provided diff. +Returns a list of assistants. - - `const CreateFileCreateFile CreateFile = "create_file"` +### Parameters - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` +- `query BetaAssistantListParams` - Instruction describing how to delete a file via the apply_patch tool. + - `After param.Field[string]` - - `Path string` + A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - Path of the file to delete. + - `Before param.Field[string]` - - `Type DeleteFile` + A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - Delete the specified file. + - `Limit param.Field[int64]` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `Order param.Field[BetaAssistantListParamsOrder]` - Instruction describing how to update a file via the apply_patch tool. + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - - `Diff string` + - `const BetaAssistantListParamsOrderAsc BetaAssistantListParamsOrder = "asc"` - Diff to apply. + - `const BetaAssistantListParamsOrderDesc BetaAssistantListParamsOrder = "desc"` - - `Path string` +### Returns - Path of the file to update. +- `type Assistant struct{…}` - - `Type UpdateFile` + Represents an `assistant` that can call the model and use tools. - Update an existing file with the provided diff. + - `ID string` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + The identifier, which can be referenced in API endpoints. - - `Status BetaResponseApplyPatchToolCallStatus` + - `CreatedAt int64` - The status of the apply patch tool call. One of `in_progress` or `completed`. + The Unix timestamp (in seconds) for when the assistant was created. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `Description string` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + The description of the assistant. The maximum length is 512 characters. - - `Type ApplyPatchCall` + - `Instructions string` - The type of the item. Always `apply_patch_call`. + The system instructions that the assistant uses. The maximum length is 256,000 characters. - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `Metadata Metadata` - - `Agent BetaResponseApplyPatchToolCallAgent` + 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. - The agent that produced this item. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `AgentName string` + - `Model string` - The canonical name of the agent that produced this item. + ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `Name string` - The execution context that produced this tool call. + The name of the assistant. The maximum length is 256 characters. - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `Object Assistant` - - `Type Direct` + The object type, which is always `assistant`. - - `const DirectDirect Direct = "direct"` + - `const AssistantAssistant Assistant = "assistant"` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `Tools []AssistantToolUnion` - - `CallerID string` + A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - The call ID of the program item that produced this tool call. + - `type CodeInterpreterTool struct{…}` - - `Type Program` + - `Type CodeInterpreter` - - `const ProgramProgram Program = "program"` + The type of tool being defined: `code_interpreter` - - `CreatedBy string` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The ID of the entity that created this tool call. + - `type FileSearchTool struct{…}` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + - `Type FileSearch` - The output emitted by an apply patch tool call. + The type of tool being defined: `file_search` - - `ID string` + - `const FileSearchFileSearch FileSearch = "file_search"` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `FileSearch FileSearchToolFileSearch` - - `CallID string` + Overrides for the file search tool. - The unique ID of the apply patch tool call generated by the model. + - `MaxNumResults int64` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - The status of the apply patch tool call output. One of `completed` or `failed`. + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `Type ApplyPatchCallOutput` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - The type of the item. Always `apply_patch_call_output`. + - `ScoreThreshold float64` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `Ranker string` - The agent that produced this item. + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `AgentName string` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - The canonical name of the agent that produced this item. + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `type FunctionTool struct{…}` - The execution context that produced this tool call. + - `Function FunctionDefinition` - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `Name string` - - `Type Direct` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `const DirectDirect Direct = "direct"` + - `Description string` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + A description of what the function does, used by the model to choose when and how to call the function. - - `CallerID string` + - `Parameters FunctionParameters` - The call ID of the program item that produced this tool call. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `Type Program` + Omitting `parameters` defines a function with an empty parameter list. - - `const ProgramProgram Program = "program"` + - `Strict bool` - - `CreatedBy string` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - The ID of the entity that created this tool call output. + - `Type Function` - - `Output string` + The type of tool being defined: `function` - Optional textual output returned by the apply patch tool. + - `const FunctionFunction Function = "function"` - - `type BetaResponseOutputItemMcpCall struct{…}` + - `ResponseFormat AssistantResponseFormatOptionUnion` - An invocation of a tool on an MCP server. + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `ID string` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The unique ID of the tool call. + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `Arguments string` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - A JSON string of the arguments passed to the tool. + - `type Auto string` - - `Name string` + `auto` is the default value - The name of the tool that was run. + - `const AutoAuto Auto = "auto"` - - `ServerLabel string` + - `type ResponseFormatText struct{…}` - The label of the MCP server running the tool. + Default response format. Used to generate text responses. - - `Type McpCall` + - `Type Text` - The type of the item. Always `mcp_call`. + The type of response format being defined. Always `text`. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `const TextText Text = "text"` - - `Agent BetaResponseOutputItemMcpCallAgent` + - `type ResponseFormatJSONObject struct{…}` - The agent that produced this item. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `AgentName string` + - `Type JSONObject` - The canonical name of the agent that produced this item. + The type of response format being defined. Always `json_object`. - - `ApprovalRequestID string` + - `const JSONObjectJSONObject JSONObject = "json_object"` - 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. + - `type ResponseFormatJSONSchema struct{…}` - - `Error string` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The error from the tool call, if any. + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `Output string` + Structured Outputs configuration options, including a JSON Schema. - The output from the tool call. + - `Name string` - - `Status string` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `Description string` - - `const BetaResponseOutputItemMcpCallStatusInProgress BetaResponseOutputItemMcpCallStatus = "in_progress"` + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `const BetaResponseOutputItemMcpCallStatusCompleted BetaResponseOutputItemMcpCallStatus = "completed"` + - `Schema map[string, any]` - - `const BetaResponseOutputItemMcpCallStatusIncomplete BetaResponseOutputItemMcpCallStatus = "incomplete"` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `const BetaResponseOutputItemMcpCallStatusCalling BetaResponseOutputItemMcpCallStatus = "calling"` + - `Strict bool` - - `const BetaResponseOutputItemMcpCallStatusFailed BetaResponseOutputItemMcpCallStatus = "failed"` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `type BetaResponseOutputItemMcpListTools struct{…}` + - `Type JSONSchema` - A list of tools available on an MCP server. + The type of response format being defined. Always `json_schema`. - - `ID string` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - The unique ID of the list. + - `Temperature float64` - - `ServerLabel string` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - The label of the MCP server. + - `ToolResources AssistantToolResources` - - `Tools []BetaResponseOutputItemMcpListToolsTool` + A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - The tools available on the server. + - `CodeInterpreter AssistantToolResourcesCodeInterpreter` - - `InputSchema any` + - `FileIDs []string` - The JSON schema describing the tool's input. + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - `Name string` + - `FileSearch AssistantToolResourcesFileSearch` - The name of the tool. + - `VectorStoreIDs []string` - - `Annotations any` + The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - Additional annotations about the tool. + - `TopP float64` - - `Description string` + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - The description of the tool. + We generally recommend altering this or temperature but not both. - - `Type McpListTools` +### Example - The type of the item. Always `mcp_list_tools`. +```go +package main - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` +import ( + "context" + "fmt" - - `Agent BetaResponseOutputItemMcpListToolsAgent` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The agent that produced this item. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + page, err := client.Beta.Assistants.List(context.TODO(), openai.BetaAssistantListParams{ - - `AgentName string` + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - The canonical name of the agent that produced this item. +#### Response - - `Error string` +```json +{ + "data": [ + { + "id": "id", + "created_at": 0, + "description": "description", + "instructions": "instructions", + "metadata": { + "foo": "string" + }, + "model": "model", + "name": "name", + "object": "assistant", + "tools": [ + { + "type": "code_interpreter" + } + ], + "response_format": "auto", + "temperature": 1, + "tool_resources": { + "code_interpreter": { + "file_ids": [ + "string" + ] + }, + "file_search": { + "vector_store_ids": [ + "string" + ] + } + }, + "top_p": 1 + } + ], + "first_id": "asst_abc123", + "has_more": false, + "last_id": "asst_abc456", + "object": "list" +} +``` - Error message if the server could not list tools. +## Create assistant - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` +`client.Beta.Assistants.New(ctx, body) (*Assistant, error)` - A request for human approval of a tool invocation. +**post** `/assistants` - - `ID string` +Create an assistant with a model and instructions. - The unique ID of the approval request. +### Parameters - - `Arguments string` +- `body BetaAssistantNewParams` - A JSON string of arguments for the tool. + - `Model param.Field[ChatModel]` - - `Name string` + ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - The name of the tool to run. + - `string` - - `ServerLabel string` + - `type ChatModel string` - The label of the MCP server making the request. + - `const ChatModelGPT5_6Sol ChatModel = "gpt-5.6-sol"` - - `Type McpApprovalRequest` + - `const ChatModelGPT5_6Terra ChatModel = "gpt-5.6-terra"` - The type of the item. Always `mcp_approval_request`. + - `const ChatModelGPT5_6Luna ChatModel = "gpt-5.6-luna"` - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"` - - `Agent BetaResponseOutputItemMcpApprovalRequestAgent` + - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"` - The agent that produced this item. + - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"` - - `AgentName string` + - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"` - The canonical name of the agent that produced this item. + - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"` - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"` - A response to an MCP approval request. + - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"` - - `ID string` + - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"` - The unique ID of the approval response + - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"` - - `ApprovalRequestID string` + - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"` - The ID of the approval request being answered. + - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"` - - `Approve bool` + - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"` - Whether the request was approved. + - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"` - - `Type McpApprovalResponse` + - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"` - The type of the item. Always `mcp_approval_response`. + - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"` - - `Agent BetaResponseOutputItemMcpApprovalResponseAgent` + - `const ChatModelGPT5 ChatModel = "gpt-5"` - The agent that produced this item. + - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"` - - `AgentName string` + - `const ChatModelGPT5Nano ChatModel = "gpt-5-nano"` - The canonical name of the agent that produced this item. + - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"` - - `Reason string` + - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"` - Optional reason for the decision. + - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"` - - `type BetaResponseCustomToolCall struct{…}` + - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"` - A call to a custom tool created by the model. + - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"` - The output of a custom tool call from your code, being sent back to the model. + - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"` - - `ID string` + - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"` - The unique ID of the custom tool call output item. + - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"` - - `Status string` + - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const ChatModelO4Mini ChatModel = "o4-mini"` - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + - `const ChatModelO3 ChatModel = "o3"` - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"` - - `CreatedBy string` + - `const ChatModelO3Mini ChatModel = "o3-mini"` - The identifier of the actor that created the item. + - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"` - - `ParallelToolCalls bool` + - `const ChatModelO1 ChatModel = "o1"` - Whether to allow the model to run tool calls in parallel. + - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"` - - `Temperature float64` + - `const ChatModelO1Preview ChatModel = "o1-preview"` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"` - - `ToolChoice BetaResponseToolChoiceUnion` + - `const ChatModelO1Mini ChatModel = "o1-mini"` - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"` - - `type BetaToolChoiceOptions string` + - `const ChatModelGPT4o ChatModel = "gpt-4o"` - Controls which (if any) tool is called by the model. + - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"` - `none` means the model will not call any tool and instead generates a message. + - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"` - `auto` means the model can pick between generating a message or calling one or - more tools. + - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"` - `required` means the model must call one or more tools. + - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"` - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"` - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"` - - `type BetaToolChoiceAllowed struct{…}` + - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"` - Constrains the tools available to the model to a pre-defined set. + - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - `Mode BetaToolChoiceAllowedMode` + - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"` - Constrains the tools available to the model to a pre-defined set. + - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"` - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"` - `required` requires the model to call one or more of the allowed tools. + - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"` - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"` - - `Tools []map[string, any]` + - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"` - A list of tool definitions that the model should be allowed to call. + - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"` - For the Responses API, the list of tool definitions might look like: + - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"` - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"` - - `Type AllowedTools` + - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"` - Allowed tool configuration type. Always `allowed_tools`. + - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"` - - `type BetaToolChoiceTypes struct{…}` + - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"` - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `const ChatModelGPT4 ChatModel = "gpt-4"` - - `Type BetaToolChoiceTypesType` + - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"` - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"` - Allowed values are: + - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"` - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"` - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"` - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"` - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"` - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"` - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"` - - `type BetaToolChoiceFunction struct{…}` + - `Description param.Field[string]` - Use this option to force the model to call a specific function. + The description of the assistant. The maximum length is 512 characters. - - `Name string` + - `Instructions param.Field[string]` - The name of the function to call. + The system instructions that the assistant uses. The maximum length is 256,000 characters. - - `Type Function` + - `Metadata param.Field[Metadata]` - For function calling, the type is always `function`. + 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. - - `const FunctionFunction Function = "function"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `type BetaToolChoiceMcp struct{…}` + - `Name param.Field[string]` - Use this option to force the model to call a specific tool on a remote MCP server. + The name of the assistant. The maximum length is 256 characters. - - `ServerLabel string` + - `ReasoningEffort param.Field[ReasoningEffort]` - The label of the MCP server to use. + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - - `Type Mcp` + - `ResponseFormat param.Field[AssistantResponseFormatOptionUnion]` - For MCP tools, the type is always `mcp`. + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `const McpMcp Mcp = "mcp"` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Name string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - The name of the tool to call on the server. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `type BetaToolChoiceCustom struct{…}` + - `Temperature param.Field[float64]` - Use this option to force the model to call a specific custom tool. + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - `Name string` + - `ToolResources param.Field[BetaAssistantNewParamsToolResources]` - The name of the custom tool to call. + A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `Type Custom` + - `CodeInterpreter BetaAssistantNewParamsToolResourcesCodeInterpreter` - For custom tool calling, the type is always `custom`. + - `FileIDs []string` - - `const CustomCustom Custom = "custom"` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - `type BetaResponseToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `FileSearch BetaAssistantNewParamsToolResourcesFileSearch` - - `Type ProgrammaticToolCalling` + - `VectorStoreIDs []string` - The tool to call. Always `programmatic_tool_calling`. + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `VectorStores []BetaAssistantNewParamsToolResourcesFileSearchVectorStore` - - `type BetaToolChoiceApplyPatch struct{…}` + A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this assistant. There can be a maximum of 1 vector store attached to the assistant. - Forces the model to call the apply_patch tool when executing a tool call. + - `ChunkingStrategy BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion` - - `Type ApplyPatch` + The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - The tool to call. Always `apply_patch`. + - `type BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyAuto struct{…}` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. - - `type BetaToolChoiceShell struct{…}` + - `Type Auto` - Forces the model to call the shell tool when a tool call is required. + Always `auto`. - - `Type Shell` + - `const AutoAuto Auto = "auto"` - The tool to call. Always `shell`. + - `type BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyStatic struct{…}` - - `const ShellShell Shell = "shell"` + - `Static BetaAssistantNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic` - - `Tools []BetaToolUnion` + - `ChunkOverlapTokens int64` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + The number of tokens that overlap between chunks. The default value is `400`. - We support the following categories of tools: + Note that the overlap must not exceed half of `max_chunk_size_tokens`. - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. + - `MaxChunkSizeTokens int64` - - `type BetaFunctionTool struct{…}` + The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Type Static` - - `type BetaFileSearchTool struct{…}` + Always `static`. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const StaticStatic Static = "static"` - - `type BetaComputerTool struct{…}` + - `FileIDs []string` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. - - `type BetaComputerUsePreviewTool struct{…}` + - `Metadata Metadata` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + 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. - - `type BetaWebSearchTool struct{…}` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Tools param.Field[[]AssistantToolUnion]` - - `type BetaToolMcp struct{…}` + A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `type CodeInterpreterTool struct{…}` - - `type BetaToolCodeInterpreter struct{…}` + - `Type CodeInterpreter` - A tool that runs Python code to help generate a response to a prompt. + The type of tool being defined: `code_interpreter` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `type BetaToolImageGeneration struct{…}` + - `type FileSearchTool struct{…}` - A tool that generates images using the GPT image models. + - `Type FileSearch` - - `type BetaToolLocalShell struct{…}` + The type of tool being defined: `file_search` - A tool that allows the model to execute shell commands in a local environment. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type BetaFunctionShellTool struct{…}` + - `FileSearch FileSearchToolFileSearch` - A tool that allows the model to execute shell commands. + Overrides for the file search tool. - - `type BetaCustomTool struct{…}` + - `MaxNumResults int64` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `type BetaNamespaceTool struct{…}` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - Groups function/custom tools under a shared namespace. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `type BetaToolSearchTool struct{…}` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - Hosted or BYOT tool search configuration for deferred tools. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `type BetaWebSearchPreviewTool struct{…}` + - `ScoreThreshold float64` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `type BetaApplyPatchTool struct{…}` + - `Ranker string` - Allows the assistant to create, delete, or update files using unified diffs. + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `TopP float64` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - We generally recommend altering this or `temperature` but not both. + - `type FunctionTool struct{…}` - - `Background bool` + - `Function FunctionDefinition` - Whether to run the model response in the background. - [Learn more](https://platform.openai.com/docs/guides/background). + - `Name string` - - `CompletedAt float64` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. + - `Description string` - - `Conversation BetaResponseConversation` + A description of what the function does, used by the model to choose when and how to call the function. - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + - `Parameters FunctionParameters` - - `ID string` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - The unique ID of the conversation that this response was associated with. + Omitting `parameters` defines a function with an empty parameter list. - - `MaxOutputTokens int64` + - `Strict bool` - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `MaxToolCalls int64` + - `Type Function` - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + The type of tool being defined: `function` - - `Moderation BetaResponseModeration` + - `const FunctionFunction Function = "function"` - Moderation results for the response input and output, if moderated completions were requested. + - `TopP param.Field[float64]` - - `Input BetaResponseModerationInputUnion` + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - Moderation for the response input. + We generally recommend altering this or temperature but not both. - - `type BetaResponseModerationInputModerationResult struct{…}` +### Returns - A moderation result produced for the response input or output. +- `type Assistant struct{…}` - - `Categories map[string, bool]` + Represents an `assistant` that can call the model and use tools. - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `ID string` - - `CategoryAppliedInputTypes map[string, []string]` + The identifier, which can be referenced in API endpoints. - Which modalities of input are reflected by the score for each category. + - `CreatedAt int64` - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeText BetaResponseModerationInputModerationResultCategoryAppliedInputType = "text"` + The Unix timestamp (in seconds) for when the assistant was created. - - `const BetaResponseModerationInputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationInputModerationResultCategoryAppliedInputType = "image"` + - `Description string` - - `CategoryScores map[string, float64]` + The description of the assistant. The maximum length is 512 characters. - A dictionary of moderation categories to scores. + - `Instructions string` - - `Flagged bool` + The system instructions that the assistant uses. The maximum length is 256,000 characters. - A boolean indicating whether the content was flagged by any category. + - `Metadata Metadata` - - `Model string` + 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. - The moderation model that produced this result. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `Type ModerationResult` + - `Model string` - The object type, which was always `moderation_result` for successful moderation results. + ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + - `Name string` - - `type BetaResponseModerationInputError struct{…}` + The name of the assistant. The maximum length is 256 characters. - An error produced while attempting moderation for the response input or output. + - `Object Assistant` - - `Code string` + The object type, which is always `assistant`. - The error code. + - `const AssistantAssistant Assistant = "assistant"` - - `Message string` + - `Tools []AssistantToolUnion` - The error message. + A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - `Type Error` + - `type CodeInterpreterTool struct{…}` - The object type, which was always `error` for moderation failures. + - `Type CodeInterpreter` - - `const ErrorError Error = "error"` + The type of tool being defined: `code_interpreter` - - `Output BetaResponseModerationOutputUnion` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - Moderation for the response output. + - `type FileSearchTool struct{…}` - - `type BetaResponseModerationOutputModerationResult struct{…}` + - `Type FileSearch` - A moderation result produced for the response input or output. + The type of tool being defined: `file_search` - - `Categories map[string, bool]` + - `const FileSearchFileSearch FileSearch = "file_search"` - A dictionary of moderation categories to booleans, True if the input is flagged under this category. + - `FileSearch FileSearchToolFileSearch` - - `CategoryAppliedInputTypes map[string, []string]` + Overrides for the file search tool. - Which modalities of input are reflected by the score for each category. + - `MaxNumResults int64` - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeText BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "text"` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `const BetaResponseModerationOutputModerationResultCategoryAppliedInputTypeImage BetaResponseModerationOutputModerationResultCategoryAppliedInputType = "image"` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `CategoryScores map[string, float64]` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - A dictionary of moderation categories to scores. + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `Flagged bool` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - A boolean indicating whether the content was flagged by any category. + - `ScoreThreshold float64` - - `Model string` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - The moderation model that produced this result. + - `Ranker string` - - `Type ModerationResult` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The object type, which was always `moderation_result` for successful moderation results. + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `const ModerationResultModerationResult ModerationResult = "moderation_result"` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `type BetaResponseModerationOutputError struct{…}` + - `type FunctionTool struct{…}` - An error produced while attempting moderation for the response input or output. + - `Function FunctionDefinition` - - `Code string` + - `Name string` - The error code. + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `Message string` + - `Description string` - The error message. + A description of what the function does, used by the model to choose when and how to call the function. - - `Type Error` + - `Parameters FunctionParameters` - The object type, which was always `error` for moderation failures. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `const ErrorError Error = "error"` + Omitting `parameters` defines a function with an empty parameter list. - - `PreviousResponseID string` + - `Strict bool` - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `Prompt BetaResponsePrompt` + - `Type Function` - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + The type of tool being defined: `function` - - `ID string` + - `const FunctionFunction Function = "function"` - The unique identifier of the prompt template to use. + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `Variables map[string, BetaResponsePromptVariableUnion]` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `type BetaResponseInputText struct{…}` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - A text input to the model. + - `type Auto string` - - `type BetaResponseInputImage struct{…}` + `auto` is the default value - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const AutoAuto Auto = "auto"` - - `type BetaResponseInputFile struct{…}` + - `type ResponseFormatText struct{…}` - A file input to the model. + Default response format. Used to generate text responses. - - `Version string` + - `Type Text` - Optional version of the prompt template. + The type of response format being defined. Always `text`. - - `PromptCacheKey string` + - `const TextText Text = "text"` - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + - `type ResponseFormatJSONObject struct{…}` - - `PromptCacheOptions BetaResponsePromptCacheOptions` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. + - `Type JSONObject` - - `Mode string` + The type of response format being defined. Always `json_object`. - Whether implicit prompt-cache breakpoints were enabled. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `const BetaResponsePromptCacheOptionsModeImplicit BetaResponsePromptCacheOptionsMode = "implicit"` + - `type ResponseFormatJSONSchema struct{…}` - - `const BetaResponsePromptCacheOptionsModeExplicit BetaResponsePromptCacheOptionsMode = "explicit"` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `Ttl string` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - The minimum lifetime applied to each cache breakpoint. + Structured Outputs configuration options, including a JSON Schema. - - `const BetaResponsePromptCacheOptionsTtl30m BetaResponsePromptCacheOptionsTtl = "30m"` + - `Name string` - - `PromptCacheRetention BetaResponsePromptCacheRetention` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - Deprecated. Use `prompt_cache_options.ttl` instead. + - `Description string` - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + A description of what the response format is for, used by the model to + determine how to respond in the format. - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + - `Schema map[string, any]` - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `const BetaResponsePromptCacheRetentionInMemory BetaResponsePromptCacheRetention = "in_memory"` + - `Strict bool` - - `const BetaResponsePromptCacheRetention24h BetaResponsePromptCacheRetention = "24h"` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Reasoning BetaResponseReasoning` + - `Type JSONSchema` - **gpt-5 and o-series models only** + The type of response format being defined. Always `json_schema`. - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `Context string` + - `Temperature float64` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - `const BetaResponseReasoningContextAuto BetaResponseReasoningContext = "auto"` + - `ToolResources AssistantToolResources` - - `const BetaResponseReasoningContextCurrentTurn BetaResponseReasoningContext = "current_turn"` + A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `const BetaResponseReasoningContextAllTurns BetaResponseReasoningContext = "all_turns"` + - `CodeInterpreter AssistantToolResourcesCodeInterpreter` - - `Effort string` + - `FileIDs []string` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - `const BetaResponseReasoningEffortNone BetaResponseReasoningEffort = "none"` + - `FileSearch AssistantToolResourcesFileSearch` - - `const BetaResponseReasoningEffortMinimal BetaResponseReasoningEffort = "minimal"` + - `VectorStoreIDs []string` - - `const BetaResponseReasoningEffortLow BetaResponseReasoningEffort = "low"` + The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - `const BetaResponseReasoningEffortMedium BetaResponseReasoningEffort = "medium"` + - `TopP float64` - - `const BetaResponseReasoningEffortHigh BetaResponseReasoningEffort = "high"` + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - `const BetaResponseReasoningEffortXhigh BetaResponseReasoningEffort = "xhigh"` + We generally recommend altering this or temperature but not both. - - `const BetaResponseReasoningEffortMax BetaResponseReasoningEffort = "max"` +### Example - - `GenerateSummary string` +```go +package main - **Deprecated:** use `summary` instead. +import ( + "context" + "fmt" - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" + "github.com/openai/openai-go/shared" +) - - `const BetaResponseReasoningGenerateSummaryAuto BetaResponseReasoningGenerateSummary = "auto"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + assistant, err := client.Beta.Assistants.New(context.TODO(), openai.BetaAssistantNewParams{ + Model: shared.ChatModelGPT4o, + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", assistant.ID) +} +``` - - `const BetaResponseReasoningGenerateSummaryConcise BetaResponseReasoningGenerateSummary = "concise"` +#### Response - - `const BetaResponseReasoningGenerateSummaryDetailed BetaResponseReasoningGenerateSummary = "detailed"` +```json +{ + "id": "id", + "created_at": 0, + "description": "description", + "instructions": "instructions", + "metadata": { + "foo": "string" + }, + "model": "model", + "name": "name", + "object": "assistant", + "tools": [ + { + "type": "code_interpreter" + } + ], + "response_format": "auto", + "temperature": 1, + "tool_resources": { + "code_interpreter": { + "file_ids": [ + "string" + ] + }, + "file_search": { + "vector_store_ids": [ + "string" + ] + } + }, + "top_p": 1 +} +``` - - `Mode string` +## Retrieve assistant - Controls the reasoning execution mode for the request. +`client.Beta.Assistants.Get(ctx, assistantID) (*Assistant, error)` - When returned on a response, this is the effective execution mode. +**get** `/assistants/{assistant_id}` - - `string` +Retrieves an assistant. - - `string` +### Parameters - - `const BetaResponseReasoningModeStandard BetaResponseReasoningMode = "standard"` +- `assistantID string` - - `const BetaResponseReasoningModePro BetaResponseReasoningMode = "pro"` +### Returns - - `Summary string` +- `type Assistant struct{…}` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + Represents an `assistant` that can call the model and use tools. - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `ID string` - - `const BetaResponseReasoningSummaryAuto BetaResponseReasoningSummary = "auto"` + The identifier, which can be referenced in API endpoints. - - `const BetaResponseReasoningSummaryConcise BetaResponseReasoningSummary = "concise"` + - `CreatedAt int64` - - `const BetaResponseReasoningSummaryDetailed BetaResponseReasoningSummary = "detailed"` + The Unix timestamp (in seconds) for when the assistant was created. - - `SafetyIdentifier string` + - `Description string` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + The description of the assistant. The maximum length is 512 characters. - - `ServiceTier BetaResponseServiceTier` + - `Instructions string` - Specifies the processing type used for serving the request. + The system instructions that the assistant uses. The maximum length is 256,000 characters. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `Metadata Metadata` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + 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. - - `const BetaResponseServiceTierAuto BetaResponseServiceTier = "auto"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaResponseServiceTierDefault BetaResponseServiceTier = "default"` + - `Model string` - - `const BetaResponseServiceTierFlex BetaResponseServiceTier = "flex"` + ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - - `const BetaResponseServiceTierScale BetaResponseServiceTier = "scale"` + - `Name string` - - `const BetaResponseServiceTierPriority BetaResponseServiceTier = "priority"` + The name of the assistant. The maximum length is 256 characters. - - `Status BetaResponseStatus` + - `Object Assistant` - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. + The object type, which is always `assistant`. - - `const BetaResponseStatusCompleted BetaResponseStatus = "completed"` + - `const AssistantAssistant Assistant = "assistant"` - - `const BetaResponseStatusFailed BetaResponseStatus = "failed"` + - `Tools []AssistantToolUnion` - - `const BetaResponseStatusInProgress BetaResponseStatus = "in_progress"` + A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - `const BetaResponseStatusCancelled BetaResponseStatus = "cancelled"` + - `type CodeInterpreterTool struct{…}` - - `const BetaResponseStatusQueued BetaResponseStatus = "queued"` + - `Type CodeInterpreter` - - `const BetaResponseStatusIncomplete BetaResponseStatus = "incomplete"` + The type of tool being defined: `code_interpreter` - - `Text BetaResponseTextConfig` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `type FileSearchTool struct{…}` - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `Type FileSearch` - - `Format BetaResponseFormatTextConfigUnion` + The type of tool being defined: `file_search` - An object specifying the format that the model must output. + - `const FileSearchFileSearch FileSearch = "file_search"` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `FileSearch FileSearchToolFileSearch` - The default format is `{ "type": "text" }` with no additional options. + Overrides for the file search tool. - **Not recommended for gpt-4o and newer models:** + - `MaxNumResults int64` - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `type BetaResponseFormatTextConfigText struct{…}` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - Default response format. Used to generate text responses. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `Type Text` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - The type of response format being defined. Always `text`. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const TextText Text = "text"` + - `ScoreThreshold float64` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `Ranker string` - - `Name string` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `Schema map[string, any]` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `type FunctionTool struct{…}` - - `Type JSONSchema` + - `Function FunctionDefinition` - The type of response format being defined. Always `json_schema`. + - `Name string` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - `Description string` - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `Strict bool` + A description of what the function does, used by the model to choose when and how to call the function. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). + - `Parameters FunctionParameters` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + Omitting `parameters` defines a function with an empty parameter list. - - `Type JSONObject` + - `Strict bool` - The type of response format being defined. Always `json_object`. + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `Type Function` - - `Verbosity BetaResponseTextConfigVerbosity` + The type of tool being defined: `function` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + - `const FunctionFunction Function = "function"` - - `const BetaResponseTextConfigVerbosityLow BetaResponseTextConfigVerbosity = "low"` + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `const BetaResponseTextConfigVerbosityMedium BetaResponseTextConfigVerbosity = "medium"` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `const BetaResponseTextConfigVerbosityHigh BetaResponseTextConfigVerbosity = "high"` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `TopLogprobs int64` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `Truncation BetaResponseTruncation` + - `type Auto string` - The truncation strategy to use for the model response. + `auto` is the default value - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `const AutoAuto Auto = "auto"` - - `const BetaResponseTruncationAuto BetaResponseTruncation = "auto"` + - `type ResponseFormatText struct{…}` - - `const BetaResponseTruncationDisabled BetaResponseTruncation = "disabled"` + Default response format. Used to generate text responses. - - `Usage BetaResponseUsage` + - `Type Text` - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. + The type of response format being defined. Always `text`. - - `InputTokens int64` + - `const TextText Text = "text"` - The number of input tokens. + - `type ResponseFormatJSONObject struct{…}` - - `InputTokensDetails BetaResponseUsageInputTokensDetails` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - A detailed breakdown of the input tokens. + - `Type JSONObject` - - `CacheWriteTokens int64` + The type of response format being defined. Always `json_object`. - The number of input tokens that were written to the cache. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `CachedTokens int64` + - `type ResponseFormatJSONSchema struct{…}` - The number of tokens that were retrieved from the cache. - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `OutputTokens int64` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - The number of output tokens. + Structured Outputs configuration options, including a JSON Schema. - - `OutputTokensDetails BetaResponseUsageOutputTokensDetails` + - `Name string` - A detailed breakdown of the output tokens. + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `ReasoningTokens int64` + - `Description string` - The number of reasoning tokens. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `TotalTokens int64` + - `Schema map[string, any]` - The total number of tokens used. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `User string` + - `Strict bool` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `SequenceNumber int64` + - `Type JSONSchema` - The sequence number for this event. + The type of response format being defined. Always `json_schema`. - - `Type ResponseCompleted` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - The type of the event. Always `response.completed`. + - `Temperature float64` - - `const ResponseCompletedResponseCompleted ResponseCompleted = "response.completed"` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - `Agent BetaResponseCompletedEventAgent` + - `ToolResources AssistantToolResources` - The agent that owns this multi-agent streaming event. + A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `AgentName string` + - `CodeInterpreter AssistantToolResourcesCodeInterpreter` - The canonical name of the agent that produced this item. + - `FileIDs []string` - - `type BetaResponseContentPartAddedEvent struct{…}` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - Emitted when a new content part is added. + - `FileSearch AssistantToolResourcesFileSearch` - - `ContentIndex int64` + - `VectorStoreIDs []string` - The index of the content part that was added. + The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - `ItemID string` + - `TopP float64` - The ID of the output item that the content part was added to. + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - `OutputIndex int64` + We generally recommend altering this or temperature but not both. - The index of the output item that the content part was added to. +### Example - - `Part BetaResponseContentPartAddedEventPartUnion` +```go +package main - The content part that was added. +import ( + "context" + "fmt" - - `type BetaResponseOutputText struct{…}` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - A text output from the model. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + assistant, err := client.Beta.Assistants.Get(context.TODO(), "assistant_id") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", assistant.ID) +} +``` - - `type BetaResponseOutputRefusal struct{…}` +#### Response - A refusal from the model. +```json +{ + "id": "id", + "created_at": 0, + "description": "description", + "instructions": "instructions", + "metadata": { + "foo": "string" + }, + "model": "model", + "name": "name", + "object": "assistant", + "tools": [ + { + "type": "code_interpreter" + } + ], + "response_format": "auto", + "temperature": 1, + "tool_resources": { + "code_interpreter": { + "file_ids": [ + "string" + ] + }, + "file_search": { + "vector_store_ids": [ + "string" + ] + } + }, + "top_p": 1 +} +``` - - `type BetaResponseContentPartAddedEventPartReasoningText struct{…}` +## Modify assistant - Reasoning text from the model. +`client.Beta.Assistants.Update(ctx, assistantID, body) (*Assistant, error)` - - `Text string` +**post** `/assistants/{assistant_id}` - The reasoning text from the model. +Modifies an assistant. - - `Type ReasoningText` +### Parameters - The type of the reasoning text. Always `reasoning_text`. +- `assistantID string` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` +- `body BetaAssistantUpdateParams` - - `SequenceNumber int64` + - `Description param.Field[string]` - The sequence number of this event. + The description of the assistant. The maximum length is 512 characters. - - `Type ResponseContentPartAdded` + - `Instructions param.Field[string]` - The type of the event. Always `response.content_part.added`. + The system instructions that the assistant uses. The maximum length is 256,000 characters. - - `const ResponseContentPartAddedResponseContentPartAdded ResponseContentPartAdded = "response.content_part.added"` + - `Metadata param.Field[Metadata]` - - `Agent BetaResponseContentPartAddedEventAgent` + 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. - The agent that owns this multi-agent streaming event. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `AgentName string` + - `Model param.Field[BetaAssistantUpdateParamsModel]` - The canonical name of the agent that produced this item. + ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - - `type BetaResponseContentPartDoneEvent struct{…}` + - `string` - Emitted when a content part is done. + - `type BetaAssistantUpdateParamsModel string` - - `ContentIndex int64` + ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - The index of the content part that is done. + - `const BetaAssistantUpdateParamsModelGPT5 BetaAssistantUpdateParamsModel = "gpt-5"` - - `ItemID string` + - `const BetaAssistantUpdateParamsModelGPT5Mini BetaAssistantUpdateParamsModel = "gpt-5-mini"` - The ID of the output item that the content part was added to. + - `const BetaAssistantUpdateParamsModelGPT5Nano BetaAssistantUpdateParamsModel = "gpt-5-nano"` - - `OutputIndex int64` + - `const BetaAssistantUpdateParamsModelGPT5_2025_08_07 BetaAssistantUpdateParamsModel = "gpt-5-2025-08-07"` - The index of the output item that the content part was added to. + - `const BetaAssistantUpdateParamsModelGPT5Mini2025_08_07 BetaAssistantUpdateParamsModel = "gpt-5-mini-2025-08-07"` - - `Part BetaResponseContentPartDoneEventPartUnion` + - `const BetaAssistantUpdateParamsModelGPT5Nano2025_08_07 BetaAssistantUpdateParamsModel = "gpt-5-nano-2025-08-07"` - The content part that is done. + - `const BetaAssistantUpdateParamsModelGPT4_1 BetaAssistantUpdateParamsModel = "gpt-4.1"` - - `type BetaResponseOutputText struct{…}` + - `const BetaAssistantUpdateParamsModelGPT4_1Mini BetaAssistantUpdateParamsModel = "gpt-4.1-mini"` - A text output from the model. + - `const BetaAssistantUpdateParamsModelGPT4_1Nano BetaAssistantUpdateParamsModel = "gpt-4.1-nano"` - - `type BetaResponseOutputRefusal struct{…}` + - `const BetaAssistantUpdateParamsModelGPT4_1_2025_04_14 BetaAssistantUpdateParamsModel = "gpt-4.1-2025-04-14"` - A refusal from the model. + - `const BetaAssistantUpdateParamsModelGPT4_1Mini2025_04_14 BetaAssistantUpdateParamsModel = "gpt-4.1-mini-2025-04-14"` - - `type BetaResponseContentPartDoneEventPartReasoningText struct{…}` + - `const BetaAssistantUpdateParamsModelGPT4_1Nano2025_04_14 BetaAssistantUpdateParamsModel = "gpt-4.1-nano-2025-04-14"` - Reasoning text from the model. + - `const BetaAssistantUpdateParamsModelO3Mini BetaAssistantUpdateParamsModel = "o3-mini"` - - `Text string` + - `const BetaAssistantUpdateParamsModelO3Mini2025_01_31 BetaAssistantUpdateParamsModel = "o3-mini-2025-01-31"` - The reasoning text from the model. + - `const BetaAssistantUpdateParamsModelO1 BetaAssistantUpdateParamsModel = "o1"` - - `Type ReasoningText` + - `const BetaAssistantUpdateParamsModelO1_2024_12_17 BetaAssistantUpdateParamsModel = "o1-2024-12-17"` - The type of the reasoning text. Always `reasoning_text`. + - `const BetaAssistantUpdateParamsModelGPT4o BetaAssistantUpdateParamsModel = "gpt-4o"` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `const BetaAssistantUpdateParamsModelGPT4o2024_11_20 BetaAssistantUpdateParamsModel = "gpt-4o-2024-11-20"` - - `SequenceNumber int64` + - `const BetaAssistantUpdateParamsModelGPT4o2024_08_06 BetaAssistantUpdateParamsModel = "gpt-4o-2024-08-06"` - The sequence number of this event. + - `const BetaAssistantUpdateParamsModelGPT4o2024_05_13 BetaAssistantUpdateParamsModel = "gpt-4o-2024-05-13"` - - `Type ResponseContentPartDone` + - `const BetaAssistantUpdateParamsModelGPT4oMini BetaAssistantUpdateParamsModel = "gpt-4o-mini"` - The type of the event. Always `response.content_part.done`. + - `const BetaAssistantUpdateParamsModelGPT4oMini2024_07_18 BetaAssistantUpdateParamsModel = "gpt-4o-mini-2024-07-18"` - - `const ResponseContentPartDoneResponseContentPartDone ResponseContentPartDone = "response.content_part.done"` + - `const BetaAssistantUpdateParamsModelGPT4_5Preview BetaAssistantUpdateParamsModel = "gpt-4.5-preview"` - - `Agent BetaResponseContentPartDoneEventAgent` + - `const BetaAssistantUpdateParamsModelGPT4_5Preview2025_02_27 BetaAssistantUpdateParamsModel = "gpt-4.5-preview-2025-02-27"` - The agent that owns this multi-agent streaming event. + - `const BetaAssistantUpdateParamsModelGPT4Turbo BetaAssistantUpdateParamsModel = "gpt-4-turbo"` - - `AgentName string` + - `const BetaAssistantUpdateParamsModelGPT4Turbo2024_04_09 BetaAssistantUpdateParamsModel = "gpt-4-turbo-2024-04-09"` - The canonical name of the agent that produced this item. + - `const BetaAssistantUpdateParamsModelGPT4_0125Preview BetaAssistantUpdateParamsModel = "gpt-4-0125-preview"` - - `type BetaResponseCreatedEvent struct{…}` + - `const BetaAssistantUpdateParamsModelGPT4TurboPreview BetaAssistantUpdateParamsModel = "gpt-4-turbo-preview"` - An event that is emitted when a response is created. + - `const BetaAssistantUpdateParamsModelGPT4_1106Preview BetaAssistantUpdateParamsModel = "gpt-4-1106-preview"` - - `Response BetaResponse` + - `const BetaAssistantUpdateParamsModelGPT4VisionPreview BetaAssistantUpdateParamsModel = "gpt-4-vision-preview"` - The response that was created. + - `const BetaAssistantUpdateParamsModelGPT4 BetaAssistantUpdateParamsModel = "gpt-4"` - - `SequenceNumber int64` + - `const BetaAssistantUpdateParamsModelGPT4_0314 BetaAssistantUpdateParamsModel = "gpt-4-0314"` - The sequence number for this event. + - `const BetaAssistantUpdateParamsModelGPT4_0613 BetaAssistantUpdateParamsModel = "gpt-4-0613"` - - `Type ResponseCreated` + - `const BetaAssistantUpdateParamsModelGPT4_32k BetaAssistantUpdateParamsModel = "gpt-4-32k"` - The type of the event. Always `response.created`. + - `const BetaAssistantUpdateParamsModelGPT4_32k0314 BetaAssistantUpdateParamsModel = "gpt-4-32k-0314"` - - `const ResponseCreatedResponseCreated ResponseCreated = "response.created"` + - `const BetaAssistantUpdateParamsModelGPT4_32k0613 BetaAssistantUpdateParamsModel = "gpt-4-32k-0613"` - - `Agent BetaResponseCreatedEventAgent` + - `const BetaAssistantUpdateParamsModelGPT3_5Turbo BetaAssistantUpdateParamsModel = "gpt-3.5-turbo"` - The agent that owns this multi-agent streaming event. + - `const BetaAssistantUpdateParamsModelGPT3_5Turbo16k BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-16k"` - - `AgentName string` + - `const BetaAssistantUpdateParamsModelGPT3_5Turbo0613 BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-0613"` - The canonical name of the agent that produced this item. + - `const BetaAssistantUpdateParamsModelGPT3_5Turbo1106 BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-1106"` - - `type BetaResponseErrorEvent struct{…}` + - `const BetaAssistantUpdateParamsModelGPT3_5Turbo0125 BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-0125"` - Emitted when an error occurs. + - `const BetaAssistantUpdateParamsModelGPT3_5Turbo16k0613 BetaAssistantUpdateParamsModel = "gpt-3.5-turbo-16k-0613"` - - `Code string` + - `Name param.Field[string]` - The error code. + The name of the assistant. The maximum length is 256 characters. - - `Message string` + - `ReasoningEffort param.Field[ReasoningEffort]` - The error message. + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - - `Param string` + - `ResponseFormat param.Field[AssistantResponseFormatOptionUnion]` - The error parameter. + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `SequenceNumber int64` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The sequence number of this event. + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `Type Error` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - The type of the event. Always `error`. + - `Temperature param.Field[float64]` - - `const ErrorError Error = "error"` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - `Agent BetaResponseErrorEventAgent` + - `ToolResources param.Field[BetaAssistantUpdateParamsToolResources]` - The agent that owns this multi-agent streaming event. + A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `AgentName string` + - `CodeInterpreter BetaAssistantUpdateParamsToolResourcesCodeInterpreter` - The canonical name of the agent that produced this item. + - `FileIDs []string` - - `type BetaResponseFileSearchCallCompletedEvent struct{…}` + Overrides the list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - Emitted when a file search call is completed (results found). + - `FileSearch BetaAssistantUpdateParamsToolResourcesFileSearch` - - `ItemID string` + - `VectorStoreIDs []string` - The ID of the output item that the file search call is initiated. + Overrides the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - `OutputIndex int64` + - `Tools param.Field[[]AssistantToolUnion]` - The index of the output item that the file search call is initiated. + A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - `SequenceNumber int64` + - `type CodeInterpreterTool struct{…}` - The sequence number of this event. + - `Type CodeInterpreter` - - `Type ResponseFileSearchCallCompleted` + The type of tool being defined: `code_interpreter` - The type of the event. Always `response.file_search_call.completed`. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `const ResponseFileSearchCallCompletedResponseFileSearchCallCompleted ResponseFileSearchCallCompleted = "response.file_search_call.completed"` + - `type FileSearchTool struct{…}` - - `Agent BetaResponseFileSearchCallCompletedEventAgent` + - `Type FileSearch` - The agent that owns this multi-agent streaming event. + The type of tool being defined: `file_search` - - `AgentName string` + - `const FileSearchFileSearch FileSearch = "file_search"` - The canonical name of the agent that produced this item. + - `FileSearch FileSearchToolFileSearch` - - `type BetaResponseFileSearchCallInProgressEvent struct{…}` + Overrides for the file search tool. - Emitted when a file search call is initiated. + - `MaxNumResults int64` - - `ItemID string` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - The ID of the output item that the file search call is initiated. + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `OutputIndex int64` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - The index of the output item that the file search call is initiated. + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `SequenceNumber int64` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - The sequence number of this event. + - `ScoreThreshold float64` - - `Type ResponseFileSearchCallInProgress` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - The type of the event. Always `response.file_search_call.in_progress`. + - `Ranker string` - - `const ResponseFileSearchCallInProgressResponseFileSearchCallInProgress ResponseFileSearchCallInProgress = "response.file_search_call.in_progress"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `Agent BetaResponseFileSearchCallInProgressEventAgent` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - The agent that owns this multi-agent streaming event. + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `AgentName string` + - `type FunctionTool struct{…}` - The canonical name of the agent that produced this item. + - `Function FunctionDefinition` - - `type BetaResponseFileSearchCallSearchingEvent struct{…}` + - `Name string` - Emitted when a file search is currently searching. + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `ItemID string` + - `Description string` - The ID of the output item that the file search call is initiated. + A description of what the function does, used by the model to choose when and how to call the function. - - `OutputIndex int64` + - `Parameters FunctionParameters` - The index of the output item that the file search call is searching. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `SequenceNumber int64` + Omitting `parameters` defines a function with an empty parameter list. - The sequence number of this event. + - `Strict bool` - - `Type ResponseFileSearchCallSearching` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - The type of the event. Always `response.file_search_call.searching`. + - `Type Function` - - `const ResponseFileSearchCallSearchingResponseFileSearchCallSearching ResponseFileSearchCallSearching = "response.file_search_call.searching"` + The type of tool being defined: `function` - - `Agent BetaResponseFileSearchCallSearchingEventAgent` + - `const FunctionFunction Function = "function"` - The agent that owns this multi-agent streaming event. + - `TopP param.Field[float64]` - - `AgentName string` + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - The canonical name of the agent that produced this item. + We generally recommend altering this or temperature but not both. - - `type BetaResponseFunctionCallArgumentsDeltaEvent struct{…}` +### Returns - Emitted when there is a partial function-call arguments delta. +- `type Assistant struct{…}` - - `Delta string` + Represents an `assistant` that can call the model and use tools. - The function-call arguments delta that is added. + - `ID string` - - `ItemID string` + The identifier, which can be referenced in API endpoints. - The ID of the output item that the function-call arguments delta is added to. + - `CreatedAt int64` - - `OutputIndex int64` + The Unix timestamp (in seconds) for when the assistant was created. - The index of the output item that the function-call arguments delta is added to. + - `Description string` - - `SequenceNumber int64` + The description of the assistant. The maximum length is 512 characters. - The sequence number of this event. + - `Instructions string` - - `Type ResponseFunctionCallArgumentsDelta` + The system instructions that the assistant uses. The maximum length is 256,000 characters. - The type of the event. Always `response.function_call_arguments.delta`. + - `Metadata Metadata` - - `const ResponseFunctionCallArgumentsDeltaResponseFunctionCallArgumentsDelta ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta"` + 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. - - `Agent BetaResponseFunctionCallArgumentsDeltaEventAgent` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - The agent that owns this multi-agent streaming event. + - `Model string` - - `AgentName string` + ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - The canonical name of the agent that produced this item. + - `Name string` - - `type BetaResponseFunctionCallArgumentsDoneEvent struct{…}` + The name of the assistant. The maximum length is 256 characters. - Emitted when function-call arguments are finalized. + - `Object Assistant` - - `Arguments string` + The object type, which is always `assistant`. - The function-call arguments. + - `const AssistantAssistant Assistant = "assistant"` - - `ItemID string` + - `Tools []AssistantToolUnion` - The ID of the item. + A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - `Name string` + - `type CodeInterpreterTool struct{…}` - The name of the function that was called. + - `Type CodeInterpreter` - - `OutputIndex int64` + The type of tool being defined: `code_interpreter` - The index of the output item. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `SequenceNumber int64` + - `type FileSearchTool struct{…}` - The sequence number of this event. + - `Type FileSearch` - - `Type ResponseFunctionCallArgumentsDone` + The type of tool being defined: `file_search` - - `const ResponseFunctionCallArgumentsDoneResponseFunctionCallArgumentsDone ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Agent BetaResponseFunctionCallArgumentsDoneEventAgent` + - `FileSearch FileSearchToolFileSearch` - The agent that owns this multi-agent streaming event. + Overrides for the file search tool. - - `AgentName string` + - `MaxNumResults int64` - The canonical name of the agent that produced this item. + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `type BetaResponseInProgressEvent struct{…}` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - Emitted when the response is in progress. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `Response BetaResponse` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - The response that is in progress. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `SequenceNumber int64` + - `ScoreThreshold float64` - The sequence number of this event. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `Type ResponseInProgress` + - `Ranker string` - The type of the event. Always `response.in_progress`. + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const ResponseInProgressResponseInProgress ResponseInProgress = "response.in_progress"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `Agent BetaResponseInProgressEventAgent` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - The agent that owns this multi-agent streaming event. + - `type FunctionTool struct{…}` - - `AgentName string` + - `Function FunctionDefinition` - The canonical name of the agent that produced this item. + - `Name string` - - `type BetaResponseFailedEvent struct{…}` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - An event that is emitted when a response fails. + - `Description string` - - `Response BetaResponse` + A description of what the function does, used by the model to choose when and how to call the function. - The response that failed. + - `Parameters FunctionParameters` - - `SequenceNumber int64` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - The sequence number of this event. + Omitting `parameters` defines a function with an empty parameter list. - - `Type ResponseFailed` + - `Strict bool` - The type of the event. Always `response.failed`. + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `const ResponseFailedResponseFailed ResponseFailed = "response.failed"` + - `Type Function` - - `Agent BetaResponseFailedEventAgent` + The type of tool being defined: `function` - The agent that owns this multi-agent streaming event. + - `const FunctionFunction Function = "function"` - - `AgentName string` + - `ResponseFormat AssistantResponseFormatOptionUnion` - The canonical name of the agent that produced this item. + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `type BetaResponseIncompleteEvent struct{…}` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - An event that is emitted when a response finishes as incomplete. + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `Response BetaResponse` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - The response that was incomplete. + - `type Auto string` - - `SequenceNumber int64` + `auto` is the default value - The sequence number of this event. + - `const AutoAuto Auto = "auto"` - - `Type ResponseIncomplete` + - `type ResponseFormatText struct{…}` - The type of the event. Always `response.incomplete`. + Default response format. Used to generate text responses. - - `const ResponseIncompleteResponseIncomplete ResponseIncomplete = "response.incomplete"` + - `Type Text` - - `Agent BetaResponseIncompleteEventAgent` + The type of response format being defined. Always `text`. - The agent that owns this multi-agent streaming event. + - `const TextText Text = "text"` - - `AgentName string` + - `type ResponseFormatJSONObject struct{…}` - The canonical name of the agent that produced this item. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `type BetaResponseOutputItemAddedEvent struct{…}` + - `Type JSONObject` - Emitted when a new output item is added. + The type of response format being defined. Always `json_object`. - - `Item BetaResponseOutputItemUnion` + - `const JSONObjectJSONObject JSONObject = "json_object"` - The output item that was added. + - `type ResponseFormatJSONSchema struct{…}` - - `type BetaResponseOutputMessage struct{…}` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - An output message from the model. + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `type BetaResponseFileSearchToolCall struct{…}` + Structured Outputs configuration options, including a JSON Schema. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `Name string` - - `type BetaResponseFunctionToolCall struct{…}` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `Description string` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `type BetaResponseOutputItemAgentMessage struct{…}` + - `Schema map[string, any]` - - `type BetaResponseOutputItemMultiAgentCall struct{…}` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `type BetaResponseOutputItemMultiAgentCallOutput struct{…}` + - `Strict bool` - - `type BetaResponseFunctionWebSearch struct{…}` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `Type JSONSchema` - - `type BetaResponseComputerToolCall struct{…}` + The type of response format being defined. Always `json_schema`. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `Temperature float64` - - `type BetaResponseReasoningItem struct{…}` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - 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](https://platform.openai.com/docs/guides/conversation-state). + - `ToolResources AssistantToolResources` - - `type BetaResponseOutputItemProgram struct{…}` + A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `type BetaResponseOutputItemProgramOutput struct{…}` + - `CodeInterpreter AssistantToolResourcesCodeInterpreter` - - `type BetaResponseToolSearchCall struct{…}` + - `FileIDs []string` - - `type BetaResponseToolSearchOutputItem struct{…}` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - `type BetaResponseOutputItemAdditionalTools struct{…}` + - `FileSearch AssistantToolResourcesFileSearch` - - `type BetaResponseCompactionItem struct{…}` + - `VectorStoreIDs []string` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - `type BetaResponseOutputItemImageGenerationCall struct{…}` + - `TopP float64` - An image generation request made by the model. + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + We generally recommend altering this or temperature but not both. - A tool call to run code. +### Example - - `type BetaResponseOutputItemLocalShellCall struct{…}` +```go +package main - A tool call to run a command on the local shell. +import ( + "context" + "fmt" - - `type BetaResponseOutputItemLocalShellCallOutput struct{…}` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The output of a local shell tool call. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + assistant, err := client.Beta.Assistants.Update( + context.TODO(), + "assistant_id", + openai.BetaAssistantUpdateParams{ - - `type BetaResponseFunctionShellToolCall struct{…}` + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", assistant.ID) +} +``` - A tool call that executes one or more shell commands in a managed environment. +#### Response - - `type BetaResponseFunctionShellToolCallOutput struct{…}` +```json +{ + "id": "id", + "created_at": 0, + "description": "description", + "instructions": "instructions", + "metadata": { + "foo": "string" + }, + "model": "model", + "name": "name", + "object": "assistant", + "tools": [ + { + "type": "code_interpreter" + } + ], + "response_format": "auto", + "temperature": 1, + "tool_resources": { + "code_interpreter": { + "file_ids": [ + "string" + ] + }, + "file_search": { + "vector_store_ids": [ + "string" + ] + } + }, + "top_p": 1 +} +``` - The output of a shell tool call that was emitted. +## Delete assistant - - `type BetaResponseApplyPatchToolCall struct{…}` +`client.Beta.Assistants.Delete(ctx, assistantID) (*AssistantDeleted, error)` - A tool call that applies file diffs by creating, deleting, or updating files. +**delete** `/assistants/{assistant_id}` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` +Delete an assistant. - The output emitted by an apply patch tool call. +### Parameters - - `type BetaResponseOutputItemMcpCall struct{…}` +- `assistantID string` - An invocation of a tool on an MCP server. +### Returns - - `type BetaResponseOutputItemMcpListTools struct{…}` +- `type AssistantDeleted struct{…}` - A list of tools available on an MCP server. + - `ID string` - - `type BetaResponseOutputItemMcpApprovalRequest struct{…}` + - `Deleted bool` - A request for human approval of a tool invocation. + - `Object AssistantDeleted` - - `type BetaResponseOutputItemMcpApprovalResponse struct{…}` + - `const AssistantDeletedAssistantDeleted AssistantDeleted = "assistant.deleted"` - A response to an MCP approval request. +### Example - - `type BetaResponseCustomToolCall struct{…}` +```go +package main - A call to a custom tool created by the model. +import ( + "context" + "fmt" - - `type BetaResponseCustomToolCallOutputItem struct{…}` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The output of a custom tool call from your code, being sent back to the model. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + assistantDeleted, err := client.Beta.Assistants.Delete(context.TODO(), "assistant_id") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", assistantDeleted.ID) +} +``` - - `OutputIndex int64` +#### Response - The index of the output item that was added. +```json +{ + "id": "id", + "deleted": true, + "object": "assistant.deleted" +} +``` - - `SequenceNumber int64` +## Domain Types - The sequence number of this event. +### Assistant - - `Type ResponseOutputItemAdded` +- `type Assistant struct{…}` - The type of the event. Always `response.output_item.added`. + Represents an `assistant` that can call the model and use tools. - - `const ResponseOutputItemAddedResponseOutputItemAdded ResponseOutputItemAdded = "response.output_item.added"` + - `ID string` - - `Agent BetaResponseOutputItemAddedEventAgent` + The identifier, which can be referenced in API endpoints. - The agent that owns this multi-agent streaming event. + - `CreatedAt int64` - - `AgentName string` + The Unix timestamp (in seconds) for when the assistant was created. - The canonical name of the agent that produced this item. + - `Description string` - - `type BetaResponseOutputItemDoneEvent struct{…}` + The description of the assistant. The maximum length is 512 characters. - Emitted when an output item is marked done. + - `Instructions string` - - `Item BetaResponseOutputItemUnion` + The system instructions that the assistant uses. The maximum length is 256,000 characters. - The output item that was marked done. + - `Metadata Metadata` - - `OutputIndex int64` + 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. - The index of the output item that was marked done. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `SequenceNumber int64` + - `Model string` - The sequence number of this event. + ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - - `Type ResponseOutputItemDone` + - `Name string` - The type of the event. Always `response.output_item.done`. + The name of the assistant. The maximum length is 256 characters. - - `const ResponseOutputItemDoneResponseOutputItemDone ResponseOutputItemDone = "response.output_item.done"` + - `Object Assistant` - - `Agent BetaResponseOutputItemDoneEventAgent` + The object type, which is always `assistant`. - The agent that owns this multi-agent streaming event. + - `const AssistantAssistant Assistant = "assistant"` - - `AgentName string` + - `Tools []AssistantToolUnion` - The canonical name of the agent that produced this item. + A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - - `type BetaResponseReasoningSummaryPartAddedEvent struct{…}` + - `type CodeInterpreterTool struct{…}` - Emitted when a new reasoning summary part is added. + - `Type CodeInterpreter` - - `ItemID string` + The type of tool being defined: `code_interpreter` - The ID of the item this summary part is associated with. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `OutputIndex int64` + - `type FileSearchTool struct{…}` - The index of the output item this summary part is associated with. + - `Type FileSearch` - - `Part BetaResponseReasoningSummaryPartAddedEventPart` + The type of tool being defined: `file_search` - The summary part that was added. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Text string` + - `FileSearch FileSearchToolFileSearch` - The text of the summary part. + Overrides for the file search tool. - - `Type SummaryText` + - `MaxNumResults int64` - The type of the summary part. Always `summary_text`. + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `SequenceNumber int64` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - The sequence number of this event. + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `SummaryIndex int64` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - The index of the summary part within the reasoning summary. + - `ScoreThreshold float64` - - `Type ResponseReasoningSummaryPartAdded` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - The type of the event. Always `response.reasoning_summary_part.added`. + - `Ranker string` - - `const ResponseReasoningSummaryPartAddedResponseReasoningSummaryPartAdded ResponseReasoningSummaryPartAdded = "response.reasoning_summary_part.added"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `Agent BetaResponseReasoningSummaryPartAddedEventAgent` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - The agent that owns this multi-agent streaming event. + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `AgentName string` + - `type FunctionTool struct{…}` - The canonical name of the agent that produced this item. + - `Function FunctionDefinition` - - `type BetaResponseReasoningSummaryPartDoneEvent struct{…}` + - `Name string` - Emitted when a reasoning summary part is completed. + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `ItemID string` + - `Description string` - The ID of the item this summary part is associated with. + A description of what the function does, used by the model to choose when and how to call the function. - - `OutputIndex int64` + - `Parameters FunctionParameters` - The index of the output item this summary part is associated with. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `Part BetaResponseReasoningSummaryPartDoneEventPart` + Omitting `parameters` defines a function with an empty parameter list. - The completed summary part. + - `Strict bool` - - `Text string` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - The text of the summary part. + - `Type Function` - - `Type SummaryText` + The type of tool being defined: `function` - The type of the summary part. Always `summary_text`. + - `const FunctionFunction Function = "function"` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `SequenceNumber int64` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The sequence number of this event. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `SummaryIndex int64` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - The index of the summary part within the reasoning summary. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `Type ResponseReasoningSummaryPartDone` + - `type Auto string` - The type of the event. Always `response.reasoning_summary_part.done`. + `auto` is the default value - - `const ResponseReasoningSummaryPartDoneResponseReasoningSummaryPartDone ResponseReasoningSummaryPartDone = "response.reasoning_summary_part.done"` + - `const AutoAuto Auto = "auto"` - - `Agent BetaResponseReasoningSummaryPartDoneEventAgent` + - `type ResponseFormatText struct{…}` - The agent that owns this multi-agent streaming event. + Default response format. Used to generate text responses. - - `AgentName string` + - `Type Text` - The canonical name of the agent that produced this item. + The type of response format being defined. Always `text`. - - `Status BetaResponseReasoningSummaryPartDoneEventStatus` + - `const TextText Text = "text"` - The completion status of the summary part. Omitted when the part completed - normally and set to `incomplete` when generation was interrupted. + - `type ResponseFormatJSONObject struct{…}` - - `const BetaResponseReasoningSummaryPartDoneEventStatusIncomplete BetaResponseReasoningSummaryPartDoneEventStatus = "incomplete"` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `type BetaResponseReasoningSummaryTextDeltaEvent struct{…}` + - `Type JSONObject` - Emitted when a delta is added to a reasoning summary text. + The type of response format being defined. Always `json_object`. - - `Delta string` + - `const JSONObjectJSONObject JSONObject = "json_object"` - The text delta that was added to the summary. + - `type ResponseFormatJSONSchema struct{…}` - - `ItemID string` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The ID of the item this summary text delta is associated with. + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `OutputIndex int64` + Structured Outputs configuration options, including a JSON Schema. - The index of the output item this summary text delta is associated with. + - `Name string` - - `SequenceNumber int64` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The sequence number of this event. + - `Description string` - - `SummaryIndex int64` + A description of what the response format is for, used by the model to + determine how to respond in the format. - The index of the summary part within the reasoning summary. + - `Schema map[string, any]` - - `Type ResponseReasoningSummaryTextDelta` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - The type of the event. Always `response.reasoning_summary_text.delta`. + - `Strict bool` - - `const ResponseReasoningSummaryTextDeltaResponseReasoningSummaryTextDelta ResponseReasoningSummaryTextDelta = "response.reasoning_summary_text.delta"` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Agent BetaResponseReasoningSummaryTextDeltaEventAgent` + - `Type JSONSchema` - The agent that owns this multi-agent streaming event. + The type of response format being defined. Always `json_schema`. - - `AgentName string` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - The canonical name of the agent that produced this item. + - `Temperature float64` - - `type BetaResponseReasoningSummaryTextDoneEvent struct{…}` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - Emitted when a reasoning summary text is completed. + - `ToolResources AssistantToolResources` - - `ItemID string` + A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - The ID of the item this summary text is associated with. + - `CodeInterpreter AssistantToolResourcesCodeInterpreter` - - `OutputIndex int64` + - `FileIDs []string` - The index of the output item this summary text is associated with. + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - - `SequenceNumber int64` + - `FileSearch AssistantToolResourcesFileSearch` - The sequence number of this event. + - `VectorStoreIDs []string` - - `SummaryIndex int64` + The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - The index of the summary part within the reasoning summary. + - `TopP float64` - - `Text string` + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - The full text of the completed reasoning summary. + We generally recommend altering this or temperature but not both. - - `Type ResponseReasoningSummaryTextDone` +### Assistant Deleted - The type of the event. Always `response.reasoning_summary_text.done`. +- `type AssistantDeleted struct{…}` - - `const ResponseReasoningSummaryTextDoneResponseReasoningSummaryTextDone ResponseReasoningSummaryTextDone = "response.reasoning_summary_text.done"` + - `ID string` - - `Agent BetaResponseReasoningSummaryTextDoneEventAgent` + - `Deleted bool` - The agent that owns this multi-agent streaming event. + - `Object AssistantDeleted` - - `AgentName string` + - `const AssistantDeletedAssistantDeleted AssistantDeleted = "assistant.deleted"` - The canonical name of the agent that produced this item. +### Assistant Stream Event - - `type BetaResponseReasoningTextDeltaEvent struct{…}` +- `type AssistantStreamEventUnion interface{…}` - Emitted when a delta is added to a reasoning text. + Represents an event emitted when streaming a Run. - - `ContentIndex int64` + Each event in a server-sent events stream has an `event` and `data` property: - The index of the reasoning content part this delta is associated with. + ``` + event: thread.created + data: {"id": "thread_123", "object": "thread", ...} + ``` - - `Delta string` + We emit events whenever a new object is created, transitions to a new state, or is being + streamed in parts (deltas). For example, we emit `thread.run.created` when a new run + is created, `thread.run.completed` when a run completes, and so on. When an Assistant chooses + to create a message during a run, we emit a `thread.message.created event`, a + `thread.message.in_progress` event, many `thread.message.delta` events, and finally a + `thread.message.completed` event. - The text delta that was added to the reasoning content. + We may add additional events over time, so we recommend handling unknown events gracefully + in your code. See the [Assistants API quickstart](https://platform.openai.com/docs/assistants/overview) to learn how to + integrate the Assistants API with streaming. - - `ItemID string` + - `type AssistantStreamEventThreadCreated struct{…}` - The ID of the item this reasoning text delta is associated with. + Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object) is created. - - `OutputIndex int64` + - `Data Thread` - The index of the output item this reasoning text delta is associated with. + Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). - - `SequenceNumber int64` + - `ID string` - The sequence number of this event. + The identifier, which can be referenced in API endpoints. - - `Type ResponseReasoningTextDelta` + - `CreatedAt int64` - The type of the event. Always `response.reasoning_text.delta`. + The Unix timestamp (in seconds) for when the thread was created. - - `const ResponseReasoningTextDeltaResponseReasoningTextDelta ResponseReasoningTextDelta = "response.reasoning_text.delta"` + - `Metadata Metadata` - - `Agent BetaResponseReasoningTextDeltaEventAgent` + 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. - The agent that owns this multi-agent streaming event. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `AgentName string` + - `Object Thread` - The canonical name of the agent that produced this item. + The object type, which is always `thread`. - - `type BetaResponseReasoningTextDoneEvent struct{…}` + - `const ThreadThread Thread = "thread"` - Emitted when a reasoning text is completed. + - `ToolResources ThreadToolResources` - - `ContentIndex int64` + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - The index of the reasoning content part. + - `CodeInterpreter ThreadToolResourcesCodeInterpreter` - - `ItemID string` + - `FileIDs []string` - The ID of the item this reasoning text is associated with. + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - `OutputIndex int64` + - `FileSearch ThreadToolResourcesFileSearch` - The index of the output item this reasoning text is associated with. + - `VectorStoreIDs []string` - - `SequenceNumber int64` + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - The sequence number of this event. + - `Event ThreadCreated` - - `Text string` + - `const ThreadCreatedThreadCreated ThreadCreated = "thread.created"` - The full text of the completed reasoning content. + - `Enabled bool` - - `Type ResponseReasoningTextDone` + Whether to enable input audio transcription. - The type of the event. Always `response.reasoning_text.done`. + - `type AssistantStreamEventThreadRunCreated struct{…}` - - `const ResponseReasoningTextDoneResponseReasoningTextDone ResponseReasoningTextDone = "response.reasoning_text.done"` + Occurs when a new [run](https://platform.openai.com/docs/api-reference/runs/object) is created. - - `Agent BetaResponseReasoningTextDoneEventAgent` + - `Data Run` - The agent that owns this multi-agent streaming event. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `AgentName string` + - `ID string` - The canonical name of the agent that produced this item. + The identifier, which can be referenced in API endpoints. - - `type BetaResponseRefusalDeltaEvent struct{…}` + - `AssistantID string` - Emitted when there is a partial refusal text. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - - `ContentIndex int64` + - `CancelledAt int64` - The index of the content part that the refusal text is added to. + The Unix timestamp (in seconds) for when the run was cancelled. - - `Delta string` + - `CompletedAt int64` - The refusal text that is added. + The Unix timestamp (in seconds) for when the run was completed. - - `ItemID string` + - `CreatedAt int64` - The ID of the output item that the refusal text is added to. + The Unix timestamp (in seconds) for when the run was created. - - `OutputIndex int64` + - `ExpiresAt int64` - The index of the output item that the refusal text is added to. + The Unix timestamp (in seconds) for when the run will expire. - - `SequenceNumber int64` + - `FailedAt int64` - The sequence number of this event. + The Unix timestamp (in seconds) for when the run failed. - - `Type ResponseRefusalDelta` + - `IncompleteDetails RunIncompleteDetails` - The type of the event. Always `response.refusal.delta`. + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - `const ResponseRefusalDeltaResponseRefusalDelta ResponseRefusalDelta = "response.refusal.delta"` + - `Reason string` - - `Agent BetaResponseRefusalDeltaEventAgent` + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - The agent that owns this multi-agent streaming event. + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - - `AgentName string` + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - The canonical name of the agent that produced this item. + - `Instructions string` - - `type BetaResponseRefusalDoneEvent struct{…}` + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - Emitted when refusal text is finalized. + - `LastError RunLastError` - - `ContentIndex int64` + The last error associated with this run. Will be `null` if there are no errors. - The index of the content part that the refusal text is finalized. + - `Code string` - - `ItemID string` + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - The ID of the output item that the refusal text is finalized. + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - - `OutputIndex int64` + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - The index of the output item that the refusal text is finalized. + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - - `Refusal string` + - `Message string` - The refusal text that is finalized. + A human-readable description of the error. - - `SequenceNumber int64` + - `MaxCompletionTokens int64` - The sequence number of this event. + The maximum number of completion tokens specified to have been used over the course of the run. - - `Type ResponseRefusalDone` + - `MaxPromptTokens int64` - The type of the event. Always `response.refusal.done`. + The maximum number of prompt tokens specified to have been used over the course of the run. - - `const ResponseRefusalDoneResponseRefusalDone ResponseRefusalDone = "response.refusal.done"` + - `Metadata Metadata` - - `Agent BetaResponseRefusalDoneEventAgent` + 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. - The agent that owns this multi-agent streaming event. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `AgentName string` + - `Model string` - The canonical name of the agent that produced this item. + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `type BetaResponseTextDeltaEvent struct{…}` + - `Object ThreadRun` - Emitted when there is an additional text delta. + The object type, which is always `thread.run`. - - `ContentIndex int64` + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - The index of the content part that the text delta was added to. + - `ParallelToolCalls bool` - - `Delta string` + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - The text delta that was added. + - `RequiredAction RunRequiredAction` - - `ItemID string` + Details on the action required to continue the run. Will be `null` if no action is required. - The ID of the output item that the text delta was added to. + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - - `Logprobs []BetaResponseTextDeltaEventLogprob` + Details on the tool outputs needed for this run to continue. - The log probabilities of the tokens in the delta. + - `ToolCalls []RequiredActionFunctionToolCall` - - `Token string` + A list of the relevant tool calls. - A possible text token. + - `ID string` - - `Logprob float64` + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - The log probability of this token. + - `Function RequiredActionFunctionToolCallFunction` - - `TopLogprobs []BetaResponseTextDeltaEventLogprobTopLogprob` + The function definition. - The log probabilities of up to 20 of the most likely tokens. + - `Arguments string` - - `Token string` + The arguments that the model expects you to pass to the function. - A possible text token. + - `Name string` - - `Logprob float64` + The name of the function. - The log probability of this token. + - `Type Function` - - `OutputIndex int64` + The type of tool call the output is required for. For now, this is always `function`. - The index of the output item that the text delta was added to. + - `const FunctionFunction Function = "function"` - - `SequenceNumber int64` + - `Type SubmitToolOutputs` - The sequence number for this event. + For now, this is always `submit_tool_outputs`. - - `Type ResponseOutputTextDelta` + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - The type of the event. Always `response.output_text.delta`. + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `const ResponseOutputTextDeltaResponseOutputTextDelta ResponseOutputTextDelta = "response.output_text.delta"` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `Agent BetaResponseTextDeltaEventAgent` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The agent that owns this multi-agent streaming event. + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `AgentName string` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - The canonical name of the agent that produced this item. + - `type Auto string` - - `type BetaResponseTextDoneEvent struct{…}` + `auto` is the default value - Emitted when text content is finalized. + - `const AutoAuto Auto = "auto"` - - `ContentIndex int64` + - `type ResponseFormatText struct{…}` - The index of the content part that the text content is finalized. + Default response format. Used to generate text responses. - - `ItemID string` + - `Type Text` - The ID of the output item that the text content is finalized. + The type of response format being defined. Always `text`. - - `Logprobs []BetaResponseTextDoneEventLogprob` + - `const TextText Text = "text"` - The log probabilities of the tokens in the delta. + - `type ResponseFormatJSONObject struct{…}` - - `Token string` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - A possible text token. + - `Type JSONObject` - - `Logprob float64` + The type of response format being defined. Always `json_object`. - The log probability of this token. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `TopLogprobs []BetaResponseTextDoneEventLogprobTopLogprob` + - `type ResponseFormatJSONSchema struct{…}` - The log probabilities of up to 20 of the most likely tokens. + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `Token string` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - A possible text token. + Structured Outputs configuration options, including a JSON Schema. - - `Logprob float64` + - `Name string` - The log probability of this token. + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `OutputIndex int64` + - `Description string` - The index of the output item that the text content is finalized. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `SequenceNumber int64` + - `Schema map[string, any]` - The sequence number for this event. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `Text string` + - `Strict bool` - The text content that is finalized. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Type ResponseOutputTextDone` + - `Type JSONSchema` - The type of the event. Always `response.output_text.done`. + The type of response format being defined. Always `json_schema`. - - `const ResponseOutputTextDoneResponseOutputTextDone ResponseOutputTextDone = "response.output_text.done"` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `Agent BetaResponseTextDoneEventAgent` + - `StartedAt int64` - The agent that owns this multi-agent streaming event. + The Unix timestamp (in seconds) for when the run was started. - - `AgentName string` + - `Status RunStatus` - The canonical name of the agent that produced this item. + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - `type BetaResponseWebSearchCallCompletedEvent struct{…}` + - `const RunStatusQueued RunStatus = "queued"` - Emitted when a web search call is completed. + - `const RunStatusInProgress RunStatus = "in_progress"` - - `ItemID string` + - `const RunStatusRequiresAction RunStatus = "requires_action"` - Unique ID for the output item associated with the web search call. + - `const RunStatusCancelling RunStatus = "cancelling"` - - `OutputIndex int64` + - `const RunStatusCancelled RunStatus = "cancelled"` - The index of the output item that the web search call is associated with. + - `const RunStatusFailed RunStatus = "failed"` - - `SequenceNumber int64` + - `const RunStatusCompleted RunStatus = "completed"` - The sequence number of the web search call being processed. + - `const RunStatusIncomplete RunStatus = "incomplete"` - - `Type ResponseWebSearchCallCompleted` + - `const RunStatusExpired RunStatus = "expired"` - The type of the event. Always `response.web_search_call.completed`. + - `ThreadID string` - - `const ResponseWebSearchCallCompletedResponseWebSearchCallCompleted ResponseWebSearchCallCompleted = "response.web_search_call.completed"` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - - `Agent BetaResponseWebSearchCallCompletedEventAgent` + - `ToolChoice AssistantToolChoiceOptionUnion` - The agent that owns this multi-agent streaming event. + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `AgentName string` + - `type AssistantToolChoiceOptionAuto string` - The canonical name of the agent that produced this item. + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - `type BetaResponseWebSearchCallInProgressEvent struct{…}` + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - Emitted when a web search call is initiated. + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - - `ItemID string` + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - Unique ID for the output item associated with the web search call. + - `type AssistantToolChoice struct{…}` - - `OutputIndex int64` + Specifies a tool the model should use. Use to force the model to call a specific tool. - The index of the output item that the web search call is associated with. + - `Type AssistantToolChoiceType` - - `SequenceNumber int64` + The type of the tool. If type is `function`, the function name must be set - The sequence number of the web search call being processed. + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - - `Type ResponseWebSearchCallInProgress` + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - The type of the event. Always `response.web_search_call.in_progress`. + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - - `const ResponseWebSearchCallInProgressResponseWebSearchCallInProgress ResponseWebSearchCallInProgress = "response.web_search_call.in_progress"` + - `Function AssistantToolChoiceFunction` - - `Agent BetaResponseWebSearchCallInProgressEventAgent` + - `Name string` - The agent that owns this multi-agent streaming event. + The name of the function to call. - - `AgentName string` + - `Tools []AssistantToolUnion` - The canonical name of the agent that produced this item. + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `type BetaResponseWebSearchCallSearchingEvent struct{…}` + - `type CodeInterpreterTool struct{…}` - Emitted when a web search call is executing. + - `Type CodeInterpreter` - - `ItemID string` + The type of tool being defined: `code_interpreter` - Unique ID for the output item associated with the web search call. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `OutputIndex int64` + - `type FileSearchTool struct{…}` - The index of the output item that the web search call is associated with. + - `Type FileSearch` - - `SequenceNumber int64` + The type of tool being defined: `file_search` - The sequence number of the web search call being processed. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Type ResponseWebSearchCallSearching` + - `FileSearch FileSearchToolFileSearch` - The type of the event. Always `response.web_search_call.searching`. + Overrides for the file search tool. - - `const ResponseWebSearchCallSearchingResponseWebSearchCallSearching ResponseWebSearchCallSearching = "response.web_search_call.searching"` + - `MaxNumResults int64` - - `Agent BetaResponseWebSearchCallSearchingEventAgent` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - The agent that owns this multi-agent streaming event. + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `AgentName string` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - The canonical name of the agent that produced this item. + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `type BetaResponseImageGenCallCompletedEvent struct{…}` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - Emitted when an image generation tool call has completed and the final image is available. + - `ScoreThreshold float64` - - `ItemID string` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - The unique identifier of the image generation item being processed. + - `Ranker string` - - `OutputIndex int64` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The index of the output item in the response's output array. + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `SequenceNumber int64` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - The sequence number of this event. + - `type FunctionTool struct{…}` - - `Type ResponseImageGenerationCallCompleted` + - `Function FunctionDefinition` - The type of the event. Always 'response.image_generation_call.completed'. + - `Name string` - - `const ResponseImageGenerationCallCompletedResponseImageGenerationCallCompleted ResponseImageGenerationCallCompleted = "response.image_generation_call.completed"` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `Agent BetaResponseImageGenCallCompletedEventAgent` + - `Description string` - The agent that owns this multi-agent streaming event. + A description of what the function does, used by the model to choose when and how to call the function. - - `AgentName string` + - `Parameters FunctionParameters` - The canonical name of the agent that produced this item. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `type BetaResponseImageGenCallGeneratingEvent struct{…}` + Omitting `parameters` defines a function with an empty parameter list. - Emitted when an image generation tool call is actively generating an image (intermediate state). + - `Strict bool` - - `ItemID string` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - The unique identifier of the image generation item being processed. + - `Type Function` - - `OutputIndex int64` + The type of tool being defined: `function` - The index of the output item in the response's output array. + - `const FunctionFunction Function = "function"` - - `SequenceNumber int64` + - `TruncationStrategy RunTruncationStrategy` - The sequence number of the image generation item being processed. + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `Type ResponseImageGenerationCallGenerating` + - `Type string` - The type of the event. Always 'response.image_generation_call.generating'. + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - `const ResponseImageGenerationCallGeneratingResponseImageGenerationCallGenerating ResponseImageGenerationCallGenerating = "response.image_generation_call.generating"` + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `Agent BetaResponseImageGenCallGeneratingEventAgent` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - The agent that owns this multi-agent streaming event. + - `LastMessages int64` - - `AgentName string` + The number of most recent messages from the thread when constructing the context for the run. - The canonical name of the agent that produced this item. + - `Usage RunUsage` - - `type BetaResponseImageGenCallInProgressEvent struct{…}` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - Emitted when an image generation tool call is in progress. + - `CompletionTokens int64` - - `ItemID string` + Number of completion tokens used over the course of the run. - The unique identifier of the image generation item being processed. + - `PromptTokens int64` - - `OutputIndex int64` + Number of prompt tokens used over the course of the run. - The index of the output item in the response's output array. + - `TotalTokens int64` - - `SequenceNumber int64` + Total number of tokens used (prompt + completion). - The sequence number of the image generation item being processed. + - `Temperature float64` - - `Type ResponseImageGenerationCallInProgress` + The sampling temperature used for this run. If not set, defaults to 1. - The type of the event. Always 'response.image_generation_call.in_progress'. + - `TopP float64` - - `const ResponseImageGenerationCallInProgressResponseImageGenerationCallInProgress ResponseImageGenerationCallInProgress = "response.image_generation_call.in_progress"` + The nucleus sampling value used for this run. If not set, defaults to 1. - - `Agent BetaResponseImageGenCallInProgressEventAgent` + - `Event ThreadRunCreated` - The agent that owns this multi-agent streaming event. + - `const ThreadRunCreatedThreadRunCreated ThreadRunCreated = "thread.run.created"` - - `AgentName string` + - `type AssistantStreamEventThreadRunQueued struct{…}` - The canonical name of the agent that produced this item. + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `queued` status. - - `type BetaResponseImageGenCallPartialImageEvent struct{…}` + - `Data Run` - Emitted when a partial image is available during image generation streaming. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `ItemID string` + - `Event ThreadRunQueued` - The unique identifier of the image generation item being processed. + - `const ThreadRunQueuedThreadRunQueued ThreadRunQueued = "thread.run.queued"` - - `OutputIndex int64` + - `type AssistantStreamEventThreadRunInProgress struct{…}` - The index of the output item in the response's output array. + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to an `in_progress` status. - - `PartialImageB64 string` + - `Data Run` - Base64-encoded partial image data, suitable for rendering as an image. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `PartialImageIndex int64` + - `Event ThreadRunInProgress` - 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + - `const ThreadRunInProgressThreadRunInProgress ThreadRunInProgress = "thread.run.in_progress"` - - `SequenceNumber int64` + - `type AssistantStreamEventThreadRunRequiresAction struct{…}` - The sequence number of the image generation item being processed. + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `requires_action` status. - - `Type ResponseImageGenerationCallPartialImage` + - `Data Run` - The type of the event. Always 'response.image_generation_call.partial_image'. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `const ResponseImageGenerationCallPartialImageResponseImageGenerationCallPartialImage ResponseImageGenerationCallPartialImage = "response.image_generation_call.partial_image"` + - `Event ThreadRunRequiresAction` - - `Agent BetaResponseImageGenCallPartialImageEventAgent` + - `const ThreadRunRequiresActionThreadRunRequiresAction ThreadRunRequiresAction = "thread.run.requires_action"` - The agent that owns this multi-agent streaming event. + - `type AssistantStreamEventThreadRunCompleted struct{…}` - - `AgentName string` + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is completed. - The canonical name of the agent that produced this item. + - `Data Run` - - `type BetaResponseMcpCallArgumentsDeltaEvent struct{…}` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - Emitted when there is a delta (partial update) to the arguments of an MCP tool call. + - `Event ThreadRunCompleted` - - `Delta string` + - `const ThreadRunCompletedThreadRunCompleted ThreadRunCompleted = "thread.run.completed"` - A JSON string containing the partial update to the arguments for the MCP tool call. + - `type AssistantStreamEventThreadRunIncomplete struct{…}` - - `ItemID string` + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) ends with status `incomplete`. - The unique identifier of the MCP tool call item being processed. + - `Data Run` - - `OutputIndex int64` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - The index of the output item in the response's output array. + - `Event ThreadRunIncomplete` - - `SequenceNumber int64` + - `const ThreadRunIncompleteThreadRunIncomplete ThreadRunIncomplete = "thread.run.incomplete"` - The sequence number of this event. + - `type AssistantStreamEventThreadRunFailed struct{…}` - - `Type ResponseMcpCallArgumentsDelta` + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) fails. - The type of the event. Always 'response.mcp_call_arguments.delta'. + - `Data Run` - - `const ResponseMcpCallArgumentsDeltaResponseMcpCallArgumentsDelta ResponseMcpCallArgumentsDelta = "response.mcp_call_arguments.delta"` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `Agent BetaResponseMcpCallArgumentsDeltaEventAgent` + - `Event ThreadRunFailed` - The agent that owns this multi-agent streaming event. + - `const ThreadRunFailedThreadRunFailed ThreadRunFailed = "thread.run.failed"` - - `AgentName string` + - `type AssistantStreamEventThreadRunCancelling struct{…}` - The canonical name of the agent that produced this item. + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `cancelling` status. - - `type BetaResponseMcpCallArgumentsDoneEvent struct{…}` + - `Data Run` - Emitted when the arguments for an MCP tool call are finalized. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `Arguments string` + - `Event ThreadRunCancelling` - A JSON string containing the finalized arguments for the MCP tool call. + - `const ThreadRunCancellingThreadRunCancelling ThreadRunCancelling = "thread.run.cancelling"` - - `ItemID string` + - `type AssistantStreamEventThreadRunCancelled struct{…}` - The unique identifier of the MCP tool call item being processed. + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is cancelled. - - `OutputIndex int64` + - `Data Run` - The index of the output item in the response's output array. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `SequenceNumber int64` + - `Event ThreadRunCancelled` - The sequence number of this event. + - `const ThreadRunCancelledThreadRunCancelled ThreadRunCancelled = "thread.run.cancelled"` - - `Type ResponseMcpCallArgumentsDone` + - `type AssistantStreamEventThreadRunExpired struct{…}` - The type of the event. Always 'response.mcp_call_arguments.done'. + Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) expires. - - `const ResponseMcpCallArgumentsDoneResponseMcpCallArgumentsDone ResponseMcpCallArgumentsDone = "response.mcp_call_arguments.done"` + - `Data Run` - - `Agent BetaResponseMcpCallArgumentsDoneEventAgent` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - The agent that owns this multi-agent streaming event. + - `Event ThreadRunExpired` - - `AgentName string` + - `const ThreadRunExpiredThreadRunExpired ThreadRunExpired = "thread.run.expired"` - The canonical name of the agent that produced this item. + - `type AssistantStreamEventThreadRunStepCreated struct{…}` - - `type BetaResponseMcpCallCompletedEvent struct{…}` + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is created. - Emitted when an MCP tool call has completed successfully. + - `Data RunStep` - - `ItemID string` + Represents a step in execution of a run. - The ID of the MCP tool call item that completed. + - `ID string` - - `OutputIndex int64` + The identifier of the run step, which can be referenced in API endpoints. - The index of the output item that completed. + - `AssistantID string` - - `SequenceNumber int64` + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. - The sequence number of this event. + - `CancelledAt int64` - - `Type ResponseMcpCallCompleted` + The Unix timestamp (in seconds) for when the run step was cancelled. - The type of the event. Always 'response.mcp_call.completed'. + - `CompletedAt int64` - - `const ResponseMcpCallCompletedResponseMcpCallCompleted ResponseMcpCallCompleted = "response.mcp_call.completed"` + The Unix timestamp (in seconds) for when the run step completed. - - `Agent BetaResponseMcpCallCompletedEventAgent` + - `CreatedAt int64` - The agent that owns this multi-agent streaming event. + The Unix timestamp (in seconds) for when the run step was created. - - `AgentName string` + - `ExpiredAt int64` - The canonical name of the agent that produced this item. + The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - `type BetaResponseMcpCallFailedEvent struct{…}` + - `FailedAt int64` - Emitted when an MCP tool call has failed. + The Unix timestamp (in seconds) for when the run step failed. - - `ItemID string` + - `LastError RunStepLastError` - The ID of the MCP tool call item that failed. + The last error associated with this run step. Will be `null` if there are no errors. - - `OutputIndex int64` + - `Code string` - The index of the output item that failed. + One of `server_error` or `rate_limit_exceeded`. - - `SequenceNumber int64` + - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` - The sequence number of this event. + - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` - - `Type ResponseMcpCallFailed` + - `Message string` - The type of the event. Always 'response.mcp_call.failed'. + A human-readable description of the error. - - `const ResponseMcpCallFailedResponseMcpCallFailed ResponseMcpCallFailed = "response.mcp_call.failed"` + - `Metadata Metadata` - - `Agent BetaResponseMcpCallFailedEventAgent` + 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. + + - `Object ThreadRunStep` - The agent that owns this multi-agent streaming event. + The object type, which is always `thread.run.step`. - - `AgentName string` + - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` - The canonical name of the agent that produced this item. + - `RunID string` - - `type BetaResponseMcpCallInProgressEvent struct{…}` + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. - Emitted when an MCP tool call is in progress. + - `Status RunStepStatus` - - `ItemID string` + The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - The unique identifier of the MCP tool call item being processed. + - `const RunStepStatusInProgress RunStepStatus = "in_progress"` - - `OutputIndex int64` + - `const RunStepStatusCancelled RunStepStatus = "cancelled"` - The index of the output item in the response's output array. + - `const RunStepStatusFailed RunStepStatus = "failed"` - - `SequenceNumber int64` + - `const RunStepStatusCompleted RunStepStatus = "completed"` - The sequence number of this event. + - `const RunStepStatusExpired RunStepStatus = "expired"` - - `Type ResponseMcpCallInProgress` + - `StepDetails RunStepStepDetailsUnion` - The type of the event. Always 'response.mcp_call.in_progress'. + The details of the run step. - - `const ResponseMcpCallInProgressResponseMcpCallInProgress ResponseMcpCallInProgress = "response.mcp_call.in_progress"` + - `type MessageCreationStepDetails struct{…}` - - `Agent BetaResponseMcpCallInProgressEventAgent` + Details of the message creation by the run step. - The agent that owns this multi-agent streaming event. + - `MessageCreation MessageCreationStepDetailsMessageCreation` - - `AgentName string` + - `MessageID string` - The canonical name of the agent that produced this item. + The ID of the message that was created by this run step. - - `type BetaResponseMcpListToolsCompletedEvent struct{…}` + - `Type MessageCreation` - Emitted when the list of available MCP tools has been successfully retrieved. + Always `message_creation`. - - `ItemID string` + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - The ID of the MCP tool call item that produced this output. + - `type ToolCallsStepDetails struct{…}` - - `OutputIndex int64` + Details of the tool call. - The index of the output item that was processed. + - `ToolCalls []ToolCallUnion` - - `SequenceNumber int64` + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - The sequence number of this event. + - `type CodeInterpreterToolCall struct{…}` - - `Type ResponseMcpListToolsCompleted` + Details of the Code Interpreter tool call the run step was involved in. - The type of the event. Always 'response.mcp_list_tools.completed'. + - `ID string` - - `const ResponseMcpListToolsCompletedResponseMcpListToolsCompleted ResponseMcpListToolsCompleted = "response.mcp_list_tools.completed"` + The ID of the tool call. - - `Agent BetaResponseMcpListToolsCompletedEventAgent` + - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` - The agent that owns this multi-agent streaming event. + The Code Interpreter tool call definition. - - `AgentName string` + - `Input string` - The canonical name of the agent that produced this item. + The input to the Code Interpreter tool call. - - `type BetaResponseMcpListToolsFailedEvent struct{…}` + - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` - Emitted when the attempt to list available MCP tools has failed. + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `ItemID string` + - `type CodeInterpreterToolCallCodeInterpreterOutputLogs struct{…}` - The ID of the MCP tool call item that failed. + Text output from the Code Interpreter tool call as part of a run step. - - `OutputIndex int64` + - `Logs string` - The index of the output item that failed. + The text output from the Code Interpreter tool call. - - `SequenceNumber int64` + - `Type Logs` - The sequence number of this event. + Always `logs`. - - `Type ResponseMcpListToolsFailed` + - `const LogsLogs Logs = "logs"` - The type of the event. Always 'response.mcp_list_tools.failed'. + - `type CodeInterpreterToolCallCodeInterpreterOutputImage struct{…}` - - `const ResponseMcpListToolsFailedResponseMcpListToolsFailed ResponseMcpListToolsFailed = "response.mcp_list_tools.failed"` + - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` - - `Agent BetaResponseMcpListToolsFailedEventAgent` + - `FileID string` - The agent that owns this multi-agent streaming event. + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `AgentName string` + - `Type Image` - The canonical name of the agent that produced this item. + Always `image`. - - `type BetaResponseMcpListToolsInProgressEvent struct{…}` + - `const ImageImage Image = "image"` - Emitted when the system is in the process of retrieving the list of available MCP tools. + - `Type CodeInterpreter` - - `ItemID string` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - The ID of the MCP tool call item that is being processed. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `OutputIndex int64` + - `type FileSearchToolCall struct{…}` - The index of the output item that is being processed. + - `ID string` - - `SequenceNumber int64` + The ID of the tool call object. - The sequence number of this event. + - `FileSearch FileSearchToolCallFileSearch` - - `Type ResponseMcpListToolsInProgress` + For now, this is always going to be an empty object. - The type of the event. Always 'response.mcp_list_tools.in_progress'. + - `RankingOptions FileSearchToolCallFileSearchRankingOptions` - - `const ResponseMcpListToolsInProgressResponseMcpListToolsInProgress ResponseMcpListToolsInProgress = "response.mcp_list_tools.in_progress"` + The ranking options for the file search. - - `Agent BetaResponseMcpListToolsInProgressEventAgent` + - `Ranker string` - The agent that owns this multi-agent streaming event. + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `AgentName string` + - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` - The canonical name of the agent that produced this item. + - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `type BetaResponseOutputTextAnnotationAddedEvent struct{…}` + - `ScoreThreshold float64` - Emitted when an annotation is added to output text content. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `Annotation any` + - `Results []FileSearchToolCallFileSearchResult` - The annotation object being added. (See annotation schema for details.) + The results of the file search. - - `AnnotationIndex int64` + - `FileID string` - The index of the annotation within the content part. + The ID of the file that result was found in. - - `ContentIndex int64` + - `FileName string` - The index of the content part within the output item. + The name of the file that result was found in. - - `ItemID string` + - `Score float64` - The unique identifier of the item to which the annotation is being added. + The score of the result. All values must be a floating point number between 0 and 1. - - `OutputIndex int64` + - `Content []FileSearchToolCallFileSearchResultContent` - The index of the output item in the response's output array. + The content of the result that was found. The content is only included if requested via the include query parameter. - - `SequenceNumber int64` + - `Text string` - The sequence number of this event. + The text content of the file. - - `Type ResponseOutputTextAnnotationAdded` + - `Type string` - The type of the event. Always 'response.output_text.annotation.added'. + The type of the content. - - `const ResponseOutputTextAnnotationAddedResponseOutputTextAnnotationAdded ResponseOutputTextAnnotationAdded = "response.output_text.annotation.added"` + - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` - - `Agent BetaResponseOutputTextAnnotationAddedEventAgent` + - `Type FileSearch` - The agent that owns this multi-agent streaming event. + The type of tool call. This is always going to be `file_search` for this type of tool call. - - `AgentName string` + - `const FileSearchFileSearch FileSearch = "file_search"` - The canonical name of the agent that produced this item. + - `type FunctionToolCall struct{…}` - - `type BetaResponseQueuedEvent struct{…}` + - `ID string` - Emitted when a response is queued and waiting to be processed. + The ID of the tool call object. - - `Response BetaResponse` + - `Function FunctionToolCallFunction` - The full response object that is queued. + The definition of the function that was called. - - `SequenceNumber int64` + - `Arguments string` - The sequence number for this event. + The arguments passed to the function. - - `Type ResponseQueued` + - `Name string` - The type of the event. Always 'response.queued'. + The name of the function. - - `const ResponseQueuedResponseQueued ResponseQueued = "response.queued"` + - `Output string` - - `Agent BetaResponseQueuedEventAgent` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - The agent that owns this multi-agent streaming event. + - `Type Function` - - `AgentName string` + The type of tool call. This is always going to be `function` for this type of tool call. - The canonical name of the agent that produced this item. + - `const FunctionFunction Function = "function"` - - `type BetaResponseCustomToolCallInputDeltaEvent struct{…}` + - `Type ToolCalls` - Event representing a delta (partial update) to the input of a custom tool call. + Always `tool_calls`. - - `Delta string` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - The incremental input data (delta) for the custom tool call. + - `ThreadID string` - - `ItemID string` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - Unique identifier for the API item associated with this event. + - `Type RunStepType` - - `OutputIndex int64` + The type of run step, which can be either `message_creation` or `tool_calls`. - The index of the output this delta applies to. + - `const RunStepTypeMessageCreation RunStepType = "message_creation"` - - `SequenceNumber int64` + - `const RunStepTypeToolCalls RunStepType = "tool_calls"` - The sequence number of this event. + - `Usage RunStepUsage` - - `Type ResponseCustomToolCallInputDelta` + Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - The event type identifier. + - `CompletionTokens int64` - - `const ResponseCustomToolCallInputDeltaResponseCustomToolCallInputDelta ResponseCustomToolCallInputDelta = "response.custom_tool_call_input.delta"` + Number of completion tokens used over the course of the run step. - - `Agent BetaResponseCustomToolCallInputDeltaEventAgent` + - `PromptTokens int64` - The agent that owns this multi-agent streaming event. + Number of prompt tokens used over the course of the run step. - - `AgentName string` + - `TotalTokens int64` - The canonical name of the agent that produced this item. + Total number of tokens used (prompt + completion). - - `type BetaResponseCustomToolCallInputDoneEvent struct{…}` + - `Event ThreadRunStepCreated` - Event indicating that input for a custom tool call is complete. + - `const ThreadRunStepCreatedThreadRunStepCreated ThreadRunStepCreated = "thread.run.step.created"` - - `Input string` + - `type AssistantStreamEventThreadRunStepInProgress struct{…}` - The complete input data for the custom tool call. + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) moves to an `in_progress` state. - - `ItemID string` + - `Data RunStep` - Unique identifier for the API item associated with this event. + Represents a step in execution of a run. - - `OutputIndex int64` + - `Event ThreadRunStepInProgress` - The index of the output this event applies to. + - `const ThreadRunStepInProgressThreadRunStepInProgress ThreadRunStepInProgress = "thread.run.step.in_progress"` - - `SequenceNumber int64` + - `type AssistantStreamEventThreadRunStepDelta struct{…}` - The sequence number of this event. + Occurs when parts of a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) are being streamed. - - `Type ResponseCustomToolCallInputDone` + - `Data RunStepDeltaEvent` - The event type identifier. + Represents a run step delta i.e. any changed fields on a run step during streaming. - - `const ResponseCustomToolCallInputDoneResponseCustomToolCallInputDone ResponseCustomToolCallInputDone = "response.custom_tool_call_input.done"` + - `ID string` - - `Agent BetaResponseCustomToolCallInputDoneEventAgent` + The identifier of the run step, which can be referenced in API endpoints. - The agent that owns this multi-agent streaming event. + - `Delta RunStepDelta` - - `AgentName string` + The delta containing the fields that have changed on the run step. - The canonical name of the agent that produced this item. + - `StepDetails RunStepDeltaStepDetailsUnion` - - `BetaResponsesServerEventResponseInjectCreated` + The details of the run step. - - `ResponseID string` + - `type RunStepDeltaMessageDelta struct{…}` - The ID of the response that accepted the input. + Details of the message creation by the run step. - - `SequenceNumber int64` + - `Type MessageCreation` - The sequence number for this event. + Always `message_creation`. - - `Type ResponseInjectCreated` + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - The event discriminator. Always `response.inject.created`. + - `MessageCreation RunStepDeltaMessageDeltaMessageCreation` - - `const ResponseInjectCreatedResponseInjectCreated ResponseInjectCreated = "response.inject.created"` + - `MessageID string` - - `StreamID string` + The ID of the message that was created by this run step. - The multiplexed WebSocket stream that emitted the event. This field is - present only when WebSocket multiplexing is enabled separately. + - `type ToolCallDeltaObject struct{…}` - - `BetaResponsesServerEventResponseInjectFailed` + Details of the tool call. - - `Error BetaResponsesServerEventResponseInjectFailedError` + - `Type ToolCalls` - Information about why the input was not committed. + Always `tool_calls`. - - `Code string` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - A machine-readable error code. + - `ToolCalls []ToolCallDeltaUnion` - - `const BetaResponsesServerEventResponseInjectFailedErrorCodeResponseAlreadyCompleted BetaResponsesServerEventResponseInjectFailedErrorCode = "response_already_completed"` + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - `const BetaResponsesServerEventResponseInjectFailedErrorCodeResponseNotFound BetaResponsesServerEventResponseInjectFailedErrorCode = "response_not_found"` + - `type CodeInterpreterToolCallDelta struct{…}` - - `Message string` + Details of the Code Interpreter tool call the run step was involved in. - A human-readable description of the error. + - `Index int64` - - `Input []BetaResponseInputItemUnion` + The index of the tool call in the tool calls array. - The raw input items that were not committed. + - `Type CodeInterpreter` - - `type BetaEasyInputMessage struct{…}` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `type BetaResponseInputItemMessage struct{…}` + - `ID string` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + The ID of the tool call. - - `type BetaResponseOutputMessage struct{…}` + - `CodeInterpreter CodeInterpreterToolCallDeltaCodeInterpreter` - An output message from the model. + The Code Interpreter tool call definition. - - `type BetaResponseFileSearchToolCall struct{…}` + - `Input string` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + The input to the Code Interpreter tool call. - - `type BetaResponseComputerToolCall struct{…}` + - `Outputs []CodeInterpreterToolCallDeltaCodeInterpreterOutputUnion` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `type BetaResponseInputItemComputerCallOutput struct{…}` + - `type CodeInterpreterLogs struct{…}` - The output of a computer tool call. + Text output from the Code Interpreter tool call as part of a run step. - - `type BetaResponseFunctionWebSearch struct{…}` + - `Index int64` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + The index of the output in the outputs array. - - `type BetaResponseFunctionToolCall struct{…}` + - `Type Logs` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + Always `logs`. - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `const LogsLogs Logs = "logs"` - The output of a function tool call. + - `Logs string` - - `type BetaResponseInputItemAgentMessage struct{…}` + The text output from the Code Interpreter tool call. - A message routed between agents. + - `type CodeInterpreterOutputImage struct{…}` - - `type BetaResponseInputItemMultiAgentCall struct{…}` + - `Index int64` - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + The index of the output in the outputs array. - - `type BetaResponseInputItemToolSearchCall struct{…}` + - `Type Image` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + Always `image`. - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `const ImageImage Image = "image"` - - `type BetaResponseReasoningItem struct{…}` + - `Image CodeInterpreterOutputImageImage` - 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](https://platform.openai.com/docs/guides/conversation-state). + - `FileID string` - - `type BetaResponseCompactionItemParamResp struct{…}` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `type FileSearchToolCallDelta struct{…}` - - `type BetaResponseInputItemImageGenerationCall struct{…}` + - `FileSearch any` - An image generation request made by the model. + For now, this is always going to be an empty object. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `Index int64` - A tool call to run code. + The index of the tool call in the tool calls array. - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `Type FileSearch` - A tool call to run a command on the local shell. + The type of tool call. This is always going to be `file_search` for this type of tool call. - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - The output of a local shell tool call. + - `ID string` - - `type BetaResponseInputItemShellCall struct{…}` + The ID of the tool call object. - A tool representing a request to execute one or more shell commands. + - `type FunctionToolCallDelta struct{…}` - - `type BetaResponseInputItemShellCallOutput struct{…}` + - `Index int64` - The streamed output items emitted by a shell tool call. + The index of the tool call in the tool calls array. - - `type BetaResponseInputItemApplyPatchCall struct{…}` + - `Type Function` - A tool call representing a request to create, delete, or update files using diff patches. + The type of tool call. This is always going to be `function` for this type of tool call. - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `const FunctionFunction Function = "function"` - The streamed output emitted by an apply patch tool call. + - `ID string` - - `type BetaResponseInputItemMcpListTools struct{…}` + The ID of the tool call object. - A list of tools available on an MCP server. + - `Function FunctionToolCallDeltaFunction` - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + The definition of the function that was called. - A request for human approval of a tool invocation. + - `Arguments string` - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` + The arguments passed to the function. - A response to an MCP approval request. + - `Name string` - - `type BetaResponseInputItemMcpCall struct{…}` + The name of the function. - An invocation of a tool on an MCP server. + - `Output string` - - `type BetaResponseCustomToolCallOutput struct{…}` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - The output of a custom tool call from your code, being sent back to the model. + - `Object ThreadRunStepDelta` - - `type BetaResponseCustomToolCall struct{…}` + The object type, which is always `thread.run.step.delta`. - A call to a custom tool created by the model. + - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + - `Event ThreadRunStepDelta` - Compacts the current context. Must be the final input item. + - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` - - `type BetaResponseInputItemItemReference struct{…}` + - `type AssistantStreamEventThreadRunStepCompleted struct{…}` - An internal identifier for an item to reference. + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is completed. - - `type BetaResponseInputItemProgram struct{…}` + - `Data RunStep` - - `type BetaResponseInputItemProgramOutput struct{…}` + Represents a step in execution of a run. - - `ResponseID string` + - `Event ThreadRunStepCompleted` - The ID of the response that rejected the input. + - `const ThreadRunStepCompletedThreadRunStepCompleted ThreadRunStepCompleted = "thread.run.step.completed"` - - `SequenceNumber int64` + - `type AssistantStreamEventThreadRunStepFailed struct{…}` - The sequence number for this event. + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) fails. - - `Type ResponseInjectFailed` + - `Data RunStep` - The event discriminator. Always `response.inject.failed`. + Represents a step in execution of a run. - - `const ResponseInjectFailedResponseInjectFailed ResponseInjectFailed = "response.inject.failed"` + - `Event ThreadRunStepFailed` - - `StreamID string` + - `const ThreadRunStepFailedThreadRunStepFailed ThreadRunStepFailed = "thread.run.step.failed"` - The multiplexed WebSocket stream that emitted the event. This field is - present only when WebSocket multiplexing is enabled separately. + - `type AssistantStreamEventThreadRunStepCancelled struct{…}` -### Beta Skill Reference + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is cancelled. -- `type BetaSkillReference struct{…}` + - `Data RunStep` - - `SkillID string` + Represents a step in execution of a run. - The ID of the referenced skill. + - `Event ThreadRunStepCancelled` - - `Type SkillReference` + - `const ThreadRunStepCancelledThreadRunStepCancelled ThreadRunStepCancelled = "thread.run.step.cancelled"` - References a skill created with the /v1/skills endpoint. + - `type AssistantStreamEventThreadRunStepExpired struct{…}` - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) expires. - - `Version string` + - `Data RunStep` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + Represents a step in execution of a run. -### Beta Tool + - `Event ThreadRunStepExpired` -- `type BetaToolUnion interface{…}` + - `const ThreadRunStepExpiredThreadRunStepExpired ThreadRunStepExpired = "thread.run.step.expired"` - A tool that can be used to generate a response. + - `type AssistantStreamEventThreadMessageCreated struct{…}` - - `type BetaFunctionTool struct{…}` + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) is created. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Data Message` - - `Name string` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - The name of the function to call. + - `ID string` - - `Parameters map[string, any]` + The identifier, which can be referenced in API endpoints. - A JSON schema object describing the parameters of the function. + - `AssistantID string` - - `Strict bool` + If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - Whether strict parameter validation is enforced for this function tool. + - `Attachments []MessageAttachment` - - `Type Function` + A list of files attached to the message, and the tools they were added to. - The type of the function tool. Always `function`. + - `FileID string` - - `const FunctionFunction Function = "function"` + The ID of the file to attach to the message. - - `AllowedCallers []string` + - `Tools []MessageAttachmentToolUnion` - The tool invocation context(s). + The tools to add this file to. - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `type CodeInterpreterTool struct{…}` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` - - `DeferLoading bool` + - `Type FileSearch` - Whether this function is deferred and loaded via tool search. + The type of tool being defined: `file_search` - - `Description string` + - `const FileSearchFileSearch FileSearch = "file_search"` - A description of the function. Used by the model to determine whether or not to call the function. + - `CompletedAt int64` - - `OutputSchema map[string, any]` + The Unix timestamp (in seconds) for when the message was completed. - A JSON schema object describing the JSON value encoded in string outputs for this function. + - `Content []MessageContentUnion` - - `type BetaFileSearchTool struct{…}` + The content of the message in array of text and/or images. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `type ImageFileContentBlock struct{…}` - - `Type FileSearch` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - The type of the file search tool. Always `file_search`. + - `ImageFile ImageFile` - - `const FileSearchFileSearch FileSearch = "file_search"` + - `FileID string` - - `VectorStoreIDs []string` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The IDs of the vector stores to search. + - `Detail ImageFileDetail` - - `Filters BetaFileSearchToolFiltersUnion` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - A filter to apply. + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `const ImageFileDetailLow ImageFileDetail = "low"` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `Key string` + - `Type ImageFile` - The key to compare against the value. + Always `image_file`. - - `Type string` + - `const ImageFileImageFile ImageFile = "image_file"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `type ImageURLContentBlock struct{…}` - - `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 + References an image URL in the content of a message. - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `ImageURL ImageURL` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `URL string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `Detail ImageURLDetail` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + - `Type ImageURL` - The value to compare against the attribute key; supports string, number, or boolean types. + The type of the content part. - - `string` + - `const ImageURLImageURL ImageURL = "image_url"` - - `float64` + - `type TextContentBlock struct{…}` - - `bool` + The text content that is part of a message. - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `Text Text` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + - `Annotations []AnnotationUnion` - Combine multiple filters using `and` or `or`. + - `type FileCitationAnnotation struct{…}` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `EndIndex int64` - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `FileCitation FileCitationAnnotationFileCitation` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `FileID string` - - `Key string` + The ID of the specific File the citation is from. - The key to compare against the value. + - `StartIndex int64` - - `Type string` + - `Text string` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The text in the message content that needs to be replaced. - - `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 + - `Type FileCitation` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + Always `file_citation`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `type FilePathAnnotation struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `EndIndex int64` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + - `FilePath FilePathAnnotationFilePath` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `FileID string` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + The ID of the file that was generated. - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + - `StartIndex int64` - The value to compare against the attribute key; supports string, number, or boolean types. + - `Text string` - - `string` + The text in the message content that needs to be replaced. - - `float64` + - `Type FilePath` - - `bool` + Always `file_path`. - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `const FilePathFilePath FilePath = "file_path"` - - `Type string` + - `Value string` - Type of operation: `and` or `or`. + The data that makes up the text. - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + - `Type Text` - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + Always `text`. - - `MaxNumResults int64` + - `const TextText Text = "text"` - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `type RefusalContentBlock struct{…}` - - `RankingOptions BetaFileSearchToolRankingOptions` + The refusal content generated by the assistant. - Ranking options for search. + - `Refusal string` - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `Type Refusal` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + Always `refusal`. - - `EmbeddingWeight float64` + - `const RefusalRefusal Refusal = "refusal"` - The weight of the embedding in the reciprocal ranking fusion. + - `CreatedAt int64` - - `TextWeight float64` + The Unix timestamp (in seconds) for when the message was created. - The weight of the text in the reciprocal ranking fusion. + - `IncompleteAt int64` - - `Ranker string` + The Unix timestamp (in seconds) for when the message was marked as incomplete. - The ranker to use for the file search. + - `IncompleteDetails MessageIncompleteDetails` - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + On an incomplete message, details about why the message is incomplete. - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + - `Reason string` - - `ScoreThreshold float64` + The reason the message is incomplete. - 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. + - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` - - `type BetaComputerTool struct{…}` + - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` - - `Type Computer` + - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` - The type of the computer tool. Always `computer`. + - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` - - `const ComputerComputer Computer = "computer"` + - `Metadata Metadata` - - `type BetaComputerUsePreviewTool struct{…}` + 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. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `DisplayHeight int64` + - `Object ThreadMessage` - The height of the computer display. + The object type, which is always `thread.message`. - - `DisplayWidth int64` + - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` - The width of the computer display. + - `Role MessageRole` - - `Environment BetaComputerUsePreviewToolEnvironment` + The entity that produced the message. One of `user` or `assistant`. - The type of computer environment to control. + - `const MessageRoleUser MessageRole = "user"` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `const MessageRoleAssistant MessageRole = "assistant"` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `RunID string` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `Status MessageStatus` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - `Type ComputerUsePreview` + - `const MessageStatusInProgress MessageStatus = "in_progress"` - The type of the computer use tool. Always `computer_use_preview`. + - `const MessageStatusIncomplete MessageStatus = "incomplete"` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `const MessageStatusCompleted MessageStatus = "completed"` - - `type BetaWebSearchTool struct{…}` + - `ThreadID string` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - - `Type BetaWebSearchToolType` + - `Event ThreadMessageCreated` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `const ThreadMessageCreatedThreadMessageCreated ThreadMessageCreated = "thread.message.created"` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `type AssistantStreamEventThreadMessageInProgress struct{…}` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) moves to an `in_progress` state. - - `Filters BetaWebSearchToolFilters` + - `Data Message` - Filters for the search. + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `AllowedDomains []string` + - `Event ThreadMessageInProgress` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `const ThreadMessageInProgressThreadMessageInProgress ThreadMessageInProgress = "thread.message.in_progress"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `type AssistantStreamEventThreadMessageDelta struct{…}` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + Occurs when parts of a [Message](https://platform.openai.com/docs/api-reference/messages/object) are being streamed. - 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. + - `Data MessageDeltaEvent` - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + Represents a message delta i.e. any changed fields on a message during streaming. - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `ID string` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + The identifier of the message, which can be referenced in API endpoints. - - `UserLocation BetaWebSearchToolUserLocation` + - `Delta MessageDelta` - The approximate location of the user. + The delta containing the fields that have changed on the Message. - - `City string` + - `Content []MessageContentDeltaUnion` - Free text input for the city of the user, e.g. `San Francisco`. + The content of the message in array of text and/or images. - - `Country string` + - `type ImageFileDeltaBlock struct{…}` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `Region string` + - `Index int64` - Free text input for the region of the user, e.g. `California`. + The index of the content part in the message. - - `Timezone string` + - `Type ImageFile` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + Always `image_file`. - - `Type string` + - `const ImageFileImageFile ImageFile = "image_file"` - The type of location approximation. Always `approximate`. + - `ImageFile ImageFileDelta` - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `Detail ImageFileDeltaDetail` - - `type BetaToolMcp struct{…}` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` - - `ServerLabel string` + - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` - A label for this MCP server, used to identify it in tool calls. + - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` - - `Type Mcp` + - `FileID string` - The type of the MCP tool. Always `mcp`. + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `const McpMcp Mcp = "mcp"` + - `type TextDeltaBlock struct{…}` - - `AllowedCallers []string` + The text content that is part of a message. - The tool invocation context(s). + - `Index int64` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + The index of the content part in the message. - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + - `Type Text` - - `AllowedTools BetaToolMcpAllowedToolsUnion` + Always `text`. - List of allowed tool names or a filter object. + - `const TextText Text = "text"` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `Text TextDelta` - A string array of allowed tool names + - `Annotations []AnnotationDeltaUnion` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `type FileCitationDeltaAnnotation struct{…}` - A filter object to specify which tools are allowed. + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `ReadOnly bool` + - `Index int64` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The index of the annotation in the text content part. - - `ToolNames []string` + - `Type FileCitation` - List of allowed tool names. + Always `file_citation`. - - `Authorization string` + - `const FileCitationFileCitation FileCitation = "file_citation"` - 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. + - `EndIndex int64` - - `ConnectorID string` + - `FileCitation FileCitationDeltaAnnotationFileCitation` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `FileID string` - Currently supported `connector_id` values are: + The ID of the specific File the citation is from. - - 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` + - `Quote string` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + The specific quote in the file. - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + - `StartIndex int64` - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `Text string` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + The text in the message content that needs to be replaced. - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `type FilePathDeltaAnnotation struct{…}` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `Index int64` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + The index of the annotation in the text content part. - - `DeferLoading bool` + - `Type FilePath` - Whether this MCP tool is deferred and discovered via tool search. + Always `file_path`. - - `Headers map[string, string]` + - `const FilePathFilePath FilePath = "file_path"` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `EndIndex int64` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `FilePath FilePathDeltaAnnotationFilePath` - Specify which of the MCP server's tools require approval. + - `FileID string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + The ID of the file that was generated. - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `StartIndex int64` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `Text string` - A filter object to specify which tools are allowed. + The text in the message content that needs to be replaced. - - `ReadOnly bool` + - `Value string` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The data that makes up the text. - - `ToolNames []string` + - `type RefusalDeltaBlock struct{…}` - List of allowed tool names. + The refusal content that is part of a message. - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `Index int64` - A filter object to specify which tools are allowed. + The index of the refusal part in the message. - - `ReadOnly bool` + - `Type Refusal` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + Always `refusal`. - - `ToolNames []string` + - `const RefusalRefusal Refusal = "refusal"` - List of allowed tool names. + - `Refusal string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `type ImageURLDeltaBlock struct{…}` - 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. + References an image URL in the content of a message. - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `Index int64` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + The index of the content part in the message. - - `ServerDescription string` + - `Type ImageURL` - Optional description of the MCP server, used to provide more context. + Always `image_url`. - - `ServerURL string` + - `const ImageURLImageURL ImageURL = "image_url"` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `ImageURL ImageURLDelta` - - `TunnelID string` + - `Detail ImageURLDeltaDetail` - 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. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `type BetaToolCodeInterpreter struct{…}` + - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` - A tool that runs Python code to help generate a response to a prompt. + - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` - - `Container BetaToolCodeInterpreterContainerUnion` + - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` - 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. + - `URL string` - - `string` + The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + - `Role MessageDeltaRole` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + The entity that produced the message. One of `user` or `assistant`. - - `Type Auto` + - `const MessageDeltaRoleUser MessageDeltaRole = "user"` - Always `auto`. + - `const MessageDeltaRoleAssistant MessageDeltaRole = "assistant"` - - `const AutoAuto Auto = "auto"` + - `Object ThreadMessageDelta` - - `FileIDs []string` + The object type, which is always `thread.message.delta`. - An optional list of uploaded files to make available to your code. + - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` - - `MemoryLimit string` + - `Event ThreadMessageDelta` - The memory limit for the code interpreter container. + - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + - `type AssistantStreamEventThreadMessageCompleted struct{…}` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) is completed. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `Data Message` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `Event ThreadMessageCompleted` - Network access policy for the container. + - `const ThreadMessageCompletedThreadMessageCompleted ThreadMessageCompleted = "thread.message.completed"` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `type AssistantStreamEventThreadMessageIncomplete struct{…}` - - `Type Disabled` + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) ends before it is completed. - Disable outbound network access. Always `disabled`. + - `Data Message` - - `const DisabledDisabled Disabled = "disabled"` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `Event ThreadMessageIncomplete` - - `AllowedDomains []string` + - `const ThreadMessageIncompleteThreadMessageIncomplete ThreadMessageIncomplete = "thread.message.incomplete"` - A list of allowed domains when type is `allowlist`. + - `type AssistantStreamEventErrorEvent struct{…}` - - `Type Allowlist` + Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. - Allow outbound network access only to specified domains. Always `allowlist`. + - `Data ErrorObject` - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `Code string` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + - `Message string` - Optional domain-scoped secrets for allowlisted domains. + - `Param string` - - `Domain string` + - `Type string` - The domain associated with the secret. + - `Event Error` - - `Name string` + - `const ErrorError Error = "error"` - The name of the secret to inject for the domain. +### Assistant Tool - - `Value string` +- `type AssistantToolUnion interface{…}` - The secret value to inject for the domain. + - `type CodeInterpreterTool struct{…}` - `Type CodeInterpreter` - The type of the code interpreter tool. Always `code_interpreter`. + The type of tool being defined: `code_interpreter` - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `AllowedCallers []string` + - `type FileSearchTool struct{…}` - The tool invocation context(s). + - `Type FileSearch` - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + The type of tool being defined: `file_search` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type BetaToolProgrammaticToolCalling struct{…}` + - `FileSearch FileSearchToolFileSearch` - - `Type ProgrammaticToolCalling` + Overrides for the file search tool. - The type of the tool. Always `programmatic_tool_calling`. + - `MaxNumResults int64` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `type BetaToolImageGeneration struct{…}` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - A tool that generates images using the GPT image models. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `Type ImageGeneration` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - The type of the image generation tool. Always `image_generation`. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `ScoreThreshold float64` - - `Action string` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - Whether to generate a new image or edit an existing image. Default: `auto`. + - `Ranker string` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `Background string` + - `type FunctionTool struct{…}` - 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. + - `Function FunctionDefinition` - `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. + - `Name string` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `Description string` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + A description of what the function does, used by the model to choose when and how to call the function. - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `Parameters FunctionParameters` - - `InputFidelity string` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - 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`. + Omitting `parameters` defines a function with an empty parameter list. - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + - `Strict bool` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `Type Function` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + The type of tool being defined: `function` - - `FileID string` + - `const FunctionFunction Function = "function"` - File ID for the mask image. +### Code Interpreter Tool - - `ImageURL string` +- `type CodeInterpreterTool struct{…}` - Base64-encoded mask image. + - `Type CodeInterpreter` - - `Model string` + The type of tool being defined: `code_interpreter` - The image generation model to use. Default: `gpt-image-1`. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `string` +### File Search Tool - - `string` +- `type FileSearchTool struct{…}` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + - `Type FileSearch` - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + The type of tool being defined: `file_search` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `FileSearch FileSearchToolFileSearch` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + Overrides for the file search tool. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `MaxNumResults int64` - - `Moderation string` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - Moderation level for the generated image. Default: `auto`. + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `OutputCompression int64` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - Compression level for the output image. Default: 100. + - `ScoreThreshold float64` - - `OutputFormat string` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `Ranker string` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `PartialImages int64` +### Function Tool - Number of partial images to generate in streaming mode, from 0 (default value) to 3. +- `type FunctionTool struct{…}` - - `Quality string` + - `Function FunctionDefinition` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `Name string` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + - `Description string` - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + A description of what the function does, used by the model to choose when and how to call the function. - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + - `Parameters FunctionParameters` - - `Size string` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - 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`. + Omitting `parameters` defines a function with an empty parameter list. - - `string` + - `Strict bool` - - `string` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `Type Function` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + The type of tool being defined: `function` - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `const FunctionFunction Function = "function"` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` +### Message Stream Event - - `type BetaToolLocalShell struct{…}` +- `type MessageStreamEventUnion interface{…}` - A tool that allows the model to execute shell commands in a local environment. + Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) is created. - - `Type LocalShell` + - `MessageStreamEventThreadMessageCreated` - The type of the local shell tool. Always `local_shell`. + - `Data Message` - - `const LocalShellLocalShell LocalShell = "local_shell"` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `type BetaFunctionShellTool struct{…}` + - `ID string` - A tool that allows the model to execute shell commands. + The identifier, which can be referenced in API endpoints. - - `Type Shell` + - `AssistantID string` - The type of the shell tool. Always `shell`. + If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - - `const ShellShell Shell = "shell"` + - `Attachments []MessageAttachment` - - `AllowedCallers []string` + A list of files attached to the message, and the tools they were added to. - The tool invocation context(s). + - `FileID string` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + The ID of the file to attach to the message. - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `Tools []MessageAttachmentToolUnion` - - `Environment BetaFunctionShellToolEnvironmentUnion` + The tools to add this file to. - - `type BetaContainerAuto struct{…}` + - `type CodeInterpreterTool struct{…}` - - `Type ContainerAuto` + - `Type CodeInterpreter` - Automatically creates a container for this request + The type of tool being defined: `code_interpreter` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `FileIDs []string` + - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` - An optional list of uploaded files to make available to your code. + - `Type FileSearch` - - `MemoryLimit BetaContainerAutoMemoryLimit` + The type of tool being defined: `file_search` - The memory limit for the container. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `CompletedAt int64` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The Unix timestamp (in seconds) for when the message was completed. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `Content []MessageContentUnion` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + The content of the message in array of text and/or images. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `type ImageFileContentBlock struct{…}` - Network access policy for the container. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `ImageFile ImageFile` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `FileID string` - - `Skills []BetaContainerAutoSkillUnion` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - An optional list of skills referenced by id or inline data. + - `Detail ImageFileDetail` - - `type BetaSkillReference struct{…}` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `SkillID string` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - The ID of the referenced skill. + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `Type SkillReference` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - References a skill created with the /v1/skills endpoint. + - `Type ImageFile` - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + Always `image_file`. - - `Version string` + - `const ImageFileImageFile ImageFile = "image_file"` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `type ImageURLContentBlock struct{…}` - - `type BetaInlineSkill struct{…}` + References an image URL in the content of a message. - - `Description string` + - `ImageURL ImageURL` - The description of the skill. + - `URL string` - - `Name string` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - The name of the skill. + - `Detail ImageURLDetail` - - `Source BetaInlineSkillSource` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - Inline skill payload + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - - `Data string` + - `const ImageURLDetailLow ImageURLDetail = "low"` - Base64-encoded skill zip bundle. + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `MediaType ApplicationZip` + - `Type ImageURL` - The media type of the inline skill payload. Must be `application/zip`. + The type of the content part. - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `const ImageURLImageURL ImageURL = "image_url"` - - `Type Base64` + - `type TextContentBlock struct{…}` - The type of the inline skill source. Must be `base64`. + The text content that is part of a message. - - `const Base64Base64 Base64 = "base64"` + - `Text Text` - - `Type Inline` + - `Annotations []AnnotationUnion` - Defines an inline skill for this request. + - `type FileCitationAnnotation struct{…}` - - `const InlineInline Inline = "inline"` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `type BetaLocalEnvironment struct{…}` + - `EndIndex int64` - - `Type Local` + - `FileCitation FileCitationAnnotationFileCitation` - Use a local computer environment. + - `FileID string` - - `const LocalLocal Local = "local"` + The ID of the specific File the citation is from. - - `Skills []BetaLocalSkill` + - `StartIndex int64` - An optional list of skills. + - `Text string` - - `Description string` + The text in the message content that needs to be replaced. - The description of the skill. + - `Type FileCitation` - - `Name string` + Always `file_citation`. - The name of the skill. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `Path string` + - `type FilePathAnnotation struct{…}` - The path to the directory containing the skill. + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `type BetaContainerReference struct{…}` + - `EndIndex int64` - - `ContainerID string` + - `FilePath FilePathAnnotationFilePath` - The ID of the referenced container. + - `FileID string` - - `Type ContainerReference` + The ID of the file that was generated. - References a container created with the /v1/containers endpoint + - `StartIndex int64` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `Text string` - - `type BetaCustomTool struct{…}` + The text in the message content that needs to be replaced. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `Type FilePath` - - `Name string` + Always `file_path`. - The name of the custom tool, used to identify it in tool calls. + - `const FilePathFilePath FilePath = "file_path"` - - `Type Custom` + - `Value string` - The type of the custom tool. Always `custom`. + The data that makes up the text. - - `const CustomCustom Custom = "custom"` + - `Type Text` - - `AllowedCallers []string` + Always `text`. - The tool invocation context(s). + - `const TextText Text = "text"` - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `type RefusalContentBlock struct{…}` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + The refusal content generated by the assistant. - - `DeferLoading bool` + - `Refusal string` - Whether this tool should be deferred and discovered via tool search. + - `Type Refusal` - - `Description string` + Always `refusal`. - Optional description of the custom tool, used to provide more context. + - `const RefusalRefusal Refusal = "refusal"` - - `Format BetaCustomToolFormatUnion` + - `CreatedAt int64` - The input format for the custom tool. Default is unconstrained text. + The Unix timestamp (in seconds) for when the message was created. - - `type BetaCustomToolFormatText struct{…}` + - `IncompleteAt int64` - Unconstrained free-form text. + The Unix timestamp (in seconds) for when the message was marked as incomplete. - - `Type Text` + - `IncompleteDetails MessageIncompleteDetails` - Unconstrained text format. Always `text`. + On an incomplete message, details about why the message is incomplete. - - `const TextText Text = "text"` + - `Reason string` - - `type BetaCustomToolFormatGrammar struct{…}` + The reason the message is incomplete. - A grammar defined by the user. + - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` - - `Definition string` + - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` - The grammar definition. + - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` - - `Syntax string` + - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` - The syntax of the grammar definition. One of `lark` or `regex`. + - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `Metadata Metadata` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + 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. - - `Type Grammar` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - Grammar format. Always `grammar`. + - `Object ThreadMessage` - - `const GrammarGrammar Grammar = "grammar"` + The object type, which is always `thread.message`. - - `type BetaNamespaceTool struct{…}` + - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` - Groups function/custom tools under a shared namespace. + - `Role MessageRole` - - `Description string` + The entity that produced the message. One of `user` or `assistant`. - A description of the namespace shown to the model. + - `const MessageRoleUser MessageRole = "user"` - - `Name string` + - `const MessageRoleAssistant MessageRole = "assistant"` - The namespace name used in tool calls (for example, `crm`). + - `RunID string` - - `Tools []BetaNamespaceToolToolUnion` + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - The function/custom tools available inside this namespace. + - `Status MessageStatus` - - `type BetaNamespaceToolToolFunction struct{…}` + The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - `Name string` + - `const MessageStatusInProgress MessageStatus = "in_progress"` - - `Type Function` + - `const MessageStatusIncomplete MessageStatus = "incomplete"` - - `const FunctionFunction Function = "function"` + - `const MessageStatusCompleted MessageStatus = "completed"` - - `AllowedCallers []string` + - `ThreadID string` - The tool invocation context(s). + The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `Event ThreadMessageCreated` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `const ThreadMessageCreatedThreadMessageCreated ThreadMessageCreated = "thread.message.created"` - - `DeferLoading bool` + - `MessageStreamEventThreadMessageInProgress` - Whether this function should be deferred and discovered via tool search. + - `Data Message` - - `Description string` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `OutputSchema map[string, any]` + - `Event ThreadMessageInProgress` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `const ThreadMessageInProgressThreadMessageInProgress ThreadMessageInProgress = "thread.message.in_progress"` - - `Parameters any` + - `MessageStreamEventThreadMessageDelta` - - `Strict bool` + - `Data MessageDeltaEvent` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + Represents a message delta i.e. any changed fields on a message during streaming. - - `type BetaCustomTool struct{…}` + - `ID string` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The identifier of the message, which can be referenced in API endpoints. - - `Type Namespace` + - `Delta MessageDelta` - The type of the tool. Always `namespace`. + The delta containing the fields that have changed on the Message. - - `const NamespaceNamespace Namespace = "namespace"` + - `Content []MessageContentDeltaUnion` - - `type BetaToolSearchTool struct{…}` + The content of the message in array of text and/or images. - Hosted or BYOT tool search configuration for deferred tools. + - `type ImageFileDeltaBlock struct{…}` - - `Type ToolSearch` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - The type of the tool. Always `tool_search`. + - `Index int64` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + The index of the content part in the message. - - `Description string` + - `Type ImageFile` - Description shown to the model for a client-executed tool search tool. + Always `image_file`. - - `Execution BetaToolSearchToolExecution` + - `const ImageFileImageFile ImageFile = "image_file"` - Whether tool search is executed by the server or by the client. + - `ImageFile ImageFileDelta` - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `Detail ImageFileDeltaDetail` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `Parameters any` + - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` - Parameter schema for a client-executed tool search tool. + - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` - - `type BetaWebSearchPreviewTool struct{…}` + - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `FileID string` - - `Type BetaWebSearchPreviewToolType` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `type TextDeltaBlock struct{…}` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + The text content that is part of a message. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + - `Index int64` - - `SearchContentTypes []string` + The index of the content part in the message. - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `Type Text` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + Always `text`. - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `const TextText Text = "text"` - 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. + - `Text TextDelta` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `Annotations []AnnotationDeltaUnion` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `type FileCitationDeltaAnnotation struct{…}` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `Index int64` - The user's location. + The index of the annotation in the text content part. - - `Type Approximate` + - `Type FileCitation` - The type of location approximation. Always `approximate`. + Always `file_citation`. - - `const ApproximateApproximate Approximate = "approximate"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `City string` + - `EndIndex int64` - Free text input for the city of the user, e.g. `San Francisco`. + - `FileCitation FileCitationDeltaAnnotationFileCitation` - - `Country string` + - `FileID string` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + The ID of the specific File the citation is from. - - `Region string` + - `Quote string` - Free text input for the region of the user, e.g. `California`. + The specific quote in the file. - - `Timezone string` + - `StartIndex int64` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `Text string` - - `type BetaApplyPatchTool struct{…}` + The text in the message content that needs to be replaced. - Allows the assistant to create, delete, or update files using unified diffs. + - `type FilePathDeltaAnnotation struct{…}` - - `Type ApplyPatch` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - The type of the tool. Always `apply_patch`. + - `Index int64` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + The index of the annotation in the text content part. - - `AllowedCallers []string` + - `Type FilePath` - The tool invocation context(s). + Always `file_path`. - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `const FilePathFilePath FilePath = "file_path"` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `EndIndex int64` -### Beta Tool Choice Allowed + - `FilePath FilePathDeltaAnnotationFilePath` -- `type BetaToolChoiceAllowed struct{…}` + - `FileID string` - Constrains the tools available to the model to a pre-defined set. + The ID of the file that was generated. - - `Mode BetaToolChoiceAllowedMode` + - `StartIndex int64` - Constrains the tools available to the model to a pre-defined set. + - `Text string` - `auto` allows the model to pick from among the allowed tools and generate a - message. + The text in the message content that needs to be replaced. - `required` requires the model to call one or more of the allowed tools. + - `Value string` - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + The data that makes up the text. - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` + - `type RefusalDeltaBlock struct{…}` - - `Tools []map[string, any]` + The refusal content that is part of a message. - A list of tool definitions that the model should be allowed to call. + - `Index int64` - For the Responses API, the list of tool definitions might look like: + The index of the refusal part in the message. - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `Type Refusal` - - `Type AllowedTools` + Always `refusal`. - Allowed tool configuration type. Always `allowed_tools`. + - `const RefusalRefusal Refusal = "refusal"` - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `Refusal string` -### Beta Tool Choice Apply Patch + - `type ImageURLDeltaBlock struct{…}` -- `type BetaToolChoiceApplyPatch struct{…}` + References an image URL in the content of a message. - Forces the model to call the apply_patch tool when executing a tool call. + - `Index int64` - - `Type ApplyPatch` + The index of the content part in the message. - The tool to call. Always `apply_patch`. + - `Type ImageURL` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + Always `image_url`. -### Beta Tool Choice Custom + - `const ImageURLImageURL ImageURL = "image_url"` -- `type BetaToolChoiceCustom struct{…}` + - `ImageURL ImageURLDelta` - Use this option to force the model to call a specific custom tool. + - `Detail ImageURLDeltaDetail` - - `Name string` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - The name of the custom tool to call. + - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` - - `Type Custom` + - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` - For custom tool calling, the type is always `custom`. + - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` - - `const CustomCustom Custom = "custom"` + - `URL string` -### Beta Tool Choice Function + The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. -- `type BetaToolChoiceFunction struct{…}` + - `Role MessageDeltaRole` - Use this option to force the model to call a specific function. + The entity that produced the message. One of `user` or `assistant`. - - `Name string` + - `const MessageDeltaRoleUser MessageDeltaRole = "user"` - The name of the function to call. + - `const MessageDeltaRoleAssistant MessageDeltaRole = "assistant"` - - `Type Function` + - `Object ThreadMessageDelta` - For function calling, the type is always `function`. + The object type, which is always `thread.message.delta`. - - `const FunctionFunction Function = "function"` + - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` -### Beta Tool Choice Mcp + - `Event ThreadMessageDelta` -- `type BetaToolChoiceMcp struct{…}` + - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` - Use this option to force the model to call a specific tool on a remote MCP server. + - `MessageStreamEventThreadMessageCompleted` - - `ServerLabel string` + - `Data Message` - The label of the MCP server to use. + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `Type Mcp` + - `Event ThreadMessageCompleted` - For MCP tools, the type is always `mcp`. + - `const ThreadMessageCompletedThreadMessageCompleted ThreadMessageCompleted = "thread.message.completed"` - - `const McpMcp Mcp = "mcp"` + - `MessageStreamEventThreadMessageIncomplete` - - `Name string` + - `Data Message` - The name of the tool to call on the server. + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). -### Beta Tool Choice Options + - `Event ThreadMessageIncomplete` -- `type BetaToolChoiceOptions string` + - `const ThreadMessageIncompleteThreadMessageIncomplete ThreadMessageIncomplete = "thread.message.incomplete"` - Controls which (if any) tool is called by the model. +### Run Step Stream Event - `none` means the model will not call any tool and instead generates a message. +- `type RunStepStreamEventUnion interface{…}` - `auto` means the model can pick between generating a message or calling one or - more tools. + Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is created. - `required` means the model must call one or more tools. + - `RunStepStreamEventThreadRunStepCreated` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + - `Data RunStep` - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + Represents a step in execution of a run. - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + - `ID string` -### Beta Tool Choice Shell + The identifier of the run step, which can be referenced in API endpoints. -- `type BetaToolChoiceShell struct{…}` + - `AssistantID string` - Forces the model to call the shell tool when a tool call is required. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. - - `Type Shell` + - `CancelledAt int64` - The tool to call. Always `shell`. + The Unix timestamp (in seconds) for when the run step was cancelled. - - `const ShellShell Shell = "shell"` + - `CompletedAt int64` -### Beta Tool Choice Types + The Unix timestamp (in seconds) for when the run step completed. -- `type BetaToolChoiceTypes struct{…}` + - `CreatedAt int64` - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + The Unix timestamp (in seconds) for when the run step was created. - - `Type BetaToolChoiceTypesType` + - `ExpiredAt int64` - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - Allowed values are: + - `FailedAt int64` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + The Unix timestamp (in seconds) for when the run step failed. - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + - `LastError RunStepLastError` - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + The last error associated with this run step. Will be `null` if there are no errors. - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + - `Code string` - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + One of `server_error` or `rate_limit_exceeded`. - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + - `Message string` - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + A human-readable description of the error. -### Beta Tool Search Tool + - `Metadata Metadata` -- `type BetaToolSearchTool struct{…}` + 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. - Hosted or BYOT tool search configuration for deferred tools. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `Type ToolSearch` + - `Object ThreadRunStep` - The type of the tool. Always `tool_search`. + The object type, which is always `thread.run.step`. - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` - - `Description string` + - `RunID string` - Description shown to the model for a client-executed tool search tool. + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. - - `Execution BetaToolSearchToolExecution` + - `Status RunStepStatus` - Whether tool search is executed by the server or by the client. + The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + - `const RunStepStatusInProgress RunStepStatus = "in_progress"` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `const RunStepStatusCancelled RunStepStatus = "cancelled"` - - `Parameters any` + - `const RunStepStatusFailed RunStepStatus = "failed"` - Parameter schema for a client-executed tool search tool. + - `const RunStepStatusCompleted RunStepStatus = "completed"` -### Beta Web Search Preview Tool + - `const RunStepStatusExpired RunStepStatus = "expired"` -- `type BetaWebSearchPreviewTool struct{…}` + - `StepDetails RunStepStepDetailsUnion` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The details of the run step. - - `Type BetaWebSearchPreviewToolType` + - `type MessageCreationStepDetails struct{…}` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + Details of the message creation by the run step. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `MessageCreation MessageCreationStepDetailsMessageCreation` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + - `MessageID string` - - `SearchContentTypes []string` + The ID of the message that was created by this run step. - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `Type MessageCreation` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + Always `message_creation`. - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - 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. + - `type ToolCallsStepDetails struct{…}` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + Details of the tool call. - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `ToolCalls []ToolCallUnion` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `type CodeInterpreterToolCall struct{…}` - The user's location. + Details of the Code Interpreter tool call the run step was involved in. - - `Type Approximate` + - `ID string` - The type of location approximation. Always `approximate`. + The ID of the tool call. - - `const ApproximateApproximate Approximate = "approximate"` + - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` - - `City string` + The Code Interpreter tool call definition. - Free text input for the city of the user, e.g. `San Francisco`. + - `Input string` - - `Country string` + The input to the Code Interpreter tool call. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` - - `Region string` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - Free text input for the region of the user, e.g. `California`. + - `type CodeInterpreterToolCallCodeInterpreterOutputLogs struct{…}` - - `Timezone string` + Text output from the Code Interpreter tool call as part of a run step. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `Logs string` -### Beta Web Search Tool + The text output from the Code Interpreter tool call. -- `type BetaWebSearchTool struct{…}` + - `Type Logs` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + Always `logs`. - - `Type BetaWebSearchToolType` + - `const LogsLogs Logs = "logs"` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `type CodeInterpreterToolCallCodeInterpreterOutputImage struct{…}` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `FileID string` - - `Filters BetaWebSearchToolFilters` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - Filters for the search. + - `Type Image` - - `AllowedDomains []string` + Always `image`. - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `const ImageImage Image = "image"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `Type CodeInterpreter` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - 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 CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `type FileSearchToolCall struct{…}` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `ID string` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + The ID of the tool call object. - - `UserLocation BetaWebSearchToolUserLocation` + - `FileSearch FileSearchToolCallFileSearch` - The approximate location of the user. + For now, this is always going to be an empty object. - - `City string` + - `RankingOptions FileSearchToolCallFileSearchRankingOptions` - Free text input for the city of the user, e.g. `San Francisco`. + The ranking options for the file search. - - `Country string` + - `Ranker string` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `Region string` + - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` - Free text input for the region of the user, e.g. `California`. + - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `Timezone string` + - `ScoreThreshold float64` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `Type string` + - `Results []FileSearchToolCallFileSearchResult` - The type of location approximation. Always `approximate`. + The results of the file search. - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `FileID string` -# Input Items + The ID of the file that result was found in. -## List input items + - `FileName string` -`client.Beta.Responses.InputItems.List(ctx, responseID, params) (*CursorPage[BetaResponseItemUnion], error)` + The name of the file that result was found in. -**get** `/responses/{response_id}/input_items?beta=true` + - `Score float64` -List input items + The score of the result. All values must be a floating point number between 0 and 1. -### Parameters + - `Content []FileSearchToolCallFileSearchResultContent` -- `responseID string` + The content of the result that was found. The content is only included if requested via the include query parameter. -- `params InputItemListParams` + - `Text string` - - `After param.Field[string]` + The text content of the file. - Query param: An item ID to list items after, used in pagination. + - `Type string` - - `Include param.Field[[]BetaResponseIncludable]` + The type of the content. - Query param: Additional fields to include in the response. See the `include` - parameter for Response creation above for more information. + - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` - - `const BetaResponseIncludableFileSearchCallResults BetaResponseIncludable = "file_search_call.results"` + - `Type FileSearch` - - `const BetaResponseIncludableWebSearchCallResults BetaResponseIncludable = "web_search_call.results"` + The type of tool call. This is always going to be `file_search` for this type of tool call. - - `const BetaResponseIncludableWebSearchCallActionSources BetaResponseIncludable = "web_search_call.action.sources"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `const BetaResponseIncludableMessageInputImageImageURL BetaResponseIncludable = "message.input_image.image_url"` + - `type FunctionToolCall struct{…}` - - `const BetaResponseIncludableComputerCallOutputOutputImageURL BetaResponseIncludable = "computer_call_output.output.image_url"` + - `ID string` - - `const BetaResponseIncludableCodeInterpreterCallOutputs BetaResponseIncludable = "code_interpreter_call.outputs"` + The ID of the tool call object. - - `const BetaResponseIncludableReasoningEncryptedContent BetaResponseIncludable = "reasoning.encrypted_content"` + - `Function FunctionToolCallFunction` - - `const BetaResponseIncludableMessageOutputTextLogprobs BetaResponseIncludable = "message.output_text.logprobs"` + The definition of the function that was called. - - `Limit param.Field[int64]` + - `Arguments string` - Query param: A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. + The arguments passed to the function. - - `Order param.Field[InputItemListParamsOrder]` + - `Name string` - Query param: The order to return the input items in. Default is `desc`. + The name of the function. - - `asc`: Return the input items in ascending order. - - `desc`: Return the input items in descending order. + - `Output string` - - `const InputItemListParamsOrderAsc InputItemListParamsOrder = "asc"` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `const InputItemListParamsOrderDesc InputItemListParamsOrder = "desc"` + - `Type Function` - - `Betas param.Field[[]string]` + The type of tool call. This is always going to be `function` for this type of tool call. - Header param: Optional beta features to enable for this request. + - `const FunctionFunction Function = "function"` - - `const InputItemListParamsOpenAIBetaResponsesMultiAgentV1 InputItemListParamsOpenAIBeta = "responses_multi_agent=v1"` + - `Type ToolCalls` -### Returns + Always `tool_calls`. -- `type BetaResponseItemUnion interface{…}` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - Content item used to generate a response. + - `ThreadID string` - - `type BetaResponseInputMessageItem struct{…}` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - - `ID string` + - `Type RunStepType` - The unique ID of the message input. + The type of run step, which can be either `message_creation` or `tool_calls`. - - `Content BetaResponseInputMessageContentList` + - `const RunStepTypeMessageCreation RunStepType = "message_creation"` - A list of one or many input items to the model, containing different content - types. + - `const RunStepTypeToolCalls RunStepType = "tool_calls"` - - `type BetaResponseInputText struct{…}` + - `Usage RunStepUsage` - A text input to the model. + Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - `Text string` + - `CompletionTokens int64` - The text input to the model. + Number of completion tokens used over the course of the run step. - - `Type InputText` + - `PromptTokens int64` - The type of the input item. Always `input_text`. + Number of prompt tokens used over the course of the run step. - - `const InputTextInputText InputText = "input_text"` + - `TotalTokens int64` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + Total number of tokens used (prompt + completion). - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Event ThreadRunStepCreated` - - `Mode Explicit` + - `const ThreadRunStepCreatedThreadRunStepCreated ThreadRunStepCreated = "thread.run.step.created"` - The breakpoint mode. Always `explicit`. + - `RunStepStreamEventThreadRunStepInProgress` - - `const ExplicitExplicit Explicit = "explicit"` + - `Data RunStep` - - `type BetaResponseInputImage struct{…}` + Represents a step in execution of a run. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `Event ThreadRunStepInProgress` - - `Detail BetaResponseInputImageDetail` + - `const ThreadRunStepInProgressThreadRunStepInProgress ThreadRunStepInProgress = "thread.run.step.in_progress"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `RunStepStreamEventThreadRunStepDelta` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `Data RunStepDeltaEvent` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + Represents a run step delta i.e. any changed fields on a run step during streaming. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `ID string` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + The identifier of the run step, which can be referenced in API endpoints. - - `Type InputImage` + - `Delta RunStepDelta` - The type of the input item. Always `input_image`. + The delta containing the fields that have changed on the run step. - - `const InputImageInputImage InputImage = "input_image"` + - `StepDetails RunStepDeltaStepDetailsUnion` - - `FileID string` + The details of the run step. - The ID of the file to be sent to the model. + - `type RunStepDeltaMessageDelta struct{…}` - - `ImageURL string` + Details of the message creation by the run step. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `Type MessageCreation` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + Always `message_creation`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - - `Mode Explicit` + - `MessageCreation RunStepDeltaMessageDeltaMessageCreation` - The breakpoint mode. Always `explicit`. + - `MessageID string` - - `const ExplicitExplicit Explicit = "explicit"` + The ID of the message that was created by this run step. - - `type BetaResponseInputFile struct{…}` + - `type ToolCallDeltaObject struct{…}` - A file input to the model. + Details of the tool call. - - `Type InputFile` + - `Type ToolCalls` - The type of the input item. Always `input_file`. + Always `tool_calls`. - - `const InputFileInputFile InputFile = "input_file"` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - - `Detail BetaResponseInputFileDetail` + - `ToolCalls []ToolCallDeltaUnion` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + - `type CodeInterpreterToolCallDelta struct{…}` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + Details of the Code Interpreter tool call the run step was involved in. - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `Index int64` - - `FileData string` + The index of the tool call in the tool calls array. - The content of the file to be sent to the model. + - `Type CodeInterpreter` - - `FileID string` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - The ID of the file to be sent to the model. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `FileURL string` + - `ID string` - The URL of the file to be sent to the model. + The ID of the tool call. - - `Filename string` + - `CodeInterpreter CodeInterpreterToolCallDeltaCodeInterpreter` - The name of the file to be sent to the model. + The Code Interpreter tool call definition. - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + - `Input string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The input to the Code Interpreter tool call. - - `Mode Explicit` + - `Outputs []CodeInterpreterToolCallDeltaCodeInterpreterOutputUnion` - The breakpoint mode. Always `explicit`. + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `const ExplicitExplicit Explicit = "explicit"` + - `type CodeInterpreterLogs struct{…}` - - `Role BetaResponseInputMessageItemRole` + Text output from the Code Interpreter tool call as part of a run step. - The role of the message input. One of `user`, `system`, or `developer`. + - `Index int64` - - `const BetaResponseInputMessageItemRoleUser BetaResponseInputMessageItemRole = "user"` + The index of the output in the outputs array. - - `const BetaResponseInputMessageItemRoleSystem BetaResponseInputMessageItemRole = "system"` + - `Type Logs` - - `const BetaResponseInputMessageItemRoleDeveloper BetaResponseInputMessageItemRole = "developer"` + Always `logs`. - - `Type Message` + - `const LogsLogs Logs = "logs"` - The type of the message input. Always set to `message`. + - `Logs string` - - `const MessageMessage Message = "message"` + The text output from the Code Interpreter tool call. - - `Agent BetaResponseInputMessageItemAgent` + - `type CodeInterpreterOutputImage struct{…}` - The agent that produced this item. + - `Index int64` - - `AgentName string` + The index of the output in the outputs array. - The canonical name of the agent that produced this item. + - `Type Image` - - `Status BetaResponseInputMessageItemStatus` + Always `image`. - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const ImageImage Image = "image"` - - `const BetaResponseInputMessageItemStatusInProgress BetaResponseInputMessageItemStatus = "in_progress"` + - `Image CodeInterpreterOutputImageImage` - - `const BetaResponseInputMessageItemStatusCompleted BetaResponseInputMessageItemStatus = "completed"` + - `FileID string` - - `const BetaResponseInputMessageItemStatusIncomplete BetaResponseInputMessageItemStatus = "incomplete"` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `type BetaResponseOutputMessage struct{…}` + - `type FileSearchToolCallDelta struct{…}` - An output message from the model. + - `FileSearch any` - - `ID string` + For now, this is always going to be an empty object. - The unique ID of the output message. + - `Index int64` - - `Content []BetaResponseOutputMessageContentUnion` + The index of the tool call in the tool calls array. - The content of the output message. + - `Type FileSearch` - - `type BetaResponseOutputText struct{…}` + The type of tool call. This is always going to be `file_search` for this type of tool call. - A text output from the model. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `ID string` - The annotations of the text output. + The ID of the tool call object. - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + - `type FunctionToolCallDelta struct{…}` - A citation to a file. + - `Index int64` - - `FileID string` + The index of the tool call in the tool calls array. - The ID of the file. + - `Type Function` - - `Filename string` + The type of tool call. This is always going to be `function` for this type of tool call. - The filename of the file cited. + - `const FunctionFunction Function = "function"` - - `Index int64` + - `ID string` - The index of the file in the list of files. + The ID of the tool call object. - - `Type FileCitation` + - `Function FunctionToolCallDeltaFunction` - The type of the file citation. Always `file_citation`. + The definition of the function that was called. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `Arguments string` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + The arguments passed to the function. - A citation for a web resource used to generate a model response. + - `Name string` - - `EndIndex int64` + The name of the function. - The index of the last character of the URL citation in the message. + - `Output string` - - `StartIndex int64` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - The index of the first character of the URL citation in the message. + - `Object ThreadRunStepDelta` - - `Title string` + The object type, which is always `thread.run.step.delta`. - The title of the web resource. + - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` - - `Type URLCitation` + - `Event ThreadRunStepDelta` - The type of the URL citation. Always `url_citation`. + - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `RunStepStreamEventThreadRunStepCompleted` - - `URL string` + - `Data RunStep` - The URL of the web resource. + Represents a step in execution of a run. - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `Event ThreadRunStepCompleted` - A citation for a container file used to generate a model response. + - `const ThreadRunStepCompletedThreadRunStepCompleted ThreadRunStepCompleted = "thread.run.step.completed"` - - `ContainerID string` + - `RunStepStreamEventThreadRunStepFailed` - The ID of the container file. + - `Data RunStep` - - `EndIndex int64` + Represents a step in execution of a run. - The index of the last character of the container file citation in the message. + - `Event ThreadRunStepFailed` - - `FileID string` + - `const ThreadRunStepFailedThreadRunStepFailed ThreadRunStepFailed = "thread.run.step.failed"` - The ID of the file. + - `RunStepStreamEventThreadRunStepCancelled` - - `Filename string` + - `Data RunStep` - The filename of the container file cited. + Represents a step in execution of a run. - - `StartIndex int64` + - `Event ThreadRunStepCancelled` - The index of the first character of the container file citation in the message. + - `const ThreadRunStepCancelledThreadRunStepCancelled ThreadRunStepCancelled = "thread.run.step.cancelled"` - - `Type ContainerFileCitation` + - `RunStepStreamEventThreadRunStepExpired` - The type of the container file citation. Always `container_file_citation`. + - `Data RunStep` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + Represents a step in execution of a run. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `Event ThreadRunStepExpired` - A path to a file. + - `const ThreadRunStepExpiredThreadRunStepExpired ThreadRunStepExpired = "thread.run.step.expired"` - - `FileID string` +### Run Stream Event - The ID of the file. +- `type RunStreamEventUnion interface{…}` - - `Index int64` + Occurs when a new [run](https://platform.openai.com/docs/api-reference/runs/object) is created. - The index of the file in the list of files. + - `RunStreamEventThreadRunCreated` - - `Type FilePath` + - `Data Run` - The type of the file path. Always `file_path`. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `const FilePathFilePath FilePath = "file_path"` + - `ID string` - - `Text string` + The identifier, which can be referenced in API endpoints. - The text output from the model. + - `AssistantID string` - - `Type OutputText` + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - The type of the output text. Always `output_text`. + - `CancelledAt int64` - - `const OutputTextOutputText OutputText = "output_text"` + The Unix timestamp (in seconds) for when the run was cancelled. - - `Logprobs []BetaResponseOutputTextLogprob` + - `CompletedAt int64` - - `Token string` + The Unix timestamp (in seconds) for when the run was completed. - - `Bytes []int64` + - `CreatedAt int64` - - `Logprob float64` + The Unix timestamp (in seconds) for when the run was created. - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `ExpiresAt int64` - - `Token string` + The Unix timestamp (in seconds) for when the run will expire. - - `Bytes []int64` + - `FailedAt int64` - - `Logprob float64` + The Unix timestamp (in seconds) for when the run failed. - - `type BetaResponseOutputRefusal struct{…}` + - `IncompleteDetails RunIncompleteDetails` - A refusal from the model. + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - `Refusal string` + - `Reason string` - The refusal explanation from the model. + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - `Type Refusal` + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - The type of the refusal. Always `refusal`. + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - - `const RefusalRefusal Refusal = "refusal"` + - `Instructions string` - - `Role Assistant` + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The role of the output message. Always `assistant`. + - `LastError RunLastError` - - `const AssistantAssistant Assistant = "assistant"` + The last error associated with this run. Will be `null` if there are no errors. - - `Status BetaResponseOutputMessageStatus` + - `Code string` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - - `Type Message` + - `Message string` - The type of the output message. Always `message`. + A human-readable description of the error. - - `const MessageMessage Message = "message"` + - `MaxCompletionTokens int64` - - `Agent BetaResponseOutputMessageAgent` + The maximum number of completion tokens specified to have been used over the course of the run. - The agent that produced this item. + - `MaxPromptTokens int64` - - `AgentName string` + The maximum number of prompt tokens specified to have been used over the course of the run. - The canonical name of the agent that produced this item. + - `Metadata Metadata` - - `Phase BetaResponseOutputMessagePhase` + 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. - 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. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `Model string` - - `type BetaResponseFileSearchToolCall struct{…}` + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `Object ThreadRun` - - `ID string` + The object type, which is always `thread.run`. - The unique ID of the file search tool call. + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - - `Queries []string` + - `ParallelToolCalls bool` - The queries used to search for files. + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - `Status BetaResponseFileSearchToolCallStatus` + - `RequiredAction RunRequiredAction` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + Details on the action required to continue the run. Will be `null` if no action is required. - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + Details on the tool outputs needed for this run to continue. - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + - `ToolCalls []RequiredActionFunctionToolCall` - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + A list of the relevant tool calls. - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + - `ID string` - - `Type FileSearchCall` + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - The type of the file search tool call. Always `file_search_call`. + - `Function RequiredActionFunctionToolCallFunction` - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + The function definition. - - `Agent BetaResponseFileSearchToolCallAgent` + - `Arguments string` - The agent that produced this item. + The arguments that the model expects you to pass to the function. - - `AgentName string` + - `Name string` - The canonical name of the agent that produced this item. + The name of the function. - - `Results []BetaResponseFileSearchToolCallResult` + - `Type Function` - The results of the file search tool call. + The type of tool call the output is required for. For now, this is always `function`. - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + - `const FunctionFunction Function = "function"` - 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. + - `Type SubmitToolOutputs` - - `string` + For now, this is always `submit_tool_outputs`. - - `float64` + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - - `bool` + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `FileID string` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The unique ID of the file. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Filename string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - The name of the file. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `Score float64` + - `type Auto string` - The relevance score of the file - a value between 0 and 1. + `auto` is the default value - - `Text string` + - `const AutoAuto Auto = "auto"` - The text that was retrieved from the file. + - `type ResponseFormatText struct{…}` - - `type BetaResponseComputerToolCall struct{…}` + Default response format. Used to generate text responses. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `Type Text` - - `ID string` + The type of response format being defined. Always `text`. - The unique ID of the computer call. + - `const TextText Text = "text"` - - `CallID string` + - `type ResponseFormatJSONObject struct{…}` - An identifier used when responding to the tool call with output. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + - `Type JSONObject` - The pending safety checks for the computer call. + The type of response format being defined. Always `json_object`. - - `ID string` + - `const JSONObjectJSONObject JSONObject = "json_object"` - The ID of the pending safety check. + - `type ResponseFormatJSONSchema struct{…}` - - `Code string` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The type of the pending safety check. + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `Message string` + Structured Outputs configuration options, including a JSON Schema. - Details about the pending safety check. + - `Name string` - - `Status BetaResponseComputerToolCallStatus` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Description string` - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + - `Schema map[string, any]` - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `Type BetaResponseComputerToolCallType` + - `Strict bool` - The type of the computer call. Always `computer_call`. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `Type JSONSchema` - - `Action BetaComputerActionUnion` + The type of response format being defined. Always `json_schema`. - A click action. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `type BetaComputerActionClick struct{…}` + - `StartedAt int64` - A click action. + The Unix timestamp (in seconds) for when the run was started. - - `Button string` + - `Status RunStatus` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `const RunStatusQueued RunStatus = "queued"` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `const RunStatusInProgress RunStatus = "in_progress"` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `const RunStatusRequiresAction RunStatus = "requires_action"` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `const RunStatusCancelling RunStatus = "cancelling"` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + - `const RunStatusCancelled RunStatus = "cancelled"` - - `Type Click` + - `const RunStatusFailed RunStatus = "failed"` - Specifies the event type. For a click action, this property is always `click`. + - `const RunStatusCompleted RunStatus = "completed"` - - `const ClickClick Click = "click"` + - `const RunStatusIncomplete RunStatus = "incomplete"` - - `X int64` + - `const RunStatusExpired RunStatus = "expired"` - The x-coordinate where the click occurred. + - `ThreadID string` - - `Y int64` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - The y-coordinate where the click occurred. + - `ToolChoice AssistantToolChoiceOptionUnion` - - `Keys []string` + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - The keys being held while clicking. + - `type AssistantToolChoiceOptionAuto string` - - `type BetaComputerActionDoubleClick struct{…}` + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - A double click action. + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - - `Keys []string` + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - The keys being held while double-clicking. + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - - `Type DoubleClick` + - `type AssistantToolChoice struct{…}` - Specifies the event type. For a double click action, this property is always set to `double_click`. + Specifies a tool the model should use. Use to force the model to call a specific tool. - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `Type AssistantToolChoiceType` - - `X int64` + The type of the tool. If type is `function`, the function name must be set - The x-coordinate where the double click occurred. + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - - `Y int64` + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - The y-coordinate where the double click occurred. + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - - `type BetaComputerActionDrag struct{…}` + - `Function AssistantToolChoiceFunction` - A drag action. + - `Name string` - - `Path []BetaComputerActionDragPath` + The name of the function to call. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `Tools []AssistantToolUnion` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `X int64` + - `type CodeInterpreterTool struct{…}` - The x-coordinate. + - `Type CodeInterpreter` - - `Y int64` + The type of tool being defined: `code_interpreter` - The y-coordinate. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Type Drag` + - `type FileSearchTool struct{…}` - Specifies the event type. For a drag action, this property is always set to `drag`. + - `Type FileSearch` - - `const DragDrag Drag = "drag"` + The type of tool being defined: `file_search` - - `Keys []string` + - `const FileSearchFileSearch FileSearch = "file_search"` - The keys being held while dragging the mouse. + - `FileSearch FileSearchToolFileSearch` - - `type BetaComputerActionKeypress struct{…}` + Overrides for the file search tool. - A collection of keypresses the model would like to perform. + - `MaxNumResults int64` - - `Keys []string` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `Type Keypress` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `const KeypressKeypress Keypress = "keypress"` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `type BetaComputerActionMove struct{…}` + - `ScoreThreshold float64` - A mouse move action. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `Type Move` + - `Ranker string` - Specifies the event type. For a move action, this property is always set to `move`. + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const MoveMove Move = "move"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `X int64` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - The x-coordinate to move to. + - `type FunctionTool struct{…}` - - `Y int64` + - `Function FunctionDefinition` - The y-coordinate to move to. + - `Name string` - - `Keys []string` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - The keys being held while moving the mouse. + - `Description string` - - `type BetaComputerActionScreenshot struct{…}` + A description of what the function does, used by the model to choose when and how to call the function. - A screenshot action. + - `Parameters FunctionParameters` - - `Type Screenshot` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + Omitting `parameters` defines a function with an empty parameter list. - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `Strict bool` - - `type BetaComputerActionScroll struct{…}` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - A scroll action. + - `Type Function` - - `ScrollX int64` + The type of tool being defined: `function` - The horizontal scroll distance. + - `const FunctionFunction Function = "function"` - - `ScrollY int64` + - `TruncationStrategy RunTruncationStrategy` - The vertical scroll distance. + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `Type Scroll` + - `Type string` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - `const ScrollScroll Scroll = "scroll"` + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `X int64` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - The x-coordinate where the scroll occurred. + - `LastMessages int64` - - `Y int64` + The number of most recent messages from the thread when constructing the context for the run. - The y-coordinate where the scroll occurred. + - `Usage RunUsage` - - `Keys []string` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - The keys being held while scrolling. + - `CompletionTokens int64` - - `type BetaComputerActionType struct{…}` + Number of completion tokens used over the course of the run. - An action to type in text. + - `PromptTokens int64` - - `Text string` + Number of prompt tokens used over the course of the run. - The text to type. + - `TotalTokens int64` - - `Type Type` + Total number of tokens used (prompt + completion). - Specifies the event type. For a type action, this property is always set to `type`. + - `Temperature float64` - - `const TypeType Type = "type"` + The sampling temperature used for this run. If not set, defaults to 1. - - `type BetaComputerActionWait struct{…}` + - `TopP float64` - A wait action. + The nucleus sampling value used for this run. If not set, defaults to 1. - - `Type Wait` + - `Event ThreadRunCreated` - Specifies the event type. For a wait action, this property is always set to `wait`. + - `const ThreadRunCreatedThreadRunCreated ThreadRunCreated = "thread.run.created"` - - `const WaitWait Wait = "wait"` + - `RunStreamEventThreadRunQueued` - - `Actions BetaComputerActionList` + - `Data Run` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `type BetaComputerActionClick struct{…}` + - `Event ThreadRunQueued` - A click action. + - `const ThreadRunQueuedThreadRunQueued ThreadRunQueued = "thread.run.queued"` - - `type BetaComputerActionDoubleClick struct{…}` + - `RunStreamEventThreadRunInProgress` - A double click action. + - `Data Run` - - `type BetaComputerActionDrag struct{…}` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - A drag action. + - `Event ThreadRunInProgress` - - `type BetaComputerActionKeypress struct{…}` + - `const ThreadRunInProgressThreadRunInProgress ThreadRunInProgress = "thread.run.in_progress"` - A collection of keypresses the model would like to perform. + - `RunStreamEventThreadRunRequiresAction` - - `type BetaComputerActionMove struct{…}` + - `Data Run` - A mouse move action. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `type BetaComputerActionScreenshot struct{…}` + - `Event ThreadRunRequiresAction` - A screenshot action. + - `const ThreadRunRequiresActionThreadRunRequiresAction ThreadRunRequiresAction = "thread.run.requires_action"` - - `type BetaComputerActionScroll struct{…}` + - `RunStreamEventThreadRunCompleted` - A scroll action. + - `Data Run` - - `type BetaComputerActionType struct{…}` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - An action to type in text. + - `Event ThreadRunCompleted` - - `type BetaComputerActionWait struct{…}` + - `const ThreadRunCompletedThreadRunCompleted ThreadRunCompleted = "thread.run.completed"` - A wait action. + - `RunStreamEventThreadRunIncomplete` - - `Agent BetaResponseComputerToolCallAgent` + - `Data Run` - The agent that produced this item. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `AgentName string` + - `Event ThreadRunIncomplete` - The canonical name of the agent that produced this item. + - `const ThreadRunIncompleteThreadRunIncomplete ThreadRunIncomplete = "thread.run.incomplete"` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `RunStreamEventThreadRunFailed` - - `ID string` + - `Data Run` - The unique ID of the computer call tool output. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `CallID string` + - `Event ThreadRunFailed` - The ID of the computer tool call that produced the output. + - `const ThreadRunFailedThreadRunFailed ThreadRunFailed = "thread.run.failed"` - - `Output BetaResponseComputerToolCallOutputScreenshot` + - `RunStreamEventThreadRunCancelling` - A computer screenshot image used with the computer use tool. + - `Data Run` - - `Type ComputerScreenshot` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `Event ThreadRunCancelling` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `const ThreadRunCancellingThreadRunCancelling ThreadRunCancelling = "thread.run.cancelling"` - - `FileID string` + - `RunStreamEventThreadRunCancelled` - The identifier of an uploaded file that contains the screenshot. + - `Data Run` - - `ImageURL string` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - The URL of the screenshot image. + - `Event ThreadRunCancelled` - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `const ThreadRunCancelledThreadRunCancelled ThreadRunCancelled = "thread.run.cancelled"` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `RunStreamEventThreadRunExpired` - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `Data Run` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `Event ThreadRunExpired` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + - `const ThreadRunExpiredThreadRunExpired ThreadRunExpired = "thread.run.expired"` - - `Type ComputerCallOutput` +### Thread Stream Event - The type of the computer tool call output. Always `computer_call_output`. +- `type ThreadStreamEvent struct{…}` - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object) is created. - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + - `Data Thread` - The safety checks reported by the API that have been acknowledged by the - developer. + Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). - `ID string` - The ID of the pending safety check. + The identifier, which can be referenced in API endpoints. - - `Code string` + - `CreatedAt int64` - The type of the pending safety check. + The Unix timestamp (in seconds) for when the thread was created. - - `Message string` + - `Metadata Metadata` - Details about the pending safety check. + 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. - - `Agent BetaResponseComputerToolCallOutputItemAgent` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - The agent that produced this item. + - `Object Thread` - - `AgentName string` + The object type, which is always `thread`. - The canonical name of the agent that produced this item. + - `const ThreadThread Thread = "thread"` - - `CreatedBy string` + - `ToolResources ThreadToolResources` - The identifier of the actor that created the item. + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `type BetaResponseFunctionWebSearch struct{…}` + - `CodeInterpreter ThreadToolResourcesCodeInterpreter` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `FileIDs []string` - - `ID string` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - The unique ID of the web search tool call. + - `FileSearch ThreadToolResourcesFileSearch` - - `Action BetaResponseFunctionWebSearchActionUnion` + - `VectorStoreIDs []string` - 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). + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `Event ThreadCreated` - Action type "search" - Performs a web search query. + - `const ThreadCreatedThreadCreated ThreadCreated = "thread.created"` - - `Type Search` + - `Enabled bool` - The action type. + Whether to enable input audio transcription. - - `const SearchSearch Search = "search"` +# Threads - - `Queries []string` +## Create thread - The search queries. +`client.Beta.Threads.New(ctx, body) (*Thread, error)` - - `Query string` +**post** `/threads` - The search query. +Create a thread. - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` +### Parameters - The sources used in the search. +- `body BetaThreadNewParams` - - `Type URL` + - `Messages param.Field[[]BetaThreadNewParamsMessage]` - The type of source. Always `url`. + A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. - - `const URLURL URL = "url"` + - `Content BetaThreadNewParamsMessageContentUnion` - - `URL string` + The text contents of the message. - The URL of the source. + - `string` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + - `type BetaThreadNewParamsMessageContentArrayOfContentParts []MessageContentPartParamUnionResp` - Action type "open_page" - Opens a specific URL from search results. + An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](https://platform.openai.com/docs/models). - - `Type OpenPage` + - `type ImageFileContentBlock struct{…}` - The action type. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `const OpenPageOpenPage OpenPage = "open_page"` + - `ImageFile ImageFile` - - `URL string` + - `FileID string` - The URL opened by the model. + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `Detail ImageFileDetail` - Action type "find_in_page": Searches for a pattern within a loaded page. + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `Pattern string` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - The pattern or text to search for within the page. + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `Type FindInPage` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - The action type. + - `Type ImageFile` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + Always `image_file`. - - `URL string` + - `const ImageFileImageFile ImageFile = "image_file"` - The URL of the page searched for the pattern. + - `type ImageURLContentBlock struct{…}` - - `Status BetaResponseFunctionWebSearchStatus` + References an image URL in the content of a message. - The status of the web search tool call. + - `ImageURL ImageURL` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `URL string` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `Detail ImageURLDetail` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `Type WebSearchCall` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - The type of the web search tool call. Always `web_search_call`. + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `Agent BetaResponseFunctionWebSearchAgent` + - `Type ImageURL` - The agent that produced this item. + The type of the content part. - - `AgentName string` + - `const ImageURLImageURL ImageURL = "image_url"` - The canonical name of the agent that produced this item. + - `type TextContentBlockParam struct{…}` - - `type BetaResponseFunctionToolCallItem struct{…}` + The text content that is part of a message. - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `Text string` - - `ID string` + Text content to be sent to the model - The unique ID of the function tool call. + - `Type Text` - - `Status string` + Always `text`. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const TextText Text = "text"` - - `const BetaResponseFunctionToolCallItemStatusInProgress BetaResponseFunctionToolCallItemStatus = "in_progress"` + - `Role string` - - `const BetaResponseFunctionToolCallItemStatusCompleted BetaResponseFunctionToolCallItemStatus = "completed"` + The role of the entity that is creating the message. Allowed values include: - - `const BetaResponseFunctionToolCallItemStatusIncomplete BetaResponseFunctionToolCallItemStatus = "incomplete"` + - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - `CreatedBy string` + - `const BetaThreadNewParamsMessageRoleUser BetaThreadNewParamsMessageRole = "user"` - The identifier of the actor that created the item. + - `const BetaThreadNewParamsMessageRoleAssistant BetaThreadNewParamsMessageRole = "assistant"` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `Attachments []BetaThreadNewParamsMessageAttachment` - - `ID string` + A list of files attached to the message, and the tools they should be added to. - The unique ID of the function call tool output. + - `FileID string` - - `CallID string` + The ID of the file to attach to the message. - The unique ID of the function tool call generated by the model. + - `Tools []BetaThreadNewParamsMessageAttachmentToolUnion` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + The tools to add this file to. - The output from the function call generated by your code. - Can be a string or an list of output content. + - `type CodeInterpreterTool struct{…}` - - `string` + - `Type CodeInterpreter` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + The type of tool being defined: `code_interpreter` - Text, image, or file output of the function call. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `type BetaResponseInputText struct{…}` + - `type BetaThreadNewParamsMessageAttachmentToolFileSearch struct{…}` - A text input to the model. + - `Type FileSearch` - - `type BetaResponseInputImage struct{…}` + The type of tool being defined: `file_search` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type BetaResponseInputFile struct{…}` + - `Metadata Metadata` - A file input to the model. + 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. - - `Status BetaResponseFunctionToolCallOutputItemStatus` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Metadata param.Field[Metadata]` - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + 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. - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `ToolResources param.Field[BetaThreadNewParamsToolResources]` - - `Type FunctionCallOutput` + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - The type of the function tool call output. Always `function_call_output`. + - `CodeInterpreter BetaThreadNewParamsToolResourcesCodeInterpreter` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `FileIDs []string` - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - The agent that produced this item. + - `FileSearch BetaThreadNewParamsToolResourcesFileSearch` - - `AgentName string` + - `VectorStoreIDs []string` - The canonical name of the agent that produced this item. + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `VectorStores []BetaThreadNewParamsToolResourcesFileSearchVectorStore` - The execution context that produced this tool call. + A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this thread. There can be a maximum of 1 vector store attached to the thread. - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `ChunkingStrategy BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyUnion` - - `Type Direct` + The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - The caller type. Always `direct`. + - `type BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyAuto struct{…}` - - `const DirectDirect Direct = "direct"` + The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + - `Type Auto` - - `CallerID string` + Always `auto`. - The call ID of the program item that produced this tool call. + - `const AutoAuto Auto = "auto"` - - `Type Program` + - `type BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyStatic struct{…}` - The caller type. Always `program`. + - `Static BetaThreadNewParamsToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic` - - `const ProgramProgram Program = "program"` + - `ChunkOverlapTokens int64` - - `CreatedBy string` + The number of tokens that overlap between chunks. The default value is `400`. - The identifier of the actor that created the item. + Note that the overlap must not exceed half of `max_chunk_size_tokens`. - - `type BetaResponseItemAgentMessage struct{…}` + - `MaxChunkSizeTokens int64` - - `ID string` + The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. - The unique ID of the agent message. + - `Type Static` - - `Author string` + Always `static`. - The sending agent identity. + - `const StaticStatic Static = "static"` - - `Content []BetaResponseItemAgentMessageContentUnion` + - `FileIDs []string` - Encrypted content sent between agents. + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. - - `type BetaResponseInputText struct{…}` + - `Metadata Metadata` - A text input to the model. + 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. - - `type BetaResponseOutputText struct{…}` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - A text output from the model. +### Returns - - `type BetaResponseItemAgentMessageContentText struct{…}` +- `type Thread struct{…}` - A text content. + Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). - - `Text string` + - `ID string` - - `Type Text` + The identifier, which can be referenced in API endpoints. - - `const TextText Text = "text"` + - `CreatedAt int64` - - `type BetaResponseItemAgentMessageContentSummaryText struct{…}` + The Unix timestamp (in seconds) for when the thread was created. - A summary text from the model. + - `Metadata Metadata` - - `Text string` + 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. - A summary of the reasoning output from the model so far. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `Type SummaryText` + - `Object Thread` - The type of the object. Always `summary_text`. + The object type, which is always `thread`. - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `const ThreadThread Thread = "thread"` - - `type BetaResponseItemAgentMessageContentReasoningText struct{…}` + - `ToolResources ThreadToolResources` - Reasoning text from the model. + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `Text string` + - `CodeInterpreter ThreadToolResourcesCodeInterpreter` - The reasoning text from the model. + - `FileIDs []string` - - `Type ReasoningText` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - The type of the reasoning text. Always `reasoning_text`. + - `FileSearch ThreadToolResourcesFileSearch` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + - `VectorStoreIDs []string` - - `type BetaResponseOutputRefusal struct{…}` + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - A refusal from the model. +### Example - - `type BetaResponseInputImage struct{…}` +```go +package main - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). +import ( + "context" + "fmt" - - `type BetaResponseItemAgentMessageContentComputerScreenshot struct{…}` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - A screenshot of a computer. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + thread, err := client.Beta.Threads.New(context.TODO(), openai.BetaThreadNewParams{ - - `Detail string` + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", thread.ID) +} +``` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. +#### Response - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailLow BetaResponseItemAgentMessageContentComputerScreenshotDetail = "low"` +```json +{ + "id": "id", + "created_at": 0, + "metadata": { + "foo": "string" + }, + "object": "thread", + "tool_resources": { + "code_interpreter": { + "file_ids": [ + "string" + ] + }, + "file_search": { + "vector_store_ids": [ + "string" + ] + } + } +} +``` - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseItemAgentMessageContentComputerScreenshotDetail = "high"` +## Create thread and run - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseItemAgentMessageContentComputerScreenshotDetail = "auto"` +`client.Beta.Threads.NewAndRun(ctx, body) (*Run, error)` - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseItemAgentMessageContentComputerScreenshotDetail = "original"` +**post** `/threads/runs` - - `FileID string` +Create a thread and run it in one request. - The identifier of an uploaded file that contains the screenshot. +### Parameters - - `ImageURL string` +- `body BetaThreadNewAndRunParams` - The URL of the screenshot image. + - `AssistantID param.Field[string]` - - `Type ComputerScreenshot` + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `Instructions param.Field[string]` - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. - - `PromptCacheBreakpoint BetaResponseItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + - `MaxCompletionTokens param.Field[int64]` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - - `Mode Explicit` + - `MaxPromptTokens param.Field[int64]` - The breakpoint mode. Always `explicit`. + The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - - `const ExplicitExplicit Explicit = "explicit"` + - `Metadata param.Field[Metadata]` - - `type BetaResponseInputFile struct{…}` + 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. - A file input to the model. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `type BetaResponseItemAgentMessageContentEncryptedContent struct{…}` + - `Model param.Field[ChatModel]` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - - `EncryptedContent string` + - `string` - Opaque encrypted content. + - `type ChatModel string` - - `Type EncryptedContent` + - `const ChatModelGPT5_6Sol ChatModel = "gpt-5.6-sol"` - The type of the input item. Always `encrypted_content`. + - `const ChatModelGPT5_6Terra ChatModel = "gpt-5.6-terra"` - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `const ChatModelGPT5_6Luna ChatModel = "gpt-5.6-luna"` - - `Recipient string` + - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"` + + - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"` + + - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"` - The destination agent identity. + - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"` - - `Type AgentMessage` + - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"` - The type of the item. Always `agent_message`. + - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"` - - `Agent BetaResponseItemAgentMessageAgent` + - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"` - The agent that produced this item. + - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"` - - `AgentName string` + - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"` - The canonical name of the agent that produced this item. + - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"` - - `type BetaResponseItemMultiAgentCall struct{…}` + - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"` - - `ID string` + - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"` - The unique ID of the multi-agent call item. + - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"` - - `Action string` + - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"` - The multi-agent action to execute. + - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"` - - `const BetaResponseItemMultiAgentCallActionSpawnAgent BetaResponseItemMultiAgentCallAction = "spawn_agent"` + - `const ChatModelGPT5 ChatModel = "gpt-5"` - - `const BetaResponseItemMultiAgentCallActionInterruptAgent BetaResponseItemMultiAgentCallAction = "interrupt_agent"` + - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"` - - `const BetaResponseItemMultiAgentCallActionListAgents BetaResponseItemMultiAgentCallAction = "list_agents"` + - `const ChatModelGPT5Nano ChatModel = "gpt-5-nano"` - - `const BetaResponseItemMultiAgentCallActionSendMessage BetaResponseItemMultiAgentCallAction = "send_message"` + - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"` - - `const BetaResponseItemMultiAgentCallActionFollowupTask BetaResponseItemMultiAgentCallAction = "followup_task"` + - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"` - - `const BetaResponseItemMultiAgentCallActionWaitAgent BetaResponseItemMultiAgentCallAction = "wait_agent"` + - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"` - - `Arguments string` + - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"` - The JSON string of arguments generated for the action. + - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"` - - `CallID string` + - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"` - The unique ID linking this call to its output. + - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"` - - `Type MultiAgentCall` + - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"` - The type of the multi-agent call. Always `multi_agent_call`. + - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"` - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"` - - `Agent BetaResponseItemMultiAgentCallAgent` + - `const ChatModelO4Mini ChatModel = "o4-mini"` - The agent that produced this item. + - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"` - - `AgentName string` + - `const ChatModelO3 ChatModel = "o3"` - The canonical name of the agent that produced this item. + - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"` - - `type BetaResponseItemMultiAgentCallOutput struct{…}` + - `const ChatModelO3Mini ChatModel = "o3-mini"` - - `ID string` + - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"` - The unique ID of the multi-agent call output item. + - `const ChatModelO1 ChatModel = "o1"` - - `Action string` + - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"` - The multi-agent action that produced this result. + - `const ChatModelO1Preview ChatModel = "o1-preview"` - - `const BetaResponseItemMultiAgentCallOutputActionSpawnAgent BetaResponseItemMultiAgentCallOutputAction = "spawn_agent"` + - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"` - - `const BetaResponseItemMultiAgentCallOutputActionInterruptAgent BetaResponseItemMultiAgentCallOutputAction = "interrupt_agent"` + - `const ChatModelO1Mini ChatModel = "o1-mini"` - - `const BetaResponseItemMultiAgentCallOutputActionListAgents BetaResponseItemMultiAgentCallOutputAction = "list_agents"` + - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"` - - `const BetaResponseItemMultiAgentCallOutputActionSendMessage BetaResponseItemMultiAgentCallOutputAction = "send_message"` + - `const ChatModelGPT4o ChatModel = "gpt-4o"` - - `const BetaResponseItemMultiAgentCallOutputActionFollowupTask BetaResponseItemMultiAgentCallOutputAction = "followup_task"` + - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"` - - `const BetaResponseItemMultiAgentCallOutputActionWaitAgent BetaResponseItemMultiAgentCallOutputAction = "wait_agent"` + - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"` - - `CallID string` + - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"` - The unique ID of the multi-agent call. + - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"` - - `Output []BetaResponseOutputText` + - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"` - Text output returned by the multi-agent action. + - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"` - The annotations of the text output. + - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"` - - `Text string` + - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"` - The text output from the model. + - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"` - - `Type OutputText` + - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"` - The type of the output text. Always `output_text`. + - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"` - - `Logprobs []BetaResponseOutputTextLogprob` + - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `Type MultiAgentCallOutput` + - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"` - The type of the multi-agent result. Always `multi_agent_call_output`. + - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"` - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"` - - `Agent BetaResponseItemMultiAgentCallOutputAgent` + - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"` - The agent that produced this item. + - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"` - - `AgentName string` + - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"` - The canonical name of the agent that produced this item. + - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"` - - `type BetaResponseToolSearchCall struct{…}` + - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"` - - `ID string` + - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"` - The unique ID of the tool search call item. + - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"` - - `Arguments any` + - `const ChatModelGPT4 ChatModel = "gpt-4"` - Arguments used for the tool search call. + - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"` - - `CallID string` + - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"` - The unique ID of the tool search call generated by the model. + - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"` - - `Execution BetaResponseToolSearchCallExecution` + - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"` - Whether tool search was executed by the server or by the client. + - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"` - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"` - - `Status BetaResponseToolSearchCallStatus` + - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"` - The status of the tool search call item that was recorded. + - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"` - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"` - - `Type ToolSearchCall` + - `ParallelToolCalls param.Field[bool]` - The type of the item. Always `tool_search_call`. + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `ResponseFormat param.Field[AssistantResponseFormatOptionUnion]` - - `Agent BetaResponseToolSearchCallAgent` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The agent that produced this item. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `AgentName string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - The canonical name of the agent that produced this item. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `CreatedBy string` + - `` - The identifier of the actor that created the item. + - `Temperature param.Field[float64]` - - `type BetaResponseToolSearchOutputItem struct{…}` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - - `ID string` + - `Thread param.Field[BetaThreadNewAndRunParamsThread]` - The unique ID of the tool search output item. + Options to create a new thread. If no thread is provided when running a + request, an empty thread will be created. - - `CallID string` + - `Messages []BetaThreadNewAndRunParamsThreadMessage` - The unique ID of the tool search call generated by the model. + A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. - - `Execution BetaResponseToolSearchOutputItemExecution` + - `Content BetaThreadNewAndRunParamsThreadMessageContentUnion` - Whether tool search was executed by the server or by the client. + The text contents of the message. - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + - `string` - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `[]MessageContentPartParamUnion` - - `Status BetaResponseToolSearchOutputItemStatus` + - `type ImageFileContentBlock struct{…}` - The status of the tool search output item that was recorded. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `ImageFile ImageFile` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `FileID string` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `Tools []BetaToolUnion` + - `Detail ImageFileDetail` - The loaded tool definitions returned by tool search. + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `type BetaFunctionTool struct{…}` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `Name string` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - The name of the function to call. + - `Type ImageFile` - - `Parameters map[string, any]` + Always `image_file`. - A JSON schema object describing the parameters of the function. + - `const ImageFileImageFile ImageFile = "image_file"` - - `Strict bool` + - `type ImageURLContentBlock struct{…}` - Whether strict parameter validation is enforced for this function tool. + References an image URL in the content of a message. - - `Type Function` + - `ImageURL ImageURL` - The type of the function tool. Always `function`. + - `URL string` - - `const FunctionFunction Function = "function"` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `AllowedCallers []string` + - `Detail ImageURLDetail` - The tool invocation context(s). + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `DeferLoading bool` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - Whether this function is deferred and loaded via tool search. + - `Type ImageURL` - - `Description string` + The type of the content part. - A description of the function. Used by the model to determine whether or not to call the function. + - `const ImageURLImageURL ImageURL = "image_url"` - - `OutputSchema map[string, any]` + - `type TextContentBlockParam struct{…}` - A JSON schema object describing the JSON value encoded in string outputs for this function. + The text content that is part of a message. - - `type BetaFileSearchTool struct{…}` + - `Text string` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + Text content to be sent to the model - - `Type FileSearch` + - `Type Text` - The type of the file search tool. Always `file_search`. + Always `text`. - - `const FileSearchFileSearch FileSearch = "file_search"` + - `const TextText Text = "text"` - - `VectorStoreIDs []string` + - `Role string` - The IDs of the vector stores to search. + The role of the entity that is creating the message. Allowed values include: - - `Filters BetaFileSearchToolFiltersUnion` + - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - A filter to apply. + - `const BetaThreadNewAndRunParamsThreadMessageRoleUser BetaThreadNewAndRunParamsThreadMessageRole = "user"` - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `const BetaThreadNewAndRunParamsThreadMessageRoleAssistant BetaThreadNewAndRunParamsThreadMessageRole = "assistant"` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `Attachments []BetaThreadNewAndRunParamsThreadMessageAttachment` - - `Key string` + A list of files attached to the message, and the tools they should be added to. - The key to compare against the value. + - `FileID string` - - `Type string` + The ID of the file to attach to the message. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `Tools []BetaThreadNewAndRunParamsThreadMessageAttachmentToolUnion` - - `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 + The tools to add this file to. - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `type CodeInterpreterTool struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `Type CodeInterpreter` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + The type of tool being defined: `code_interpreter` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + - `BetaThreadNewAndRunParamsThreadMessageAttachmentToolFileSearch` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + - `Type FileSearch` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + The type of tool being defined: `file_search` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + - `Metadata Metadata` - The value to compare against the attribute key; supports string, number, or boolean types. + 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. - - `string` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `float64` + - `Metadata Metadata` - - `bool` + 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. - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + - `ToolResources BetaThreadNewAndRunParamsThreadToolResources` - Combine multiple filters using `and` or `or`. + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + - `CodeInterpreter BetaThreadNewAndRunParamsThreadToolResourcesCodeInterpreter` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `FileIDs []string` - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `FileSearch BetaThreadNewAndRunParamsThreadToolResourcesFileSearch` - - `Key string` + - `VectorStoreIDs []string` - The key to compare against the value. + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - - `Type string` + - `VectorStores []BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStore` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this thread. There can be a maximum of 1 vector store attached to the thread. - - `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 + - `ChunkingStrategy BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyUnion` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + - `BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `Type Auto` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + Always `auto`. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `const AutoAuto Auto = "auto"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + - `BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `Static BetaThreadNewAndRunParamsThreadToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `ChunkOverlapTokens int64` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + The number of tokens that overlap between chunks. The default value is `400`. - The value to compare against the attribute key; supports string, number, or boolean types. + Note that the overlap must not exceed half of `max_chunk_size_tokens`. - - `string` + - `MaxChunkSizeTokens int64` - - `float64` + The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. - - `bool` + - `Type Static` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + Always `static`. - - `Type string` + - `const StaticStatic Static = "static"` - Type of operation: `and` or `or`. + - `FileIDs []string` - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to add to the vector store. For vector stores created before Nov 2025, there can be a maximum of 10,000 files in a vector store. For vector stores created starting in Nov 2025, the limit is 100,000,000 files. - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + - `Metadata Metadata` - - `MaxNumResults int64` + 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. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `RankingOptions BetaFileSearchToolRankingOptions` + - `ToolChoice param.Field[AssistantToolChoiceOptionUnion]` - Ranking options for search. + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `ToolResources param.Field[BetaThreadNewAndRunParamsToolResources]` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `EmbeddingWeight float64` + - `CodeInterpreter BetaThreadNewAndRunParamsToolResourcesCodeInterpreter` - The weight of the embedding in the reciprocal ranking fusion. + - `FileIDs []string` - - `TextWeight float64` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - The weight of the text in the reciprocal ranking fusion. + - `FileSearch BetaThreadNewAndRunParamsToolResourcesFileSearch` - - `Ranker string` + - `VectorStoreIDs []string` - The ranker to use for the file search. + The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + - `Tools param.Field[[]AssistantToolUnion]` - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - - `ScoreThreshold float64` + - `type CodeInterpreterTool struct{…}` - 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 FileSearchTool struct{…}` - - `type BetaComputerTool struct{…}` + - `Type FileSearch` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The type of tool being defined: `file_search` - - `Type Computer` + - `const FileSearchFileSearch FileSearch = "file_search"` - The type of the computer tool. Always `computer`. + - `FileSearch FileSearchToolFileSearch` - - `const ComputerComputer Computer = "computer"` + Overrides for the file search tool. - - `type BetaComputerUsePreviewTool struct{…}` + - `MaxNumResults int64` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `DisplayHeight int64` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - The height of the computer display. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `DisplayWidth int64` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - The width of the computer display. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `Environment BetaComputerUsePreviewToolEnvironment` + - `ScoreThreshold float64` - The type of computer environment to control. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + - `Ranker string` - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + - `type FunctionTool struct{…}` - - `Type ComputerUsePreview` + - `Function FunctionDefinition` - The type of the computer use tool. Always `computer_use_preview`. + - `Name string` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `type BetaWebSearchTool struct{…}` + - `Description string` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + A description of what the function does, used by the model to choose when and how to call the function. - - `Type BetaWebSearchToolType` + - `Parameters FunctionParameters` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + Omitting `parameters` defines a function with an empty parameter list. - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `Strict bool` - - `Filters BetaWebSearchToolFilters` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - Filters for the search. + - `Type Function` - - `AllowedDomains []string` + The type of tool being defined: `function` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `const FunctionFunction Function = "function"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `TopP param.Field[float64]` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - 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. + We generally recommend altering this or temperature but not both. - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `TruncationStrategy param.Field[BetaThreadNewAndRunParamsTruncationStrategy]` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `Type string` - - `UserLocation BetaWebSearchToolUserLocation` + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - The approximate location of the user. + - `const BetaThreadNewAndRunParamsTruncationStrategyTypeAuto BetaThreadNewAndRunParamsTruncationStrategyType = "auto"` - - `City string` + - `const BetaThreadNewAndRunParamsTruncationStrategyTypeLastMessages BetaThreadNewAndRunParamsTruncationStrategyType = "last_messages"` - Free text input for the city of the user, e.g. `San Francisco`. + - `LastMessages int64` - - `Country string` + The number of most recent messages from the thread when constructing the context for the run. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. +### Returns - - `Region string` +- `type Run struct{…}` - Free text input for the region of the user, e.g. `California`. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `Timezone string` + - `ID string` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + The identifier, which can be referenced in API endpoints. - - `Type string` + - `AssistantID string` - The type of location approximation. Always `approximate`. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `CancelledAt int64` - - `type BetaToolMcp struct{…}` + The Unix timestamp (in seconds) for when the run was cancelled. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `CompletedAt int64` - - `ServerLabel string` + The Unix timestamp (in seconds) for when the run was completed. - A label for this MCP server, used to identify it in tool calls. + - `CreatedAt int64` - - `Type Mcp` + The Unix timestamp (in seconds) for when the run was created. - The type of the MCP tool. Always `mcp`. + - `ExpiresAt int64` - - `const McpMcp Mcp = "mcp"` + The Unix timestamp (in seconds) for when the run will expire. - - `AllowedCallers []string` + - `FailedAt int64` - The tool invocation context(s). + The Unix timestamp (in seconds) for when the run failed. - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + - `IncompleteDetails RunIncompleteDetails` - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `Reason string` - List of allowed tool names or a filter object. + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - A string array of allowed tool names + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `Instructions string` - A filter object to specify which tools are allowed. + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `ReadOnly bool` + - `LastError RunLastError` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The last error associated with this run. Will be `null` if there are no errors. - - `ToolNames []string` + - `Code string` - List of allowed tool names. + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - `Authorization string` + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - 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. + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - - `ConnectorID string` + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `Message string` - Currently supported `connector_id` values are: + A human-readable description of the error. - - 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` + - `MaxCompletionTokens int64` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + The maximum number of completion tokens specified to have been used over the course of the run. - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + - `MaxPromptTokens int64` - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + The maximum number of prompt tokens specified to have been used over the course of the run. - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + - `Metadata Metadata` - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + 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. - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `Model string` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `DeferLoading bool` + - `Object ThreadRun` - Whether this MCP tool is deferred and discovered via tool search. + The object type, which is always `thread.run`. - - `Headers map[string, string]` + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `ParallelToolCalls bool` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - Specify which of the MCP server's tools require approval. + - `RequiredAction RunRequiredAction` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + Details on the action required to continue the run. Will be `null` if no action is required. - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + Details on the tool outputs needed for this run to continue. - A filter object to specify which tools are allowed. + - `ToolCalls []RequiredActionFunctionToolCall` - - `ReadOnly bool` + A list of the relevant tool calls. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `ID string` - - `ToolNames []string` + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - List of allowed tool names. + - `Function RequiredActionFunctionToolCallFunction` - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + The function definition. - A filter object to specify which tools are allowed. + - `Arguments string` - - `ReadOnly bool` + The arguments that the model expects you to pass to the function. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Name string` - - `ToolNames []string` + The name of the function. - List of allowed tool names. + - `Type Function` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + The type of tool call the output is required for. For now, this is always `function`. - 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 FunctionFunction Function = "function"` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `Type SubmitToolOutputs` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + For now, this is always `submit_tool_outputs`. - - `ServerDescription string` + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - Optional description of the MCP server, used to provide more context. + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `ServerURL string` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `TunnelID string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - 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. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `type BetaToolCodeInterpreter struct{…}` + - `type Auto string` - A tool that runs Python code to help generate a response to a prompt. + `auto` is the default value - - `Container BetaToolCodeInterpreterContainerUnion` + - `const AutoAuto Auto = "auto"` - 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. + - `type ResponseFormatText struct{…}` - - `string` + Default response format. Used to generate text responses. - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + - `Type Text` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + The type of response format being defined. Always `text`. - - `Type Auto` + - `const TextText Text = "text"` - Always `auto`. + - `type ResponseFormatJSONObject struct{…}` - - `const AutoAuto Auto = "auto"` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `FileIDs []string` + - `Type JSONObject` - An optional list of uploaded files to make available to your code. + The type of response format being defined. Always `json_object`. - - `MemoryLimit string` + - `const JSONObjectJSONObject JSONObject = "json_object"` - The memory limit for the code interpreter container. + - `type ResponseFormatJSONSchema struct{…}` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + Structured Outputs configuration options, including a JSON Schema. - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `Name string` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - Network access policy for the container. + - `Description string` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `Type Disabled` + - `Schema map[string, any]` - Disable outbound network access. Always `disabled`. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `const DisabledDisabled Disabled = "disabled"` + - `Strict bool` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `AllowedDomains []string` + - `Type JSONSchema` - A list of allowed domains when type is `allowlist`. + The type of response format being defined. Always `json_schema`. - - `Type Allowlist` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - Allow outbound network access only to specified domains. Always `allowlist`. + - `StartedAt int64` - - `const AllowlistAllowlist Allowlist = "allowlist"` + The Unix timestamp (in seconds) for when the run was started. - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + - `Status RunStatus` - Optional domain-scoped secrets for allowlisted domains. + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - `Domain string` + - `const RunStatusQueued RunStatus = "queued"` - The domain associated with the secret. + - `const RunStatusInProgress RunStatus = "in_progress"` - - `Name string` + - `const RunStatusRequiresAction RunStatus = "requires_action"` - The name of the secret to inject for the domain. + - `const RunStatusCancelling RunStatus = "cancelling"` - - `Value string` + - `const RunStatusCancelled RunStatus = "cancelled"` - The secret value to inject for the domain. + - `const RunStatusFailed RunStatus = "failed"` - - `Type CodeInterpreter` + - `const RunStatusCompleted RunStatus = "completed"` - The type of the code interpreter tool. Always `code_interpreter`. + - `const RunStatusIncomplete RunStatus = "incomplete"` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `const RunStatusExpired RunStatus = "expired"` - - `AllowedCallers []string` + - `ThreadID string` - The tool invocation context(s). + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `ToolChoice AssistantToolChoiceOptionUnion` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `type AssistantToolChoiceOptionAuto string` - - `Type ProgrammaticToolCalling` + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - The type of the tool. Always `programmatic_tool_calling`. + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - - `type BetaToolImageGeneration struct{…}` + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - A tool that generates images using the GPT image models. + - `type AssistantToolChoice struct{…}` - - `Type ImageGeneration` + Specifies a tool the model should use. Use to force the model to call a specific tool. - The type of the image generation tool. Always `image_generation`. + - `Type AssistantToolChoiceType` - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + The type of the tool. If type is `function`, the function name must be set - - `Action string` + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - Whether to generate a new image or edit an existing image. Default: `auto`. + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `Function AssistantToolChoiceFunction` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + - `Name string` - - `Background string` + The name of the function to call. - 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. + - `Tools []AssistantToolUnion` - `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. + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + - `type CodeInterpreterTool struct{…}` - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `Type CodeInterpreter` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + The type of tool being defined: `code_interpreter` - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `InputFidelity string` + - `type FileSearchTool struct{…}` - 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`. + - `Type FileSearch` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + The type of tool being defined: `file_search` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `FileSearch FileSearchToolFileSearch` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + Overrides for the file search tool. - - `FileID string` + - `MaxNumResults int64` - File ID for the mask image. + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `ImageURL string` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - Base64-encoded mask image. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `Model string` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - The image generation model to use. Default: `gpt-image-1`. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `string` + - `ScoreThreshold float64` - - `string` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + - `Ranker string` - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + - `type FunctionTool struct{…}` - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `Function FunctionDefinition` - - `Moderation string` + - `Name string` - Moderation level for the generated image. Default: `auto`. + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `Description string` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + A description of what the function does, used by the model to choose when and how to call the function. - - `OutputCompression int64` + - `Parameters FunctionParameters` - Compression level for the output image. Default: 100. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `OutputFormat string` + Omitting `parameters` defines a function with an empty parameter list. - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `Strict bool` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + - `Type Function` - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + The type of tool being defined: `function` - - `PartialImages int64` + - `const FunctionFunction Function = "function"` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `TruncationStrategy RunTruncationStrategy` - - `Quality string` + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `Type string` - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + - `LastMessages int64` - - `Size string` + The number of most recent messages from the thread when constructing the context for the run. - 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`. + - `Usage RunUsage` - - `string` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - `string` + - `CompletionTokens int64` - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + Number of completion tokens used over the course of the run. - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + - `PromptTokens int64` - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + Number of prompt tokens used over the course of the run. - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + - `TotalTokens int64` - - `type BetaToolLocalShell struct{…}` + Total number of tokens used (prompt + completion). - A tool that allows the model to execute shell commands in a local environment. + - `Temperature float64` - - `Type LocalShell` + The sampling temperature used for this run. If not set, defaults to 1. - The type of the local shell tool. Always `local_shell`. + - `TopP float64` - - `const LocalShellLocalShell LocalShell = "local_shell"` + The nucleus sampling value used for this run. If not set, defaults to 1. - - `type BetaFunctionShellTool struct{…}` +### Example - A tool that allows the model to execute shell commands. +```go +package main - - `Type Shell` +import ( + "context" + "fmt" - The type of the shell tool. Always `shell`. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `const ShellShell Shell = "shell"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + run, err := client.Beta.Threads.NewAndRun(context.TODO(), openai.BetaThreadNewAndRunParams{ + AssistantID: "assistant_id", + }) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", run.ID) +} +``` - - `AllowedCallers []string` +#### Response - The tool invocation context(s). +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expires_at": 0, + "failed_at": 0, + "incomplete_details": { + "reason": "max_completion_tokens" + }, + "instructions": "instructions", + "last_error": { + "code": "server_error", + "message": "message" + }, + "max_completion_tokens": 256, + "max_prompt_tokens": 256, + "metadata": { + "foo": "string" + }, + "model": "model", + "object": "thread.run", + "parallel_tool_calls": true, + "required_action": { + "submit_tool_outputs": { + "tool_calls": [ + { + "id": "id", + "function": { + "arguments": "arguments", + "name": "name" + }, + "type": "function" + } + ] + }, + "type": "submit_tool_outputs" + }, + "response_format": "auto", + "started_at": 0, + "status": "queued", + "thread_id": "thread_id", + "tool_choice": "none", + "tools": [ + { + "type": "code_interpreter" + } + ], + "truncation_strategy": { + "type": "auto", + "last_messages": 1 + }, + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + }, + "temperature": 0, + "top_p": 0 +} +``` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` +## Retrieve thread - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` +`client.Beta.Threads.Get(ctx, threadID) (*Thread, error)` - - `Environment BetaFunctionShellToolEnvironmentUnion` +**get** `/threads/{thread_id}` - - `type BetaContainerAuto struct{…}` +Retrieves a thread. - - `Type ContainerAuto` +### Parameters - Automatically creates a container for this request +- `threadID string` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` +### Returns - - `FileIDs []string` +- `type Thread struct{…}` - An optional list of uploaded files to make available to your code. + Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `ID string` - The memory limit for the container. + The identifier, which can be referenced in API endpoints. - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `CreatedAt int64` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + The Unix timestamp (in seconds) for when the thread was created. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `Metadata Metadata` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + 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. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - Network access policy for the container. + - `Object Thread` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + The object type, which is always `thread`. - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `const ThreadThread Thread = "thread"` - - `Skills []BetaContainerAutoSkillUnion` + - `ToolResources ThreadToolResources` - An optional list of skills referenced by id or inline data. + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `type BetaSkillReference struct{…}` + - `CodeInterpreter ThreadToolResourcesCodeInterpreter` - - `SkillID string` + - `FileIDs []string` - The ID of the referenced skill. + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - `Type SkillReference` + - `FileSearch ThreadToolResourcesFileSearch` - References a skill created with the /v1/skills endpoint. + - `VectorStoreIDs []string` - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - - `Version string` +### Example - Optional skill version. Use a positive integer or 'latest'. Omit for default. +```go +package main - - `type BetaInlineSkill struct{…}` +import ( + "context" + "fmt" - - `Description string` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The description of the skill. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + thread, err := client.Beta.Threads.Get(context.TODO(), "thread_id") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", thread.ID) +} +``` - - `Name string` +#### Response - The name of the skill. +```json +{ + "id": "id", + "created_at": 0, + "metadata": { + "foo": "string" + }, + "object": "thread", + "tool_resources": { + "code_interpreter": { + "file_ids": [ + "string" + ] + }, + "file_search": { + "vector_store_ids": [ + "string" + ] + } + } +} +``` - - `Source BetaInlineSkillSource` +## Modify thread - Inline skill payload +`client.Beta.Threads.Update(ctx, threadID, body) (*Thread, error)` - - `Data string` +**post** `/threads/{thread_id}` - Base64-encoded skill zip bundle. +Modifies a thread. - - `MediaType ApplicationZip` +### Parameters - The media type of the inline skill payload. Must be `application/zip`. +- `threadID string` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` +- `body BetaThreadUpdateParams` - - `Type Base64` + - `Metadata param.Field[Metadata]` - The type of the inline skill source. Must be `base64`. + 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. - - `const Base64Base64 Base64 = "base64"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `Type Inline` + - `ToolResources param.Field[BetaThreadUpdateParamsToolResources]` - Defines an inline skill for this request. + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `const InlineInline Inline = "inline"` + - `CodeInterpreter BetaThreadUpdateParamsToolResourcesCodeInterpreter` - - `type BetaLocalEnvironment struct{…}` + - `FileIDs []string` - - `Type Local` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - Use a local computer environment. + - `FileSearch BetaThreadUpdateParamsToolResourcesFileSearch` - - `const LocalLocal Local = "local"` + - `VectorStoreIDs []string` - - `Skills []BetaLocalSkill` + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - An optional list of skills. +### Returns - - `Description string` +- `type Thread struct{…}` - The description of the skill. + Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). - - `Name string` + - `ID string` - The name of the skill. + The identifier, which can be referenced in API endpoints. - - `Path string` + - `CreatedAt int64` - The path to the directory containing the skill. + The Unix timestamp (in seconds) for when the thread was created. - - `type BetaContainerReference struct{…}` + - `Metadata Metadata` - - `ContainerID string` + 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. - The ID of the referenced container. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `Type ContainerReference` + - `Object Thread` - References a container created with the /v1/containers endpoint + The object type, which is always `thread`. - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `const ThreadThread Thread = "thread"` - - `type BetaCustomTool struct{…}` + - `ToolResources ThreadToolResources` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `Name string` + - `CodeInterpreter ThreadToolResourcesCodeInterpreter` - The name of the custom tool, used to identify it in tool calls. + - `FileIDs []string` - - `Type Custom` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - The type of the custom tool. Always `custom`. + - `FileSearch ThreadToolResourcesFileSearch` - - `const CustomCustom Custom = "custom"` + - `VectorStoreIDs []string` - - `AllowedCallers []string` + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - The tool invocation context(s). +### Example - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` +```go +package main - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` +import ( + "context" + "fmt" - - `DeferLoading bool` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - Whether this tool should be deferred and discovered via tool search. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + thread, err := client.Beta.Threads.Update( + context.TODO(), + "thread_id", + openai.BetaThreadUpdateParams{ - - `Description string` + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", thread.ID) +} +``` - Optional description of the custom tool, used to provide more context. +#### Response - - `Format BetaCustomToolFormatUnion` +```json +{ + "id": "id", + "created_at": 0, + "metadata": { + "foo": "string" + }, + "object": "thread", + "tool_resources": { + "code_interpreter": { + "file_ids": [ + "string" + ] + }, + "file_search": { + "vector_store_ids": [ + "string" + ] + } + } +} +``` - The input format for the custom tool. Default is unconstrained text. +## Delete thread - - `type BetaCustomToolFormatText struct{…}` +`client.Beta.Threads.Delete(ctx, threadID) (*ThreadDeleted, error)` - Unconstrained free-form text. +**delete** `/threads/{thread_id}` - - `Type Text` +Delete a thread. - Unconstrained text format. Always `text`. +### Parameters - - `const TextText Text = "text"` +- `threadID string` - - `type BetaCustomToolFormatGrammar struct{…}` +### Returns - A grammar defined by the user. +- `type ThreadDeleted struct{…}` - - `Definition string` + - `ID string` - The grammar definition. + - `Deleted bool` - - `Syntax string` + - `Object ThreadDeleted` - The syntax of the grammar definition. One of `lark` or `regex`. + - `const ThreadDeletedThreadDeleted ThreadDeleted = "thread.deleted"` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` +### Example - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` +```go +package main - - `Type Grammar` +import ( + "context" + "fmt" - Grammar format. Always `grammar`. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `const GrammarGrammar Grammar = "grammar"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + threadDeleted, err := client.Beta.Threads.Delete(context.TODO(), "thread_id") + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", threadDeleted.ID) +} +``` - - `type BetaNamespaceTool struct{…}` +#### Response - Groups function/custom tools under a shared namespace. +```json +{ + "id": "id", + "deleted": true, + "object": "thread.deleted" +} +``` - - `Description string` +## Domain Types - A description of the namespace shown to the model. +### Assistant Response Format Option - - `Name string` +- `type AssistantResponseFormatOptionUnion interface{…}` - The namespace name used in tool calls (for example, `crm`). + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `Tools []BetaNamespaceToolToolUnion` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The function/custom tools available inside this namespace. + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `type BetaNamespaceToolToolFunction struct{…}` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `Name string` + - `type Auto string` - - `Type Function` + `auto` is the default value - - `const FunctionFunction Function = "function"` + - `const AutoAuto Auto = "auto"` - - `AllowedCallers []string` + - `type ResponseFormatText struct{…}` - The tool invocation context(s). + Default response format. Used to generate text responses. - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + - `Type Text` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + The type of response format being defined. Always `text`. - - `DeferLoading bool` + - `const TextText Text = "text"` - Whether this function should be deferred and discovered via tool search. + - `type ResponseFormatJSONObject struct{…}` - - `Description string` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `OutputSchema map[string, any]` + - `Type JSONObject` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + The type of response format being defined. Always `json_object`. - - `Parameters any` + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `Strict bool` + - `type ResponseFormatJSONSchema struct{…}` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `type BetaCustomTool struct{…}` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + Structured Outputs configuration options, including a JSON Schema. - - `Type Namespace` + - `Name string` - The type of the tool. Always `namespace`. + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `const NamespaceNamespace Namespace = "namespace"` + - `Description string` - - `type BetaToolSearchTool struct{…}` + A description of what the response format is for, used by the model to + determine how to respond in the format. - Hosted or BYOT tool search configuration for deferred tools. + - `Schema map[string, any]` - - `Type ToolSearch` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - The type of the tool. Always `tool_search`. + - `Strict bool` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Description string` + - `Type JSONSchema` - Description shown to the model for a client-executed tool search tool. + The type of response format being defined. Always `json_schema`. - - `Execution BetaToolSearchToolExecution` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - Whether tool search is executed by the server or by the client. +### Assistant Tool Choice - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` +- `type AssistantToolChoice struct{…}` - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + Specifies a tool the model should use. Use to force the model to call a specific tool. - - `Parameters any` + - `Type AssistantToolChoiceType` - Parameter schema for a client-executed tool search tool. + The type of the tool. If type is `function`, the function name must be set - - `type BetaWebSearchPreviewTool struct{…}` + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - - `Type BetaWebSearchPreviewToolType` + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `Function AssistantToolChoiceFunction` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `Name string` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + The name of the function to call. - - `SearchContentTypes []string` +### Assistant Tool Choice Function - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` +- `type AssistantToolChoiceFunction struct{…}` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + - `Name string` - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + The name of the function to call. - 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. +### Assistant Tool Choice Option - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` +- `type AssistantToolChoiceOptionUnion interface{…}` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `type AssistantToolChoiceOptionAuto string` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - The user's location. + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - - `Type Approximate` + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - The type of location approximation. Always `approximate`. + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - - `const ApproximateApproximate Approximate = "approximate"` + - `type AssistantToolChoice struct{…}` - - `City string` + Specifies a tool the model should use. Use to force the model to call a specific tool. - Free text input for the city of the user, e.g. `San Francisco`. + - `Type AssistantToolChoiceType` - - `Country string` + The type of the tool. If type is `function`, the function name must be set - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - - `Region string` + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - Free text input for the region of the user, e.g. `California`. + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - - `Timezone string` + - `Function AssistantToolChoiceFunction` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `Name string` - - `type BetaApplyPatchTool struct{…}` + The name of the function to call. - Allows the assistant to create, delete, or update files using unified diffs. +### Thread - - `Type ApplyPatch` +- `type Thread struct{…}` - The type of the tool. Always `apply_patch`. + Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `ID string` - - `AllowedCallers []string` + The identifier, which can be referenced in API endpoints. - The tool invocation context(s). + - `CreatedAt int64` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + The Unix timestamp (in seconds) for when the thread was created. - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `Metadata Metadata` - - `Type ToolSearchOutput` + 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. - The type of the item. Always `tool_search_output`. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `Object Thread` - - `Agent BetaResponseToolSearchOutputItemAgent` + The object type, which is always `thread`. - The agent that produced this item. + - `const ThreadThread Thread = "thread"` - - `AgentName string` + - `ToolResources ThreadToolResources` - The canonical name of the agent that produced this item. + A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - - `CreatedBy string` + - `CodeInterpreter ThreadToolResourcesCodeInterpreter` - The identifier of the actor that created the item. + - `FileIDs []string` - - `type BetaResponseItemAdditionalTools struct{…}` + A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - - `ID string` + - `FileSearch ThreadToolResourcesFileSearch` - The unique ID of the additional tools item. + - `VectorStoreIDs []string` - - `Role string` + The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - The role that provided the additional tools. +### Thread Deleted - - `const BetaResponseItemAdditionalToolsRoleUnknown BetaResponseItemAdditionalToolsRole = "unknown"` +- `type ThreadDeleted struct{…}` - - `const BetaResponseItemAdditionalToolsRoleUser BetaResponseItemAdditionalToolsRole = "user"` + - `ID string` - - `const BetaResponseItemAdditionalToolsRoleAssistant BetaResponseItemAdditionalToolsRole = "assistant"` + - `Deleted bool` - - `const BetaResponseItemAdditionalToolsRoleSystem BetaResponseItemAdditionalToolsRole = "system"` + - `Object ThreadDeleted` - - `const BetaResponseItemAdditionalToolsRoleCritic BetaResponseItemAdditionalToolsRole = "critic"` + - `const ThreadDeletedThreadDeleted ThreadDeleted = "thread.deleted"` - - `const BetaResponseItemAdditionalToolsRoleDiscriminator BetaResponseItemAdditionalToolsRole = "discriminator"` +# Runs - - `const BetaResponseItemAdditionalToolsRoleDeveloper BetaResponseItemAdditionalToolsRole = "developer"` +## List runs - - `const BetaResponseItemAdditionalToolsRoleTool BetaResponseItemAdditionalToolsRole = "tool"` +`client.Beta.Threads.Runs.List(ctx, threadID, query) (*CursorPage[Run], error)` - - `Tools []BetaToolUnion` +**get** `/threads/{thread_id}/runs` - The additional tool definitions made available at this item. +Returns a list of runs belonging to a thread. - - `type BetaFunctionTool struct{…}` +### Parameters - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). +- `threadID string` - - `type BetaFileSearchTool struct{…}` +- `query BetaThreadRunListParams` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `After param.Field[string]` - - `type BetaComputerTool struct{…}` + A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Before param.Field[string]` - - `type BetaComputerUsePreviewTool struct{…}` + A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `Limit param.Field[int64]` - - `type BetaWebSearchTool struct{…}` + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Order param.Field[BetaThreadRunListParamsOrder]` - - `type BetaToolMcp struct{…}` + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `const BetaThreadRunListParamsOrderAsc BetaThreadRunListParamsOrder = "asc"` - - `type BetaToolCodeInterpreter struct{…}` + - `const BetaThreadRunListParamsOrderDesc BetaThreadRunListParamsOrder = "desc"` - A tool that runs Python code to help generate a response to a prompt. +### Returns - - `type BetaToolProgrammaticToolCalling struct{…}` +- `type Run struct{…}` - - `type BetaToolImageGeneration struct{…}` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - A tool that generates images using the GPT image models. + - `ID string` - - `type BetaToolLocalShell struct{…}` + The identifier, which can be referenced in API endpoints. - A tool that allows the model to execute shell commands in a local environment. + - `AssistantID string` - - `type BetaFunctionShellTool struct{…}` + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - A tool that allows the model to execute shell commands. + - `CancelledAt int64` - - `type BetaCustomTool struct{…}` + The Unix timestamp (in seconds) for when the run was cancelled. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `CompletedAt int64` - - `type BetaNamespaceTool struct{…}` + The Unix timestamp (in seconds) for when the run was completed. - Groups function/custom tools under a shared namespace. + - `CreatedAt int64` - - `type BetaToolSearchTool struct{…}` + The Unix timestamp (in seconds) for when the run was created. - Hosted or BYOT tool search configuration for deferred tools. + - `ExpiresAt int64` - - `type BetaWebSearchPreviewTool struct{…}` + The Unix timestamp (in seconds) for when the run will expire. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `FailedAt int64` - - `type BetaApplyPatchTool struct{…}` + The Unix timestamp (in seconds) for when the run failed. - Allows the assistant to create, delete, or update files using unified diffs. + - `IncompleteDetails RunIncompleteDetails` - - `Type AdditionalTools` + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - The type of the item. Always `additional_tools`. + - `Reason string` - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - `Agent BetaResponseItemAdditionalToolsAgent` + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - The agent that produced this item. + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - - `AgentName string` + - `Instructions string` - The canonical name of the agent that produced this item. + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `type BetaResponseReasoningItem struct{…}` + - `LastError RunLastError` - 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](https://platform.openai.com/docs/guides/conversation-state). + The last error associated with this run. Will be `null` if there are no errors. - - `ID string` + - `Code string` - The unique identifier of the reasoning content. + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - `Summary []BetaResponseReasoningItemSummary` + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - Reasoning summary content. + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - - `Text string` + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - A summary of the reasoning output from the model so far. + - `Message string` - - `Type SummaryText` + A human-readable description of the error. - The type of the object. Always `summary_text`. + - `MaxCompletionTokens int64` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + The maximum number of completion tokens specified to have been used over the course of the run. - - `Type Reasoning` + - `MaxPromptTokens int64` - The type of the object. Always `reasoning`. + The maximum number of prompt tokens specified to have been used over the course of the run. - - `const ReasoningReasoning Reasoning = "reasoning"` + - `Metadata Metadata` - - `Agent BetaResponseReasoningItemAgent` + 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. - The agent that produced this item. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `AgentName string` + - `Model string` - The canonical name of the agent that produced this item. + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `Content []BetaResponseReasoningItemContent` + - `Object ThreadRun` - Reasoning text content. + The object type, which is always `thread.run`. - - `Text string` + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - The reasoning text from the model. + - `ParallelToolCalls bool` - - `Type ReasoningText` + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - The type of the reasoning text. Always `reasoning_text`. + - `RequiredAction RunRequiredAction` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + Details on the action required to continue the run. Will be `null` if no action is required. - - `EncryptedContent string` + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + Details on the tool outputs needed for this run to continue. - - `Status BetaResponseReasoningItemStatus` + - `ToolCalls []RequiredActionFunctionToolCall` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + A list of the relevant tool calls. - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `ID string` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + - `Function RequiredActionFunctionToolCallFunction` - - `type BetaResponseItemProgram struct{…}` + The function definition. - - `ID string` + - `Arguments string` - The unique ID of the program item. + The arguments that the model expects you to pass to the function. - - `CallID string` + - `Name string` - The stable call ID of the program item. + The name of the function. - - `Code string` + - `Type Function` - The JavaScript source executed by programmatic tool calling. + The type of tool call the output is required for. For now, this is always `function`. - - `Fingerprint string` + - `const FunctionFunction Function = "function"` - Opaque program replay fingerprint that must be round-tripped. + - `Type SubmitToolOutputs` - - `Type Program` + For now, this is always `submit_tool_outputs`. - The type of the item. Always `program`. + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - - `const ProgramProgram Program = "program"` + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `Agent BetaResponseItemProgramAgent` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The agent that produced this item. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `AgentName string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - The canonical name of the agent that produced this item. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `type BetaResponseItemProgramOutput struct{…}` + - `type Auto string` - - `ID string` + `auto` is the default value - The unique ID of the program output item. + - `const AutoAuto Auto = "auto"` - - `CallID string` + - `type ResponseFormatText struct{…}` - The call ID of the program item. + Default response format. Used to generate text responses. - - `Result string` + - `Type Text` - The result produced by the program item. + The type of response format being defined. Always `text`. - - `Status string` + - `const TextText Text = "text"` - The terminal status of the program output item. + - `type ResponseFormatJSONObject struct{…}` - - `const BetaResponseItemProgramOutputStatusCompleted BetaResponseItemProgramOutputStatus = "completed"` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `const BetaResponseItemProgramOutputStatusIncomplete BetaResponseItemProgramOutputStatus = "incomplete"` + - `Type JSONObject` - - `Type ProgramOutput` + The type of response format being defined. Always `json_object`. - The type of the item. Always `program_output`. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `type ResponseFormatJSONSchema struct{…}` - - `Agent BetaResponseItemProgramOutputAgent` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The agent that produced this item. + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `AgentName string` + Structured Outputs configuration options, including a JSON Schema. - The canonical name of the agent that produced this item. + - `Name string` - - `type BetaResponseCompactionItem struct{…}` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `Description string` - - `ID string` + A description of what the response format is for, used by the model to + determine how to respond in the format. - The unique ID of the compaction item. + - `Schema map[string, any]` - - `EncryptedContent string` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - The encrypted content that was produced by compaction. + - `Strict bool` - - `Type Compaction` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The type of the item. Always `compaction`. + - `Type JSONSchema` - - `const CompactionCompaction Compaction = "compaction"` + The type of response format being defined. Always `json_schema`. - - `Agent BetaResponseCompactionItemAgent` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - The agent that produced this item. + - `StartedAt int64` - - `AgentName string` + The Unix timestamp (in seconds) for when the run was started. - The canonical name of the agent that produced this item. + - `Status RunStatus` - - `CreatedBy string` + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - The identifier of the actor that created the item. + - `const RunStatusQueued RunStatus = "queued"` - - `type BetaResponseItemImageGenerationCall struct{…}` + - `const RunStatusInProgress RunStatus = "in_progress"` - An image generation request made by the model. + - `const RunStatusRequiresAction RunStatus = "requires_action"` - - `ID string` + - `const RunStatusCancelling RunStatus = "cancelling"` - The unique ID of the image generation call. + - `const RunStatusCancelled RunStatus = "cancelled"` - - `Result string` + - `const RunStatusFailed RunStatus = "failed"` - The generated image encoded in base64. + - `const RunStatusCompleted RunStatus = "completed"` - - `Status string` + - `const RunStatusIncomplete RunStatus = "incomplete"` - The status of the image generation call. + - `const RunStatusExpired RunStatus = "expired"` - - `const BetaResponseItemImageGenerationCallStatusInProgress BetaResponseItemImageGenerationCallStatus = "in_progress"` + - `ThreadID string` - - `const BetaResponseItemImageGenerationCallStatusCompleted BetaResponseItemImageGenerationCallStatus = "completed"` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - - `const BetaResponseItemImageGenerationCallStatusGenerating BetaResponseItemImageGenerationCallStatus = "generating"` + - `ToolChoice AssistantToolChoiceOptionUnion` - - `const BetaResponseItemImageGenerationCallStatusFailed BetaResponseItemImageGenerationCallStatus = "failed"` + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `Type ImageGenerationCall` + - `type AssistantToolChoiceOptionAuto string` - The type of the image generation call. Always `image_generation_call`. + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - - `Agent BetaResponseItemImageGenerationCallAgent` + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - The agent that produced this item. + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - - `AgentName string` + - `type AssistantToolChoice struct{…}` - The canonical name of the agent that produced this item. + Specifies a tool the model should use. Use to force the model to call a specific tool. - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `Type AssistantToolChoiceType` - A tool call to run code. + The type of the tool. If type is `function`, the function name must be set - - `ID string` + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - The unique ID of the code interpreter tool call. + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - - `Code string` + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - The code to run, or null if not available. + - `Function AssistantToolChoiceFunction` - - `ContainerID string` + - `Name string` - The ID of the container used to run the code. + The name of the function to call. - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + - `Tools []AssistantToolUnion` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `type CodeInterpreterTool struct{…}` - The logs output from the code interpreter. + - `Type CodeInterpreter` - - `Logs string` + The type of tool being defined: `code_interpreter` - The logs output from the code interpreter. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Type Logs` + - `type FileSearchTool struct{…}` - The type of the output. Always `logs`. + - `Type FileSearch` - - `const LogsLogs Logs = "logs"` + The type of tool being defined: `file_search` - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - The image output from the code interpreter. + - `FileSearch FileSearchToolFileSearch` - - `Type Image` + Overrides for the file search tool. - The type of the output. Always `image`. + - `MaxNumResults int64` - - `const ImageImage Image = "image"` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `URL string` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - The URL of the image output from the code interpreter. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `Status BetaResponseCodeInterpreterToolCallStatus` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + - `ScoreThreshold float64` - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + - `Ranker string` - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `Type CodeInterpreterCall` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `type FunctionTool struct{…}` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + - `Function FunctionDefinition` - - `Agent BetaResponseCodeInterpreterToolCallAgent` + - `Name string` - The agent that produced this item. + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `AgentName string` + - `Description string` - The canonical name of the agent that produced this item. + A description of what the function does, used by the model to choose when and how to call the function. - - `type BetaResponseItemLocalShellCall struct{…}` + - `Parameters FunctionParameters` - A tool call to run a command on the local shell. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `ID string` + Omitting `parameters` defines a function with an empty parameter list. - The unique ID of the local shell call. + - `Strict bool` - - `Action BetaResponseItemLocalShellCallAction` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - Execute a shell command on the server. + - `Type Function` - - `Command []string` + The type of tool being defined: `function` - The command to run. + - `const FunctionFunction Function = "function"` - - `Env map[string, string]` + - `TruncationStrategy RunTruncationStrategy` - Environment variables to set for the command. + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `Type Exec` + - `Type string` - The type of the local shell action. Always `exec`. + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - `const ExecExec Exec = "exec"` + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `TimeoutMs int64` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - Optional timeout in milliseconds for the command. + - `LastMessages int64` - - `User string` + The number of most recent messages from the thread when constructing the context for the run. - Optional user to run the command as. + - `Usage RunUsage` - - `WorkingDirectory string` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - Optional working directory to run the command in. + - `CompletionTokens int64` - - `CallID string` + Number of completion tokens used over the course of the run. - The unique ID of the local shell tool call generated by the model. + - `PromptTokens int64` - - `Status string` + Number of prompt tokens used over the course of the run. - The status of the local shell call. + - `TotalTokens int64` - - `const BetaResponseItemLocalShellCallStatusInProgress BetaResponseItemLocalShellCallStatus = "in_progress"` + Total number of tokens used (prompt + completion). - - `const BetaResponseItemLocalShellCallStatusCompleted BetaResponseItemLocalShellCallStatus = "completed"` + - `Temperature float64` - - `const BetaResponseItemLocalShellCallStatusIncomplete BetaResponseItemLocalShellCallStatus = "incomplete"` + The sampling temperature used for this run. If not set, defaults to 1. - - `Type LocalShellCall` + - `TopP float64` - The type of the local shell call. Always `local_shell_call`. + The nucleus sampling value used for this run. If not set, defaults to 1. - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` +### Example - - `Agent BetaResponseItemLocalShellCallAgent` +```go +package main - The agent that produced this item. +import ( + "context" + "fmt" - - `AgentName string` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The canonical name of the agent that produced this item. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + page, err := client.Beta.Threads.Runs.List( + context.TODO(), + "thread_id", + openai.BetaThreadRunListParams{ - - `type BetaResponseItemLocalShellCallOutput struct{…}` + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - The output of a local shell tool call. +#### Response - - `ID string` +```json +{ + "data": [ + { + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expires_at": 0, + "failed_at": 0, + "incomplete_details": { + "reason": "max_completion_tokens" + }, + "instructions": "instructions", + "last_error": { + "code": "server_error", + "message": "message" + }, + "max_completion_tokens": 256, + "max_prompt_tokens": 256, + "metadata": { + "foo": "string" + }, + "model": "model", + "object": "thread.run", + "parallel_tool_calls": true, + "required_action": { + "submit_tool_outputs": { + "tool_calls": [ + { + "id": "id", + "function": { + "arguments": "arguments", + "name": "name" + }, + "type": "function" + } + ] + }, + "type": "submit_tool_outputs" + }, + "response_format": "auto", + "started_at": 0, + "status": "queued", + "thread_id": "thread_id", + "tool_choice": "none", + "tools": [ + { + "type": "code_interpreter" + } + ], + "truncation_strategy": { + "type": "auto", + "last_messages": 1 + }, + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + }, + "temperature": 0, + "top_p": 0 + } + ], + "first_id": "run_abc123", + "has_more": false, + "last_id": "run_abc456", + "object": "list" +} +``` - The unique ID of the local shell tool call generated by the model. +## Create run - - `Output string` +`client.Beta.Threads.Runs.New(ctx, threadID, params) (*Run, error)` - A JSON string of the output of the local shell tool call. +**post** `/threads/{thread_id}/runs` - - `Type LocalShellCallOutput` +Create a run. - The type of the local shell tool call output. Always `local_shell_call_output`. +### Parameters - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` +- `threadID string` - - `Agent BetaResponseItemLocalShellCallOutputAgent` +- `params BetaThreadRunNewParams` - The agent that produced this item. + - `AssistantID param.Field[string]` - - `AgentName string` + Body param: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - The canonical name of the agent that produced this item. + - `Include param.Field[[]RunStepInclude]` - - `Status string` + Query param: A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const BetaResponseItemLocalShellCallOutputStatusInProgress BetaResponseItemLocalShellCallOutputStatus = "in_progress"` + - `const RunStepIncludeStepDetailsToolCallsFileSearchResultsContent RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` - - `const BetaResponseItemLocalShellCallOutputStatusCompleted BetaResponseItemLocalShellCallOutputStatus = "completed"` + - `AdditionalInstructions param.Field[string]` - - `const BetaResponseItemLocalShellCallOutputStatusIncomplete BetaResponseItemLocalShellCallOutputStatus = "incomplete"` + Body param: Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. - - `type BetaResponseFunctionShellToolCall struct{…}` + - `AdditionalMessages param.Field[[]BetaThreadRunNewParamsAdditionalMessage]` - A tool call that executes one or more shell commands in a managed environment. + Body param: Adds additional messages to the thread before creating the run. - - `ID string` + - `Content BetaThreadRunNewParamsAdditionalMessageContentUnion` - The unique ID of the shell tool call. Populated when this item is returned via API. + The text contents of the message. - - `Action BetaResponseFunctionShellToolCallAction` + - `string` - The shell commands and limits that describe how to run the tool call. + - `[]MessageContentPartParamUnion` - - `Commands []string` + - `type ImageFileContentBlock struct{…}` - - `MaxOutputLength int64` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - Optional maximum number of characters to return from each command. + - `ImageFile ImageFile` - - `TimeoutMs int64` + - `FileID string` - Optional timeout in milliseconds for the commands. + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `CallID string` + - `Detail ImageFileDetail` - The unique ID of the shell tool call generated by the model. + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - Represents the use of a local environment to perform shell actions. + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `type BetaResponseLocalEnvironment struct{…}` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - Represents the use of a local environment to perform shell actions. + - `Type ImageFile` - - `Type Local` + Always `image_file`. - The environment type. Always `local`. + - `const ImageFileImageFile ImageFile = "image_file"` - - `const LocalLocal Local = "local"` + - `type ImageURLContentBlock struct{…}` - - `type BetaResponseContainerReference struct{…}` + References an image URL in the content of a message. - Represents a container created with /v1/containers. + - `ImageURL ImageURL` - - `ContainerID string` + - `URL string` - - `Type ContainerReference` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - The environment type. Always `container_reference`. + - `Detail ImageURLDetail` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `Status BetaResponseFunctionShellToolCallStatus` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `Type ImageURL` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + The type of the content part. - - `Type ShellCall` + - `const ImageURLImageURL ImageURL = "image_url"` - The type of the item. Always `shell_call`. + - `type TextContentBlockParam struct{…}` - - `const ShellCallShellCall ShellCall = "shell_call"` + The text content that is part of a message. - - `Agent BetaResponseFunctionShellToolCallAgent` + - `Text string` - The agent that produced this item. + Text content to be sent to the model - - `AgentName string` + - `Type Text` - The canonical name of the agent that produced this item. + Always `text`. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `const TextText Text = "text"` - The execution context that produced this tool call. + - `Role string` - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + The role of the entity that is creating the message. Allowed values include: - - `Type Direct` + - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - - `const DirectDirect Direct = "direct"` + - `const BetaThreadRunNewParamsAdditionalMessageRoleUser BetaThreadRunNewParamsAdditionalMessageRole = "user"` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + - `const BetaThreadRunNewParamsAdditionalMessageRoleAssistant BetaThreadRunNewParamsAdditionalMessageRole = "assistant"` - - `CallerID string` + - `Attachments []BetaThreadRunNewParamsAdditionalMessageAttachment` - The call ID of the program item that produced this tool call. + A list of files attached to the message, and the tools they should be added to. - - `Type Program` + - `FileID string` - - `const ProgramProgram Program = "program"` + The ID of the file to attach to the message. - - `CreatedBy string` + - `Tools []BetaThreadRunNewParamsAdditionalMessageAttachmentToolUnion` - The ID of the entity that created this tool call. + The tools to add this file to. - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `type CodeInterpreterTool struct{…}` - The output of a shell tool call that was emitted. + - `Type CodeInterpreter` - - `ID string` + The type of tool being defined: `code_interpreter` - The unique ID of the shell call output. Populated when this item is returned via API. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `CallID string` + - `BetaThreadRunNewParamsAdditionalMessageAttachmentToolFileSearch` - The unique ID of the shell tool call generated by the model. + - `Type FileSearch` - - `MaxOutputLength int64` + The type of tool being defined: `file_search` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + - `Metadata Metadata` - An array of shell call output contents + 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. - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + - `Instructions param.Field[string]` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + Body param: Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. - Indicates that the shell call exceeded its configured time limit. + - `MaxCompletionTokens param.Field[int64]` - - `Type Timeout` + Body param: The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - The outcome type. Always `timeout`. + - `MaxPromptTokens param.Field[int64]` - - `const TimeoutTimeout Timeout = "timeout"` + Body param: The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `Metadata param.Field[Metadata]` - Indicates that the shell commands finished and returned an exit code. + Body param: 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. - - `ExitCode int64` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - Exit code from the shell process. + - `Model param.Field[ChatModel]` - - `Type Exit` + Body param: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - The outcome type. Always `exit`. + - `string` - - `const ExitExit Exit = "exit"` + - `type ChatModel string` - - `Stderr string` + - `const ChatModelGPT5_6Sol ChatModel = "gpt-5.6-sol"` - The standard error output that was captured. + - `const ChatModelGPT5_6Terra ChatModel = "gpt-5.6-terra"` - - `Stdout string` + - `const ChatModelGPT5_6Luna ChatModel = "gpt-5.6-luna"` - The standard output that was captured. + - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"` - - `CreatedBy string` + - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"` - The identifier of the actor that created the item. + - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"` - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"` - - `Type ShellCallOutput` + - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"` - The type of the shell call output. Always `shell_call_output`. + - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"` - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"` - The agent that produced this item. + - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"` - - `AgentName string` + - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"` - The canonical name of the agent that produced this item. + - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"` - The execution context that produced this tool call. + - `const ChatModelGPT5 ChatModel = "gpt-5"` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"` - - `Type Direct` + - `const ChatModelGPT5Nano ChatModel = "gpt-5-nano"` - - `const DirectDirect Direct = "direct"` + - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"` - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` + - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"` - - `CallerID string` + - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"` - The call ID of the program item that produced this tool call. + - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"` - - `Type Program` + - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"` - - `const ProgramProgram Program = "program"` + - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"` - - `CreatedBy string` + - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"` - The identifier of the actor that created the item. + - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"` - - `type BetaResponseApplyPatchToolCall struct{…}` + - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"` - A tool call that applies file diffs by creating, deleting, or updating files. + - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"` - - `ID string` + - `const ChatModelO4Mini ChatModel = "o4-mini"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"` - - `CallID string` + - `const ChatModelO3 ChatModel = "o3"` - The unique ID of the apply patch tool call generated by the model. + - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"` - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + - `const ChatModelO3Mini ChatModel = "o3-mini"` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"` - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + - `const ChatModelO1 ChatModel = "o1"` - Instruction describing how to create a file via the apply_patch tool. + - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"` - - `Diff string` + - `const ChatModelO1Preview ChatModel = "o1-preview"` - Diff to apply. + - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"` - - `Path string` + - `const ChatModelO1Mini ChatModel = "o1-mini"` - Path of the file to create. + - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"` - - `Type CreateFile` + - `const ChatModelGPT4o ChatModel = "gpt-4o"` - Create a new file with the provided diff. + - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"` - - `const CreateFileCreateFile CreateFile = "create_file"` + - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"` - Instruction describing how to delete a file via the apply_patch tool. + - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"` - - `Path string` + - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"` - Path of the file to delete. + - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"` - - `Type DeleteFile` + - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"` - Delete the specified file. + - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"` - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"` - Instruction describing how to update a file via the apply_patch tool. + - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"` - - `Diff string` + - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"` - Diff to apply. + - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"` - - `Path string` + - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"` - Path of the file to update. + - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"` - - `Type UpdateFile` + - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"` - Update an existing file with the provided diff. + - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"` - - `Status BetaResponseApplyPatchToolCallStatus` + - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"` - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"` - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"` - - `Type ApplyPatchCall` + - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"` - The type of the item. Always `apply_patch_call`. + - `const ChatModelGPT4 ChatModel = "gpt-4"` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"` - - `Agent BetaResponseApplyPatchToolCallAgent` + - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"` - The agent that produced this item. + - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"` - - `AgentName string` + - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"` - The canonical name of the agent that produced this item. + - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"` - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"` - The execution context that produced this tool call. + - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"` - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"` - - `Type Direct` + - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"` - - `const DirectDirect Direct = "direct"` + - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"` - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"` - - `CallerID string` + - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"` - The call ID of the program item that produced this tool call. + - `ParallelToolCalls param.Field[bool]` - - `Type Program` + Body param: Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - `const ProgramProgram Program = "program"` + - `ReasoningEffort param.Field[ReasoningEffort]` - - `CreatedBy string` + Body param: Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - The ID of the entity that created this tool call. + - `ResponseFormat param.Field[AssistantResponseFormatOptionUnion]` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + Body param: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The output emitted by an apply patch tool call. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `ID string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `CallID string` + - `` - The unique ID of the apply patch tool call generated by the model. + - `Temperature param.Field[float64]` - - `Status BetaResponseApplyPatchToolCallOutputStatus` + Body param: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `ToolChoice param.Field[AssistantToolChoiceOptionUnion]` - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + Body param: Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + - `Tools param.Field[[]AssistantToolUnion]` - - `Type ApplyPatchCallOutput` + Body param: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - The type of the item. Always `apply_patch_call_output`. + - `type CodeInterpreterTool struct{…}` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `type FileSearchTool struct{…}` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + - `Type FileSearch` - The agent that produced this item. + The type of tool being defined: `file_search` - - `AgentName string` + - `const FileSearchFileSearch FileSearch = "file_search"` - The canonical name of the agent that produced this item. + - `FileSearch FileSearchToolFileSearch` - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + Overrides for the file search tool. - The execution context that produced this tool call. + - `MaxNumResults int64` - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `Type Direct` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const DirectDirect Direct = "direct"` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `CallerID string` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - The call ID of the program item that produced this tool call. + - `ScoreThreshold float64` - - `Type Program` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `const ProgramProgram Program = "program"` + - `Ranker string` - - `CreatedBy string` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The ID of the entity that created this tool call output. + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `Output string` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - Optional textual output returned by the apply patch tool. + - `type FunctionTool struct{…}` - - `type BetaResponseItemMcpListTools struct{…}` + - `Function FunctionDefinition` - A list of tools available on an MCP server. + - `Name string` - - `ID string` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - The unique ID of the list. + - `Description string` - - `ServerLabel string` + A description of what the function does, used by the model to choose when and how to call the function. - The label of the MCP server. + - `Parameters FunctionParameters` - - `Tools []BetaResponseItemMcpListToolsTool` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - The tools available on the server. + Omitting `parameters` defines a function with an empty parameter list. - - `InputSchema any` + - `Strict bool` - The JSON schema describing the tool's input. + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `Name string` + - `Type Function` - The name of the tool. + The type of tool being defined: `function` - - `Annotations any` + - `const FunctionFunction Function = "function"` - Additional annotations about the tool. + - `TopP param.Field[float64]` - - `Description string` + Body param: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - The description of the tool. + We generally recommend altering this or temperature but not both. - - `Type McpListTools` + - `TruncationStrategy param.Field[BetaThreadRunNewParamsTruncationStrategy]` - The type of the item. Always `mcp_list_tools`. + Body param: Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + - `Type string` - - `Agent BetaResponseItemMcpListToolsAgent` + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - The agent that produced this item. + - `const BetaThreadRunNewParamsTruncationStrategyTypeAuto BetaThreadRunNewParamsTruncationStrategyType = "auto"` - - `AgentName string` + - `const BetaThreadRunNewParamsTruncationStrategyTypeLastMessages BetaThreadRunNewParamsTruncationStrategyType = "last_messages"` - The canonical name of the agent that produced this item. + - `LastMessages int64` - - `Error string` + The number of most recent messages from the thread when constructing the context for the run. - Error message if the server could not list tools. +### Returns - - `type BetaResponseItemMcpApprovalRequest struct{…}` +- `type Run struct{…}` - A request for human approval of a tool invocation. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - `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. + The identifier, which can be referenced in API endpoints. - - `ServerLabel string` + - `AssistantID string` - The label of the MCP server making the request. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - - `Type McpApprovalRequest` + - `CancelledAt int64` - The type of the item. Always `mcp_approval_request`. + The Unix timestamp (in seconds) for when the run was cancelled. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `CompletedAt int64` - - `Agent BetaResponseItemMcpApprovalRequestAgent` + The Unix timestamp (in seconds) for when the run was completed. - The agent that produced this item. + - `CreatedAt int64` - - `AgentName string` + The Unix timestamp (in seconds) for when the run was created. - The canonical name of the agent that produced this item. + - `ExpiresAt int64` - - `type BetaResponseItemMcpApprovalResponse struct{…}` + The Unix timestamp (in seconds) for when the run will expire. - A response to an MCP approval request. + - `FailedAt int64` - - `ID string` + The Unix timestamp (in seconds) for when the run failed. - The unique ID of the approval response + - `IncompleteDetails RunIncompleteDetails` - - `ApprovalRequestID string` + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - The ID of the approval request being answered. + - `Reason string` - - `Approve bool` + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - Whether the request was approved. + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - - `Type McpApprovalResponse` + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - The type of the item. Always `mcp_approval_response`. + - `Instructions string` - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `Agent BetaResponseItemMcpApprovalResponseAgent` + - `LastError RunLastError` - The agent that produced this item. + The last error associated with this run. Will be `null` if there are no errors. - - `AgentName string` + - `Code string` - The canonical name of the agent that produced this item. + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - `Reason string` + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - Optional reason for the decision. + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - - `type BetaResponseItemMcpCall struct{…}` + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - An invocation of a tool on an MCP server. + - `Message string` - - `ID string` + A human-readable description of the error. - The unique ID of the tool call. + - `MaxCompletionTokens int64` - - `Arguments string` + The maximum number of completion tokens specified to have been used over the course of the run. - A JSON string of the arguments passed to the tool. + - `MaxPromptTokens int64` - - `Name string` + The maximum number of prompt tokens specified to have been used over the course of the run. - The name of the tool that was run. + - `Metadata Metadata` - - `ServerLabel string` + 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. - The label of the MCP server running the tool. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `Type McpCall` + - `Model string` - The type of the item. Always `mcp_call`. + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `const McpCallMcpCall McpCall = "mcp_call"` + - `Object ThreadRun` - - `Agent BetaResponseItemMcpCallAgent` + The object type, which is always `thread.run`. - The agent that produced this item. + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - - `AgentName string` + - `ParallelToolCalls bool` - The canonical name of the agent that produced this item. + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - `ApprovalRequestID string` + - `RequiredAction RunRequiredAction` - 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. + Details on the action required to continue the run. Will be `null` if no action is required. - - `Error string` + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - The error from the tool call, if any. + Details on the tool outputs needed for this run to continue. - - `Output string` + - `ToolCalls []RequiredActionFunctionToolCall` - The output from the tool call. + A list of the relevant tool calls. - - `Status string` + - `ID string` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - - `const BetaResponseItemMcpCallStatusInProgress BetaResponseItemMcpCallStatus = "in_progress"` + - `Function RequiredActionFunctionToolCallFunction` - - `const BetaResponseItemMcpCallStatusCompleted BetaResponseItemMcpCallStatus = "completed"` + The function definition. - - `const BetaResponseItemMcpCallStatusIncomplete BetaResponseItemMcpCallStatus = "incomplete"` + - `Arguments string` - - `const BetaResponseItemMcpCallStatusCalling BetaResponseItemMcpCallStatus = "calling"` + The arguments that the model expects you to pass to the function. - - `const BetaResponseItemMcpCallStatusFailed BetaResponseItemMcpCallStatus = "failed"` + - `Name string` - - `type BetaResponseCustomToolCallItem struct{…}` + The name of the function. - A call to a custom tool created by the model. + - `Type Function` - - `ID string` + The type of tool call the output is required for. For now, this is always `function`. - The unique ID of the custom tool call item. + - `const FunctionFunction Function = "function"` - - `Status string` + - `Type SubmitToolOutputs` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + For now, this is always `submit_tool_outputs`. - - `const BetaResponseCustomToolCallItemStatusInProgress BetaResponseCustomToolCallItemStatus = "in_progress"` + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - - `const BetaResponseCustomToolCallItemStatusCompleted BetaResponseCustomToolCallItemStatus = "completed"` + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `const BetaResponseCustomToolCallItemStatusIncomplete BetaResponseCustomToolCallItemStatus = "incomplete"` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `CreatedBy string` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The identifier of the actor that created the item. + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `type BetaResponseCustomToolCallOutputItem struct{…}` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - The output of a custom tool call from your code, being sent back to the model. + - `type Auto string` - - `ID string` + `auto` is the default value - The unique ID of the custom tool call output item. + - `const AutoAuto Auto = "auto"` - - `Status string` + - `type ResponseFormatText struct{…}` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Default response format. Used to generate text responses. - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + - `Type Text` - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + The type of response format being defined. Always `text`. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `const TextText Text = "text"` - - `CreatedBy string` + - `type ResponseFormatJSONObject struct{…}` - The identifier of the actor that created the item. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. -### Example + - `Type JSONObject` -```go -package main + The type of response format being defined. Always `json_object`. -import ( - "context" - "fmt" + - `const JSONObjectJSONObject JSONObject = "json_object"` - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" - "github.com/openai/openai-go/responses" -) + - `type ResponseFormatJSONSchema struct{…}` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - page, err := client.Beta.Responses.InputItems.List( - context.TODO(), - "response_id", - responses.InputItemListParams{ + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - }, - ) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", page) -} -``` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` -#### Response + Structured Outputs configuration options, including a JSON Schema. -```json -{ - "data": [ - { - "id": "id", - "content": [ - { - "text": "text", - "type": "input_text", - "prompt_cache_breakpoint": { - "mode": "explicit" - } - } - ], - "role": "user", - "type": "message", - "agent": { - "agent_name": "agent_name" - }, - "status": "in_progress" - } - ], - "first_id": "first_id", - "has_more": true, - "last_id": "last_id", - "object": "list" -} -``` + - `Name string` -## Domain Types + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. -### Beta Response Item List + - `Description string` -- `type BetaResponseItemList struct{…}` + A description of what the response format is for, used by the model to + determine how to respond in the format. - A list of Response items. + - `Schema map[string, any]` - - `Data []BetaResponseItemUnion` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - A list of items used to generate this response. + - `Strict bool` - - `type BetaResponseInputMessageItem struct{…}` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `ID string` + - `Type JSONSchema` - The unique ID of the message input. + The type of response format being defined. Always `json_schema`. - - `Content BetaResponseInputMessageContentList` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - A list of one or many input items to the model, containing different content - types. + - `StartedAt int64` - - `type BetaResponseInputText struct{…}` + The Unix timestamp (in seconds) for when the run was started. - A text input to the model. + - `Status RunStatus` - - `Text string` + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - The text input to the model. + - `const RunStatusQueued RunStatus = "queued"` - - `Type InputText` + - `const RunStatusInProgress RunStatus = "in_progress"` - The type of the input item. Always `input_text`. + - `const RunStatusRequiresAction RunStatus = "requires_action"` - - `const InputTextInputText InputText = "input_text"` + - `const RunStatusCancelling RunStatus = "cancelling"` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `const RunStatusCancelled RunStatus = "cancelled"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const RunStatusFailed RunStatus = "failed"` - - `Mode Explicit` + - `const RunStatusCompleted RunStatus = "completed"` - The breakpoint mode. Always `explicit`. + - `const RunStatusIncomplete RunStatus = "incomplete"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const RunStatusExpired RunStatus = "expired"` - - `type BetaResponseInputImage struct{…}` + - `ThreadID string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - - `Detail BetaResponseInputImageDetail` + - `ToolChoice AssistantToolChoiceOptionUnion` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `type AssistantToolChoiceOptionAuto string` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - - `Type InputImage` + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - The type of the input item. Always `input_image`. + - `type AssistantToolChoice struct{…}` - - `const InputImageInputImage InputImage = "input_image"` + Specifies a tool the model should use. Use to force the model to call a specific tool. - - `FileID string` + - `Type AssistantToolChoiceType` - The ID of the file to be sent to the model. + The type of the tool. If type is `function`, the function name must be set - - `ImageURL string` + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Function AssistantToolChoiceFunction` - - `Mode Explicit` + - `Name string` - The breakpoint mode. Always `explicit`. + The name of the function to call. - - `const ExplicitExplicit Explicit = "explicit"` + - `Tools []AssistantToolUnion` - - `type BetaResponseInputFile struct{…}` + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - A file input to the model. + - `type CodeInterpreterTool struct{…}` - - `Type InputFile` + - `Type CodeInterpreter` - The type of the input item. Always `input_file`. + The type of tool being defined: `code_interpreter` - - `const InputFileInputFile InputFile = "input_file"` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Detail BetaResponseInputFileDetail` + - `type FileSearchTool struct{…}` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Type FileSearch` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + The type of tool being defined: `file_search` - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + - `FileSearch FileSearchToolFileSearch` - - `FileData string` + Overrides for the file search tool. - The content of the file to be sent to the model. + - `MaxNumResults int64` - - `FileID string` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - The ID of the file to be sent to the model. + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `FileURL string` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - The URL of the file to be sent to the model. + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `Filename string` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - The name of the file to be sent to the model. + - `ScoreThreshold float64` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Ranker string` - - `Mode Explicit` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The breakpoint mode. Always `explicit`. + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `const ExplicitExplicit Explicit = "explicit"` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `Role BetaResponseInputMessageItemRole` + - `type FunctionTool struct{…}` - The role of the message input. One of `user`, `system`, or `developer`. + - `Function FunctionDefinition` - - `const BetaResponseInputMessageItemRoleUser BetaResponseInputMessageItemRole = "user"` + - `Name string` - - `const BetaResponseInputMessageItemRoleSystem BetaResponseInputMessageItemRole = "system"` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `const BetaResponseInputMessageItemRoleDeveloper BetaResponseInputMessageItemRole = "developer"` + - `Description string` - - `Type Message` + A description of what the function does, used by the model to choose when and how to call the function. - The type of the message input. Always set to `message`. + - `Parameters FunctionParameters` - - `const MessageMessage Message = "message"` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `Agent BetaResponseInputMessageItemAgent` + Omitting `parameters` defines a function with an empty parameter list. - The agent that produced this item. + - `Strict bool` - - `AgentName string` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - The canonical name of the agent that produced this item. + - `Type Function` - - `Status BetaResponseInputMessageItemStatus` + The type of tool being defined: `function` - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `const FunctionFunction Function = "function"` - - `const BetaResponseInputMessageItemStatusInProgress BetaResponseInputMessageItemStatus = "in_progress"` + - `TruncationStrategy RunTruncationStrategy` - - `const BetaResponseInputMessageItemStatusCompleted BetaResponseInputMessageItemStatus = "completed"` + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `const BetaResponseInputMessageItemStatusIncomplete BetaResponseInputMessageItemStatus = "incomplete"` + - `Type string` - - `type BetaResponseOutputMessage struct{…}` + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - An output message from the model. + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `ID string` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - The unique ID of the output message. + - `LastMessages int64` - - `Content []BetaResponseOutputMessageContentUnion` + The number of most recent messages from the thread when constructing the context for the run. - The content of the output message. + - `Usage RunUsage` - - `type BetaResponseOutputText struct{…}` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - A text output from the model. + - `CompletionTokens int64` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + Number of completion tokens used over the course of the run. - The annotations of the text output. + - `PromptTokens int64` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + Number of prompt tokens used over the course of the run. - A citation to a file. + - `TotalTokens int64` - - `FileID string` + Total number of tokens used (prompt + completion). - The ID of the file. + - `Temperature float64` - - `Filename string` + The sampling temperature used for this run. If not set, defaults to 1. - The filename of the file cited. + - `TopP float64` - - `Index int64` + The nucleus sampling value used for this run. If not set, defaults to 1. - The index of the file in the list of files. +### Example - - `Type FileCitation` +```go +package main - The type of the file citation. Always `file_citation`. +import ( + "context" + "fmt" - - `const FileCitationFileCitation FileCitation = "file_citation"` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + run, err := client.Beta.Threads.Runs.New( + context.TODO(), + "thread_id", + openai.BetaThreadRunNewParams{ + AssistantID: "assistant_id", + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", run.ID) +} +``` - A citation for a web resource used to generate a model response. +#### Response - - `EndIndex int64` +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expires_at": 0, + "failed_at": 0, + "incomplete_details": { + "reason": "max_completion_tokens" + }, + "instructions": "instructions", + "last_error": { + "code": "server_error", + "message": "message" + }, + "max_completion_tokens": 256, + "max_prompt_tokens": 256, + "metadata": { + "foo": "string" + }, + "model": "model", + "object": "thread.run", + "parallel_tool_calls": true, + "required_action": { + "submit_tool_outputs": { + "tool_calls": [ + { + "id": "id", + "function": { + "arguments": "arguments", + "name": "name" + }, + "type": "function" + } + ] + }, + "type": "submit_tool_outputs" + }, + "response_format": "auto", + "started_at": 0, + "status": "queued", + "thread_id": "thread_id", + "tool_choice": "none", + "tools": [ + { + "type": "code_interpreter" + } + ], + "truncation_strategy": { + "type": "auto", + "last_messages": 1 + }, + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + }, + "temperature": 0, + "top_p": 0 +} +``` - The index of the last character of the URL citation in the message. +## Retrieve run - - `StartIndex int64` +`client.Beta.Threads.Runs.Get(ctx, threadID, runID) (*Run, error)` - The index of the first character of the URL citation in the message. +**get** `/threads/{thread_id}/runs/{run_id}` - - `Title string` +Retrieves a run. - The title of the web resource. +### Parameters - - `Type URLCitation` +- `threadID string` - The type of the URL citation. Always `url_citation`. +- `runID string` - - `const URLCitationURLCitation URLCitation = "url_citation"` +### Returns - - `URL string` +- `type Run struct{…}` - The URL of the web resource. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `ID string` - A citation for a container file used to generate a model response. + The identifier, which can be referenced in API endpoints. - - `ContainerID string` + - `AssistantID string` - The ID of the container file. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - - `EndIndex int64` + - `CancelledAt int64` - The index of the last character of the container file citation in the message. + The Unix timestamp (in seconds) for when the run was cancelled. - - `FileID string` + - `CompletedAt int64` - The ID of the file. + The Unix timestamp (in seconds) for when the run was completed. - - `Filename string` + - `CreatedAt int64` - The filename of the container file cited. + The Unix timestamp (in seconds) for when the run was created. - - `StartIndex int64` + - `ExpiresAt int64` - The index of the first character of the container file citation in the message. + The Unix timestamp (in seconds) for when the run will expire. - - `Type ContainerFileCitation` + - `FailedAt int64` - The type of the container file citation. Always `container_file_citation`. + The Unix timestamp (in seconds) for when the run failed. - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `IncompleteDetails RunIncompleteDetails` - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - A path to a file. + - `Reason string` - - `FileID string` + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - The ID of the file. + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - - `Index int64` + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - The index of the file in the list of files. + - `Instructions string` - - `Type FilePath` + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The type of the file path. Always `file_path`. + - `LastError RunLastError` - - `const FilePathFilePath FilePath = "file_path"` + The last error associated with this run. Will be `null` if there are no errors. - - `Text string` + - `Code string` - The text output from the model. + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - `Type OutputText` + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - The type of the output text. Always `output_text`. + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - - `const OutputTextOutputText OutputText = "output_text"` + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - - `Logprobs []BetaResponseOutputTextLogprob` + - `Message string` - - `Token string` + A human-readable description of the error. - - `Bytes []int64` + - `MaxCompletionTokens int64` - - `Logprob float64` + The maximum number of completion tokens specified to have been used over the course of the run. - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` + - `MaxPromptTokens int64` - - `Token string` + The maximum number of prompt tokens specified to have been used over the course of the run. - - `Bytes []int64` + - `Metadata Metadata` - - `Logprob float64` + 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. - - `type BetaResponseOutputRefusal struct{…}` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - A refusal from the model. + - `Model string` - - `Refusal string` + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The refusal explanation from the model. + - `Object ThreadRun` - - `Type Refusal` + The object type, which is always `thread.run`. - The type of the refusal. Always `refusal`. + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - - `const RefusalRefusal Refusal = "refusal"` + - `ParallelToolCalls bool` - - `Role Assistant` + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - The role of the output message. Always `assistant`. + - `RequiredAction RunRequiredAction` - - `const AssistantAssistant Assistant = "assistant"` + Details on the action required to continue the run. Will be `null` if no action is required. - - `Status BetaResponseOutputMessageStatus` + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + Details on the tool outputs needed for this run to continue. - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + - `ToolCalls []RequiredActionFunctionToolCall` - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + A list of the relevant tool calls. - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + - `ID string` - - `Type Message` + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - The type of the output message. Always `message`. + - `Function RequiredActionFunctionToolCallFunction` - - `const MessageMessage Message = "message"` + The function definition. - - `Agent BetaResponseOutputMessageAgent` + - `Arguments string` - The agent that produced this item. + The arguments that the model expects you to pass to the function. - - `AgentName string` + - `Name string` - The canonical name of the agent that produced this item. + The name of the function. - - `Phase BetaResponseOutputMessagePhase` + - `Type Function` - 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. + The type of tool call the output is required for. For now, this is always `function`. - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `const FunctionFunction Function = "function"` - - `type BetaResponseFileSearchToolCall struct{…}` + - `Type SubmitToolOutputs` - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + For now, this is always `submit_tool_outputs`. - - `ID string` + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - The unique ID of the file search tool call. + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `Queries []string` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The queries used to search for files. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Status BetaResponseFileSearchToolCallStatus` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + - `type Auto string` - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + `auto` is the default value - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + - `const AutoAuto Auto = "auto"` - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `type ResponseFormatText struct{…}` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + Default response format. Used to generate text responses. - - `Type FileSearchCall` + - `Type Text` - The type of the file search tool call. Always `file_search_call`. + The type of response format being defined. Always `text`. - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `const TextText Text = "text"` - - `Agent BetaResponseFileSearchToolCallAgent` + - `type ResponseFormatJSONObject struct{…}` - The agent that produced this item. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `AgentName string` + - `Type JSONObject` - The canonical name of the agent that produced this item. + The type of response format being defined. Always `json_object`. - - `Results []BetaResponseFileSearchToolCallResult` + - `const JSONObjectJSONObject JSONObject = "json_object"` - The results of the file search tool call. + - `type ResponseFormatJSONSchema struct{…}` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - 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. + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `string` + Structured Outputs configuration options, including a JSON Schema. - - `float64` + - `Name string` - - `bool` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `FileID string` + - `Description string` - The unique ID of the file. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `Filename string` + - `Schema map[string, any]` - The name of the file. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `Score float64` + - `Strict bool` - The relevance score of the file - a value between 0 and 1. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Text string` + - `Type JSONSchema` - The text that was retrieved from the file. + The type of response format being defined. Always `json_schema`. - - `type BetaResponseComputerToolCall struct{…}` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `StartedAt int64` - - `ID string` + The Unix timestamp (in seconds) for when the run was started. - The unique ID of the computer call. + - `Status RunStatus` - - `CallID string` + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - An identifier used when responding to the tool call with output. + - `const RunStatusQueued RunStatus = "queued"` - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + - `const RunStatusInProgress RunStatus = "in_progress"` - The pending safety checks for the computer call. + - `const RunStatusRequiresAction RunStatus = "requires_action"` - - `ID string` + - `const RunStatusCancelling RunStatus = "cancelling"` - The ID of the pending safety check. + - `const RunStatusCancelled RunStatus = "cancelled"` - - `Code string` + - `const RunStatusFailed RunStatus = "failed"` - The type of the pending safety check. + - `const RunStatusCompleted RunStatus = "completed"` - - `Message string` + - `const RunStatusIncomplete RunStatus = "incomplete"` - Details about the pending safety check. + - `const RunStatusExpired RunStatus = "expired"` - - `Status BetaResponseComputerToolCallStatus` + - `ThreadID string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `ToolChoice AssistantToolChoiceOptionUnion` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `type AssistantToolChoiceOptionAuto string` - - `Type BetaResponseComputerToolCallType` + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - The type of the computer call. Always `computer_call`. + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - - `Action BetaComputerActionUnion` + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - A click action. + - `type AssistantToolChoice struct{…}` - - `type BetaComputerActionClick struct{…}` + Specifies a tool the model should use. Use to force the model to call a specific tool. - A click action. + - `Type AssistantToolChoiceType` - - `Button string` + The type of the tool. If type is `function`, the function name must be set - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `Function AssistantToolChoiceFunction` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + - `Name string` - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` + The name of the function to call. - - `Type Click` + - `Tools []AssistantToolUnion` - Specifies the event type. For a click action, this property is always `click`. + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `const ClickClick Click = "click"` + - `type CodeInterpreterTool struct{…}` - - `X int64` + - `Type CodeInterpreter` - The x-coordinate where the click occurred. + The type of tool being defined: `code_interpreter` - - `Y int64` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The y-coordinate where the click occurred. + - `type FileSearchTool struct{…}` - - `Keys []string` + - `Type FileSearch` - The keys being held while clicking. + The type of tool being defined: `file_search` - - `type BetaComputerActionDoubleClick struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - A double click action. + - `FileSearch FileSearchToolFileSearch` - - `Keys []string` + Overrides for the file search tool. - The keys being held while double-clicking. + - `MaxNumResults int64` - - `Type DoubleClick` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - Specifies the event type. For a double click action, this property is always set to `double_click`. + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `X int64` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - The x-coordinate where the double click occurred. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `Y int64` + - `ScoreThreshold float64` - The y-coordinate where the double click occurred. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `type BetaComputerActionDrag struct{…}` + - `Ranker string` - A drag action. + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `Path []BetaComputerActionDragPath` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `type FunctionTool struct{…}` - - `X int64` + - `Function FunctionDefinition` - The x-coordinate. + - `Name string` - - `Y int64` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - The y-coordinate. + - `Description string` - - `Type Drag` + A description of what the function does, used by the model to choose when and how to call the function. - Specifies the event type. For a drag action, this property is always set to `drag`. + - `Parameters FunctionParameters` - - `const DragDrag Drag = "drag"` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `Keys []string` + Omitting `parameters` defines a function with an empty parameter list. - The keys being held while dragging the mouse. + - `Strict bool` - - `type BetaComputerActionKeypress struct{…}` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - A collection of keypresses the model would like to perform. + - `Type Function` - - `Keys []string` + The type of tool being defined: `function` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `const FunctionFunction Function = "function"` - - `Type Keypress` + - `TruncationStrategy RunTruncationStrategy` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `const KeypressKeypress Keypress = "keypress"` + - `Type string` - - `type BetaComputerActionMove struct{…}` + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - A mouse move action. + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `Type Move` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - Specifies the event type. For a move action, this property is always set to `move`. + - `LastMessages int64` - - `const MoveMove Move = "move"` + The number of most recent messages from the thread when constructing the context for the run. - - `X int64` + - `Usage RunUsage` - The x-coordinate to move to. + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - `Y int64` + - `CompletionTokens int64` - The y-coordinate to move to. + Number of completion tokens used over the course of the run. - - `Keys []string` + - `PromptTokens int64` - The keys being held while moving the mouse. + Number of prompt tokens used over the course of the run. - - `type BetaComputerActionScreenshot struct{…}` + - `TotalTokens int64` - A screenshot action. + Total number of tokens used (prompt + completion). - - `Type Screenshot` + - `Temperature float64` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + The sampling temperature used for this run. If not set, defaults to 1. - - `const ScreenshotScreenshot Screenshot = "screenshot"` + - `TopP float64` - - `type BetaComputerActionScroll struct{…}` + The nucleus sampling value used for this run. If not set, defaults to 1. - A scroll action. +### Example - - `ScrollX int64` +```go +package main - The horizontal scroll distance. +import ( + "context" + "fmt" - - `ScrollY int64` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The vertical scroll distance. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + run, err := client.Beta.Threads.Runs.Get( + context.TODO(), + "thread_id", + "run_id", + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", run.ID) +} +``` - - `Type Scroll` +#### Response - Specifies the event type. For a scroll action, this property is always set to `scroll`. +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expires_at": 0, + "failed_at": 0, + "incomplete_details": { + "reason": "max_completion_tokens" + }, + "instructions": "instructions", + "last_error": { + "code": "server_error", + "message": "message" + }, + "max_completion_tokens": 256, + "max_prompt_tokens": 256, + "metadata": { + "foo": "string" + }, + "model": "model", + "object": "thread.run", + "parallel_tool_calls": true, + "required_action": { + "submit_tool_outputs": { + "tool_calls": [ + { + "id": "id", + "function": { + "arguments": "arguments", + "name": "name" + }, + "type": "function" + } + ] + }, + "type": "submit_tool_outputs" + }, + "response_format": "auto", + "started_at": 0, + "status": "queued", + "thread_id": "thread_id", + "tool_choice": "none", + "tools": [ + { + "type": "code_interpreter" + } + ], + "truncation_strategy": { + "type": "auto", + "last_messages": 1 + }, + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + }, + "temperature": 0, + "top_p": 0 +} +``` - - `const ScrollScroll Scroll = "scroll"` +## Modify run - - `X int64` +`client.Beta.Threads.Runs.Update(ctx, threadID, runID, body) (*Run, error)` - The x-coordinate where the scroll occurred. +**post** `/threads/{thread_id}/runs/{run_id}` - - `Y int64` +Modifies a run. - The y-coordinate where the scroll occurred. +### Parameters - - `Keys []string` +- `threadID string` - The keys being held while scrolling. +- `runID string` - - `type BetaComputerActionType struct{…}` +- `body BetaThreadRunUpdateParams` - An action to type in text. + - `Metadata param.Field[Metadata]` - - `Text string` + 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. - The text to type. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `Type Type` +### Returns - Specifies the event type. For a type action, this property is always set to `type`. +- `type Run struct{…}` - - `const TypeType Type = "type"` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `type BetaComputerActionWait struct{…}` + - `ID string` - A wait action. + The identifier, which can be referenced in API endpoints. - - `Type Wait` + - `AssistantID string` - Specifies the event type. For a wait action, this property is always set to `wait`. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - - `const WaitWait Wait = "wait"` + - `CancelledAt int64` - - `Actions BetaComputerActionList` + The Unix timestamp (in seconds) for when the run was cancelled. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `CompletedAt int64` - - `type BetaComputerActionClick struct{…}` + The Unix timestamp (in seconds) for when the run was completed. - A click action. + - `CreatedAt int64` - - `type BetaComputerActionDoubleClick struct{…}` + The Unix timestamp (in seconds) for when the run was created. - A double click action. + - `ExpiresAt int64` - - `type BetaComputerActionDrag struct{…}` + The Unix timestamp (in seconds) for when the run will expire. - A drag action. + - `FailedAt int64` - - `type BetaComputerActionKeypress struct{…}` + The Unix timestamp (in seconds) for when the run failed. - A collection of keypresses the model would like to perform. + - `IncompleteDetails RunIncompleteDetails` - - `type BetaComputerActionMove struct{…}` + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - A mouse move action. + - `Reason string` - - `type BetaComputerActionScreenshot struct{…}` + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - A screenshot action. + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - - `type BetaComputerActionScroll struct{…}` + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - A scroll action. + - `Instructions string` - - `type BetaComputerActionType struct{…}` + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - An action to type in text. + - `LastError RunLastError` - - `type BetaComputerActionWait struct{…}` + The last error associated with this run. Will be `null` if there are no errors. - A wait action. + - `Code string` - - `Agent BetaResponseComputerToolCallAgent` + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - The agent that produced this item. + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - - `AgentName string` + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - The canonical name of the agent that produced this item. + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - - `type BetaResponseComputerToolCallOutputItem struct{…}` + - `Message string` - - `ID string` + A human-readable description of the error. - The unique ID of the computer call tool output. + - `MaxCompletionTokens int64` - - `CallID string` + The maximum number of completion tokens specified to have been used over the course of the run. - The ID of the computer tool call that produced the output. + - `MaxPromptTokens int64` - - `Output BetaResponseComputerToolCallOutputScreenshot` + The maximum number of prompt tokens specified to have been used over the course of the run. - A computer screenshot image used with the computer use tool. + - `Metadata Metadata` - - `Type ComputerScreenshot` + 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. - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `Model string` - - `FileID string` + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The identifier of an uploaded file that contains the screenshot. + - `Object ThreadRun` - - `ImageURL string` + The object type, which is always `thread.run`. - The URL of the screenshot image. + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - - `Status BetaResponseComputerToolCallOutputItemStatus` + - `ParallelToolCalls bool` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - `const BetaResponseComputerToolCallOutputItemStatusCompleted BetaResponseComputerToolCallOutputItemStatus = "completed"` + - `RequiredAction RunRequiredAction` - - `const BetaResponseComputerToolCallOutputItemStatusIncomplete BetaResponseComputerToolCallOutputItemStatus = "incomplete"` + Details on the action required to continue the run. Will be `null` if no action is required. - - `const BetaResponseComputerToolCallOutputItemStatusFailed BetaResponseComputerToolCallOutputItemStatus = "failed"` + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - - `const BetaResponseComputerToolCallOutputItemStatusInProgress BetaResponseComputerToolCallOutputItemStatus = "in_progress"` + Details on the tool outputs needed for this run to continue. - - `Type ComputerCallOutput` + - `ToolCalls []RequiredActionFunctionToolCall` - The type of the computer tool call output. Always `computer_call_output`. + A list of the relevant tool calls. - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `ID string` - - `AcknowledgedSafetyChecks []BetaResponseComputerToolCallOutputItemAcknowledgedSafetyCheck` + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - The safety checks reported by the API that have been acknowledged by the - developer. + - `Function RequiredActionFunctionToolCallFunction` - - `ID string` + The function definition. - The ID of the pending safety check. + - `Arguments string` - - `Code string` + The arguments that the model expects you to pass to the function. - The type of the pending safety check. + - `Name string` - - `Message string` + The name of the function. - Details about the pending safety check. + - `Type Function` - - `Agent BetaResponseComputerToolCallOutputItemAgent` + The type of tool call the output is required for. For now, this is always `function`. - The agent that produced this item. + - `const FunctionFunction Function = "function"` - - `AgentName string` + - `Type SubmitToolOutputs` - The canonical name of the agent that produced this item. + For now, this is always `submit_tool_outputs`. - - `CreatedBy string` + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - The identifier of the actor that created the item. + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `type BetaResponseFunctionWebSearch struct{…}` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `ID string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - The unique ID of the web search tool call. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `Action BetaResponseFunctionWebSearchActionUnion` + - `type Auto string` - 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). + `auto` is the default value - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + - `const AutoAuto Auto = "auto"` - Action type "search" - Performs a web search query. + - `type ResponseFormatText struct{…}` - - `Type Search` + Default response format. Used to generate text responses. - The action type. + - `Type Text` - - `const SearchSearch Search = "search"` + The type of response format being defined. Always `text`. - - `Queries []string` + - `const TextText Text = "text"` - The search queries. + - `type ResponseFormatJSONObject struct{…}` - - `Query string` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - The search query. + - `Type JSONObject` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + The type of response format being defined. Always `json_object`. - The sources used in the search. + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `Type URL` + - `type ResponseFormatJSONSchema struct{…}` - The type of source. Always `url`. + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `const URLURL URL = "url"` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `URL string` + Structured Outputs configuration options, including a JSON Schema. - The URL of the source. + - `Name string` - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - Action type "open_page" - Opens a specific URL from search results. + - `Description string` - - `Type OpenPage` + A description of what the response format is for, used by the model to + determine how to respond in the format. - The action type. + - `Schema map[string, any]` - - `const OpenPageOpenPage OpenPage = "open_page"` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `URL string` + - `Strict bool` - The URL opened by the model. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + - `Type JSONSchema` - Action type "find_in_page": Searches for a pattern within a loaded page. + The type of response format being defined. Always `json_schema`. - - `Pattern string` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - The pattern or text to search for within the page. + - `StartedAt int64` - - `Type FindInPage` + The Unix timestamp (in seconds) for when the run was started. - The action type. + - `Status RunStatus` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - `URL string` + - `const RunStatusQueued RunStatus = "queued"` - The URL of the page searched for the pattern. + - `const RunStatusInProgress RunStatus = "in_progress"` - - `Status BetaResponseFunctionWebSearchStatus` + - `const RunStatusRequiresAction RunStatus = "requires_action"` - The status of the web search tool call. + - `const RunStatusCancelling RunStatus = "cancelling"` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + - `const RunStatusCancelled RunStatus = "cancelled"` - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + - `const RunStatusFailed RunStatus = "failed"` - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + - `const RunStatusCompleted RunStatus = "completed"` - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `const RunStatusIncomplete RunStatus = "incomplete"` - - `Type WebSearchCall` + - `const RunStatusExpired RunStatus = "expired"` - The type of the web search tool call. Always `web_search_call`. + - `ThreadID string` - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - - `Agent BetaResponseFunctionWebSearchAgent` + - `ToolChoice AssistantToolChoiceOptionUnion` - The agent that produced this item. + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `AgentName string` + - `type AssistantToolChoiceOptionAuto string` - The canonical name of the agent that produced this item. + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - `type BetaResponseFunctionToolCallItem struct{…}` + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - - `ID string` + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - The unique ID of the function tool call. + - `type AssistantToolChoice struct{…}` - - `Status string` + Specifies a tool the model should use. Use to force the model to call a specific tool. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Type AssistantToolChoiceType` - - `const BetaResponseFunctionToolCallItemStatusInProgress BetaResponseFunctionToolCallItemStatus = "in_progress"` + The type of the tool. If type is `function`, the function name must be set - - `const BetaResponseFunctionToolCallItemStatusCompleted BetaResponseFunctionToolCallItemStatus = "completed"` + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - - `const BetaResponseFunctionToolCallItemStatusIncomplete BetaResponseFunctionToolCallItemStatus = "incomplete"` + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - - `CreatedBy string` + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - The identifier of the actor that created the item. + - `Function AssistantToolChoiceFunction` - - `type BetaResponseFunctionToolCallOutputItem struct{…}` + - `Name string` - - `ID string` + The name of the function to call. - The unique ID of the function call tool output. + - `Tools []AssistantToolUnion` - - `CallID string` + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The unique ID of the function tool call generated by the model. + - `type CodeInterpreterTool struct{…}` - - `Output BetaResponseFunctionToolCallOutputItemOutputUnion` + - `Type CodeInterpreter` - The output from the function call generated by your code. - Can be a string or an list of output content. + The type of tool being defined: `code_interpreter` - - `string` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `type BetaResponseFunctionToolCallOutputItemOutputOutputContentList []BetaResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion` + - `type FileSearchTool struct{…}` - Text, image, or file output of the function call. + - `Type FileSearch` - - `type BetaResponseInputText struct{…}` + The type of tool being defined: `file_search` - A text input to the model. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type BetaResponseInputImage struct{…}` + - `FileSearch FileSearchToolFileSearch` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + Overrides for the file search tool. - - `type BetaResponseInputFile struct{…}` + - `MaxNumResults int64` - A file input to the model. + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `Status BetaResponseFunctionToolCallOutputItemStatus` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `const BetaResponseFunctionToolCallOutputItemStatusInProgress BetaResponseFunctionToolCallOutputItemStatus = "in_progress"` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - - `const BetaResponseFunctionToolCallOutputItemStatusCompleted BetaResponseFunctionToolCallOutputItemStatus = "completed"` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const BetaResponseFunctionToolCallOutputItemStatusIncomplete BetaResponseFunctionToolCallOutputItemStatus = "incomplete"` + - `ScoreThreshold float64` - - `Type FunctionCallOutput` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - The type of the function tool call output. Always `function_call_output`. + - `Ranker string` - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `Agent BetaResponseFunctionToolCallOutputItemAgent` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - The agent that produced this item. + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `AgentName string` + - `type FunctionTool struct{…}` - The canonical name of the agent that produced this item. + - `Function FunctionDefinition` - - `Caller BetaResponseFunctionToolCallOutputItemCallerUnion` + - `Name string` - The execution context that produced this tool call. + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `type BetaResponseFunctionToolCallOutputItemCallerDirect struct{…}` + - `Description string` - - `Type Direct` + A description of what the function does, used by the model to choose when and how to call the function. - The caller type. Always `direct`. + - `Parameters FunctionParameters` - - `const DirectDirect Direct = "direct"` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `type BetaResponseFunctionToolCallOutputItemCallerProgram struct{…}` + Omitting `parameters` defines a function with an empty parameter list. - - `CallerID string` + - `Strict bool` - The call ID of the program item that produced this tool call. + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `Type Program` + - `Type Function` - The caller type. Always `program`. + The type of tool being defined: `function` - - `const ProgramProgram Program = "program"` + - `const FunctionFunction Function = "function"` - - `CreatedBy string` + - `TruncationStrategy RunTruncationStrategy` - The identifier of the actor that created the item. + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `type BetaResponseItemAgentMessage struct{…}` + - `Type string` - - `ID string` + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - The unique ID of the agent message. + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `Author string` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - The sending agent identity. + - `LastMessages int64` - - `Content []BetaResponseItemAgentMessageContentUnion` + The number of most recent messages from the thread when constructing the context for the run. - Encrypted content sent between agents. + - `Usage RunUsage` - - `type BetaResponseInputText struct{…}` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - A text input to the model. + - `CompletionTokens int64` - - `type BetaResponseOutputText struct{…}` + Number of completion tokens used over the course of the run. - A text output from the model. + - `PromptTokens int64` - - `type BetaResponseItemAgentMessageContentText struct{…}` + Number of prompt tokens used over the course of the run. - A text content. + - `TotalTokens int64` - - `Text string` + Total number of tokens used (prompt + completion). - - `Type Text` + - `Temperature float64` - - `const TextText Text = "text"` + The sampling temperature used for this run. If not set, defaults to 1. - - `type BetaResponseItemAgentMessageContentSummaryText struct{…}` + - `TopP float64` - A summary text from the model. + The nucleus sampling value used for this run. If not set, defaults to 1. - - `Text string` +### Example - A summary of the reasoning output from the model so far. +```go +package main - - `Type SummaryText` +import ( + "context" + "fmt" - The type of the object. Always `summary_text`. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `const SummaryTextSummaryText SummaryText = "summary_text"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + run, err := client.Beta.Threads.Runs.Update( + context.TODO(), + "thread_id", + "run_id", + openai.BetaThreadRunUpdateParams{ - - `type BetaResponseItemAgentMessageContentReasoningText struct{…}` + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", run.ID) +} +``` - Reasoning text from the model. +#### Response - - `Text string` +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expires_at": 0, + "failed_at": 0, + "incomplete_details": { + "reason": "max_completion_tokens" + }, + "instructions": "instructions", + "last_error": { + "code": "server_error", + "message": "message" + }, + "max_completion_tokens": 256, + "max_prompt_tokens": 256, + "metadata": { + "foo": "string" + }, + "model": "model", + "object": "thread.run", + "parallel_tool_calls": true, + "required_action": { + "submit_tool_outputs": { + "tool_calls": [ + { + "id": "id", + "function": { + "arguments": "arguments", + "name": "name" + }, + "type": "function" + } + ] + }, + "type": "submit_tool_outputs" + }, + "response_format": "auto", + "started_at": 0, + "status": "queued", + "thread_id": "thread_id", + "tool_choice": "none", + "tools": [ + { + "type": "code_interpreter" + } + ], + "truncation_strategy": { + "type": "auto", + "last_messages": 1 + }, + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + }, + "temperature": 0, + "top_p": 0 +} +``` - The reasoning text from the model. +## Submit tool outputs to run - - `Type ReasoningText` +`client.Beta.Threads.Runs.SubmitToolOutputs(ctx, threadID, runID, body) (*Run, error)` - The type of the reasoning text. Always `reasoning_text`. +**post** `/threads/{thread_id}/runs/{run_id}/submit_tool_outputs` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` +When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. - - `type BetaResponseOutputRefusal struct{…}` +### Parameters - A refusal from the model. +- `threadID string` - - `type BetaResponseInputImage struct{…}` +- `runID string` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). +- `body BetaThreadRunSubmitToolOutputsParams` - - `type BetaResponseItemAgentMessageContentComputerScreenshot struct{…}` + - `ToolOutputs param.Field[[]BetaThreadRunSubmitToolOutputsParamsToolOutput]` - A screenshot of a computer. + A list of tools for which the outputs are being submitted. - - `Detail string` + - `Output string` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The output of the tool call to be submitted to continue the run. - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailLow BetaResponseItemAgentMessageContentComputerScreenshotDetail = "low"` + - `ToolCallID string` - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailHigh BetaResponseItemAgentMessageContentComputerScreenshotDetail = "high"` + The ID of the tool call in the `required_action` object within the run object the output is being submitted for. - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailAuto BetaResponseItemAgentMessageContentComputerScreenshotDetail = "auto"` + - `` - - `const BetaResponseItemAgentMessageContentComputerScreenshotDetailOriginal BetaResponseItemAgentMessageContentComputerScreenshotDetail = "original"` +### Returns - - `FileID string` +- `type Run struct{…}` - The identifier of an uploaded file that contains the screenshot. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `ImageURL string` + - `ID string` - The URL of the screenshot image. + The identifier, which can be referenced in API endpoints. - - `Type ComputerScreenshot` + - `AssistantID string` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `CancelledAt int64` - - `PromptCacheBreakpoint BetaResponseItemAgentMessageContentComputerScreenshotPromptCacheBreakpoint` + The Unix timestamp (in seconds) for when the run was cancelled. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `CompletedAt int64` - - `Mode Explicit` + The Unix timestamp (in seconds) for when the run was completed. - The breakpoint mode. Always `explicit`. + - `CreatedAt int64` - - `const ExplicitExplicit Explicit = "explicit"` + The Unix timestamp (in seconds) for when the run was created. - - `type BetaResponseInputFile struct{…}` + - `ExpiresAt int64` - A file input to the model. + The Unix timestamp (in seconds) for when the run will expire. - - `type BetaResponseItemAgentMessageContentEncryptedContent struct{…}` + - `FailedAt int64` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The Unix timestamp (in seconds) for when the run failed. - - `EncryptedContent string` + - `IncompleteDetails RunIncompleteDetails` - Opaque encrypted content. + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - `Type EncryptedContent` + - `Reason string` - The type of the input item. Always `encrypted_content`. + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - - `Recipient string` + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - The destination agent identity. + - `Instructions string` - - `Type AgentMessage` + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The type of the item. Always `agent_message`. + - `LastError RunLastError` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + The last error associated with this run. Will be `null` if there are no errors. - - `Agent BetaResponseItemAgentMessageAgent` + - `Code string` - The agent that produced this item. + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - - `AgentName string` + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - The canonical name of the agent that produced this item. + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - - `type BetaResponseItemMultiAgentCall struct{…}` + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - - `ID string` + - `Message string` - The unique ID of the multi-agent call item. + A human-readable description of the error. - - `Action string` + - `MaxCompletionTokens int64` - The multi-agent action to execute. + The maximum number of completion tokens specified to have been used over the course of the run. - - `const BetaResponseItemMultiAgentCallActionSpawnAgent BetaResponseItemMultiAgentCallAction = "spawn_agent"` + - `MaxPromptTokens int64` - - `const BetaResponseItemMultiAgentCallActionInterruptAgent BetaResponseItemMultiAgentCallAction = "interrupt_agent"` + The maximum number of prompt tokens specified to have been used over the course of the run. - - `const BetaResponseItemMultiAgentCallActionListAgents BetaResponseItemMultiAgentCallAction = "list_agents"` + - `Metadata Metadata` - - `const BetaResponseItemMultiAgentCallActionSendMessage BetaResponseItemMultiAgentCallAction = "send_message"` + 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. - - `const BetaResponseItemMultiAgentCallActionFollowupTask BetaResponseItemMultiAgentCallAction = "followup_task"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaResponseItemMultiAgentCallActionWaitAgent BetaResponseItemMultiAgentCallAction = "wait_agent"` + - `Model string` - - `Arguments string` + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The JSON string of arguments generated for the action. + - `Object ThreadRun` - - `CallID string` + The object type, which is always `thread.run`. - The unique ID linking this call to its output. + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - - `Type MultiAgentCall` + - `ParallelToolCalls bool` - The type of the multi-agent call. Always `multi_agent_call`. + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `RequiredAction RunRequiredAction` - - `Agent BetaResponseItemMultiAgentCallAgent` + Details on the action required to continue the run. Will be `null` if no action is required. - The agent that produced this item. + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - - `AgentName string` + Details on the tool outputs needed for this run to continue. - The canonical name of the agent that produced this item. + - `ToolCalls []RequiredActionFunctionToolCall` - - `type BetaResponseItemMultiAgentCallOutput struct{…}` + A list of the relevant tool calls. - `ID string` - The unique ID of the multi-agent call output item. - - - `Action string` - - The multi-agent action that produced this result. - - - `const BetaResponseItemMultiAgentCallOutputActionSpawnAgent BetaResponseItemMultiAgentCallOutputAction = "spawn_agent"` - - - `const BetaResponseItemMultiAgentCallOutputActionInterruptAgent BetaResponseItemMultiAgentCallOutputAction = "interrupt_agent"` - - - `const BetaResponseItemMultiAgentCallOutputActionListAgents BetaResponseItemMultiAgentCallOutputAction = "list_agents"` - - - `const BetaResponseItemMultiAgentCallOutputActionSendMessage BetaResponseItemMultiAgentCallOutputAction = "send_message"` + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - - `const BetaResponseItemMultiAgentCallOutputActionFollowupTask BetaResponseItemMultiAgentCallOutputAction = "followup_task"` + - `Function RequiredActionFunctionToolCallFunction` - - `const BetaResponseItemMultiAgentCallOutputActionWaitAgent BetaResponseItemMultiAgentCallOutputAction = "wait_agent"` + The function definition. - - `CallID string` + - `Arguments string` - The unique ID of the multi-agent call. + The arguments that the model expects you to pass to the function. - - `Output []BetaResponseOutputText` + - `Name string` - Text output returned by the multi-agent action. + The name of the function. - - `Annotations []BetaResponseOutputTextAnnotationUnion` + - `Type Function` - The annotations of the text output. + The type of tool call the output is required for. For now, this is always `function`. - - `Text string` + - `const FunctionFunction Function = "function"` - The text output from the model. + - `Type SubmitToolOutputs` - - `Type OutputText` + For now, this is always `submit_tool_outputs`. - The type of the output text. Always `output_text`. + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - - `Logprobs []BetaResponseOutputTextLogprob` + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `Type MultiAgentCallOutput` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - The type of the multi-agent result. Always `multi_agent_call_output`. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `Agent BetaResponseItemMultiAgentCallOutputAgent` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - The agent that produced this item. + - `type Auto string` - - `AgentName string` + `auto` is the default value - The canonical name of the agent that produced this item. + - `const AutoAuto Auto = "auto"` - - `type BetaResponseToolSearchCall struct{…}` + - `type ResponseFormatText struct{…}` - - `ID string` + Default response format. Used to generate text responses. - The unique ID of the tool search call item. + - `Type Text` - - `Arguments any` + The type of response format being defined. Always `text`. - Arguments used for the tool search call. + - `const TextText Text = "text"` - - `CallID string` + - `type ResponseFormatJSONObject struct{…}` - The unique ID of the tool search call generated by the model. + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `Execution BetaResponseToolSearchCallExecution` + - `Type JSONObject` - Whether tool search was executed by the server or by the client. + The type of response format being defined. Always `json_object`. - - `const BetaResponseToolSearchCallExecutionServer BetaResponseToolSearchCallExecution = "server"` + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `const BetaResponseToolSearchCallExecutionClient BetaResponseToolSearchCallExecution = "client"` + - `type ResponseFormatJSONSchema struct{…}` - - `Status BetaResponseToolSearchCallStatus` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - The status of the tool search call item that was recorded. + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `const BetaResponseToolSearchCallStatusInProgress BetaResponseToolSearchCallStatus = "in_progress"` + Structured Outputs configuration options, including a JSON Schema. - - `const BetaResponseToolSearchCallStatusCompleted BetaResponseToolSearchCallStatus = "completed"` + - `Name string` - - `const BetaResponseToolSearchCallStatusIncomplete BetaResponseToolSearchCallStatus = "incomplete"` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `Type ToolSearchCall` + - `Description string` - The type of the item. Always `tool_search_call`. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` + - `Schema map[string, any]` - - `Agent BetaResponseToolSearchCallAgent` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - The agent that produced this item. + - `Strict bool` - - `AgentName string` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - The canonical name of the agent that produced this item. + - `Type JSONSchema` - - `CreatedBy string` + The type of response format being defined. Always `json_schema`. - The identifier of the actor that created the item. + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `type BetaResponseToolSearchOutputItem struct{…}` + - `StartedAt int64` - - `ID string` + The Unix timestamp (in seconds) for when the run was started. - The unique ID of the tool search output item. + - `Status RunStatus` - - `CallID string` + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - The unique ID of the tool search call generated by the model. + - `const RunStatusQueued RunStatus = "queued"` - - `Execution BetaResponseToolSearchOutputItemExecution` + - `const RunStatusInProgress RunStatus = "in_progress"` - Whether tool search was executed by the server or by the client. + - `const RunStatusRequiresAction RunStatus = "requires_action"` - - `const BetaResponseToolSearchOutputItemExecutionServer BetaResponseToolSearchOutputItemExecution = "server"` + - `const RunStatusCancelling RunStatus = "cancelling"` - - `const BetaResponseToolSearchOutputItemExecutionClient BetaResponseToolSearchOutputItemExecution = "client"` + - `const RunStatusCancelled RunStatus = "cancelled"` - - `Status BetaResponseToolSearchOutputItemStatus` + - `const RunStatusFailed RunStatus = "failed"` - The status of the tool search output item that was recorded. + - `const RunStatusCompleted RunStatus = "completed"` - - `const BetaResponseToolSearchOutputItemStatusInProgress BetaResponseToolSearchOutputItemStatus = "in_progress"` + - `const RunStatusIncomplete RunStatus = "incomplete"` - - `const BetaResponseToolSearchOutputItemStatusCompleted BetaResponseToolSearchOutputItemStatus = "completed"` + - `const RunStatusExpired RunStatus = "expired"` - - `const BetaResponseToolSearchOutputItemStatusIncomplete BetaResponseToolSearchOutputItemStatus = "incomplete"` + - `ThreadID string` - - `Tools []BetaToolUnion` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - The loaded tool definitions returned by tool search. + - `ToolChoice AssistantToolChoiceOptionUnion` - - `type BetaFunctionTool struct{…}` + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `type AssistantToolChoiceOptionAuto string` - - `Name string` + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - The name of the function to call. + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - - `Parameters map[string, any]` + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - A JSON schema object describing the parameters of the function. + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - - `Strict bool` + - `type AssistantToolChoice struct{…}` - Whether strict parameter validation is enforced for this function tool. + Specifies a tool the model should use. Use to force the model to call a specific tool. - - `Type Function` + - `Type AssistantToolChoiceType` - The type of the function tool. Always `function`. + The type of the tool. If type is `function`, the function name must be set - - `const FunctionFunction Function = "function"` + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - - `AllowedCallers []string` + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - The tool invocation context(s). + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + - `Function AssistantToolChoiceFunction` - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `Name string` - - `DeferLoading bool` + The name of the function to call. - Whether this function is deferred and loaded via tool search. + - `Tools []AssistantToolUnion` - - `Description string` + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - A description of the function. Used by the model to determine whether or not to call the function. + - `type CodeInterpreterTool struct{…}` - - `OutputSchema map[string, any]` + - `Type CodeInterpreter` - A JSON schema object describing the JSON value encoded in string outputs for this function. + The type of tool being defined: `code_interpreter` - - `type BetaFileSearchTool struct{…}` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `type FileSearchTool struct{…}` - `Type FileSearch` - The type of the file search tool. Always `file_search`. + The type of tool being defined: `file_search` - `const FileSearchFileSearch FileSearch = "file_search"` - - `VectorStoreIDs []string` + - `FileSearch FileSearchToolFileSearch` - The IDs of the vector stores to search. + Overrides for the file search tool. - - `Filters BetaFileSearchToolFiltersUnion` + - `MaxNumResults int64` - A filter to apply. + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `Key string` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - The key to compare against the value. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `Type string` + - `ScoreThreshold float64` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `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 + - `Ranker string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + - `type FunctionTool struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` + - `Function FunctionDefinition` - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` + - `Name string` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `Description string` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + A description of what the function does, used by the model to choose when and how to call the function. - The value to compare against the attribute key; supports string, number, or boolean types. + - `Parameters FunctionParameters` - - `string` + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `float64` + Omitting `parameters` defines a function with an empty parameter list. - - `bool` + - `Strict bool` - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + - `Type Function` - Combine multiple filters using `and` or `or`. + The type of tool being defined: `function` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + - `const FunctionFunction Function = "function"` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `TruncationStrategy RunTruncationStrategy` - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `Type string` - - `Key string` + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - The key to compare against the value. + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `Type string` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `LastMessages int64` - - `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 + The number of most recent messages from the thread when constructing the context for the run. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `Usage RunUsage` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `CompletionTokens int64` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + Number of completion tokens used over the course of the run. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `PromptTokens int64` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + Number of prompt tokens used over the course of the run. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `TotalTokens int64` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + Total number of tokens used (prompt + completion). - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + - `Temperature float64` - The value to compare against the attribute key; supports string, number, or boolean types. + The sampling temperature used for this run. If not set, defaults to 1. - - `string` + - `TopP float64` - - `float64` + The nucleus sampling value used for this run. If not set, defaults to 1. - - `bool` +### Example - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` +```go +package main - - `Type string` +import ( + "context" + "fmt" - Type of operation: `and` or `or`. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + run, err := client.Beta.Threads.Runs.SubmitToolOutputs( + context.TODO(), + "thread_id", + "run_id", + openai.BetaThreadRunSubmitToolOutputsParams{ + ToolOutputs: []openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{openai.BetaThreadRunSubmitToolOutputsParamsToolOutput{ - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + }}, + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", run.ID) +} +``` - - `MaxNumResults int64` +#### Response - The maximum number of results to return. This number should be between 1 and 50 inclusive. +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expires_at": 0, + "failed_at": 0, + "incomplete_details": { + "reason": "max_completion_tokens" + }, + "instructions": "instructions", + "last_error": { + "code": "server_error", + "message": "message" + }, + "max_completion_tokens": 256, + "max_prompt_tokens": 256, + "metadata": { + "foo": "string" + }, + "model": "model", + "object": "thread.run", + "parallel_tool_calls": true, + "required_action": { + "submit_tool_outputs": { + "tool_calls": [ + { + "id": "id", + "function": { + "arguments": "arguments", + "name": "name" + }, + "type": "function" + } + ] + }, + "type": "submit_tool_outputs" + }, + "response_format": "auto", + "started_at": 0, + "status": "queued", + "thread_id": "thread_id", + "tool_choice": "none", + "tools": [ + { + "type": "code_interpreter" + } + ], + "truncation_strategy": { + "type": "auto", + "last_messages": 1 + }, + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + }, + "temperature": 0, + "top_p": 0 +} +``` - - `RankingOptions BetaFileSearchToolRankingOptions` +## Cancel a run - Ranking options for search. +`client.Beta.Threads.Runs.Cancel(ctx, threadID, runID) (*Run, error)` - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` +**post** `/threads/{thread_id}/runs/{run_id}/cancel` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. +Cancels a run that is `in_progress`. - - `EmbeddingWeight float64` +### Parameters - The weight of the embedding in the reciprocal ranking fusion. +- `threadID string` - - `TextWeight float64` +- `runID string` - The weight of the text in the reciprocal ranking fusion. +### Returns - - `Ranker string` +- `type Run struct{…}` - The ranker to use for the file search. + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + - `ID string` - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + The identifier, which can be referenced in API endpoints. - - `ScoreThreshold float64` + - `AssistantID string` - 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. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - - `type BetaComputerTool struct{…}` + - `CancelledAt int64` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The Unix timestamp (in seconds) for when the run was cancelled. - - `Type Computer` + - `CompletedAt int64` - The type of the computer tool. Always `computer`. + The Unix timestamp (in seconds) for when the run was completed. - - `const ComputerComputer Computer = "computer"` + - `CreatedAt int64` - - `type BetaComputerUsePreviewTool struct{…}` + The Unix timestamp (in seconds) for when the run was created. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `ExpiresAt int64` - - `DisplayHeight int64` + The Unix timestamp (in seconds) for when the run will expire. - The height of the computer display. + - `FailedAt int64` - - `DisplayWidth int64` + The Unix timestamp (in seconds) for when the run failed. - The width of the computer display. + - `IncompleteDetails RunIncompleteDetails` - - `Environment BetaComputerUsePreviewToolEnvironment` + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - The type of computer environment to control. + - `Reason string` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `Instructions string` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `Type ComputerUsePreview` + - `LastError RunLastError` - The type of the computer use tool. Always `computer_use_preview`. + The last error associated with this run. Will be `null` if there are no errors. - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + - `Code string` - - `type BetaWebSearchTool struct{…}` + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - - `Type BetaWebSearchToolType` + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + - `Message string` - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + A human-readable description of the error. - - `Filters BetaWebSearchToolFilters` + - `MaxCompletionTokens int64` - Filters for the search. + The maximum number of completion tokens specified to have been used over the course of the run. - - `AllowedDomains []string` + - `MaxPromptTokens int64` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + The maximum number of prompt tokens specified to have been used over the course of the run. - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `Metadata Metadata` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + 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. - 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. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `Model string` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + - `Object ThreadRun` - - `UserLocation BetaWebSearchToolUserLocation` + The object type, which is always `thread.run`. - The approximate location of the user. + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - - `City string` + - `ParallelToolCalls bool` - Free text input for the city of the user, e.g. `San Francisco`. + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - `Country string` + - `RequiredAction RunRequiredAction` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + Details on the action required to continue the run. Will be `null` if no action is required. - - `Region string` + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - Free text input for the region of the user, e.g. `California`. + Details on the tool outputs needed for this run to continue. - - `Timezone string` + - `ToolCalls []RequiredActionFunctionToolCall` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + A list of the relevant tool calls. - - `Type string` + - `ID string` - The type of location approximation. Always `approximate`. + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + - `Function RequiredActionFunctionToolCallFunction` - - `type BetaToolMcp struct{…}` + The function definition. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Arguments string` - - `ServerLabel string` + The arguments that the model expects you to pass to the function. - A label for this MCP server, used to identify it in tool calls. + - `Name string` - - `Type Mcp` + The name of the function. - The type of the MCP tool. Always `mcp`. + - `Type Function` - - `const McpMcp Mcp = "mcp"` + The type of tool call the output is required for. For now, this is always `function`. - - `AllowedCallers []string` + - `const FunctionFunction Function = "function"` - The tool invocation context(s). + - `Type SubmitToolOutputs` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + For now, this is always `submit_tool_outputs`. - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - - `AllowedTools BetaToolMcpAllowedToolsUnion` + - `ResponseFormat AssistantResponseFormatOptionUnion` - List of allowed tool names or a filter object. + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - A string array of allowed tool names + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - A filter object to specify which tools are allowed. + - `type Auto string` - - `ReadOnly bool` + `auto` is the default value - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `const AutoAuto Auto = "auto"` - - `ToolNames []string` + - `type ResponseFormatText struct{…}` - List of allowed tool names. + Default response format. Used to generate text responses. - - `Authorization string` + - `Type Text` - 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. + The type of response format being defined. Always `text`. - - `ConnectorID string` + - `const TextText Text = "text"` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + - `type ResponseFormatJSONObject struct{…}` - Currently supported `connector_id` values are: + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - 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` + - `Type JSONObject` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` + The type of response format being defined. Always `json_object`. - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` + - `type ResponseFormatJSONSchema struct{…}` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + Structured Outputs configuration options, including a JSON Schema. - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + - `Name string` - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `DeferLoading bool` + - `Description string` - Whether this MCP tool is deferred and discovered via tool search. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `Headers map[string, string]` + - `Schema map[string, any]` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `RequireApproval BetaToolMcpRequireApprovalUnion` + - `Strict bool` - Specify which of the MCP server's tools require approval. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + - `Type JSONSchema` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + The type of response format being defined. Always `json_schema`. - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - A filter object to specify which tools are allowed. + - `StartedAt int64` - - `ReadOnly bool` + The Unix timestamp (in seconds) for when the run was started. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Status RunStatus` - - `ToolNames []string` + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - List of allowed tool names. + - `const RunStatusQueued RunStatus = "queued"` - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `const RunStatusInProgress RunStatus = "in_progress"` - A filter object to specify which tools are allowed. + - `const RunStatusRequiresAction RunStatus = "requires_action"` - - `ReadOnly bool` + - `const RunStatusCancelling RunStatus = "cancelling"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `const RunStatusCancelled RunStatus = "cancelled"` - - `ToolNames []string` + - `const RunStatusFailed RunStatus = "failed"` - List of allowed tool names. + - `const RunStatusCompleted RunStatus = "completed"` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `const RunStatusIncomplete RunStatus = "incomplete"` - 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 RunStatusExpired RunStatus = "expired"` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + - `ThreadID string` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - - `ServerDescription string` + - `ToolChoice AssistantToolChoiceOptionUnion` - Optional description of the MCP server, used to provide more context. + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `ServerURL string` + - `type AssistantToolChoiceOptionAuto string` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - `TunnelID string` + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - 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. + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - - `type BetaToolCodeInterpreter struct{…}` + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - A tool that runs Python code to help generate a response to a prompt. + - `type AssistantToolChoice struct{…}` - - `Container BetaToolCodeInterpreterContainerUnion` + Specifies a tool the model should use. Use to force the model to call a specific tool. - 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. + - `Type AssistantToolChoiceType` - - `string` + The type of the tool. If type is `function`, the function name must be set - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - - `Type Auto` + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - Always `auto`. + - `Function AssistantToolChoiceFunction` - - `const AutoAuto Auto = "auto"` + - `Name string` - - `FileIDs []string` + The name of the function to call. - An optional list of uploaded files to make available to your code. + - `Tools []AssistantToolUnion` - - `MemoryLimit string` + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - The memory limit for the code interpreter container. + - `type CodeInterpreterTool struct{…}` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + - `Type CodeInterpreter` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + The type of tool being defined: `code_interpreter` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `type FileSearchTool struct{…}` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `Type FileSearch` - Network access policy for the container. + The type of tool being defined: `file_search` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Type Disabled` + - `FileSearch FileSearchToolFileSearch` - Disable outbound network access. Always `disabled`. + Overrides for the file search tool. - - `const DisabledDisabled Disabled = "disabled"` + - `MaxNumResults int64` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - - `AllowedDomains []string` + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - A list of allowed domains when type is `allowlist`. + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `Type Allowlist` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - Allow outbound network access only to specified domains. Always `allowlist`. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `ScoreThreshold float64` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - Optional domain-scoped secrets for allowlisted domains. + - `Ranker string` - - `Domain string` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The domain associated with the secret. + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `Name string` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - The name of the secret to inject for the domain. + - `type FunctionTool struct{…}` - - `Value string` + - `Function FunctionDefinition` - The secret value to inject for the domain. + - `Name string` - - `Type CodeInterpreter` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - The type of the code interpreter tool. Always `code_interpreter`. + - `Description string` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + A description of what the function does, used by the model to choose when and how to call the function. - - `AllowedCallers []string` + - `Parameters FunctionParameters` - The tool invocation context(s). + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + Omitting `parameters` defines a function with an empty parameter list. - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + - `Strict bool` - - `type BetaToolProgrammaticToolCalling struct{…}` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `Type ProgrammaticToolCalling` + - `Type Function` - The type of the tool. Always `programmatic_tool_calling`. + The type of tool being defined: `function` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `const FunctionFunction Function = "function"` - - `type BetaToolImageGeneration struct{…}` + - `TruncationStrategy RunTruncationStrategy` - A tool that generates images using the GPT image models. + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `Type ImageGeneration` + - `Type string` - The type of the image generation tool. Always `image_generation`. + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - - `Action string` + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - Whether to generate a new image or edit an existing image. Default: `auto`. + - `LastMessages int64` - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + The number of most recent messages from the thread when constructing the context for the run. - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `Usage RunUsage` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - - `Background string` + - `CompletionTokens int64` - 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. + Number of completion tokens used over the course of the run. - `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. + - `PromptTokens int64` - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + Number of prompt tokens used over the course of the run. - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + - `TotalTokens int64` - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + Total number of tokens used (prompt + completion). - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + - `Temperature float64` - - `InputFidelity string` + The sampling temperature used for this run. If not set, defaults to 1. - 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`. + - `TopP float64` - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + The nucleus sampling value used for this run. If not set, defaults to 1. - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` +### Example - - `InputImageMask BetaToolImageGenerationInputImageMask` +```go +package main - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). +import ( + "context" + "fmt" - - `FileID string` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - File ID for the mask image. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + run, err := client.Beta.Threads.Runs.Cancel( + context.TODO(), + "thread_id", + "run_id", + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", run.ID) +} +``` - - `ImageURL string` +#### Response + +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expires_at": 0, + "failed_at": 0, + "incomplete_details": { + "reason": "max_completion_tokens" + }, + "instructions": "instructions", + "last_error": { + "code": "server_error", + "message": "message" + }, + "max_completion_tokens": 256, + "max_prompt_tokens": 256, + "metadata": { + "foo": "string" + }, + "model": "model", + "object": "thread.run", + "parallel_tool_calls": true, + "required_action": { + "submit_tool_outputs": { + "tool_calls": [ + { + "id": "id", + "function": { + "arguments": "arguments", + "name": "name" + }, + "type": "function" + } + ] + }, + "type": "submit_tool_outputs" + }, + "response_format": "auto", + "started_at": 0, + "status": "queued", + "thread_id": "thread_id", + "tool_choice": "none", + "tools": [ + { + "type": "code_interpreter" + } + ], + "truncation_strategy": { + "type": "auto", + "last_messages": 1 + }, + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + }, + "temperature": 0, + "top_p": 0 +} +``` - Base64-encoded mask image. +## Domain Types - - `Model string` +### Required Action Function Tool Call - The image generation model to use. Default: `gpt-image-1`. +- `type RequiredActionFunctionToolCall struct{…}` - - `string` + Tool call objects - - `string` + - `ID string` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `Function RequiredActionFunctionToolCallFunction` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + The function definition. - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `Arguments string` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + The arguments that the model expects you to pass to the function. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `Name string` - - `Moderation string` + The name of the function. - Moderation level for the generated image. Default: `auto`. + - `Type Function` - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + The type of tool call the output is required for. For now, this is always `function`. - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `const FunctionFunction Function = "function"` - - `OutputCompression int64` +### Run - Compression level for the output image. Default: 100. +- `type Run struct{…}` - - `OutputFormat string` + Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `ID string` - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` + The identifier, which can be referenced in API endpoints. - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + - `AssistantID string` - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - - `PartialImages int64` + - `CancelledAt int64` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + The Unix timestamp (in seconds) for when the run was cancelled. - - `Quality string` + - `CompletedAt int64` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + The Unix timestamp (in seconds) for when the run was completed. - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` + - `CreatedAt int64` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` + The Unix timestamp (in seconds) for when the run was created. - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` + - `ExpiresAt int64` - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` + The Unix timestamp (in seconds) for when the run will expire. - - `Size string` + - `FailedAt int64` - 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`. + The Unix timestamp (in seconds) for when the run failed. - - `string` + - `IncompleteDetails RunIncompleteDetails` - - `string` + Details on why the run is incomplete. Will be `null` if the run is not incomplete. - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + - `Reason string` - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + - `const RunIncompleteDetailsReasonMaxCompletionTokens RunIncompleteDetailsReason = "max_completion_tokens"` - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + - `const RunIncompleteDetailsReasonMaxPromptTokens RunIncompleteDetailsReason = "max_prompt_tokens"` - - `type BetaToolLocalShell struct{…}` + - `Instructions string` - A tool that allows the model to execute shell commands in a local environment. + The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `Type LocalShell` + - `LastError RunLastError` - The type of the local shell tool. Always `local_shell`. + The last error associated with this run. Will be `null` if there are no errors. - - `const LocalShellLocalShell LocalShell = "local_shell"` + - `Code string` - - `type BetaFunctionShellTool struct{…}` + One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - A tool that allows the model to execute shell commands. + - `const RunLastErrorCodeServerError RunLastErrorCode = "server_error"` - - `Type Shell` + - `const RunLastErrorCodeRateLimitExceeded RunLastErrorCode = "rate_limit_exceeded"` - The type of the shell tool. Always `shell`. + - `const RunLastErrorCodeInvalidPrompt RunLastErrorCode = "invalid_prompt"` - - `const ShellShell Shell = "shell"` + - `Message string` - - `AllowedCallers []string` + A human-readable description of the error. - The tool invocation context(s). + - `MaxCompletionTokens int64` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + The maximum number of completion tokens specified to have been used over the course of the run. - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + - `MaxPromptTokens int64` - - `Environment BetaFunctionShellToolEnvironmentUnion` + The maximum number of prompt tokens specified to have been used over the course of the run. - - `type BetaContainerAuto struct{…}` + - `Metadata Metadata` - - `Type ContainerAuto` + 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. - Automatically creates a container for this request + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + - `Model string` - - `FileIDs []string` + The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - An optional list of uploaded files to make available to your code. + - `Object ThreadRun` - - `MemoryLimit BetaContainerAutoMemoryLimit` + The object type, which is always `thread.run`. - The memory limit for the container. + - `const ThreadRunThreadRun ThreadRun = "thread.run"` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + - `ParallelToolCalls bool` - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + - `RequiredAction RunRequiredAction` - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + Details on the action required to continue the run. Will be `null` if no action is required. - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `SubmitToolOutputs RunRequiredActionSubmitToolOutputs` - Network access policy for the container. + Details on the tool outputs needed for this run to continue. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `ToolCalls []RequiredActionFunctionToolCall` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + A list of the relevant tool calls. - - `Skills []BetaContainerAutoSkillUnion` + - `ID string` - An optional list of skills referenced by id or inline data. + The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - - `type BetaSkillReference struct{…}` + - `Function RequiredActionFunctionToolCallFunction` - - `SkillID string` + The function definition. - The ID of the referenced skill. + - `Arguments string` - - `Type SkillReference` + The arguments that the model expects you to pass to the function. - References a skill created with the /v1/skills endpoint. + - `Name string` - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + The name of the function. - - `Version string` + - `Type Function` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + The type of tool call the output is required for. For now, this is always `function`. - - `type BetaInlineSkill struct{…}` + - `const FunctionFunction Function = "function"` - - `Description string` + - `Type SubmitToolOutputs` - The description of the skill. + For now, this is always `submit_tool_outputs`. - - `Name string` + - `const SubmitToolOutputsSubmitToolOutputs SubmitToolOutputs = "submit_tool_outputs"` - The name of the skill. + - `ResponseFormat AssistantResponseFormatOptionUnion` - - `Source BetaInlineSkillSource` + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - Inline skill payload + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Data string` + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - Base64-encoded skill zip bundle. + **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - - `MediaType ApplicationZip` + - `type Auto string` - The media type of the inline skill payload. Must be `application/zip`. + `auto` is the default value - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `const AutoAuto Auto = "auto"` - - `Type Base64` + - `type ResponseFormatText struct{…}` - The type of the inline skill source. Must be `base64`. + Default response format. Used to generate text responses. - - `const Base64Base64 Base64 = "base64"` + - `Type Text` - - `Type Inline` + The type of response format being defined. Always `text`. - Defines an inline skill for this request. + - `const TextText Text = "text"` - - `const InlineInline Inline = "inline"` + - `type ResponseFormatJSONObject struct{…}` - - `type BetaLocalEnvironment struct{…}` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - - `Type Local` + - `Type JSONObject` - Use a local computer environment. + The type of response format being defined. Always `json_object`. - - `const LocalLocal Local = "local"` + - `const JSONObjectJSONObject JSONObject = "json_object"` - - `Skills []BetaLocalSkill` + - `type ResponseFormatJSONSchema struct{…}` - An optional list of skills. + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - - `Description string` + - `JSONSchema ResponseFormatJSONSchemaJSONSchema` - The description of the skill. + Structured Outputs configuration options, including a JSON Schema. - `Name string` - The name of the skill. - - - `Path string` - - The path to the directory containing the skill. - - - `type BetaContainerReference struct{…}` - - - `ContainerID string` - - The ID of the referenced container. - - - `Type ContainerReference` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - References a container created with the /v1/containers endpoint + - `Description string` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `type BetaCustomTool struct{…}` + - `Schema map[string, any]` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `Name string` + - `Strict bool` - The name of the custom tool, used to identify it in tool calls. + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). - - `Type Custom` + - `Type JSONSchema` - The type of the custom tool. Always `custom`. + The type of response format being defined. Always `json_schema`. - - `const CustomCustom Custom = "custom"` + - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` - - `AllowedCallers []string` + - `StartedAt int64` - The tool invocation context(s). + The Unix timestamp (in seconds) for when the run was started. - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `Status RunStatus` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - - `DeferLoading bool` + - `const RunStatusQueued RunStatus = "queued"` - Whether this tool should be deferred and discovered via tool search. + - `const RunStatusInProgress RunStatus = "in_progress"` - - `Description string` + - `const RunStatusRequiresAction RunStatus = "requires_action"` - Optional description of the custom tool, used to provide more context. + - `const RunStatusCancelling RunStatus = "cancelling"` - - `Format BetaCustomToolFormatUnion` + - `const RunStatusCancelled RunStatus = "cancelled"` - The input format for the custom tool. Default is unconstrained text. + - `const RunStatusFailed RunStatus = "failed"` - - `type BetaCustomToolFormatText struct{…}` + - `const RunStatusCompleted RunStatus = "completed"` - Unconstrained free-form text. + - `const RunStatusIncomplete RunStatus = "incomplete"` - - `Type Text` + - `const RunStatusExpired RunStatus = "expired"` - Unconstrained text format. Always `text`. + - `ThreadID string` - - `const TextText Text = "text"` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - - `type BetaCustomToolFormatGrammar struct{…}` + - `ToolChoice AssistantToolChoiceOptionUnion` - A grammar defined by the user. + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - - `Definition string` + - `type AssistantToolChoiceOptionAuto string` - The grammar definition. + `none` means the model will not call any tools and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools before responding to the user. - - `Syntax string` + - `const AssistantToolChoiceOptionAutoNone AssistantToolChoiceOptionAuto = "none"` - The syntax of the grammar definition. One of `lark` or `regex`. + - `const AssistantToolChoiceOptionAutoAuto AssistantToolChoiceOptionAuto = "auto"` - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `const AssistantToolChoiceOptionAutoRequired AssistantToolChoiceOptionAuto = "required"` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `type AssistantToolChoice struct{…}` - - `Type Grammar` + Specifies a tool the model should use. Use to force the model to call a specific tool. - Grammar format. Always `grammar`. + - `Type AssistantToolChoiceType` - - `const GrammarGrammar Grammar = "grammar"` + The type of the tool. If type is `function`, the function name must be set - - `type BetaNamespaceTool struct{…}` + - `const AssistantToolChoiceTypeFunction AssistantToolChoiceType = "function"` - Groups function/custom tools under a shared namespace. + - `const AssistantToolChoiceTypeCodeInterpreter AssistantToolChoiceType = "code_interpreter"` - - `Description string` + - `const AssistantToolChoiceTypeFileSearch AssistantToolChoiceType = "file_search"` - A description of the namespace shown to the model. + - `Function AssistantToolChoiceFunction` - `Name string` - The namespace name used in tool calls (for example, `crm`). + The name of the function to call. - - `Tools []BetaNamespaceToolToolUnion` + - `Tools []AssistantToolUnion` - The function/custom tools available inside this namespace. + The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - - `type BetaNamespaceToolToolFunction struct{…}` + - `type CodeInterpreterTool struct{…}` - - `Name string` + - `Type CodeInterpreter` - - `Type Function` + The type of tool being defined: `code_interpreter` - - `const FunctionFunction Function = "function"` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `AllowedCallers []string` + - `type FileSearchTool struct{…}` - The tool invocation context(s). + - `Type FileSearch` - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` + The type of tool being defined: `file_search` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `DeferLoading bool` + - `FileSearch FileSearchToolFileSearch` - Whether this function should be deferred and discovered via tool search. + Overrides for the file search tool. - - `Description string` + - `MaxNumResults int64` - - `OutputSchema map[string, any]` + The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `Parameters any` + - `RankingOptions FileSearchToolFileSearchRankingOptions` - - `Strict bool` + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `type BetaCustomTool struct{…}` + - `ScoreThreshold float64` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `Type Namespace` + - `Ranker string` - The type of the tool. Always `namespace`. + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `const NamespaceNamespace Namespace = "namespace"` + - `const FileSearchToolFileSearchRankingOptionsRankerAuto FileSearchToolFileSearchRankingOptionsRanker = "auto"` - - `type BetaToolSearchTool struct{…}` + - `const FileSearchToolFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolFileSearchRankingOptionsRanker = "default_2024_08_21"` - Hosted or BYOT tool search configuration for deferred tools. + - `type FunctionTool struct{…}` - - `Type ToolSearch` + - `Function FunctionDefinition` - The type of the tool. Always `tool_search`. + - `Name string` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` + The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - `Description string` - Description shown to the model for a client-executed tool search tool. - - - `Execution BetaToolSearchToolExecution` - - Whether tool search is executed by the server or by the client. - - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` - - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` - - - `Parameters any` - - Parameter schema for a client-executed tool search tool. - - - `type BetaWebSearchPreviewTool struct{…}` - - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + A description of what the function does, used by the model to choose when and how to call the function. - - `Type BetaWebSearchPreviewToolType` + - `Parameters FunctionParameters` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + Omitting `parameters` defines a function with an empty parameter list. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + - `Strict bool` - - `SearchContentTypes []string` + Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `Type Function` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + The type of tool being defined: `function` - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `const FunctionFunction Function = "function"` - 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. + - `TruncationStrategy RunTruncationStrategy` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + - `Type string` - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `const RunTruncationStrategyTypeAuto RunTruncationStrategyType = "auto"` - The user's location. + - `const RunTruncationStrategyTypeLastMessages RunTruncationStrategyType = "last_messages"` - - `Type Approximate` + - `LastMessages int64` - The type of location approximation. Always `approximate`. + The number of most recent messages from the thread when constructing the context for the run. - - `const ApproximateApproximate Approximate = "approximate"` + - `Usage RunUsage` - - `City string` + Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - Free text input for the city of the user, e.g. `San Francisco`. + - `CompletionTokens int64` - - `Country string` + Number of completion tokens used over the course of the run. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `PromptTokens int64` - - `Region string` + Number of prompt tokens used over the course of the run. - Free text input for the region of the user, e.g. `California`. + - `TotalTokens int64` - - `Timezone string` + Total number of tokens used (prompt + completion). - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `Temperature float64` - - `type BetaApplyPatchTool struct{…}` + The sampling temperature used for this run. If not set, defaults to 1. - Allows the assistant to create, delete, or update files using unified diffs. + - `TopP float64` - - `Type ApplyPatch` + The nucleus sampling value used for this run. If not set, defaults to 1. - The type of the tool. Always `apply_patch`. +### Run Status - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` +- `type RunStatus string` - - `AllowedCallers []string` + The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - The tool invocation context(s). + - `const RunStatusQueued RunStatus = "queued"` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + - `const RunStatusInProgress RunStatus = "in_progress"` - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `const RunStatusRequiresAction RunStatus = "requires_action"` - - `Type ToolSearchOutput` + - `const RunStatusCancelling RunStatus = "cancelling"` - The type of the item. Always `tool_search_output`. + - `const RunStatusCancelled RunStatus = "cancelled"` - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `const RunStatusFailed RunStatus = "failed"` - - `Agent BetaResponseToolSearchOutputItemAgent` + - `const RunStatusCompleted RunStatus = "completed"` - The agent that produced this item. + - `const RunStatusIncomplete RunStatus = "incomplete"` - - `AgentName string` + - `const RunStatusExpired RunStatus = "expired"` - The canonical name of the agent that produced this item. +# Steps - - `CreatedBy string` +## List run steps - The identifier of the actor that created the item. +`client.Beta.Threads.Runs.Steps.List(ctx, threadID, runID, query) (*CursorPage[RunStep], error)` - - `type BetaResponseItemAdditionalTools struct{…}` +**get** `/threads/{thread_id}/runs/{run_id}/steps` - - `ID string` +Returns a list of run steps belonging to a run. - The unique ID of the additional tools item. +### Parameters - - `Role string` +- `threadID string` - The role that provided the additional tools. +- `runID string` - - `const BetaResponseItemAdditionalToolsRoleUnknown BetaResponseItemAdditionalToolsRole = "unknown"` +- `query BetaThreadRunStepListParams` - - `const BetaResponseItemAdditionalToolsRoleUser BetaResponseItemAdditionalToolsRole = "user"` + - `After param.Field[string]` - - `const BetaResponseItemAdditionalToolsRoleAssistant BetaResponseItemAdditionalToolsRole = "assistant"` + A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - - `const BetaResponseItemAdditionalToolsRoleSystem BetaResponseItemAdditionalToolsRole = "system"` + - `Before param.Field[string]` - - `const BetaResponseItemAdditionalToolsRoleCritic BetaResponseItemAdditionalToolsRole = "critic"` + A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - - `const BetaResponseItemAdditionalToolsRoleDiscriminator BetaResponseItemAdditionalToolsRole = "discriminator"` + - `Include param.Field[[]RunStepInclude]` - - `const BetaResponseItemAdditionalToolsRoleDeveloper BetaResponseItemAdditionalToolsRole = "developer"` + A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - - `const BetaResponseItemAdditionalToolsRoleTool BetaResponseItemAdditionalToolsRole = "tool"` + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `Tools []BetaToolUnion` + - `const RunStepIncludeStepDetailsToolCallsFileSearchResultsContent RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` - The additional tool definitions made available at this item. + - `Limit param.Field[int64]` - - `type BetaFunctionTool struct{…}` + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `Order param.Field[BetaThreadRunStepListParamsOrder]` - - `type BetaFileSearchTool struct{…}` + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaThreadRunStepListParamsOrderAsc BetaThreadRunStepListParamsOrder = "asc"` - - `type BetaComputerTool struct{…}` + - `const BetaThreadRunStepListParamsOrderDesc BetaThreadRunStepListParamsOrder = "desc"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). +### Returns - - `type BetaComputerUsePreviewTool struct{…}` +- `type RunStep struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + Represents a step in execution of a run. - - `type BetaWebSearchTool struct{…}` + - `ID string` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The identifier of the run step, which can be referenced in API endpoints. - - `type BetaToolMcp struct{…}` + - `AssistantID string` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. - - `type BetaToolCodeInterpreter struct{…}` + - `CancelledAt int64` - A tool that runs Python code to help generate a response to a prompt. + The Unix timestamp (in seconds) for when the run step was cancelled. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `CompletedAt int64` - - `type BetaToolImageGeneration struct{…}` + The Unix timestamp (in seconds) for when the run step completed. - A tool that generates images using the GPT image models. + - `CreatedAt int64` - - `type BetaToolLocalShell struct{…}` + The Unix timestamp (in seconds) for when the run step was created. - A tool that allows the model to execute shell commands in a local environment. + - `ExpiredAt int64` - - `type BetaFunctionShellTool struct{…}` + The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - A tool that allows the model to execute shell commands. + - `FailedAt int64` - - `type BetaCustomTool struct{…}` + The Unix timestamp (in seconds) for when the run step failed. - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `LastError RunStepLastError` - - `type BetaNamespaceTool struct{…}` + The last error associated with this run step. Will be `null` if there are no errors. - Groups function/custom tools under a shared namespace. + - `Code string` - - `type BetaToolSearchTool struct{…}` + One of `server_error` or `rate_limit_exceeded`. - Hosted or BYOT tool search configuration for deferred tools. + - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` - - `type BetaWebSearchPreviewTool struct{…}` + - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Message string` - - `type BetaApplyPatchTool struct{…}` + A human-readable description of the error. - Allows the assistant to create, delete, or update files using unified diffs. + - `Metadata Metadata` - - `Type AdditionalTools` + 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. - The type of the item. Always `additional_tools`. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` + - `Object ThreadRunStep` - - `Agent BetaResponseItemAdditionalToolsAgent` + The object type, which is always `thread.run.step`. - The agent that produced this item. + - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` - - `AgentName string` + - `RunID string` - The canonical name of the agent that produced this item. + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. - - `type BetaResponseReasoningItem struct{…}` + - `Status RunStepStatus` - 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](https://platform.openai.com/docs/guides/conversation-state). + The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - `ID string` + - `const RunStepStatusInProgress RunStepStatus = "in_progress"` - The unique identifier of the reasoning content. + - `const RunStepStatusCancelled RunStepStatus = "cancelled"` - - `Summary []BetaResponseReasoningItemSummary` + - `const RunStepStatusFailed RunStepStatus = "failed"` - Reasoning summary content. + - `const RunStepStatusCompleted RunStepStatus = "completed"` - - `Text string` + - `const RunStepStatusExpired RunStepStatus = "expired"` - A summary of the reasoning output from the model so far. + - `StepDetails RunStepStepDetailsUnion` - - `Type SummaryText` + The details of the run step. - The type of the object. Always `summary_text`. + - `type MessageCreationStepDetails struct{…}` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + Details of the message creation by the run step. - - `Type Reasoning` + - `MessageCreation MessageCreationStepDetailsMessageCreation` - The type of the object. Always `reasoning`. + - `MessageID string` - - `const ReasoningReasoning Reasoning = "reasoning"` + The ID of the message that was created by this run step. - - `Agent BetaResponseReasoningItemAgent` + - `Type MessageCreation` - The agent that produced this item. + Always `message_creation`. - - `AgentName string` + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - The canonical name of the agent that produced this item. + - `type ToolCallsStepDetails struct{…}` - - `Content []BetaResponseReasoningItemContent` + Details of the tool call. - Reasoning text content. + - `ToolCalls []ToolCallUnion` - - `Text string` + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - The reasoning text from the model. + - `type CodeInterpreterToolCall struct{…}` - - `Type ReasoningText` + Details of the Code Interpreter tool call the run step was involved in. - The type of the reasoning text. Always `reasoning_text`. + - `ID string` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + The ID of the tool call. - - `EncryptedContent string` + - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + The Code Interpreter tool call definition. - - `Status BetaResponseReasoningItemStatus` + - `Input string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The input to the Code Interpreter tool call. - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` + - `type CodeInterpreterToolCallCodeInterpreterOutputLogs struct{…}` - - `type BetaResponseItemProgram struct{…}` + Text output from the Code Interpreter tool call as part of a run step. - - `ID string` + - `Logs string` - The unique ID of the program item. + The text output from the Code Interpreter tool call. - - `CallID string` + - `Type Logs` - The stable call ID of the program item. + Always `logs`. - - `Code string` + - `const LogsLogs Logs = "logs"` - The JavaScript source executed by programmatic tool calling. + - `type CodeInterpreterToolCallCodeInterpreterOutputImage struct{…}` - - `Fingerprint string` + - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` - Opaque program replay fingerprint that must be round-tripped. + - `FileID string` - - `Type Program` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - The type of the item. Always `program`. + - `Type Image` - - `const ProgramProgram Program = "program"` + Always `image`. - - `Agent BetaResponseItemProgramAgent` + - `const ImageImage Image = "image"` - The agent that produced this item. + - `Type CodeInterpreter` - - `AgentName string` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - The canonical name of the agent that produced this item. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `type BetaResponseItemProgramOutput struct{…}` + - `type FileSearchToolCall struct{…}` - `ID string` - The unique ID of the program output item. - - - `CallID string` - - The call ID of the program item. - - - `Result string` + The ID of the tool call object. - The result produced by the program item. + - `FileSearch FileSearchToolCallFileSearch` - - `Status string` + For now, this is always going to be an empty object. - The terminal status of the program output item. + - `RankingOptions FileSearchToolCallFileSearchRankingOptions` - - `const BetaResponseItemProgramOutputStatusCompleted BetaResponseItemProgramOutputStatus = "completed"` + The ranking options for the file search. - - `const BetaResponseItemProgramOutputStatusIncomplete BetaResponseItemProgramOutputStatus = "incomplete"` + - `Ranker string` - - `Type ProgramOutput` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The type of the item. Always `program_output`. + - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `Agent BetaResponseItemProgramOutputAgent` + - `ScoreThreshold float64` - The agent that produced this item. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `AgentName string` + - `Results []FileSearchToolCallFileSearchResult` - The canonical name of the agent that produced this item. + The results of the file search. - - `type BetaResponseCompactionItem struct{…}` + - `FileID string` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + The ID of the file that result was found in. - - `ID string` + - `FileName string` - The unique ID of the compaction item. + The name of the file that result was found in. - - `EncryptedContent string` + - `Score float64` - The encrypted content that was produced by compaction. + The score of the result. All values must be a floating point number between 0 and 1. - - `Type Compaction` + - `Content []FileSearchToolCallFileSearchResultContent` - The type of the item. Always `compaction`. + The content of the result that was found. The content is only included if requested via the include query parameter. - - `const CompactionCompaction Compaction = "compaction"` + - `Text string` - - `Agent BetaResponseCompactionItemAgent` + The text content of the file. - The agent that produced this item. + - `Type string` - - `AgentName string` + The type of the content. - The canonical name of the agent that produced this item. + - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` - - `CreatedBy string` + - `Type FileSearch` - The identifier of the actor that created the item. + The type of tool call. This is always going to be `file_search` for this type of tool call. - - `type BetaResponseItemImageGenerationCall struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - An image generation request made by the model. + - `type FunctionToolCall struct{…}` - `ID string` - The unique ID of the image generation call. - - - `Result string` - - The generated image encoded in base64. - - - `Status string` + The ID of the tool call object. - The status of the image generation call. + - `Function FunctionToolCallFunction` - - `const BetaResponseItemImageGenerationCallStatusInProgress BetaResponseItemImageGenerationCallStatus = "in_progress"` + The definition of the function that was called. - - `const BetaResponseItemImageGenerationCallStatusCompleted BetaResponseItemImageGenerationCallStatus = "completed"` + - `Arguments string` - - `const BetaResponseItemImageGenerationCallStatusGenerating BetaResponseItemImageGenerationCallStatus = "generating"` + The arguments passed to the function. - - `const BetaResponseItemImageGenerationCallStatusFailed BetaResponseItemImageGenerationCallStatus = "failed"` + - `Name string` - - `Type ImageGenerationCall` + The name of the function. - The type of the image generation call. Always `image_generation_call`. + - `Output string` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `Agent BetaResponseItemImageGenerationCallAgent` + - `Type Function` - The agent that produced this item. + The type of tool call. This is always going to be `function` for this type of tool call. - - `AgentName string` + - `const FunctionFunction Function = "function"` - The canonical name of the agent that produced this item. + - `Type ToolCalls` - - `type BetaResponseCodeInterpreterToolCall struct{…}` + Always `tool_calls`. - A tool call to run code. + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - - `ID string` + - `ThreadID string` - The unique ID of the code interpreter tool call. + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - - `Code string` + - `Type RunStepType` - The code to run, or null if not available. + The type of run step, which can be either `message_creation` or `tool_calls`. - - `ContainerID string` + - `const RunStepTypeMessageCreation RunStepType = "message_creation"` - The ID of the container used to run the code. + - `const RunStepTypeToolCalls RunStepType = "tool_calls"` - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + - `Usage RunStepUsage` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `CompletionTokens int64` - The logs output from the code interpreter. + Number of completion tokens used over the course of the run step. - - `Logs string` + - `PromptTokens int64` - The logs output from the code interpreter. + Number of prompt tokens used over the course of the run step. - - `Type Logs` + - `TotalTokens int64` - The type of the output. Always `logs`. + Total number of tokens used (prompt + completion). - - `const LogsLogs Logs = "logs"` +### Example - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` +```go +package main - The image output from the code interpreter. +import ( + "context" + "fmt" - - `Type Image` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - The type of the output. Always `image`. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + page, err := client.Beta.Threads.Runs.Steps.List( + context.TODO(), + "thread_id", + "run_id", + openai.BetaThreadRunStepListParams{ - - `const ImageImage Image = "image"` + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - - `URL string` +#### Response - The URL of the image output from the code interpreter. +```json +{ + "data": [ + { + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expired_at": 0, + "failed_at": 0, + "last_error": { + "code": "server_error", + "message": "message" + }, + "metadata": { + "foo": "string" + }, + "object": "thread.run.step", + "run_id": "run_id", + "status": "in_progress", + "step_details": { + "message_creation": { + "message_id": "message_id" + }, + "type": "message_creation" + }, + "thread_id": "thread_id", + "type": "message_creation", + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + } + } + ], + "first_id": "step_abc123", + "has_more": false, + "last_id": "step_abc456", + "object": "list" +} +``` - - `Status BetaResponseCodeInterpreterToolCallStatus` +## Retrieve run step - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. +`client.Beta.Threads.Runs.Steps.Get(ctx, threadID, runID, stepID, query) (*RunStep, error)` - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` +**get** `/threads/{thread_id}/runs/{run_id}/steps/{step_id}` - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` +Retrieves a run step. - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` +### Parameters - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` +- `threadID string` - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` +- `runID string` - - `Type CodeInterpreterCall` +- `stepID string` - The type of the code interpreter tool call. Always `code_interpreter_call`. +- `query BetaThreadRunStepGetParams` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + - `Include param.Field[[]RunStepInclude]` - - `Agent BetaResponseCodeInterpreterToolCallAgent` + A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - The agent that produced this item. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - - `AgentName string` + - `const RunStepIncludeStepDetailsToolCallsFileSearchResultsContent RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` - The canonical name of the agent that produced this item. +### Returns - - `type BetaResponseItemLocalShellCall struct{…}` +- `type RunStep struct{…}` - A tool call to run a command on the local shell. + Represents a step in execution of a run. - `ID string` - The unique ID of the local shell call. - - - `Action BetaResponseItemLocalShellCallAction` - - Execute a shell command on the server. - - - `Command []string` - - The command to run. - - - `Env map[string, string]` - - Environment variables to set for the command. + The identifier of the run step, which can be referenced in API endpoints. - - `Type Exec` + - `AssistantID string` - The type of the local shell action. Always `exec`. + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. - - `const ExecExec Exec = "exec"` + - `CancelledAt int64` - - `TimeoutMs int64` + The Unix timestamp (in seconds) for when the run step was cancelled. - Optional timeout in milliseconds for the command. + - `CompletedAt int64` - - `User string` + The Unix timestamp (in seconds) for when the run step completed. - Optional user to run the command as. + - `CreatedAt int64` - - `WorkingDirectory string` + The Unix timestamp (in seconds) for when the run step was created. - Optional working directory to run the command in. + - `ExpiredAt int64` - - `CallID string` + The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - The unique ID of the local shell tool call generated by the model. + - `FailedAt int64` - - `Status string` + The Unix timestamp (in seconds) for when the run step failed. - The status of the local shell call. + - `LastError RunStepLastError` - - `const BetaResponseItemLocalShellCallStatusInProgress BetaResponseItemLocalShellCallStatus = "in_progress"` + The last error associated with this run step. Will be `null` if there are no errors. - - `const BetaResponseItemLocalShellCallStatusCompleted BetaResponseItemLocalShellCallStatus = "completed"` + - `Code string` - - `const BetaResponseItemLocalShellCallStatusIncomplete BetaResponseItemLocalShellCallStatus = "incomplete"` + One of `server_error` or `rate_limit_exceeded`. - - `Type LocalShellCall` + - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` - The type of the local shell call. Always `local_shell_call`. + - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + - `Message string` - - `Agent BetaResponseItemLocalShellCallAgent` + A human-readable description of the error. - The agent that produced this item. + - `Metadata Metadata` - - `AgentName string` + 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. - The canonical name of the agent that produced this item. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `type BetaResponseItemLocalShellCallOutput struct{…}` + - `Object ThreadRunStep` - The output of a local shell tool call. + The object type, which is always `thread.run.step`. - - `ID string` + - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` - The unique ID of the local shell tool call generated by the model. + - `RunID string` - - `Output string` + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. - A JSON string of the output of the local shell tool call. + - `Status RunStepStatus` - - `Type LocalShellCallOutput` + The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - The type of the local shell tool call output. Always `local_shell_call_output`. + - `const RunStepStatusInProgress RunStepStatus = "in_progress"` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + - `const RunStepStatusCancelled RunStepStatus = "cancelled"` - - `Agent BetaResponseItemLocalShellCallOutputAgent` + - `const RunStepStatusFailed RunStepStatus = "failed"` - The agent that produced this item. + - `const RunStepStatusCompleted RunStepStatus = "completed"` - - `AgentName string` + - `const RunStepStatusExpired RunStepStatus = "expired"` - The canonical name of the agent that produced this item. + - `StepDetails RunStepStepDetailsUnion` - - `Status string` + The details of the run step. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `type MessageCreationStepDetails struct{…}` - - `const BetaResponseItemLocalShellCallOutputStatusInProgress BetaResponseItemLocalShellCallOutputStatus = "in_progress"` + Details of the message creation by the run step. - - `const BetaResponseItemLocalShellCallOutputStatusCompleted BetaResponseItemLocalShellCallOutputStatus = "completed"` + - `MessageCreation MessageCreationStepDetailsMessageCreation` - - `const BetaResponseItemLocalShellCallOutputStatusIncomplete BetaResponseItemLocalShellCallOutputStatus = "incomplete"` + - `MessageID string` - - `type BetaResponseFunctionShellToolCall struct{…}` + The ID of the message that was created by this run step. - A tool call that executes one or more shell commands in a managed environment. + - `Type MessageCreation` - - `ID string` + Always `message_creation`. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - - `Action BetaResponseFunctionShellToolCallAction` + - `type ToolCallsStepDetails struct{…}` - The shell commands and limits that describe how to run the tool call. + Details of the tool call. - - `Commands []string` + - `ToolCalls []ToolCallUnion` - - `MaxOutputLength int64` + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - Optional maximum number of characters to return from each command. + - `type CodeInterpreterToolCall struct{…}` - - `TimeoutMs int64` + Details of the Code Interpreter tool call the run step was involved in. - Optional timeout in milliseconds for the commands. + - `ID string` - - `CallID string` + The ID of the tool call. - The unique ID of the shell tool call generated by the model. + - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` - - `Environment BetaResponseFunctionShellToolCallEnvironmentUnion` + The Code Interpreter tool call definition. - Represents the use of a local environment to perform shell actions. + - `Input string` - - `type BetaResponseLocalEnvironment struct{…}` + The input to the Code Interpreter tool call. - Represents the use of a local environment to perform shell actions. + - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` - - `Type Local` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - The environment type. Always `local`. + - `type CodeInterpreterToolCallCodeInterpreterOutputLogs struct{…}` - - `const LocalLocal Local = "local"` + Text output from the Code Interpreter tool call as part of a run step. - - `type BetaResponseContainerReference struct{…}` + - `Logs string` - Represents a container created with /v1/containers. + The text output from the Code Interpreter tool call. - - `ContainerID string` + - `Type Logs` - - `Type ContainerReference` + Always `logs`. - The environment type. Always `container_reference`. + - `const LogsLogs Logs = "logs"` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + - `type CodeInterpreterToolCallCodeInterpreterOutputImage struct{…}` - - `Status BetaResponseFunctionShellToolCallStatus` + - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `FileID string` - - `const BetaResponseFunctionShellToolCallStatusInProgress BetaResponseFunctionShellToolCallStatus = "in_progress"` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `const BetaResponseFunctionShellToolCallStatusCompleted BetaResponseFunctionShellToolCallStatus = "completed"` + - `Type Image` - - `const BetaResponseFunctionShellToolCallStatusIncomplete BetaResponseFunctionShellToolCallStatus = "incomplete"` + Always `image`. - - `Type ShellCall` + - `const ImageImage Image = "image"` - The type of the item. Always `shell_call`. + - `Type CodeInterpreter` - - `const ShellCallShellCall ShellCall = "shell_call"` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - `Agent BetaResponseFunctionShellToolCallAgent` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The agent that produced this item. + - `type FileSearchToolCall struct{…}` - - `AgentName string` + - `ID string` - The canonical name of the agent that produced this item. + The ID of the tool call object. - - `Caller BetaResponseFunctionShellToolCallCallerUnion` + - `FileSearch FileSearchToolCallFileSearch` - The execution context that produced this tool call. + For now, this is always going to be an empty object. - - `type BetaResponseFunctionShellToolCallCallerDirect struct{…}` + - `RankingOptions FileSearchToolCallFileSearchRankingOptions` - - `Type Direct` + The ranking options for the file search. - - `const DirectDirect Direct = "direct"` + - `Ranker string` - - `type BetaResponseFunctionShellToolCallCallerProgram struct{…}` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `CallerID string` + - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` - The call ID of the program item that produced this tool call. + - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `Type Program` + - `ScoreThreshold float64` - - `const ProgramProgram Program = "program"` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `CreatedBy string` + - `Results []FileSearchToolCallFileSearchResult` - The ID of the entity that created this tool call. + The results of the file search. - - `type BetaResponseFunctionShellToolCallOutput struct{…}` + - `FileID string` - The output of a shell tool call that was emitted. + The ID of the file that result was found in. - - `ID string` + - `FileName string` - The unique ID of the shell call output. Populated when this item is returned via API. + The name of the file that result was found in. - - `CallID string` + - `Score float64` - The unique ID of the shell tool call generated by the model. + The score of the result. All values must be a floating point number between 0 and 1. - - `MaxOutputLength int64` + - `Content []FileSearchToolCallFileSearchResultContent` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + The content of the result that was found. The content is only included if requested via the include query parameter. - - `Output []BetaResponseFunctionShellToolCallOutputOutput` + - `Text string` - An array of shell call output contents + The text content of the file. - - `Outcome BetaResponseFunctionShellToolCallOutputOutputOutcomeUnion` + - `Type string` - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + The type of the content. - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}` + - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` - Indicates that the shell call exceeded its configured time limit. + - `Type FileSearch` - - `Type Timeout` + The type of tool call. This is always going to be `file_search` for this type of tool call. - The outcome type. Always `timeout`. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `const TimeoutTimeout Timeout = "timeout"` + - `type FunctionToolCall struct{…}` - - `type BetaResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}` + - `ID string` - Indicates that the shell commands finished and returned an exit code. + The ID of the tool call object. - - `ExitCode int64` + - `Function FunctionToolCallFunction` - Exit code from the shell process. + The definition of the function that was called. - - `Type Exit` + - `Arguments string` - The outcome type. Always `exit`. + The arguments passed to the function. - - `const ExitExit Exit = "exit"` + - `Name string` - - `Stderr string` + The name of the function. - The standard error output that was captured. + - `Output string` - - `Stdout string` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - The standard output that was captured. + - `Type Function` - - `CreatedBy string` + The type of tool call. This is always going to be `function` for this type of tool call. - The identifier of the actor that created the item. + - `const FunctionFunction Function = "function"` - - `Status BetaResponseFunctionShellToolCallOutputStatus` + - `Type ToolCalls` - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + Always `tool_calls`. - - `const BetaResponseFunctionShellToolCallOutputStatusInProgress BetaResponseFunctionShellToolCallOutputStatus = "in_progress"` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - - `const BetaResponseFunctionShellToolCallOutputStatusCompleted BetaResponseFunctionShellToolCallOutputStatus = "completed"` + - `ThreadID string` - - `const BetaResponseFunctionShellToolCallOutputStatusIncomplete BetaResponseFunctionShellToolCallOutputStatus = "incomplete"` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - - `Type ShellCallOutput` + - `Type RunStepType` - The type of the shell call output. Always `shell_call_output`. + The type of run step, which can be either `message_creation` or `tool_calls`. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const RunStepTypeMessageCreation RunStepType = "message_creation"` - - `Agent BetaResponseFunctionShellToolCallOutputAgent` + - `const RunStepTypeToolCalls RunStepType = "tool_calls"` - The agent that produced this item. + - `Usage RunStepUsage` - - `AgentName string` + Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - The canonical name of the agent that produced this item. + - `CompletionTokens int64` - - `Caller BetaResponseFunctionShellToolCallOutputCallerUnion` + Number of completion tokens used over the course of the run step. - The execution context that produced this tool call. + - `PromptTokens int64` - - `type BetaResponseFunctionShellToolCallOutputCallerDirect struct{…}` + Number of prompt tokens used over the course of the run step. - - `Type Direct` + - `TotalTokens int64` - - `const DirectDirect Direct = "direct"` + Total number of tokens used (prompt + completion). - - `type BetaResponseFunctionShellToolCallOutputCallerProgram struct{…}` +### Example - - `CallerID string` +```go +package main - The call ID of the program item that produced this tool call. +import ( + "context" + "fmt" - - `Type Program` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `const ProgramProgram Program = "program"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + runStep, err := client.Beta.Threads.Runs.Steps.Get( + context.TODO(), + "thread_id", + "run_id", + "step_id", + openai.BetaThreadRunStepGetParams{ - - `CreatedBy string` + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", runStep.ID) +} +``` - The identifier of the actor that created the item. +#### Response - - `type BetaResponseApplyPatchToolCall struct{…}` +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "cancelled_at": 0, + "completed_at": 0, + "created_at": 0, + "expired_at": 0, + "failed_at": 0, + "last_error": { + "code": "server_error", + "message": "message" + }, + "metadata": { + "foo": "string" + }, + "object": "thread.run.step", + "run_id": "run_id", + "status": "in_progress", + "step_details": { + "message_creation": { + "message_id": "message_id" + }, + "type": "message_creation" + }, + "thread_id": "thread_id", + "type": "message_creation", + "usage": { + "completion_tokens": 0, + "prompt_tokens": 0, + "total_tokens": 0 + } +} +``` - A tool call that applies file diffs by creating, deleting, or updating files. +## Domain Types - - `ID string` +### Code Interpreter Logs - The unique ID of the apply patch tool call. Populated when this item is returned via API. +- `type CodeInterpreterLogs struct{…}` - - `CallID string` + Text output from the Code Interpreter tool call as part of a run step. - The unique ID of the apply patch tool call generated by the model. + - `Index int64` - - `Operation BetaResponseApplyPatchToolCallOperationUnion` + The index of the output in the outputs array. - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `Type Logs` - - `type BetaResponseApplyPatchToolCallOperationCreateFile struct{…}` + Always `logs`. - Instruction describing how to create a file via the apply_patch tool. + - `const LogsLogs Logs = "logs"` - - `Diff string` + - `Logs string` - Diff to apply. + The text output from the Code Interpreter tool call. - - `Path string` +### Code Interpreter Output Image - Path of the file to create. +- `type CodeInterpreterOutputImage struct{…}` - - `Type CreateFile` + - `Index int64` - Create a new file with the provided diff. + The index of the output in the outputs array. - - `const CreateFileCreateFile CreateFile = "create_file"` + - `Type Image` - - `type BetaResponseApplyPatchToolCallOperationDeleteFile struct{…}` + Always `image`. - Instruction describing how to delete a file via the apply_patch tool. + - `const ImageImage Image = "image"` - - `Path string` + - `Image CodeInterpreterOutputImageImage` - Path of the file to delete. + - `FileID string` - - `Type DeleteFile` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - Delete the specified file. +### Code Interpreter Tool Call - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` +- `type CodeInterpreterToolCall struct{…}` - - `type BetaResponseApplyPatchToolCallOperationUpdateFile struct{…}` + Details of the Code Interpreter tool call the run step was involved in. - Instruction describing how to update a file via the apply_patch tool. + - `ID string` - - `Diff string` + The ID of the tool call. - Diff to apply. + - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` - - `Path string` + The Code Interpreter tool call definition. - Path of the file to update. + - `Input string` - - `Type UpdateFile` + The input to the Code Interpreter tool call. - Update an existing file with the provided diff. + - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `Status BetaResponseApplyPatchToolCallStatus` + - `type CodeInterpreterToolCallCodeInterpreterOutputLogs struct{…}` - The status of the apply patch tool call. One of `in_progress` or `completed`. + Text output from the Code Interpreter tool call as part of a run step. - - `const BetaResponseApplyPatchToolCallStatusInProgress BetaResponseApplyPatchToolCallStatus = "in_progress"` + - `Logs string` - - `const BetaResponseApplyPatchToolCallStatusCompleted BetaResponseApplyPatchToolCallStatus = "completed"` + The text output from the Code Interpreter tool call. - - `Type ApplyPatchCall` + - `Type Logs` - The type of the item. Always `apply_patch_call`. + Always `logs`. - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + - `const LogsLogs Logs = "logs"` - - `Agent BetaResponseApplyPatchToolCallAgent` + - `type CodeInterpreterToolCallCodeInterpreterOutputImage struct{…}` - The agent that produced this item. + - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` - - `AgentName string` + - `FileID string` - The canonical name of the agent that produced this item. + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `Caller BetaResponseApplyPatchToolCallCallerUnion` + - `Type Image` - The execution context that produced this tool call. + Always `image`. - - `type BetaResponseApplyPatchToolCallCallerDirect struct{…}` + - `const ImageImage Image = "image"` - - `Type Direct` + - `Type CodeInterpreter` - - `const DirectDirect Direct = "direct"` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - `type BetaResponseApplyPatchToolCallCallerProgram struct{…}` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `CallerID string` +### Code Interpreter Tool Call Delta - The call ID of the program item that produced this tool call. +- `type CodeInterpreterToolCallDelta struct{…}` - - `Type Program` + Details of the Code Interpreter tool call the run step was involved in. - - `const ProgramProgram Program = "program"` + - `Index int64` - - `CreatedBy string` + The index of the tool call in the tool calls array. - The ID of the entity that created this tool call. + - `Type CodeInterpreter` - - `type BetaResponseApplyPatchToolCallOutput struct{…}` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - The output emitted by an apply patch tool call. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - `ID string` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The ID of the tool call. - - `CallID string` + - `CodeInterpreter CodeInterpreterToolCallDeltaCodeInterpreter` - The unique ID of the apply patch tool call generated by the model. + The Code Interpreter tool call definition. - - `Status BetaResponseApplyPatchToolCallOutputStatus` + - `Input string` - The status of the apply patch tool call output. One of `completed` or `failed`. + The input to the Code Interpreter tool call. - - `const BetaResponseApplyPatchToolCallOutputStatusCompleted BetaResponseApplyPatchToolCallOutputStatus = "completed"` + - `Outputs []CodeInterpreterToolCallDeltaCodeInterpreterOutputUnion` - - `const BetaResponseApplyPatchToolCallOutputStatusFailed BetaResponseApplyPatchToolCallOutputStatus = "failed"` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `Type ApplyPatchCallOutput` + - `type CodeInterpreterLogs struct{…}` - The type of the item. Always `apply_patch_call_output`. + Text output from the Code Interpreter tool call as part of a run step. - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + - `Index int64` - - `Agent BetaResponseApplyPatchToolCallOutputAgent` + The index of the output in the outputs array. - The agent that produced this item. + - `Type Logs` - - `AgentName string` + Always `logs`. - The canonical name of the agent that produced this item. + - `const LogsLogs Logs = "logs"` - - `Caller BetaResponseApplyPatchToolCallOutputCallerUnion` + - `Logs string` - The execution context that produced this tool call. + The text output from the Code Interpreter tool call. - - `type BetaResponseApplyPatchToolCallOutputCallerDirect struct{…}` + - `type CodeInterpreterOutputImage struct{…}` - - `Type Direct` + - `Index int64` - - `const DirectDirect Direct = "direct"` + The index of the output in the outputs array. - - `type BetaResponseApplyPatchToolCallOutputCallerProgram struct{…}` + - `Type Image` - - `CallerID string` + Always `image`. - The call ID of the program item that produced this tool call. + - `const ImageImage Image = "image"` - - `Type Program` + - `Image CodeInterpreterOutputImageImage` - - `const ProgramProgram Program = "program"` + - `FileID string` - - `CreatedBy string` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - The ID of the entity that created this tool call output. +### File Search Tool Call - - `Output string` +- `type FileSearchToolCall struct{…}` - Optional textual output returned by the apply patch tool. + - `ID string` - - `type BetaResponseItemMcpListTools struct{…}` + The ID of the tool call object. - A list of tools available on an MCP server. + - `FileSearch FileSearchToolCallFileSearch` - - `ID string` + For now, this is always going to be an empty object. - The unique ID of the list. + - `RankingOptions FileSearchToolCallFileSearchRankingOptions` - - `ServerLabel string` + The ranking options for the file search. - The label of the MCP server. + - `Ranker string` - - `Tools []BetaResponseItemMcpListToolsTool` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The tools available on the server. + - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` - - `InputSchema any` + - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` - The JSON schema describing the tool's input. + - `ScoreThreshold float64` - - `Name string` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - The name of the tool. + - `Results []FileSearchToolCallFileSearchResult` - - `Annotations any` + The results of the file search. - Additional annotations about the tool. + - `FileID string` - - `Description string` + The ID of the file that result was found in. - The description of the tool. + - `FileName string` - - `Type McpListTools` + The name of the file that result was found in. - The type of the item. Always `mcp_list_tools`. + - `Score float64` - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + The score of the result. All values must be a floating point number between 0 and 1. - - `Agent BetaResponseItemMcpListToolsAgent` + - `Content []FileSearchToolCallFileSearchResultContent` - The agent that produced this item. + The content of the result that was found. The content is only included if requested via the include query parameter. - - `AgentName string` + - `Text string` - The canonical name of the agent that produced this item. + The text content of the file. - - `Error string` + - `Type string` - Error message if the server could not list tools. + The type of the content. - - `type BetaResponseItemMcpApprovalRequest struct{…}` + - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` - A request for human approval of a tool invocation. + - `Type FileSearch` - - `ID string` + The type of tool call. This is always going to be `file_search` for this type of tool call. - The unique ID of the approval request. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Arguments string` +### File Search Tool Call Delta - A JSON string of arguments for the tool. +- `type FileSearchToolCallDelta struct{…}` - - `Name string` + - `FileSearch any` - The name of the tool to run. + For now, this is always going to be an empty object. - - `ServerLabel string` + - `Index int64` - The label of the MCP server making the request. + The index of the tool call in the tool calls array. - - `Type McpApprovalRequest` + - `Type FileSearch` - The type of the item. Always `mcp_approval_request`. + The type of tool call. This is always going to be `file_search` for this type of tool call. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Agent BetaResponseItemMcpApprovalRequestAgent` + - `ID string` - The agent that produced this item. + The ID of the tool call object. - - `AgentName string` +### Function Tool Call - The canonical name of the agent that produced this item. +- `type FunctionToolCall struct{…}` - - `type BetaResponseItemMcpApprovalResponse struct{…}` + - `ID string` - A response to an MCP approval request. + The ID of the tool call object. - - `ID string` + - `Function FunctionToolCallFunction` - The unique ID of the approval response + The definition of the function that was called. - - `ApprovalRequestID string` + - `Arguments string` - The ID of the approval request being answered. + The arguments passed to the function. - - `Approve bool` + - `Name string` - Whether the request was approved. + The name of the function. - - `Type McpApprovalResponse` + - `Output string` - The type of the item. Always `mcp_approval_response`. + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `Type Function` - - `Agent BetaResponseItemMcpApprovalResponseAgent` + The type of tool call. This is always going to be `function` for this type of tool call. - The agent that produced this item. + - `const FunctionFunction Function = "function"` - - `AgentName string` +### Function Tool Call Delta - The canonical name of the agent that produced this item. +- `type FunctionToolCallDelta struct{…}` - - `Reason string` + - `Index int64` - Optional reason for the decision. + The index of the tool call in the tool calls array. - - `type BetaResponseItemMcpCall struct{…}` + - `Type Function` - An invocation of a tool on an MCP server. + The type of tool call. This is always going to be `function` for this type of tool call. + + - `const FunctionFunction Function = "function"` - `ID string` - The unique ID of the tool call. + The ID of the tool call object. - - `Arguments string` + - `Function FunctionToolCallDeltaFunction` - A JSON string of the arguments passed to the tool. + The definition of the function that was called. - - `Name string` + - `Arguments string` - The name of the tool that was run. + The arguments passed to the function. - - `ServerLabel string` + - `Name string` - The label of the MCP server running the tool. + The name of the function. - - `Type McpCall` + - `Output string` - The type of the item. Always `mcp_call`. + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `const McpCallMcpCall McpCall = "mcp_call"` +### Message Creation Step Details - - `Agent BetaResponseItemMcpCallAgent` +- `type MessageCreationStepDetails struct{…}` - The agent that produced this item. + Details of the message creation by the run step. - - `AgentName string` + - `MessageCreation MessageCreationStepDetailsMessageCreation` - The canonical name of the agent that produced this item. + - `MessageID string` - - `ApprovalRequestID string` + The ID of the message that was created by this run step. - 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. + - `Type MessageCreation` - - `Error string` + Always `message_creation`. - The error from the tool call, if any. + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - - `Output string` +### Run Step - The output from the tool call. +- `type RunStep struct{…}` - - `Status string` + Represents a step in execution of a run. - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `ID string` - - `const BetaResponseItemMcpCallStatusInProgress BetaResponseItemMcpCallStatus = "in_progress"` + The identifier of the run step, which can be referenced in API endpoints. - - `const BetaResponseItemMcpCallStatusCompleted BetaResponseItemMcpCallStatus = "completed"` + - `AssistantID string` - - `const BetaResponseItemMcpCallStatusIncomplete BetaResponseItemMcpCallStatus = "incomplete"` + The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. - - `const BetaResponseItemMcpCallStatusCalling BetaResponseItemMcpCallStatus = "calling"` + - `CancelledAt int64` - - `const BetaResponseItemMcpCallStatusFailed BetaResponseItemMcpCallStatus = "failed"` + The Unix timestamp (in seconds) for when the run step was cancelled. - - `type BetaResponseCustomToolCallItem struct{…}` + - `CompletedAt int64` - A call to a custom tool created by the model. + The Unix timestamp (in seconds) for when the run step completed. - - `ID string` + - `CreatedAt int64` - The unique ID of the custom tool call item. + The Unix timestamp (in seconds) for when the run step was created. - - `Status string` + - `ExpiredAt int64` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - - `const BetaResponseCustomToolCallItemStatusInProgress BetaResponseCustomToolCallItemStatus = "in_progress"` + - `FailedAt int64` - - `const BetaResponseCustomToolCallItemStatusCompleted BetaResponseCustomToolCallItemStatus = "completed"` + The Unix timestamp (in seconds) for when the run step failed. - - `const BetaResponseCustomToolCallItemStatusIncomplete BetaResponseCustomToolCallItemStatus = "incomplete"` + - `LastError RunStepLastError` - - `CreatedBy string` + The last error associated with this run step. Will be `null` if there are no errors. - The identifier of the actor that created the item. + - `Code string` - - `type BetaResponseCustomToolCallOutputItem struct{…}` + One of `server_error` or `rate_limit_exceeded`. - The output of a custom tool call from your code, being sent back to the model. + - `const RunStepLastErrorCodeServerError RunStepLastErrorCode = "server_error"` - - `ID string` + - `const RunStepLastErrorCodeRateLimitExceeded RunStepLastErrorCode = "rate_limit_exceeded"` - The unique ID of the custom tool call output item. + - `Message string` - - `Status string` + A human-readable description of the error. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Metadata Metadata` - - `const BetaResponseCustomToolCallOutputItemStatusInProgress BetaResponseCustomToolCallOutputItemStatus = "in_progress"` + 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. - - `const BetaResponseCustomToolCallOutputItemStatusCompleted BetaResponseCustomToolCallOutputItemStatus = "completed"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaResponseCustomToolCallOutputItemStatusIncomplete BetaResponseCustomToolCallOutputItemStatus = "incomplete"` + - `Object ThreadRunStep` - - `CreatedBy string` + The object type, which is always `thread.run.step`. - The identifier of the actor that created the item. + - `const ThreadRunStepThreadRunStep ThreadRunStep = "thread.run.step"` - - `FirstID string` + - `RunID string` - The ID of the first item in the list. + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. - - `HasMore bool` + - `Status RunStepStatus` - Whether there are more items available. + The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - - `LastID string` + - `const RunStepStatusInProgress RunStepStatus = "in_progress"` - The ID of the last item in the list. + - `const RunStepStatusCancelled RunStepStatus = "cancelled"` - - `Object List` + - `const RunStepStatusFailed RunStepStatus = "failed"` - The type of object returned, must be `list`. + - `const RunStepStatusCompleted RunStepStatus = "completed"` - - `const ListList List = "list"` + - `const RunStepStatusExpired RunStepStatus = "expired"` -# Input Tokens + - `StepDetails RunStepStepDetailsUnion` -## Get input token counts + The details of the run step. -`client.Beta.Responses.InputTokens.Count(ctx, params) (*InputTokenCountResponse, error)` + - `type MessageCreationStepDetails struct{…}` -**post** `/responses/input_tokens?beta=true` + Details of the message creation by the run step. -Get input token counts + - `MessageCreation MessageCreationStepDetailsMessageCreation` -### Parameters + - `MessageID string` -- `params InputTokenCountParams` + The ID of the message that was created by this run step. - - `Conversation param.Field[InputTokenCountParamsConversationUnion]` + - `Type MessageCreation` - Body param: The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. - Input items and output items from this response are automatically added to this conversation after this response completes. + Always `message_creation`. - - `string` + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - - `type BetaResponseConversationParamResp struct{…}` + - `type ToolCallsStepDetails struct{…}` - The conversation that this response belongs to. + Details of the tool call. - - `ID string` + - `ToolCalls []ToolCallUnion` - The unique ID of the conversation. + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - `Input param.Field[InputTokenCountParamsInputUnion]` + - `type CodeInterpreterToolCall struct{…}` - Body param: Text, image, or file inputs to the model, used to generate a response + Details of the Code Interpreter tool call the run step was involved in. - - `string` + - `ID string` - - `type InputTokenCountParamsInputArray []BetaResponseInputItemUnion` + The ID of the tool call. - A list of one or many input items to the model, containing different content types. + - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` - - `type BetaEasyInputMessage struct{…}` + The Code Interpreter tool call definition. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `Input string` - - `Content BetaEasyInputMessageContentUnion` + The input to the Code Interpreter tool call. - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` - - `string` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `type BetaResponseInputMessageContentList []BetaResponseInputContentUnion` + - `type CodeInterpreterToolCallCodeInterpreterOutputLogs struct{…}` - A list of one or many input items to the model, containing different content - types. + Text output from the Code Interpreter tool call as part of a run step. - - `type BetaResponseInputText struct{…}` + - `Logs string` - A text input to the model. + The text output from the Code Interpreter tool call. - - `Text string` + - `Type Logs` - The text input to the model. + Always `logs`. - - `Type InputText` + - `const LogsLogs Logs = "logs"` - The type of the input item. Always `input_text`. + - `type CodeInterpreterToolCallCodeInterpreterOutputImage struct{…}` - - `const InputTextInputText InputText = "input_text"` + - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` - - `PromptCacheBreakpoint BetaResponseInputTextPromptCacheBreakpoint` + - `FileID string` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `Mode Explicit` + - `Type Image` - The breakpoint mode. Always `explicit`. + Always `image`. - - `const ExplicitExplicit Explicit = "explicit"` + - `const ImageImage Image = "image"` - - `type BetaResponseInputImage struct{…}` + - `Type CodeInterpreter` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - `Detail BetaResponseInputImageDetail` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `type FileSearchToolCall struct{…}` - - `const BetaResponseInputImageDetailLow BetaResponseInputImageDetail = "low"` + - `ID string` - - `const BetaResponseInputImageDetailHigh BetaResponseInputImageDetail = "high"` + The ID of the tool call object. - - `const BetaResponseInputImageDetailAuto BetaResponseInputImageDetail = "auto"` + - `FileSearch FileSearchToolCallFileSearch` - - `const BetaResponseInputImageDetailOriginal BetaResponseInputImageDetail = "original"` + For now, this is always going to be an empty object. - - `Type InputImage` + - `RankingOptions FileSearchToolCallFileSearchRankingOptions` - The type of the input item. Always `input_image`. + The ranking options for the file search. - - `const InputImageInputImage InputImage = "input_image"` + - `Ranker string` - - `FileID string` + The ranker to use for the file search. If not specified will use the `auto` ranker. - The ID of the file to be sent to the model. + - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` - - `ImageURL string` + - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `ScoreThreshold float64` - - `PromptCacheBreakpoint BetaResponseInputImagePromptCacheBreakpoint` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Results []FileSearchToolCallFileSearchResult` - - `Mode Explicit` + The results of the file search. - The breakpoint mode. Always `explicit`. + - `FileID string` - - `const ExplicitExplicit Explicit = "explicit"` + The ID of the file that result was found in. - - `type BetaResponseInputFile struct{…}` + - `FileName string` - A file input to the model. + The name of the file that result was found in. - - `Type InputFile` + - `Score float64` - The type of the input item. Always `input_file`. + The score of the result. All values must be a floating point number between 0 and 1. - - `const InputFileInputFile InputFile = "input_file"` + - `Content []FileSearchToolCallFileSearchResultContent` - - `Detail BetaResponseInputFileDetail` + The content of the result that was found. The content is only included if requested via the include query parameter. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `Text string` - - `const BetaResponseInputFileDetailAuto BetaResponseInputFileDetail = "auto"` + The text content of the file. - - `const BetaResponseInputFileDetailLow BetaResponseInputFileDetail = "low"` + - `Type string` - - `const BetaResponseInputFileDetailHigh BetaResponseInputFileDetail = "high"` + The type of the content. - - `FileData string` + - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` - The content of the file to be sent to the model. + - `Type FileSearch` - - `FileID string` + The type of tool call. This is always going to be `file_search` for this type of tool call. - The ID of the file to be sent to the model. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `FileURL string` + - `type FunctionToolCall struct{…}` - The URL of the file to be sent to the model. + - `ID string` - - `Filename string` + The ID of the tool call object. - The name of the file to be sent to the model. + - `Function FunctionToolCallFunction` - - `PromptCacheBreakpoint BetaResponseInputFilePromptCacheBreakpoint` + The definition of the function that was called. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `Arguments string` - - `Mode Explicit` + The arguments passed to the function. - The breakpoint mode. Always `explicit`. + - `Name string` - - `const ExplicitExplicit Explicit = "explicit"` + The name of the function. - - `Role BetaEasyInputMessageRole` + - `Output string` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `const BetaEasyInputMessageRoleUser BetaEasyInputMessageRole = "user"` + - `Type Function` - - `const BetaEasyInputMessageRoleAssistant BetaEasyInputMessageRole = "assistant"` + The type of tool call. This is always going to be `function` for this type of tool call. - - `const BetaEasyInputMessageRoleSystem BetaEasyInputMessageRole = "system"` + - `const FunctionFunction Function = "function"` - - `const BetaEasyInputMessageRoleDeveloper BetaEasyInputMessageRole = "developer"` + - `Type ToolCalls` - - `Phase BetaEasyInputMessagePhase` + Always `tool_calls`. - 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 ToolCallsToolCalls ToolCalls = "tool_calls"` - - `const BetaEasyInputMessagePhaseCommentary BetaEasyInputMessagePhase = "commentary"` + - `ThreadID string` - - `Type BetaEasyInputMessageType` + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - The type of the message input. Always `message`. + - `Type RunStepType` - - `const BetaEasyInputMessageTypeMessage BetaEasyInputMessageType = "message"` + The type of run step, which can be either `message_creation` or `tool_calls`. - - `type BetaResponseInputItemMessage struct{…}` + - `const RunStepTypeMessageCreation RunStepType = "message_creation"` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `const RunStepTypeToolCalls RunStepType = "tool_calls"` - - `Content BetaResponseInputMessageContentList` + - `Usage RunStepUsage` - A list of one or many input items to the model, containing different content - types. + Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - - `Role string` + - `CompletionTokens int64` - The role of the message input. One of `user`, `system`, or `developer`. + Number of completion tokens used over the course of the run step. - - `const BetaResponseInputItemMessageRoleUser BetaResponseInputItemMessageRole = "user"` + - `PromptTokens int64` - - `const BetaResponseInputItemMessageRoleSystem BetaResponseInputItemMessageRole = "system"` + Number of prompt tokens used over the course of the run step. - - `const BetaResponseInputItemMessageRoleDeveloper BetaResponseInputItemMessageRole = "developer"` + - `TotalTokens int64` - - `Agent BetaResponseInputItemMessageAgent` + Total number of tokens used (prompt + completion). - The agent that produced this item. +### Run Step Delta - - `AgentName string` +- `type RunStepDelta struct{…}` - The canonical name of the agent that produced this item. + The delta containing the fields that have changed on the run step. - - `Status string` + - `StepDetails RunStepDeltaStepDetailsUnion` - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The details of the run step. - - `const BetaResponseInputItemMessageStatusInProgress BetaResponseInputItemMessageStatus = "in_progress"` + - `type RunStepDeltaMessageDelta struct{…}` - - `const BetaResponseInputItemMessageStatusCompleted BetaResponseInputItemMessageStatus = "completed"` + Details of the message creation by the run step. - - `const BetaResponseInputItemMessageStatusIncomplete BetaResponseInputItemMessageStatus = "incomplete"` + - `Type MessageCreation` - - `Type string` + Always `message_creation`. - The type of the message input. Always set to `message`. + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - - `const BetaResponseInputItemMessageTypeMessage BetaResponseInputItemMessageType = "message"` + - `MessageCreation RunStepDeltaMessageDeltaMessageCreation` - - `type BetaResponseOutputMessage struct{…}` + - `MessageID string` - An output message from the model. + The ID of the message that was created by this run step. - - `ID string` + - `type ToolCallDeltaObject struct{…}` - The unique ID of the output message. + Details of the tool call. - - `Content []BetaResponseOutputMessageContentUnion` + - `Type ToolCalls` - The content of the output message. + Always `tool_calls`. - - `type BetaResponseOutputText struct{…}` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - A text output from the model. + - `ToolCalls []ToolCallDeltaUnion` - - `Annotations []BetaResponseOutputTextAnnotationUnion` + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - The annotations of the text output. + - `type CodeInterpreterToolCallDelta struct{…}` - - `type BetaResponseOutputTextAnnotationFileCitation struct{…}` + Details of the Code Interpreter tool call the run step was involved in. - A citation to a file. + - `Index int64` - - `FileID string` + The index of the tool call in the tool calls array. - The ID of the file. + - `Type CodeInterpreter` - - `Filename string` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - The filename of the file cited. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Index int64` + - `ID string` - The index of the file in the list of files. + The ID of the tool call. - - `Type FileCitation` + - `CodeInterpreter CodeInterpreterToolCallDeltaCodeInterpreter` - The type of the file citation. Always `file_citation`. + The Code Interpreter tool call definition. - - `const FileCitationFileCitation FileCitation = "file_citation"` + - `Input string` - - `type BetaResponseOutputTextAnnotationURLCitation struct{…}` + The input to the Code Interpreter tool call. - A citation for a web resource used to generate a model response. + - `Outputs []CodeInterpreterToolCallDeltaCodeInterpreterOutputUnion` - - `EndIndex int64` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - The index of the last character of the URL citation in the message. + - `type CodeInterpreterLogs struct{…}` - - `StartIndex int64` + Text output from the Code Interpreter tool call as part of a run step. - The index of the first character of the URL citation in the message. + - `Index int64` - - `Title string` + The index of the output in the outputs array. - The title of the web resource. + - `Type Logs` - - `Type URLCitation` + Always `logs`. - The type of the URL citation. Always `url_citation`. + - `const LogsLogs Logs = "logs"` - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Logs string` - - `URL string` + The text output from the Code Interpreter tool call. - The URL of the web resource. + - `type CodeInterpreterOutputImage struct{…}` - - `type BetaResponseOutputTextAnnotationContainerFileCitation struct{…}` + - `Index int64` - A citation for a container file used to generate a model response. + The index of the output in the outputs array. - - `ContainerID string` + - `Type Image` - The ID of the container file. + Always `image`. - - `EndIndex int64` + - `const ImageImage Image = "image"` - The index of the last character of the container file citation in the message. + - `Image CodeInterpreterOutputImageImage` - `FileID string` - The ID of the file. + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `Filename string` + - `type FileSearchToolCallDelta struct{…}` - The filename of the container file cited. + - `FileSearch any` - - `StartIndex int64` + For now, this is always going to be an empty object. - The index of the first character of the container file citation in the message. + - `Index int64` - - `Type ContainerFileCitation` + The index of the tool call in the tool calls array. - The type of the container file citation. Always `container_file_citation`. + - `Type FileSearch` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + The type of tool call. This is always going to be `file_search` for this type of tool call. - - `type BetaResponseOutputTextAnnotationFilePath struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - A path to a file. + - `ID string` - - `FileID string` + The ID of the tool call object. - The ID of the file. + - `type FunctionToolCallDelta struct{…}` - `Index int64` - The index of the file in the list of files. + The index of the tool call in the tool calls array. - - `Type FilePath` + - `Type Function` - The type of the file path. Always `file_path`. + The type of tool call. This is always going to be `function` for this type of tool call. + + - `const FunctionFunction Function = "function"` - - `const FilePathFilePath FilePath = "file_path"` + - `ID string` - - `Text string` + The ID of the tool call object. - The text output from the model. + - `Function FunctionToolCallDeltaFunction` - - `Type OutputText` + The definition of the function that was called. - The type of the output text. Always `output_text`. + - `Arguments string` - - `const OutputTextOutputText OutputText = "output_text"` + The arguments passed to the function. - - `Logprobs []BetaResponseOutputTextLogprob` + - `Name string` - - `Token string` + The name of the function. - - `Bytes []int64` + - `Output string` - - `Logprob float64` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `TopLogprobs []BetaResponseOutputTextLogprobTopLogprob` +### Run Step Delta Event - - `Token string` +- `type RunStepDeltaEvent struct{…}` - - `Bytes []int64` + Represents a run step delta i.e. any changed fields on a run step during streaming. - - `Logprob float64` + - `ID string` - - `type BetaResponseOutputRefusal struct{…}` + The identifier of the run step, which can be referenced in API endpoints. - A refusal from the model. + - `Delta RunStepDelta` - - `Refusal string` + The delta containing the fields that have changed on the run step. - The refusal explanation from the model. + - `StepDetails RunStepDeltaStepDetailsUnion` - - `Type Refusal` + The details of the run step. - The type of the refusal. Always `refusal`. + - `type RunStepDeltaMessageDelta struct{…}` - - `const RefusalRefusal Refusal = "refusal"` + Details of the message creation by the run step. - - `Role Assistant` + - `Type MessageCreation` - The role of the output message. Always `assistant`. + Always `message_creation`. - - `const AssistantAssistant Assistant = "assistant"` + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - - `Status BetaResponseOutputMessageStatus` + - `MessageCreation RunStepDeltaMessageDeltaMessageCreation` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `MessageID string` - - `const BetaResponseOutputMessageStatusInProgress BetaResponseOutputMessageStatus = "in_progress"` + The ID of the message that was created by this run step. - - `const BetaResponseOutputMessageStatusCompleted BetaResponseOutputMessageStatus = "completed"` + - `type ToolCallDeltaObject struct{…}` - - `const BetaResponseOutputMessageStatusIncomplete BetaResponseOutputMessageStatus = "incomplete"` + Details of the tool call. - - `Type Message` + - `Type ToolCalls` - The type of the output message. Always `message`. + Always `tool_calls`. - - `const MessageMessage Message = "message"` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - - `Agent BetaResponseOutputMessageAgent` + - `ToolCalls []ToolCallDeltaUnion` - The agent that produced this item. + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - `AgentName string` + - `type CodeInterpreterToolCallDelta struct{…}` - The canonical name of the agent that produced this item. + Details of the Code Interpreter tool call the run step was involved in. - - `Phase BetaResponseOutputMessagePhase` + - `Index int64` - 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. + The index of the tool call in the tool calls array. - - `const BetaResponseOutputMessagePhaseCommentary BetaResponseOutputMessagePhase = "commentary"` + - `Type CodeInterpreter` - - `type BetaResponseFileSearchToolCall struct{…}` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - `ID string` - The unique ID of the file search tool call. - - - `Queries []string` + The ID of the tool call. - The queries used to search for files. + - `CodeInterpreter CodeInterpreterToolCallDeltaCodeInterpreter` - - `Status BetaResponseFileSearchToolCallStatus` + The Code Interpreter tool call definition. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `Input string` - - `const BetaResponseFileSearchToolCallStatusInProgress BetaResponseFileSearchToolCallStatus = "in_progress"` + The input to the Code Interpreter tool call. - - `const BetaResponseFileSearchToolCallStatusSearching BetaResponseFileSearchToolCallStatus = "searching"` + - `Outputs []CodeInterpreterToolCallDeltaCodeInterpreterOutputUnion` - - `const BetaResponseFileSearchToolCallStatusCompleted BetaResponseFileSearchToolCallStatus = "completed"` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `const BetaResponseFileSearchToolCallStatusIncomplete BetaResponseFileSearchToolCallStatus = "incomplete"` + - `type CodeInterpreterLogs struct{…}` - - `const BetaResponseFileSearchToolCallStatusFailed BetaResponseFileSearchToolCallStatus = "failed"` + Text output from the Code Interpreter tool call as part of a run step. - - `Type FileSearchCall` + - `Index int64` - The type of the file search tool call. Always `file_search_call`. + The index of the output in the outputs array. - - `const FileSearchCallFileSearchCall FileSearchCall = "file_search_call"` + - `Type Logs` - - `Agent BetaResponseFileSearchToolCallAgent` + Always `logs`. - The agent that produced this item. + - `const LogsLogs Logs = "logs"` - - `AgentName string` + - `Logs string` - The canonical name of the agent that produced this item. + The text output from the Code Interpreter tool call. - - `Results []BetaResponseFileSearchToolCallResult` + - `type CodeInterpreterOutputImage struct{…}` - The results of the file search tool call. + - `Index int64` - - `Attributes map[string, BetaResponseFileSearchToolCallResultAttributeUnion]` + The index of the output in the outputs array. - 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. + - `Type Image` - - `string` + Always `image`. - - `float64` + - `const ImageImage Image = "image"` - - `bool` + - `Image CodeInterpreterOutputImageImage` - `FileID string` - The unique ID of the file. + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `Filename string` + - `type FileSearchToolCallDelta struct{…}` - The name of the file. + - `FileSearch any` - - `Score float64` + For now, this is always going to be an empty object. - The relevance score of the file - a value between 0 and 1. + - `Index int64` - - `Text string` + The index of the tool call in the tool calls array. - The text that was retrieved from the file. + - `Type FileSearch` - - `type BetaResponseComputerToolCall struct{…}` + The type of tool call. This is always going to be `file_search` for this type of tool call. - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + - `const FileSearchFileSearch FileSearch = "file_search"` - `ID string` - The unique ID of the computer call. + The ID of the tool call object. - - `CallID string` + - `type FunctionToolCallDelta struct{…}` - An identifier used when responding to the tool call with output. + - `Index int64` - - `PendingSafetyChecks []BetaResponseComputerToolCallPendingSafetyCheck` + The index of the tool call in the tool calls array. - The pending safety checks for the computer call. + - `Type Function` - - `ID string` + The type of tool call. This is always going to be `function` for this type of tool call. - The ID of the pending safety check. + - `const FunctionFunction Function = "function"` - - `Code string` + - `ID string` - The type of the pending safety check. + The ID of the tool call object. - - `Message string` + - `Function FunctionToolCallDeltaFunction` - Details about the pending safety check. + The definition of the function that was called. - - `Status BetaResponseComputerToolCallStatus` + - `Arguments string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The arguments passed to the function. - - `const BetaResponseComputerToolCallStatusInProgress BetaResponseComputerToolCallStatus = "in_progress"` + - `Name string` - - `const BetaResponseComputerToolCallStatusCompleted BetaResponseComputerToolCallStatus = "completed"` + The name of the function. - - `const BetaResponseComputerToolCallStatusIncomplete BetaResponseComputerToolCallStatus = "incomplete"` + - `Output string` - - `Type BetaResponseComputerToolCallType` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - The type of the computer call. Always `computer_call`. + - `Object ThreadRunStepDelta` - - `const BetaResponseComputerToolCallTypeComputerCall BetaResponseComputerToolCallType = "computer_call"` + The object type, which is always `thread.run.step.delta`. - - `Action BetaComputerActionUnion` + - `const ThreadRunStepDeltaThreadRunStepDelta ThreadRunStepDelta = "thread.run.step.delta"` - A click action. +### Run Step Delta Message Delta - - `type BetaComputerActionClick struct{…}` +- `type RunStepDeltaMessageDelta struct{…}` - A click action. + Details of the message creation by the run step. - - `Button string` + - `Type MessageCreation` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + Always `message_creation`. - - `const BetaComputerActionClickButtonLeft BetaComputerActionClickButton = "left"` + - `const MessageCreationMessageCreation MessageCreation = "message_creation"` - - `const BetaComputerActionClickButtonRight BetaComputerActionClickButton = "right"` + - `MessageCreation RunStepDeltaMessageDeltaMessageCreation` - - `const BetaComputerActionClickButtonWheel BetaComputerActionClickButton = "wheel"` + - `MessageID string` - - `const BetaComputerActionClickButtonBack BetaComputerActionClickButton = "back"` + The ID of the message that was created by this run step. - - `const BetaComputerActionClickButtonForward BetaComputerActionClickButton = "forward"` +### Run Step Include - - `Type Click` +- `type RunStepInclude string` - Specifies the event type. For a click action, this property is always `click`. + - `const RunStepIncludeStepDetailsToolCallsFileSearchResultsContent RunStepInclude = "step_details.tool_calls[*].file_search.results[*].content"` - - `const ClickClick Click = "click"` +### Tool Call - - `X int64` +- `type ToolCallUnion interface{…}` - The x-coordinate where the click occurred. + Details of the Code Interpreter tool call the run step was involved in. - - `Y int64` + - `type CodeInterpreterToolCall struct{…}` - The y-coordinate where the click occurred. + Details of the Code Interpreter tool call the run step was involved in. - - `Keys []string` + - `ID string` - The keys being held while clicking. + The ID of the tool call. - - `type BetaComputerActionDoubleClick struct{…}` + - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` - A double click action. + The Code Interpreter tool call definition. - - `Keys []string` + - `Input string` - The keys being held while double-clicking. + The input to the Code Interpreter tool call. - - `Type DoubleClick` + - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` - Specifies the event type. For a double click action, this property is always set to `double_click`. + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `const DoubleClickDoubleClick DoubleClick = "double_click"` + - `type CodeInterpreterToolCallCodeInterpreterOutputLogs struct{…}` - - `X int64` + Text output from the Code Interpreter tool call as part of a run step. - The x-coordinate where the double click occurred. + - `Logs string` - - `Y int64` + The text output from the Code Interpreter tool call. - The y-coordinate where the double click occurred. + - `Type Logs` - - `type BetaComputerActionDrag struct{…}` + Always `logs`. - A drag action. + - `const LogsLogs Logs = "logs"` - - `Path []BetaComputerActionDragPath` + - `type CodeInterpreterToolCallCodeInterpreterOutputImage struct{…}` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `FileID string` - - `X int64` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - The x-coordinate. + - `Type Image` - - `Y int64` + Always `image`. - The y-coordinate. + - `const ImageImage Image = "image"` - - `Type Drag` + - `Type CodeInterpreter` - Specifies the event type. For a drag action, this property is always set to `drag`. + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - `const DragDrag Drag = "drag"` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Keys []string` + - `type FileSearchToolCall struct{…}` - The keys being held while dragging the mouse. + - `ID string` - - `type BetaComputerActionKeypress struct{…}` + The ID of the tool call object. - A collection of keypresses the model would like to perform. + - `FileSearch FileSearchToolCallFileSearch` - - `Keys []string` + For now, this is always going to be an empty object. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `RankingOptions FileSearchToolCallFileSearchRankingOptions` - - `Type Keypress` + The ranking options for the file search. - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `Ranker string` - - `const KeypressKeypress Keypress = "keypress"` + The ranker to use for the file search. If not specified will use the `auto` ranker. - - `type BetaComputerActionMove struct{…}` + - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` - A mouse move action. + - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` - - `Type Move` + - `ScoreThreshold float64` - Specifies the event type. For a move action, this property is always set to `move`. + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `const MoveMove Move = "move"` + - `Results []FileSearchToolCallFileSearchResult` - - `X int64` + The results of the file search. - The x-coordinate to move to. + - `FileID string` - - `Y int64` + The ID of the file that result was found in. - The y-coordinate to move to. + - `FileName string` - - `Keys []string` + The name of the file that result was found in. - The keys being held while moving the mouse. + - `Score float64` - - `type BetaComputerActionScreenshot struct{…}` + The score of the result. All values must be a floating point number between 0 and 1. - A screenshot action. + - `Content []FileSearchToolCallFileSearchResultContent` - - `Type Screenshot` + The content of the result that was found. The content is only included if requested via the include query parameter. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `Text string` - - `const ScreenshotScreenshot Screenshot = "screenshot"` + The text content of the file. - - `type BetaComputerActionScroll struct{…}` + - `Type string` - A scroll action. + The type of the content. - - `ScrollX int64` + - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` - The horizontal scroll distance. + - `Type FileSearch` - - `ScrollY int64` + The type of tool call. This is always going to be `file_search` for this type of tool call. - The vertical scroll distance. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Type Scroll` + - `type FunctionToolCall struct{…}` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `ID string` - - `const ScrollScroll Scroll = "scroll"` + The ID of the tool call object. - - `X int64` + - `Function FunctionToolCallFunction` - The x-coordinate where the scroll occurred. + The definition of the function that was called. - - `Y int64` + - `Arguments string` - The y-coordinate where the scroll occurred. + The arguments passed to the function. - - `Keys []string` + - `Name string` - The keys being held while scrolling. + The name of the function. - - `type BetaComputerActionType struct{…}` + - `Output string` - An action to type in text. + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `Text string` + - `Type Function` - The text to type. + The type of tool call. This is always going to be `function` for this type of tool call. - - `Type Type` + - `const FunctionFunction Function = "function"` - Specifies the event type. For a type action, this property is always set to `type`. +### Tool Call Delta - - `const TypeType Type = "type"` +- `type ToolCallDeltaUnion interface{…}` - - `type BetaComputerActionWait struct{…}` + Details of the Code Interpreter tool call the run step was involved in. - A wait action. + - `type CodeInterpreterToolCallDelta struct{…}` - - `Type Wait` + Details of the Code Interpreter tool call the run step was involved in. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `Index int64` - - `const WaitWait Wait = "wait"` + The index of the tool call in the tool calls array. - - `Actions BetaComputerActionList` + - `Type CodeInterpreter` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - `type BetaComputerActionClick struct{…}` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - A click action. + - `ID string` - - `type BetaComputerActionDoubleClick struct{…}` + The ID of the tool call. - A double click action. + - `CodeInterpreter CodeInterpreterToolCallDeltaCodeInterpreter` - - `type BetaComputerActionDrag struct{…}` + The Code Interpreter tool call definition. - A drag action. + - `Input string` - - `type BetaComputerActionKeypress struct{…}` + The input to the Code Interpreter tool call. - A collection of keypresses the model would like to perform. + - `Outputs []CodeInterpreterToolCallDeltaCodeInterpreterOutputUnion` - - `type BetaComputerActionMove struct{…}` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - A mouse move action. + - `type CodeInterpreterLogs struct{…}` - - `type BetaComputerActionScreenshot struct{…}` + Text output from the Code Interpreter tool call as part of a run step. - A screenshot action. + - `Index int64` - - `type BetaComputerActionScroll struct{…}` + The index of the output in the outputs array. - A scroll action. + - `Type Logs` - - `type BetaComputerActionType struct{…}` + Always `logs`. - An action to type in text. + - `const LogsLogs Logs = "logs"` - - `type BetaComputerActionWait struct{…}` + - `Logs string` - A wait action. + The text output from the Code Interpreter tool call. - - `Agent BetaResponseComputerToolCallAgent` + - `type CodeInterpreterOutputImage struct{…}` - The agent that produced this item. + - `Index int64` - - `AgentName string` + The index of the output in the outputs array. - The canonical name of the agent that produced this item. + - `Type Image` - - `type BetaResponseInputItemComputerCallOutput struct{…}` + Always `image`. - The output of a computer tool call. + - `const ImageImage Image = "image"` - - `CallID string` + - `Image CodeInterpreterOutputImageImage` - The ID of the computer tool call that produced the output. + - `FileID string` - - `Output BetaResponseComputerToolCallOutputScreenshot` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - A computer screenshot image used with the computer use tool. + - `type FileSearchToolCallDelta struct{…}` - - `Type ComputerScreenshot` + - `FileSearch any` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + For now, this is always going to be an empty object. - - `const ComputerScreenshotComputerScreenshot ComputerScreenshot = "computer_screenshot"` + - `Index int64` - - `FileID string` + The index of the tool call in the tool calls array. - The identifier of an uploaded file that contains the screenshot. + - `Type FileSearch` - - `ImageURL string` + The type of tool call. This is always going to be `file_search` for this type of tool call. - The URL of the screenshot image. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Type ComputerCallOutput` + - `ID string` - The type of the computer tool call output. Always `computer_call_output`. + The ID of the tool call object. - - `const ComputerCallOutputComputerCallOutput ComputerCallOutput = "computer_call_output"` + - `type FunctionToolCallDelta struct{…}` - - `ID string` + - `Index int64` - The ID of the computer tool call output. + The index of the tool call in the tool calls array. - - `AcknowledgedSafetyChecks []BetaResponseInputItemComputerCallOutputAcknowledgedSafetyCheck` + - `Type Function` - The safety checks reported by the API that have been acknowledged by the developer. + The type of tool call. This is always going to be `function` for this type of tool call. + + - `const FunctionFunction Function = "function"` - `ID string` - The ID of the pending safety check. + The ID of the tool call object. - - `Code string` + - `Function FunctionToolCallDeltaFunction` - The type of the pending safety check. + The definition of the function that was called. - - `Message string` + - `Arguments string` - Details about the pending safety check. + The arguments passed to the function. - - `Agent BetaResponseInputItemComputerCallOutputAgent` + - `Name string` - The agent that produced this item. + The name of the function. - - `AgentName string` + - `Output string` - The canonical name of the agent that produced this item. + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `Status string` +### Tool Call Delta Object - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. +- `type ToolCallDeltaObject struct{…}` - - `const BetaResponseInputItemComputerCallOutputStatusInProgress BetaResponseInputItemComputerCallOutputStatus = "in_progress"` + Details of the tool call. - - `const BetaResponseInputItemComputerCallOutputStatusCompleted BetaResponseInputItemComputerCallOutputStatus = "completed"` + - `Type ToolCalls` - - `const BetaResponseInputItemComputerCallOutputStatusIncomplete BetaResponseInputItemComputerCallOutputStatus = "incomplete"` + Always `tool_calls`. - - `type BetaResponseFunctionWebSearch struct{…}` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + - `ToolCalls []ToolCallDeltaUnion` - - `ID string` + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - The unique ID of the web search tool call. + - `type CodeInterpreterToolCallDelta struct{…}` - - `Action BetaResponseFunctionWebSearchActionUnion` + Details of the Code Interpreter tool call the run step was involved in. - 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). + - `Index int64` - - `type BetaResponseFunctionWebSearchActionSearch struct{…}` + The index of the tool call in the tool calls array. - Action type "search" - Performs a web search query. + - `Type CodeInterpreter` - - `Type Search` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - The action type. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `const SearchSearch Search = "search"` + - `ID string` - - `Queries []string` + The ID of the tool call. - The search queries. + - `CodeInterpreter CodeInterpreterToolCallDeltaCodeInterpreter` - - `Query string` + The Code Interpreter tool call definition. - The search query. + - `Input string` - - `Sources []BetaResponseFunctionWebSearchActionSearchSource` + The input to the Code Interpreter tool call. - The sources used in the search. + - `Outputs []CodeInterpreterToolCallDeltaCodeInterpreterOutputUnion` - - `Type URL` + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - The type of source. Always `url`. + - `type CodeInterpreterLogs struct{…}` - - `const URLURL URL = "url"` + Text output from the Code Interpreter tool call as part of a run step. - - `URL string` + - `Index int64` - The URL of the source. + The index of the output in the outputs array. - - `type BetaResponseFunctionWebSearchActionOpenPage struct{…}` + - `Type Logs` - Action type "open_page" - Opens a specific URL from search results. + Always `logs`. - - `Type OpenPage` + - `const LogsLogs Logs = "logs"` - The action type. + - `Logs string` - - `const OpenPageOpenPage OpenPage = "open_page"` + The text output from the Code Interpreter tool call. - - `URL string` + - `type CodeInterpreterOutputImage struct{…}` - The URL opened by the model. + - `Index int64` - - `type BetaResponseFunctionWebSearchActionFindInPage struct{…}` + The index of the output in the outputs array. - Action type "find_in_page": Searches for a pattern within a loaded page. + - `Type Image` - - `Pattern string` + Always `image`. - The pattern or text to search for within the page. + - `const ImageImage Image = "image"` - - `Type FindInPage` + - `Image CodeInterpreterOutputImageImage` - The action type. + - `FileID string` - - `const FindInPageFindInPage FindInPage = "find_in_page"` + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `URL string` + - `type FileSearchToolCallDelta struct{…}` - The URL of the page searched for the pattern. + - `FileSearch any` - - `Status BetaResponseFunctionWebSearchStatus` + For now, this is always going to be an empty object. - The status of the web search tool call. + - `Index int64` - - `const BetaResponseFunctionWebSearchStatusInProgress BetaResponseFunctionWebSearchStatus = "in_progress"` + The index of the tool call in the tool calls array. - - `const BetaResponseFunctionWebSearchStatusSearching BetaResponseFunctionWebSearchStatus = "searching"` + - `Type FileSearch` - - `const BetaResponseFunctionWebSearchStatusCompleted BetaResponseFunctionWebSearchStatus = "completed"` + The type of tool call. This is always going to be `file_search` for this type of tool call. - - `const BetaResponseFunctionWebSearchStatusFailed BetaResponseFunctionWebSearchStatus = "failed"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `Type WebSearchCall` + - `ID string` - The type of the web search tool call. Always `web_search_call`. + The ID of the tool call object. - - `const WebSearchCallWebSearchCall WebSearchCall = "web_search_call"` + - `type FunctionToolCallDelta struct{…}` - - `Agent BetaResponseFunctionWebSearchAgent` + - `Index int64` - The agent that produced this item. + The index of the tool call in the tool calls array. - - `AgentName string` + - `Type Function` - The canonical name of the agent that produced this item. + The type of tool call. This is always going to be `function` for this type of tool call. - - `type BetaResponseFunctionToolCall struct{…}` + - `const FunctionFunction Function = "function"` - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + - `ID string` - - `Arguments string` + The ID of the tool call object. - A JSON string of the arguments to pass to the function. + - `Function FunctionToolCallDeltaFunction` - - `CallID string` + The definition of the function that was called. - The unique ID of the function tool call generated by the model. + - `Arguments string` + + The arguments passed to the function. - `Name string` - The name of the function to run. + The name of the function. - - `Type FunctionCall` + - `Output string` - The type of the function tool call. Always `function_call`. + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `const FunctionCallFunctionCall FunctionCall = "function_call"` +### Tool Calls Step Details - - `ID string` +- `type ToolCallsStepDetails struct{…}` - The unique ID of the function tool call. + Details of the tool call. - - `Agent BetaResponseFunctionToolCallAgent` + - `ToolCalls []ToolCallUnion` - The agent that produced this item. + An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - - `AgentName string` + - `type CodeInterpreterToolCall struct{…}` - The canonical name of the agent that produced this item. + Details of the Code Interpreter tool call the run step was involved in. - - `Caller BetaResponseFunctionToolCallCallerUnion` + - `ID string` - The execution context that produced this tool call. + The ID of the tool call. - - `type BetaResponseFunctionToolCallCallerDirect struct{…}` + - `CodeInterpreter CodeInterpreterToolCallCodeInterpreter` - - `Type Direct` + The Code Interpreter tool call definition. - - `const DirectDirect Direct = "direct"` + - `Input string` - - `type BetaResponseFunctionToolCallCallerProgram struct{…}` + The input to the Code Interpreter tool call. - - `CallerID string` + - `Outputs []CodeInterpreterToolCallCodeInterpreterOutputUnion` - The call ID of the program item that produced this tool call. + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - - `Type Program` + - `type CodeInterpreterToolCallCodeInterpreterOutputLogs struct{…}` - - `const ProgramProgram Program = "program"` + Text output from the Code Interpreter tool call as part of a run step. - - `Namespace string` + - `Logs string` - The namespace of the function to run. + The text output from the Code Interpreter tool call. - - `Status BetaResponseFunctionToolCallStatus` + - `Type Logs` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Always `logs`. - - `const BetaResponseFunctionToolCallStatusInProgress BetaResponseFunctionToolCallStatus = "in_progress"` + - `const LogsLogs Logs = "logs"` - - `const BetaResponseFunctionToolCallStatusCompleted BetaResponseFunctionToolCallStatus = "completed"` + - `type CodeInterpreterToolCallCodeInterpreterOutputImage struct{…}` - - `const BetaResponseFunctionToolCallStatusIncomplete BetaResponseFunctionToolCallStatus = "incomplete"` + - `Image CodeInterpreterToolCallCodeInterpreterOutputImageImage` - - `type BetaResponseInputItemFunctionCallOutput struct{…}` + - `FileID string` - The output of a function tool call. + The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - - `CallID string` + - `Type Image` - The unique ID of the function tool call generated by the model. + Always `image`. - - `Output BetaResponseInputItemFunctionCallOutputOutputUnion` + - `const ImageImage Image = "image"` - Text, image, or file output of the function tool call. + - `Type CodeInterpreter` - - `string` + The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - - `type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - An array of content outputs (text, image, file) for the function tool call. + - `type FileSearchToolCall struct{…}` - - `type BetaResponseInputTextContent struct{…}` + - `ID string` - A text input to the model. + The ID of the tool call object. - - `Text string` + - `FileSearch FileSearchToolCallFileSearch` - The text input to the model. + For now, this is always going to be an empty object. - - `Type InputText` + - `RankingOptions FileSearchToolCallFileSearchRankingOptions` - The type of the input item. Always `input_text`. + The ranking options for the file search. - - `const InputTextInputText InputText = "input_text"` + - `Ranker string` - - `PromptCacheBreakpoint BetaResponseInputTextContentPromptCacheBreakpoint` + The ranker to use for the file search. If not specified will use the `auto` ranker. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `const FileSearchToolCallFileSearchRankingOptionsRankerAuto FileSearchToolCallFileSearchRankingOptionsRanker = "auto"` - - `Mode Explicit` + - `const FileSearchToolCallFileSearchRankingOptionsRankerDefault2024_08_21 FileSearchToolCallFileSearchRankingOptionsRanker = "default_2024_08_21"` - The breakpoint mode. Always `explicit`. + - `ScoreThreshold float64` - - `const ExplicitExplicit Explicit = "explicit"` + The score threshold for the file search. All values must be a floating point number between 0 and 1. - - `type BetaResponseInputImageContent struct{…}` + - `Results []FileSearchToolCallFileSearchResult` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + The results of the file search. - - `Type InputImage` + - `FileID string` - The type of the input item. Always `input_image`. + The ID of the file that result was found in. - - `const InputImageInputImage InputImage = "input_image"` + - `FileName string` - - `Detail BetaResponseInputImageContentDetail` + The name of the file that result was found in. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `Score float64` - - `const BetaResponseInputImageContentDetailLow BetaResponseInputImageContentDetail = "low"` + The score of the result. All values must be a floating point number between 0 and 1. - - `const BetaResponseInputImageContentDetailHigh BetaResponseInputImageContentDetail = "high"` + - `Content []FileSearchToolCallFileSearchResultContent` - - `const BetaResponseInputImageContentDetailAuto BetaResponseInputImageContentDetail = "auto"` + The content of the result that was found. The content is only included if requested via the include query parameter. - - `const BetaResponseInputImageContentDetailOriginal BetaResponseInputImageContentDetail = "original"` + - `Text string` - - `FileID string` + The text content of the file. - The ID of the file to be sent to the model. + - `Type string` - - `ImageURL string` + The type of the content. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `const FileSearchToolCallFileSearchResultContentTypeText FileSearchToolCallFileSearchResultContentType = "text"` - - `PromptCacheBreakpoint BetaResponseInputImageContentPromptCacheBreakpoint` + - `Type FileSearch` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The type of tool call. This is always going to be `file_search` for this type of tool call. - - `Mode Explicit` + - `const FileSearchFileSearch FileSearch = "file_search"` - The breakpoint mode. Always `explicit`. + - `type FunctionToolCall struct{…}` - - `const ExplicitExplicit Explicit = "explicit"` + - `ID string` - - `type BetaResponseInputFileContent struct{…}` + The ID of the tool call object. - A file input to the model. + - `Function FunctionToolCallFunction` - - `Type InputFile` + The definition of the function that was called. - The type of the input item. Always `input_file`. + - `Arguments string` - - `const InputFileInputFile InputFile = "input_file"` + The arguments passed to the function. - - `Detail BetaResponseInputFileContentDetail` + - `Name string` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + The name of the function. - - `const BetaResponseInputFileContentDetailAuto BetaResponseInputFileContentDetail = "auto"` + - `Output string` - - `const BetaResponseInputFileContentDetailLow BetaResponseInputFileContentDetail = "low"` + The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - - `const BetaResponseInputFileContentDetailHigh BetaResponseInputFileContentDetail = "high"` + - `Type Function` - - `FileData string` + The type of tool call. This is always going to be `function` for this type of tool call. - The base64-encoded data of the file to be sent to the model. + - `const FunctionFunction Function = "function"` - - `FileID string` + - `Type ToolCalls` - The ID of the file to be sent to the model. + Always `tool_calls`. - - `FileURL string` + - `const ToolCallsToolCalls ToolCalls = "tool_calls"` - The URL of the file to be sent to the model. +# Messages - - `Filename string` +## List messages - The name of the file to be sent to the model. +`client.Beta.Threads.Messages.List(ctx, threadID, query) (*CursorPage[Message], error)` - - `PromptCacheBreakpoint BetaResponseInputFileContentPromptCacheBreakpoint` +**get** `/threads/{thread_id}/messages` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. +Returns a list of messages for a given thread. - - `Mode Explicit` +### Parameters - The breakpoint mode. Always `explicit`. +- `threadID string` - - `const ExplicitExplicit Explicit = "explicit"` +- `query BetaThreadMessageListParams` - - `Type FunctionCallOutput` + - `After param.Field[string]` - The type of the function tool call output. Always `function_call_output`. + A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - - `const FunctionCallOutputFunctionCallOutput FunctionCallOutput = "function_call_output"` + - `Before param.Field[string]` - - `ID string` + A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - The unique ID of the function tool call output. Populated when this item is returned via API. + - `Limit param.Field[int64]` - - `Agent BetaResponseInputItemFunctionCallOutputAgent` + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - The agent that produced this item. + - `Order param.Field[BetaThreadMessageListParamsOrder]` - - `AgentName string` + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - The canonical name of the agent that produced this item. + - `const BetaThreadMessageListParamsOrderAsc BetaThreadMessageListParamsOrder = "asc"` - - `Caller BetaResponseInputItemFunctionCallOutputCallerUnion` + - `const BetaThreadMessageListParamsOrderDesc BetaThreadMessageListParamsOrder = "desc"` - The execution context that produced this tool call. + - `RunID param.Field[string]` - - `type BetaResponseInputItemFunctionCallOutputCallerDirect struct{…}` + Filter messages by the run ID that generated them. - - `Type Direct` +### Returns - The caller type. Always `direct`. +- `type Message struct{…}` - - `const DirectDirect Direct = "direct"` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `type BetaResponseInputItemFunctionCallOutputCallerProgram struct{…}` + - `ID string` - - `CallerID string` + The identifier, which can be referenced in API endpoints. - The call ID of the program item that produced this tool call. + - `AssistantID string` - - `Type Program` + If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - The caller type. Always `program`. + - `Attachments []MessageAttachment` - - `const ProgramProgram Program = "program"` + A list of files attached to the message, and the tools they were added to. - - `Status string` + - `FileID string` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + The ID of the file to attach to the message. - - `const BetaResponseInputItemFunctionCallOutputStatusInProgress BetaResponseInputItemFunctionCallOutputStatus = "in_progress"` + - `Tools []MessageAttachmentToolUnion` - - `const BetaResponseInputItemFunctionCallOutputStatusCompleted BetaResponseInputItemFunctionCallOutputStatus = "completed"` + The tools to add this file to. - - `const BetaResponseInputItemFunctionCallOutputStatusIncomplete BetaResponseInputItemFunctionCallOutputStatus = "incomplete"` + - `type CodeInterpreterTool struct{…}` - - `type BetaResponseInputItemAgentMessage struct{…}` + - `Type CodeInterpreter` - A message routed between agents. + The type of tool being defined: `code_interpreter` - - `Author string` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The sending agent identity. + - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` - - `Content []BetaResponseInputItemAgentMessageContentUnion` + - `Type FileSearch` - Plaintext, image, or encrypted content sent between agents. + The type of tool being defined: `file_search` - - `type BetaResponseInputTextContent struct{…}` + - `const FileSearchFileSearch FileSearch = "file_search"` - A text input to the model. + - `CompletedAt int64` - - `type BetaResponseInputImageContent struct{…}` + The Unix timestamp (in seconds) for when the message was completed. - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision) + - `Content []MessageContentUnion` - - `type BetaResponseInputItemAgentMessageContentEncryptedContent struct{…}` + The content of the message in array of text and/or images. - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `type ImageFileContentBlock struct{…}` - - `EncryptedContent string` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - Opaque encrypted content. + - `ImageFile ImageFile` - - `Type EncryptedContent` + - `FileID string` - The type of the input item. Always `encrypted_content`. + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `const EncryptedContentEncryptedContent EncryptedContent = "encrypted_content"` + - `Detail ImageFileDetail` - - `Recipient string` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - The destination agent identity. + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - - `Type AgentMessage` + - `const ImageFileDetailLow ImageFileDetail = "low"` - The item type. Always `agent_message`. + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `const AgentMessageAgentMessage AgentMessage = "agent_message"` + - `Type ImageFile` - - `ID string` + Always `image_file`. - The unique ID of this agent message item. + - `const ImageFileImageFile ImageFile = "image_file"` - - `Agent BetaResponseInputItemAgentMessageAgent` + - `type ImageURLContentBlock struct{…}` - The agent that produced this item. + References an image URL in the content of a message. - - `AgentName string` + - `ImageURL ImageURL` - The canonical name of the agent that produced this item. + - `URL string` - - `type BetaResponseInputItemMultiAgentCall struct{…}` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `Action string` + - `Detail ImageURLDetail` - The multi-agent action that was executed. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `const BetaResponseInputItemMultiAgentCallActionSpawnAgent BetaResponseInputItemMultiAgentCallAction = "spawn_agent"` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - - `const BetaResponseInputItemMultiAgentCallActionInterruptAgent BetaResponseInputItemMultiAgentCallAction = "interrupt_agent"` + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `const BetaResponseInputItemMultiAgentCallActionListAgents BetaResponseInputItemMultiAgentCallAction = "list_agents"` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `const BetaResponseInputItemMultiAgentCallActionSendMessage BetaResponseInputItemMultiAgentCallAction = "send_message"` + - `Type ImageURL` - - `const BetaResponseInputItemMultiAgentCallActionFollowupTask BetaResponseInputItemMultiAgentCallAction = "followup_task"` + The type of the content part. - - `const BetaResponseInputItemMultiAgentCallActionWaitAgent BetaResponseInputItemMultiAgentCallAction = "wait_agent"` + - `const ImageURLImageURL ImageURL = "image_url"` - - `Arguments string` + - `type TextContentBlock struct{…}` - The action arguments as a JSON string. + The text content that is part of a message. - - `CallID string` + - `Text Text` - The unique ID linking this call to its output. + - `Annotations []AnnotationUnion` - - `Type MultiAgentCall` + - `type FileCitationAnnotation struct{…}` - The item type. Always `multi_agent_call`. + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `const MultiAgentCallMultiAgentCall MultiAgentCall = "multi_agent_call"` + - `EndIndex int64` - - `ID string` + - `FileCitation FileCitationAnnotationFileCitation` - The unique ID of this multi-agent call. + - `FileID string` - - `Agent BetaResponseInputItemMultiAgentCallAgent` + The ID of the specific File the citation is from. - The agent that produced this item. + - `StartIndex int64` - - `AgentName string` + - `Text string` - The canonical name of the agent that produced this item. + The text in the message content that needs to be replaced. - - `type BetaResponseInputItemMultiAgentCallOutput struct{…}` + - `Type FileCitation` - - `Action string` + Always `file_citation`. - The multi-agent action that produced this result. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaResponseInputItemMultiAgentCallOutputActionSpawnAgent BetaResponseInputItemMultiAgentCallOutputAction = "spawn_agent"` + - `type FilePathAnnotation struct{…}` - - `const BetaResponseInputItemMultiAgentCallOutputActionInterruptAgent BetaResponseInputItemMultiAgentCallOutputAction = "interrupt_agent"` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `const BetaResponseInputItemMultiAgentCallOutputActionListAgents BetaResponseInputItemMultiAgentCallOutputAction = "list_agents"` + - `EndIndex int64` - - `const BetaResponseInputItemMultiAgentCallOutputActionSendMessage BetaResponseInputItemMultiAgentCallOutputAction = "send_message"` + - `FilePath FilePathAnnotationFilePath` - - `const BetaResponseInputItemMultiAgentCallOutputActionFollowupTask BetaResponseInputItemMultiAgentCallOutputAction = "followup_task"` + - `FileID string` - - `const BetaResponseInputItemMultiAgentCallOutputActionWaitAgent BetaResponseInputItemMultiAgentCallOutputAction = "wait_agent"` + The ID of the file that was generated. - - `CallID string` + - `StartIndex int64` - The unique ID of the multi-agent call. + - `Text string` - - `Output []BetaResponseInputItemMultiAgentCallOutputOutput` + The text in the message content that needs to be replaced. - Text output returned by the multi-agent action. + - `Type FilePath` - - `Text string` + Always `file_path`. - The text content. + - `const FilePathFilePath FilePath = "file_path"` - - `Type OutputText` + - `Value string` - The content type. Always `output_text`. + The data that makes up the text. - - `const OutputTextOutputText OutputText = "output_text"` + - `Type Text` - - `Annotations BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsUnion` + Always `text`. - Citations associated with the text content. + - `const TextText Text = "text"` - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArrayItem` + - `type RefusalContentBlock struct{…}` - - `FileID string` + The refusal content generated by the assistant. - The ID of the file. + - `Refusal string` - - `Filename string` + - `Type Refusal` - The filename of the file cited. + Always `refusal`. - - `Index int64` + - `const RefusalRefusal Refusal = "refusal"` - The index of the file in the list of files. + - `CreatedAt int64` - - `Type FileCitation` + The Unix timestamp (in seconds) for when the message was created. - The citation type. Always `file_citation`. + - `IncompleteAt int64` - - `const FileCitationFileCitation FileCitation = "file_citation"` + The Unix timestamp (in seconds) for when the message was marked as incomplete. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray2Item` + - `IncompleteDetails MessageIncompleteDetails` - - `EndIndex int64` + On an incomplete message, details about why the message is incomplete. - The index of the last character of the citation in the message. + - `Reason string` - - `StartIndex int64` + The reason the message is incomplete. - The index of the first character of the citation in the message. + - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` - - `Title string` + - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` - The title of the cited resource. + - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` - - `Type URLCitation` + - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` - The citation type. Always `url_citation`. + - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` - - `const URLCitationURLCitation URLCitation = "url_citation"` + - `Metadata Metadata` - - `URL string` + 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. - The URL of the cited resource. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `type BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3 []BetaResponseInputItemMultiAgentCallOutputOutputAnnotationsArray3Item` + - `Object ThreadMessage` - - `ContainerID string` + The object type, which is always `thread.message`. - The ID of the container. + - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` - - `EndIndex int64` + - `Role MessageRole` + + The entity that produced the message. One of `user` or `assistant`. - The index of the last character of the citation in the message. + - `const MessageRoleUser MessageRole = "user"` - - `FileID string` + - `const MessageRoleAssistant MessageRole = "assistant"` - The ID of the container file. + - `RunID string` - - `Filename string` + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - The filename of the container file cited. + - `Status MessageStatus` - - `StartIndex int64` + The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - The index of the first character of the citation in the message. + - `const MessageStatusInProgress MessageStatus = "in_progress"` - - `Type ContainerFileCitation` + - `const MessageStatusIncomplete MessageStatus = "incomplete"` - The citation type. Always `container_file_citation`. + - `const MessageStatusCompleted MessageStatus = "completed"` - - `const ContainerFileCitationContainerFileCitation ContainerFileCitation = "container_file_citation"` + - `ThreadID string` - - `Type MultiAgentCallOutput` + The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - The item type. Always `multi_agent_call_output`. +### Example - - `const MultiAgentCallOutputMultiAgentCallOutput MultiAgentCallOutput = "multi_agent_call_output"` +```go +package main - - `ID string` +import ( + "context" + "fmt" - The unique ID of this multi-agent call output. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `Agent BetaResponseInputItemMultiAgentCallOutputAgent` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + page, err := client.Beta.Threads.Messages.List( + context.TODO(), + "thread_id", + openai.BetaThreadMessageListParams{ - The agent that produced this item. + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", page) +} +``` - - `AgentName string` +#### Response - The canonical name of the agent that produced this item. +```json +{ + "data": [ + { + "id": "id", + "assistant_id": "assistant_id", + "attachments": [ + { + "file_id": "file_id", + "tools": [ + { + "type": "code_interpreter" + } + ] + } + ], + "completed_at": 0, + "content": [ + { + "image_file": { + "file_id": "file_id", + "detail": "auto" + }, + "type": "image_file" + } + ], + "created_at": 0, + "incomplete_at": 0, + "incomplete_details": { + "reason": "content_filter" + }, + "metadata": { + "foo": "string" + }, + "object": "thread.message", + "role": "user", + "run_id": "run_id", + "status": "in_progress", + "thread_id": "thread_id" + } + ], + "first_id": "msg_abc123", + "has_more": false, + "last_id": "msg_abc123", + "object": "list" +} +``` - - `type BetaResponseInputItemToolSearchCall struct{…}` +## Create message - - `Arguments any` +`client.Beta.Threads.Messages.New(ctx, threadID, body) (*Message, error)` - The arguments supplied to the tool search call. +**post** `/threads/{thread_id}/messages` - - `Type ToolSearchCall` +Create a message. - The item type. Always `tool_search_call`. +### Parameters - - `const ToolSearchCallToolSearchCall ToolSearchCall = "tool_search_call"` +- `threadID string` - - `ID string` +- `body BetaThreadMessageNewParams` - The unique ID of this tool search call. + - `Content param.Field[BetaThreadMessageNewParamsContentUnion]` - - `Agent BetaResponseInputItemToolSearchCallAgent` + The text contents of the message. - The agent that produced this item. + - `string` - - `AgentName string` + - `type BetaThreadMessageNewParamsContentArrayOfContentParts []MessageContentPartParamUnionResp` - The canonical name of the agent that produced this item. + An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](https://platform.openai.com/docs/models). - - `CallID string` + - `type ImageFileContentBlock struct{…}` - The unique ID of the tool search call generated by the model. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `Execution string` + - `ImageFile ImageFile` - Whether tool search was executed by the server or by the client. + - `FileID string` - - `const BetaResponseInputItemToolSearchCallExecutionServer BetaResponseInputItemToolSearchCallExecution = "server"` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `const BetaResponseInputItemToolSearchCallExecutionClient BetaResponseInputItemToolSearchCallExecution = "client"` + - `Detail ImageFileDetail` - - `Status string` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - The status of the tool search call. + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - - `const BetaResponseInputItemToolSearchCallStatusInProgress BetaResponseInputItemToolSearchCallStatus = "in_progress"` + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `const BetaResponseInputItemToolSearchCallStatusCompleted BetaResponseInputItemToolSearchCallStatus = "completed"` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `const BetaResponseInputItemToolSearchCallStatusIncomplete BetaResponseInputItemToolSearchCallStatus = "incomplete"` + - `Type ImageFile` - - `type BetaResponseToolSearchOutputItemParamResp struct{…}` + Always `image_file`. - - `Tools []BetaToolUnion` + - `const ImageFileImageFile ImageFile = "image_file"` - The loaded tool definitions returned by the tool search output. + - `type ImageURLContentBlock struct{…}` - - `type BetaFunctionTool struct{…}` + References an image URL in the content of a message. - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `ImageURL ImageURL` - - `Name string` + - `URL string` - The name of the function to call. + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `Parameters map[string, any]` + - `Detail ImageURLDetail` - A JSON schema object describing the parameters of the function. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `Strict bool` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - Whether strict parameter validation is enforced for this function tool. + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `Type Function` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - The type of the function tool. Always `function`. + - `Type ImageURL` - - `const FunctionFunction Function = "function"` + The type of the content part. - - `AllowedCallers []string` + - `const ImageURLImageURL ImageURL = "image_url"` - The tool invocation context(s). + - `type TextContentBlockParam struct{…}` - - `const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"` + The text content that is part of a message. - - `const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"` + - `Text string` - - `DeferLoading bool` + Text content to be sent to the model - Whether this function is deferred and loaded via tool search. + - `Type Text` - - `Description string` + Always `text`. - A description of the function. Used by the model to determine whether or not to call the function. + - `const TextText Text = "text"` - - `OutputSchema map[string, any]` + - `Role param.Field[BetaThreadMessageNewParamsRole]` - A JSON schema object describing the JSON value encoded in string outputs for this function. + The role of the entity that is creating the message. Allowed values include: - - `type BetaFileSearchTool struct{…}` + - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `const BetaThreadMessageNewParamsRoleUser BetaThreadMessageNewParamsRole = "user"` - - `Type FileSearch` + - `const BetaThreadMessageNewParamsRoleAssistant BetaThreadMessageNewParamsRole = "assistant"` - The type of the file search tool. Always `file_search`. + - `Attachments param.Field[[]BetaThreadMessageNewParamsAttachment]` - - `const FileSearchFileSearch FileSearch = "file_search"` + A list of files attached to the message, and the tools they should be added to. - - `VectorStoreIDs []string` + - `FileID string` - The IDs of the vector stores to search. + The ID of the file to attach to the message. - - `Filters BetaFileSearchToolFiltersUnion` + - `Tools []BetaThreadMessageNewParamsAttachmentToolUnion` - A filter to apply. + The tools to add this file to. - - `type BetaFileSearchToolFiltersComparisonFilter struct{…}` + - `type CodeInterpreterTool struct{…}` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `Type CodeInterpreter` - - `Key string` + The type of tool being defined: `code_interpreter` - The key to compare against the value. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `Type string` + - `type BetaThreadMessageNewParamsAttachmentToolFileSearch struct{…}` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `Type FileSearch` - - `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 + The type of tool being defined: `file_search` - - `const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"` + - `Metadata param.Field[Metadata]` - - `const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"` + 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. - - `const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"` +### Returns - - `const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"` +- `type Message struct{…}` - - `const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"` + - `ID string` - - `Value BetaFileSearchToolFiltersComparisonFilterValueUnion` + The identifier, which can be referenced in API endpoints. - The value to compare against the attribute key; supports string, number, or boolean types. + - `AssistantID string` - - `string` + If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - - `float64` + - `Attachments []MessageAttachment` - - `bool` + A list of files attached to the message, and the tools they were added to. - - `type BetaFileSearchToolFiltersComparisonFilterValueArray []any` + - `FileID string` - - `type BetaFileSearchToolFiltersCompoundFilter struct{…}` + The ID of the file to attach to the message. - Combine multiple filters using `and` or `or`. + - `Tools []MessageAttachmentToolUnion` - - `Filters []BetaFileSearchToolFiltersCompoundFilterFilter` + The tools to add this file to. - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `type CodeInterpreterTool struct{…}` - - `type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}` + - `Type CodeInterpreter` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + The type of tool being defined: `code_interpreter` - - `Key string` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The key to compare against the value. + - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` - - `Type string` + - `Type FileSearch` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The type of tool being defined: `file_search` - - `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 FileSearchFileSearch FileSearch = "file_search"` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"` + - `CompletedAt int64` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"` + The Unix timestamp (in seconds) for when the message was completed. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"` + - `Content []MessageContentUnion` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"` + The content of the message in array of text and/or images. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"` + - `type ImageFileContentBlock struct{…}` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"` + - `ImageFile ImageFile` - - `const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"` + - `FileID string` - - `Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The value to compare against the attribute key; supports string, number, or boolean types. + - `Detail ImageFileDetail` - - `string` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `float64` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - - `bool` + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []any` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `Type string` + - `Type ImageFile` - Type of operation: `and` or `or`. + Always `image_file`. - - `const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"` + - `const ImageFileImageFile ImageFile = "image_file"` - - `const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"` + - `type ImageURLContentBlock struct{…}` - - `MaxNumResults int64` + References an image URL in the content of a message. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `ImageURL ImageURL` - - `RankingOptions BetaFileSearchToolRankingOptions` + - `URL string` - Ranking options for search. + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `HybridSearch BetaFileSearchToolRankingOptionsHybridSearch` + - `Detail ImageURLDetail` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `EmbeddingWeight float64` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - The weight of the embedding in the reciprocal ranking fusion. + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `TextWeight float64` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - The weight of the text in the reciprocal ranking fusion. + - `Type ImageURL` - - `Ranker string` + The type of the content part. - The ranker to use for the file search. + - `const ImageURLImageURL ImageURL = "image_url"` - - `const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"` + - `type TextContentBlock struct{…}` - - `const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"` + The text content that is part of a message. - - `ScoreThreshold float64` + - `Text Text` - 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. + - `Annotations []AnnotationUnion` - - `type BetaComputerTool struct{…}` + - `type FileCitationAnnotation struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `Type Computer` + - `EndIndex int64` - The type of the computer tool. Always `computer`. + - `FileCitation FileCitationAnnotationFileCitation` - - `const ComputerComputer Computer = "computer"` + - `FileID string` - - `type BetaComputerUsePreviewTool struct{…}` + The ID of the specific File the citation is from. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `StartIndex int64` - - `DisplayHeight int64` + - `Text string` - The height of the computer display. + The text in the message content that needs to be replaced. - - `DisplayWidth int64` + - `Type FileCitation` - The width of the computer display. + Always `file_citation`. - - `Environment BetaComputerUsePreviewToolEnvironment` + - `const FileCitationFileCitation FileCitation = "file_citation"` - The type of computer environment to control. + - `type FilePathAnnotation struct{…}` - - `const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"` + - `EndIndex int64` - - `const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"` + - `FilePath FilePathAnnotationFilePath` - - `const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"` + - `FileID string` - - `const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"` + The ID of the file that was generated. - - `Type ComputerUsePreview` + - `StartIndex int64` - The type of the computer use tool. Always `computer_use_preview`. + - `Text string` - - `const ComputerUsePreviewComputerUsePreview ComputerUsePreview = "computer_use_preview"` + The text in the message content that needs to be replaced. - - `type BetaWebSearchTool struct{…}` + - `Type FilePath` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + Always `file_path`. - - `Type BetaWebSearchToolType` + - `const FilePathFilePath FilePath = "file_path"` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `Value string` - - `const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"` + The data that makes up the text. - - `const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"` + - `Type Text` - - `Filters BetaWebSearchToolFilters` + Always `text`. - Filters for the search. + - `const TextText Text = "text"` - - `AllowedDomains []string` + - `type RefusalContentBlock struct{…}` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + The refusal content generated by the assistant. - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `Refusal string` - - `SearchContextSize BetaWebSearchToolSearchContextSize` + - `Type Refusal` - 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. + Always `refusal`. - - `const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"` + - `const RefusalRefusal Refusal = "refusal"` - - `const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"` + - `CreatedAt int64` - - `const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"` + The Unix timestamp (in seconds) for when the message was created. - - `UserLocation BetaWebSearchToolUserLocation` + - `IncompleteAt int64` - The approximate location of the user. + The Unix timestamp (in seconds) for when the message was marked as incomplete. - - `City string` + - `IncompleteDetails MessageIncompleteDetails` - Free text input for the city of the user, e.g. `San Francisco`. + On an incomplete message, details about why the message is incomplete. - - `Country string` + - `Reason string` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + The reason the message is incomplete. - - `Region string` + - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` - Free text input for the region of the user, e.g. `California`. + - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` - - `Timezone string` + - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` - - `Type string` + - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` - The type of location approximation. Always `approximate`. + - `Metadata Metadata` - - `const BetaWebSearchToolUserLocationTypeApproximate BetaWebSearchToolUserLocationType = "approximate"` + 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. - - `type BetaToolMcp struct{…}` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `Object ThreadMessage` - - `ServerLabel string` + The object type, which is always `thread.message`. - A label for this MCP server, used to identify it in tool calls. + - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` - - `Type Mcp` + - `Role MessageRole` - The type of the MCP tool. Always `mcp`. + The entity that produced the message. One of `user` or `assistant`. - - `const McpMcp Mcp = "mcp"` + - `const MessageRoleUser MessageRole = "user"` - - `AllowedCallers []string` + - `const MessageRoleAssistant MessageRole = "assistant"` - The tool invocation context(s). + - `RunID string` - - `const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"` + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - `const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"` + - `Status MessageStatus` - - `AllowedTools BetaToolMcpAllowedToolsUnion` + The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - List of allowed tool names or a filter object. + - `const MessageStatusInProgress MessageStatus = "in_progress"` - - `type BetaToolMcpAllowedToolsMcpAllowedTools []string` + - `const MessageStatusIncomplete MessageStatus = "incomplete"` - A string array of allowed tool names + - `const MessageStatusCompleted MessageStatus = "completed"` - - `type BetaToolMcpAllowedToolsMcpToolFilter struct{…}` + - `ThreadID string` - A filter object to specify which tools are allowed. + The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - - `ReadOnly bool` +### Example - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. +```go +package main - - `ToolNames []string` +import ( + "context" + "fmt" - List of allowed tool names. + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `Authorization string` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + message, err := client.Beta.Threads.Messages.New( + context.TODO(), + "thread_id", + openai.BetaThreadMessageNewParams{ + Content: openai.BetaThreadMessageNewParamsContentUnion{ + OfString: openai.String("string"), + }, + Role: openai.BetaThreadMessageNewParamsRoleUser, + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", message.ID) +} +``` - 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. +#### Response - - `ConnectorID string` +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "attachments": [ + { + "file_id": "file_id", + "tools": [ + { + "type": "code_interpreter" + } + ] + } + ], + "completed_at": 0, + "content": [ + { + "image_file": { + "file_id": "file_id", + "detail": "auto" + }, + "type": "image_file" + } + ], + "created_at": 0, + "incomplete_at": 0, + "incomplete_details": { + "reason": "content_filter" + }, + "metadata": { + "foo": "string" + }, + "object": "thread.message", + "role": "user", + "run_id": "run_id", + "status": "in_progress", + "thread_id": "thread_id" +} +``` - 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](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). +## Modify message - Currently supported `connector_id` values are: +`client.Beta.Threads.Messages.Update(ctx, threadID, messageID, body) (*Message, error)` - - 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` +**post** `/threads/{thread_id}/messages/{message_id}` - - `const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"` +Modifies a message. - - `const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"` +### Parameters - - `const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"` +- `threadID string` - - `const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"` +- `messageID string` - - `const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"` +- `body BetaThreadMessageUpdateParams` - - `const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"` + - `Metadata param.Field[Metadata]` - - `const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"` + 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. - - `const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `DeferLoading bool` +### Returns - Whether this MCP tool is deferred and discovered via tool search. +- `type Message struct{…}` - - `Headers map[string, string]` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `ID string` - - `RequireApproval BetaToolMcpRequireApprovalUnion` + The identifier, which can be referenced in API endpoints. - Specify which of the MCP server's tools require approval. + - `AssistantID string` - - `type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}` + If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `Attachments []MessageAttachment` - - `Always BetaToolMcpRequireApprovalMcpToolApprovalFilterAlways` + A list of files attached to the message, and the tools they were added to. - A filter object to specify which tools are allowed. + - `FileID string` - - `ReadOnly bool` + The ID of the file to attach to the message. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `Tools []MessageAttachmentToolUnion` - - `ToolNames []string` + The tools to add this file to. - List of allowed tool names. + - `type CodeInterpreterTool struct{…}` - - `Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNever` + - `Type CodeInterpreter` - A filter object to specify which tools are allowed. + The type of tool being defined: `code_interpreter` - - `ReadOnly bool` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` - - `ToolNames []string` + - `Type FileSearch` - List of allowed tool names. + The type of tool being defined: `file_search` - - `type BetaToolMcpRequireApprovalMcpToolApprovalSetting string` + - `const FileSearchFileSearch FileSearch = "file_search"` - 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. + - `CompletedAt int64` - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"` + The Unix timestamp (in seconds) for when the message was completed. - - `const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"` + - `Content []MessageContentUnion` - - `ServerDescription string` + The content of the message in array of text and/or images. - Optional description of the MCP server, used to provide more context. + - `type ImageFileContentBlock struct{…}` - - `ServerURL string` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + - `ImageFile ImageFile` - - `TunnelID string` + - `FileID 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. + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `type BetaToolCodeInterpreter struct{…}` + - `Detail ImageFileDetail` - A tool that runs Python code to help generate a response to a prompt. + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `Container BetaToolCodeInterpreterContainerUnion` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - 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. + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `string` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}` + - `Type ImageFile` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + Always `image_file`. - - `Type Auto` + - `const ImageFileImageFile ImageFile = "image_file"` - Always `auto`. + - `type ImageURLContentBlock struct{…}` - - `const AutoAuto Auto = "auto"` + References an image URL in the content of a message. - - `FileIDs []string` + - `ImageURL ImageURL` - An optional list of uploaded files to make available to your code. + - `URL string` - - `MemoryLimit string` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - The memory limit for the code interpreter container. + - `Detail ImageURLDetail` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"` + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnion` + - `Type ImageURL` - Network access policy for the container. + The type of the content part. - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `const ImageURLImageURL ImageURL = "image_url"` - - `Type Disabled` + - `type TextContentBlock struct{…}` - Disable outbound network access. Always `disabled`. + The text content that is part of a message. - - `const DisabledDisabled Disabled = "disabled"` + - `Text Text` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + - `Annotations []AnnotationUnion` - - `AllowedDomains []string` + - `type FileCitationAnnotation struct{…}` - A list of allowed domains when type is `allowlist`. + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `Type Allowlist` + - `EndIndex int64` - Allow outbound network access only to specified domains. Always `allowlist`. + - `FileCitation FileCitationAnnotationFileCitation` - - `const AllowlistAllowlist Allowlist = "allowlist"` + - `FileID string` - - `DomainSecrets []BetaContainerNetworkPolicyDomainSecret` + The ID of the specific File the citation is from. - Optional domain-scoped secrets for allowlisted domains. + - `StartIndex int64` - - `Domain string` + - `Text string` - The domain associated with the secret. + The text in the message content that needs to be replaced. - - `Name string` + - `Type FileCitation` - The name of the secret to inject for the domain. + Always `file_citation`. - - `Value string` + - `const FileCitationFileCitation FileCitation = "file_citation"` - The secret value to inject for the domain. + - `type FilePathAnnotation struct{…}` - - `Type CodeInterpreter` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - The type of the code interpreter tool. Always `code_interpreter`. + - `EndIndex int64` - - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` + - `FilePath FilePathAnnotationFilePath` - - `AllowedCallers []string` + - `FileID string` - The tool invocation context(s). + The ID of the file that was generated. - - `const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"` + - `StartIndex int64` - - `const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"` + - `Text string` - - `type BetaToolProgrammaticToolCalling struct{…}` + The text in the message content that needs to be replaced. - - `Type ProgrammaticToolCalling` + - `Type FilePath` - The type of the tool. Always `programmatic_tool_calling`. + Always `file_path`. - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + - `const FilePathFilePath FilePath = "file_path"` - - `type BetaToolImageGeneration struct{…}` + - `Value string` - A tool that generates images using the GPT image models. + The data that makes up the text. - - `Type ImageGeneration` + - `Type Text` - The type of the image generation tool. Always `image_generation`. + Always `text`. - - `const ImageGenerationImageGeneration ImageGeneration = "image_generation"` + - `const TextText Text = "text"` - - `Action string` + - `type RefusalContentBlock struct{…}` - Whether to generate a new image or edit an existing image. Default: `auto`. + The refusal content generated by the assistant. - - `const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"` + - `Refusal string` - - `const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"` + - `Type Refusal` - - `const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"` + Always `refusal`. - - `Background string` + - `const RefusalRefusal Refusal = "refusal"` - 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. + - `CreatedAt int64` - `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. + The Unix timestamp (in seconds) for when the message was created. - If `transparent`, the output format needs to support transparency, - so it should be set to either `png` (default value) or `webp`. + - `IncompleteAt int64` - - `const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"` + The Unix timestamp (in seconds) for when the message was marked as incomplete. - - `const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"` + - `IncompleteDetails MessageIncompleteDetails` - - `const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"` + On an incomplete message, details about why the message is incomplete. - - `InputFidelity string` + - `Reason 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`. + The reason the message is incomplete. - - `const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"` + - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` - - `const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"` + - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` - - `InputImageMask BetaToolImageGenerationInputImageMask` + - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` - - `FileID string` + - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` - File ID for the mask image. + - `Metadata Metadata` - - `ImageURL string` + 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. - Base64-encoded mask image. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `Model string` + - `Object ThreadMessage` - The image generation model to use. Default: `gpt-image-1`. + The object type, which is always `thread.message`. - - `string` + - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` - - `string` + - `Role MessageRole` - - `const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"` + The entity that produced the message. One of `user` or `assistant`. - - `const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"` + - `const MessageRoleUser MessageRole = "user"` - - `const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"` + - `const MessageRoleAssistant MessageRole = "assistant"` - - `const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"` + - `RunID string` - - `const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"` + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - `const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"` + - `Status MessageStatus` - - `Moderation string` + The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - Moderation level for the generated image. Default: `auto`. + - `const MessageStatusInProgress MessageStatus = "in_progress"` - - `const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"` + - `const MessageStatusIncomplete MessageStatus = "incomplete"` - - `const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"` + - `const MessageStatusCompleted MessageStatus = "completed"` - - `OutputCompression int64` + - `ThreadID string` - Compression level for the output image. Default: 100. + The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - - `OutputFormat string` +### Example - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. +```go +package main - - `const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"` +import ( + "context" + "fmt" - - `const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + message, err := client.Beta.Threads.Messages.Update( + context.TODO(), + "thread_id", + "message_id", + openai.BetaThreadMessageUpdateParams{ - - `PartialImages int64` + }, + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", message.ID) +} +``` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. +#### Response - - `Quality string` +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "attachments": [ + { + "file_id": "file_id", + "tools": [ + { + "type": "code_interpreter" + } + ] + } + ], + "completed_at": 0, + "content": [ + { + "image_file": { + "file_id": "file_id", + "detail": "auto" + }, + "type": "image_file" + } + ], + "created_at": 0, + "incomplete_at": 0, + "incomplete_details": { + "reason": "content_filter" + }, + "metadata": { + "foo": "string" + }, + "object": "thread.message", + "role": "user", + "run_id": "run_id", + "status": "in_progress", + "thread_id": "thread_id" +} +``` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. +## Retrieve message - - `const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"` +`client.Beta.Threads.Messages.Get(ctx, threadID, messageID) (*Message, error)` - - `const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"` +**get** `/threads/{thread_id}/messages/{message_id}` - - `const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"` +Retrieve a message. - - `const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"` +### Parameters - - `Size string` +- `threadID 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`. +- `messageID string` - - `string` +### Returns - - `string` +- `type Message struct{…}` - - `const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - - `const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"` + - `ID string` - - `const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"` + The identifier, which can be referenced in API endpoints. - - `const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"` + - `AssistantID string` - - `type BetaToolLocalShell struct{…}` + If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - A tool that allows the model to execute shell commands in a local environment. + - `Attachments []MessageAttachment` - - `Type LocalShell` + A list of files attached to the message, and the tools they were added to. - The type of the local shell tool. Always `local_shell`. + - `FileID string` - - `const LocalShellLocalShell LocalShell = "local_shell"` + The ID of the file to attach to the message. - - `type BetaFunctionShellTool struct{…}` + - `Tools []MessageAttachmentToolUnion` - A tool that allows the model to execute shell commands. + The tools to add this file to. - - `Type Shell` + - `type CodeInterpreterTool struct{…}` - The type of the shell tool. Always `shell`. + - `Type CodeInterpreter` - - `const ShellShell Shell = "shell"` + The type of tool being defined: `code_interpreter` - - `AllowedCallers []string` + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - The tool invocation context(s). + - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` - - `const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"` + - `Type FileSearch` - - `const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"` + The type of tool being defined: `file_search` - - `Environment BetaFunctionShellToolEnvironmentUnion` + - `const FileSearchFileSearch FileSearch = "file_search"` - - `type BetaContainerAuto struct{…}` + - `CompletedAt int64` - - `Type ContainerAuto` + The Unix timestamp (in seconds) for when the message was completed. - Automatically creates a container for this request + - `Content []MessageContentUnion` - - `const ContainerAutoContainerAuto ContainerAuto = "container_auto"` + The content of the message in array of text and/or images. - - `FileIDs []string` + - `type ImageFileContentBlock struct{…}` - An optional list of uploaded files to make available to your code. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `MemoryLimit BetaContainerAutoMemoryLimit` + - `ImageFile ImageFile` - The memory limit for the container. + - `FileID string` - - `const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"` + - `Detail ImageFileDetail` - - `const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - - `NetworkPolicy BetaContainerAutoNetworkPolicyUnion` + - `const ImageFileDetailLow ImageFileDetail = "low"` - Network access policy for the container. + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `type BetaContainerNetworkPolicyDisabled struct{…}` + - `Type ImageFile` - - `type BetaContainerNetworkPolicyAllowlist struct{…}` + Always `image_file`. - - `Skills []BetaContainerAutoSkillUnion` + - `const ImageFileImageFile ImageFile = "image_file"` - An optional list of skills referenced by id or inline data. + - `type ImageURLContentBlock struct{…}` - - `type BetaSkillReference struct{…}` + References an image URL in the content of a message. - - `SkillID string` + - `ImageURL ImageURL` - The ID of the referenced skill. + - `URL string` - - `Type SkillReference` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - References a skill created with the /v1/skills endpoint. + - `Detail ImageURLDetail` - - `const SkillReferenceSkillReference SkillReference = "skill_reference"` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `Version string` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `type BetaInlineSkill struct{…}` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `Description string` + - `Type ImageURL` - The description of the skill. + The type of the content part. - - `Name string` + - `const ImageURLImageURL ImageURL = "image_url"` - The name of the skill. + - `type TextContentBlock struct{…}` - - `Source BetaInlineSkillSource` + The text content that is part of a message. - Inline skill payload + - `Text Text` - - `Data string` + - `Annotations []AnnotationUnion` - Base64-encoded skill zip bundle. + - `type FileCitationAnnotation struct{…}` - - `MediaType ApplicationZip` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - The media type of the inline skill payload. Must be `application/zip`. + - `EndIndex int64` - - `const ApplicationZipApplicationZip ApplicationZip = "application/zip"` + - `FileCitation FileCitationAnnotationFileCitation` - - `Type Base64` + - `FileID string` - The type of the inline skill source. Must be `base64`. + The ID of the specific File the citation is from. - - `const Base64Base64 Base64 = "base64"` + - `StartIndex int64` - - `Type Inline` + - `Text string` - Defines an inline skill for this request. + The text in the message content that needs to be replaced. - - `const InlineInline Inline = "inline"` + - `Type FileCitation` - - `type BetaLocalEnvironment struct{…}` + Always `file_citation`. - - `Type Local` + - `const FileCitationFileCitation FileCitation = "file_citation"` - Use a local computer environment. + - `type FilePathAnnotation struct{…}` - - `const LocalLocal Local = "local"` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `Skills []BetaLocalSkill` + - `EndIndex int64` - An optional list of skills. + - `FilePath FilePathAnnotationFilePath` - - `Description string` + - `FileID string` - The description of the skill. + The ID of the file that was generated. - - `Name string` + - `StartIndex int64` - The name of the skill. + - `Text string` - - `Path string` + The text in the message content that needs to be replaced. - The path to the directory containing the skill. + - `Type FilePath` - - `type BetaContainerReference struct{…}` + Always `file_path`. - - `ContainerID string` + - `const FilePathFilePath FilePath = "file_path"` - The ID of the referenced container. + - `Value string` - - `Type ContainerReference` + The data that makes up the text. - References a container created with the /v1/containers endpoint + - `Type Text` - - `const ContainerReferenceContainerReference ContainerReference = "container_reference"` + Always `text`. - - `type BetaCustomTool struct{…}` + - `const TextText Text = "text"` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `type RefusalContentBlock struct{…}` - - `Name string` + The refusal content generated by the assistant. - The name of the custom tool, used to identify it in tool calls. + - `Refusal string` - - `Type Custom` + - `Type Refusal` - The type of the custom tool. Always `custom`. + Always `refusal`. - - `const CustomCustom Custom = "custom"` + - `const RefusalRefusal Refusal = "refusal"` - - `AllowedCallers []string` + - `CreatedAt int64` - The tool invocation context(s). + The Unix timestamp (in seconds) for when the message was created. - - `const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"` + - `IncompleteAt int64` - - `const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"` + The Unix timestamp (in seconds) for when the message was marked as incomplete. - - `DeferLoading bool` + - `IncompleteDetails MessageIncompleteDetails` - Whether this tool should be deferred and discovered via tool search. + On an incomplete message, details about why the message is incomplete. - - `Description string` + - `Reason string` - Optional description of the custom tool, used to provide more context. + The reason the message is incomplete. - - `Format BetaCustomToolFormatUnion` + - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` - The input format for the custom tool. Default is unconstrained text. + - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` - - `type BetaCustomToolFormatText struct{…}` + - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` - Unconstrained free-form text. + - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` - - `Type Text` + - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` - Unconstrained text format. Always `text`. + - `Metadata Metadata` - - `const TextText Text = "text"` + 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. - - `type BetaCustomToolFormatGrammar struct{…}` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - A grammar defined by the user. + - `Object ThreadMessage` - - `Definition string` + The object type, which is always `thread.message`. - The grammar definition. + - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` - - `Syntax string` + - `Role MessageRole` - The syntax of the grammar definition. One of `lark` or `regex`. + The entity that produced the message. One of `user` or `assistant`. - - `const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"` + - `const MessageRoleUser MessageRole = "user"` - - `const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"` + - `const MessageRoleAssistant MessageRole = "assistant"` - - `Type Grammar` + - `RunID string` - Grammar format. Always `grammar`. + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - `const GrammarGrammar Grammar = "grammar"` + - `Status MessageStatus` - - `type BetaNamespaceTool struct{…}` + The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - Groups function/custom tools under a shared namespace. + - `const MessageStatusInProgress MessageStatus = "in_progress"` - - `Description string` + - `const MessageStatusIncomplete MessageStatus = "incomplete"` - A description of the namespace shown to the model. + - `const MessageStatusCompleted MessageStatus = "completed"` - - `Name string` + - `ThreadID string` - The namespace name used in tool calls (for example, `crm`). + The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - - `Tools []BetaNamespaceToolToolUnion` +### Example - The function/custom tools available inside this namespace. +```go +package main - - `type BetaNamespaceToolToolFunction struct{…}` +import ( + "context" + "fmt" - - `Name string` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - - `Type Function` +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + message, err := client.Beta.Threads.Messages.Get( + context.TODO(), + "thread_id", + "message_id", + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", message.ID) +} +``` - - `const FunctionFunction Function = "function"` +#### Response - - `AllowedCallers []string` +```json +{ + "id": "id", + "assistant_id": "assistant_id", + "attachments": [ + { + "file_id": "file_id", + "tools": [ + { + "type": "code_interpreter" + } + ] + } + ], + "completed_at": 0, + "content": [ + { + "image_file": { + "file_id": "file_id", + "detail": "auto" + }, + "type": "image_file" + } + ], + "created_at": 0, + "incomplete_at": 0, + "incomplete_details": { + "reason": "content_filter" + }, + "metadata": { + "foo": "string" + }, + "object": "thread.message", + "role": "user", + "run_id": "run_id", + "status": "in_progress", + "thread_id": "thread_id" +} +``` - The tool invocation context(s). +## Delete message - - `const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"` +`client.Beta.Threads.Messages.Delete(ctx, threadID, messageID) (*MessageDeleted, error)` - - `const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"` +**delete** `/threads/{thread_id}/messages/{message_id}` - - `DeferLoading bool` +Deletes a message. - Whether this function should be deferred and discovered via tool search. +### Parameters - - `Description string` +- `threadID string` - - `OutputSchema map[string, any]` +- `messageID string` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. +### Returns - - `Parameters any` +- `type MessageDeleted struct{…}` - - `Strict bool` + - `ID string` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + - `Deleted bool` - - `type BetaCustomTool struct{…}` + - `Object ThreadMessageDeleted` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + - `const ThreadMessageDeletedThreadMessageDeleted ThreadMessageDeleted = "thread.message.deleted"` - - `Type Namespace` +### Example - The type of the tool. Always `namespace`. +```go +package main - - `const NamespaceNamespace Namespace = "namespace"` +import ( + "context" + "fmt" - - `type BetaToolSearchTool struct{…}` + "github.com/openai/openai-go" + "github.com/openai/openai-go/option" +) - Hosted or BYOT tool search configuration for deferred tools. +func main() { + client := openai.NewClient( + option.WithAPIKey("My API Key"), + ) + messageDeleted, err := client.Beta.Threads.Messages.Delete( + context.TODO(), + "thread_id", + "message_id", + ) + if err != nil { + panic(err.Error()) + } + fmt.Printf("%+v\n", messageDeleted.ID) +} +``` - - `Type ToolSearch` +#### Response - The type of the tool. Always `tool_search`. +```json +{ + "id": "id", + "deleted": true, + "object": "thread.message.deleted" +} +``` - - `const ToolSearchToolSearch ToolSearch = "tool_search"` +## Domain Types - - `Description string` +### Annotation - Description shown to the model for a client-executed tool search tool. +- `type AnnotationUnion interface{…}` - - `Execution BetaToolSearchToolExecution` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - Whether tool search is executed by the server or by the client. + - `type FileCitationAnnotation struct{…}` - - `const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"` + - `EndIndex int64` - - `Parameters any` + - `FileCitation FileCitationAnnotationFileCitation` - Parameter schema for a client-executed tool search tool. + - `FileID string` - - `type BetaWebSearchPreviewTool struct{…}` + The ID of the specific File the citation is from. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `StartIndex int64` - - `Type BetaWebSearchPreviewToolType` + - `Text string` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + The text in the message content that needs to be replaced. - - `const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"` + - `Type FileCitation` - - `const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"` + Always `file_citation`. - - `SearchContentTypes []string` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"` + - `type FilePathAnnotation struct{…}` - - `const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `SearchContextSize BetaWebSearchPreviewToolSearchContextSize` + - `EndIndex int64` - 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. + - `FilePath FilePathAnnotationFilePath` - - `const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"` + - `FileID string` - - `const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"` + The ID of the file that was generated. - - `const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"` + - `StartIndex int64` - - `UserLocation BetaWebSearchPreviewToolUserLocation` + - `Text string` - The user's location. + The text in the message content that needs to be replaced. - - `Type Approximate` + - `Type FilePath` - The type of location approximation. Always `approximate`. + Always `file_path`. - - `const ApproximateApproximate Approximate = "approximate"` + - `const FilePathFilePath FilePath = "file_path"` - - `City string` +### Annotation Delta - Free text input for the city of the user, e.g. `San Francisco`. +- `type AnnotationDeltaUnion interface{…}` - - `Country string` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `type FileCitationDeltaAnnotation struct{…}` - - `Region string` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - Free text input for the region of the user, e.g. `California`. + - `Index int64` - - `Timezone string` + The index of the annotation in the text content part. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `Type FileCitation` - - `type BetaApplyPatchTool struct{…}` + Always `file_citation`. - Allows the assistant to create, delete, or update files using unified diffs. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `Type ApplyPatch` + - `EndIndex int64` - The type of the tool. Always `apply_patch`. + - `FileCitation FileCitationDeltaAnnotationFileCitation` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `FileID string` - - `AllowedCallers []string` + The ID of the specific File the citation is from. - The tool invocation context(s). + - `Quote string` - - `const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"` + The specific quote in the file. - - `const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"` + - `StartIndex int64` - - `Type ToolSearchOutput` + - `Text string` - The item type. Always `tool_search_output`. + The text in the message content that needs to be replaced. - - `const ToolSearchOutputToolSearchOutput ToolSearchOutput = "tool_search_output"` + - `type FilePathDeltaAnnotation struct{…}` - - `ID string` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - The unique ID of this tool search output. + - `Index int64` - - `Agent BetaResponseToolSearchOutputItemParamAgentResp` + The index of the annotation in the text content part. - The agent that produced this item. + - `Type FilePath` - - `AgentName string` + Always `file_path`. - The canonical name of the agent that produced this item. + - `const FilePathFilePath FilePath = "file_path"` - - `CallID string` + - `EndIndex int64` - The unique ID of the tool search call generated by the model. + - `FilePath FilePathDeltaAnnotationFilePath` - - `Execution BetaResponseToolSearchOutputItemParamExecution` + - `FileID string` - Whether tool search was executed by the server or by the client. + The ID of the file that was generated. - - `const BetaResponseToolSearchOutputItemParamExecutionServer BetaResponseToolSearchOutputItemParamExecution = "server"` + - `StartIndex int64` - - `const BetaResponseToolSearchOutputItemParamExecutionClient BetaResponseToolSearchOutputItemParamExecution = "client"` + - `Text string` - - `Status BetaResponseToolSearchOutputItemParamStatus` + The text in the message content that needs to be replaced. - The status of the tool search output. +### File Citation Annotation - - `const BetaResponseToolSearchOutputItemParamStatusInProgress BetaResponseToolSearchOutputItemParamStatus = "in_progress"` +- `type FileCitationAnnotation struct{…}` - - `const BetaResponseToolSearchOutputItemParamStatusCompleted BetaResponseToolSearchOutputItemParamStatus = "completed"` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `const BetaResponseToolSearchOutputItemParamStatusIncomplete BetaResponseToolSearchOutputItemParamStatus = "incomplete"` + - `EndIndex int64` - - `type BetaResponseInputItemAdditionalTools struct{…}` + - `FileCitation FileCitationAnnotationFileCitation` - - `Role Developer` + - `FileID string` - The role that provided the additional tools. Only `developer` is supported. + The ID of the specific File the citation is from. - - `const DeveloperDeveloper Developer = "developer"` + - `StartIndex int64` - - `Tools []BetaToolUnion` + - `Text string` - A list of additional tools made available at this item. + The text in the message content that needs to be replaced. - - `type BetaFunctionTool struct{…}` + - `Type FileCitation` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + Always `file_citation`. - - `type BetaFileSearchTool struct{…}` + - `const FileCitationFileCitation FileCitation = "file_citation"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). +### File Citation Delta Annotation - - `type BetaComputerTool struct{…}` +- `type FileCitationDeltaAnnotation struct{…}` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `type BetaComputerUsePreviewTool struct{…}` + - `Index int64` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The index of the annotation in the text content part. - - `type BetaWebSearchTool struct{…}` + - `Type FileCitation` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + Always `file_citation`. - - `type BetaToolMcp struct{…}` + - `const FileCitationFileCitation FileCitation = "file_citation"` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `EndIndex int64` - - `type BetaToolCodeInterpreter struct{…}` + - `FileCitation FileCitationDeltaAnnotationFileCitation` - A tool that runs Python code to help generate a response to a prompt. + - `FileID string` - - `type BetaToolProgrammaticToolCalling struct{…}` + The ID of the specific File the citation is from. - - `type BetaToolImageGeneration struct{…}` + - `Quote string` - A tool that generates images using the GPT image models. + The specific quote in the file. - - `type BetaToolLocalShell struct{…}` + - `StartIndex int64` - A tool that allows the model to execute shell commands in a local environment. + - `Text string` - - `type BetaFunctionShellTool struct{…}` + The text in the message content that needs to be replaced. - A tool that allows the model to execute shell commands. +### File Path Annotation - - `type BetaCustomTool struct{…}` +- `type FilePathAnnotation struct{…}` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `type BetaNamespaceTool struct{…}` + - `EndIndex int64` - Groups function/custom tools under a shared namespace. + - `FilePath FilePathAnnotationFilePath` - - `type BetaToolSearchTool struct{…}` + - `FileID string` - Hosted or BYOT tool search configuration for deferred tools. + The ID of the file that was generated. - - `type BetaWebSearchPreviewTool struct{…}` + - `StartIndex int64` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Text string` - - `type BetaApplyPatchTool struct{…}` + The text in the message content that needs to be replaced. - Allows the assistant to create, delete, or update files using unified diffs. + - `Type FilePath` - - `Type AdditionalTools` + Always `file_path`. - The item type. Always `additional_tools`. + - `const FilePathFilePath FilePath = "file_path"` - - `const AdditionalToolsAdditionalTools AdditionalTools = "additional_tools"` +### File Path Delta Annotation - - `ID string` +- `type FilePathDeltaAnnotation struct{…}` - The unique ID of this additional tools item. + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `Agent BetaResponseInputItemAdditionalToolsAgent` + - `Index int64` - The agent that produced this item. + The index of the annotation in the text content part. - - `AgentName string` + - `Type FilePath` - The canonical name of the agent that produced this item. + Always `file_path`. - - `type BetaResponseReasoningItem struct{…}` + - `const FilePathFilePath FilePath = "file_path"` - 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](https://platform.openai.com/docs/guides/conversation-state). + - `EndIndex int64` - - `ID string` + - `FilePath FilePathDeltaAnnotationFilePath` - The unique identifier of the reasoning content. + - `FileID string` - - `Summary []BetaResponseReasoningItemSummary` + The ID of the file that was generated. - Reasoning summary content. + - `StartIndex int64` - `Text string` - A summary of the reasoning output from the model so far. + The text in the message content that needs to be replaced. - - `Type SummaryText` +### Image File - The type of the object. Always `summary_text`. +- `type ImageFile struct{…}` - - `const SummaryTextSummaryText SummaryText = "summary_text"` + - `FileID string` - - `Type Reasoning` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The type of the object. Always `reasoning`. + - `Detail ImageFileDetail` - - `const ReasoningReasoning Reasoning = "reasoning"` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `Agent BetaResponseReasoningItemAgent` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - The agent that produced this item. + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `AgentName string` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - The canonical name of the agent that produced this item. +### Image File Content Block - - `Content []BetaResponseReasoningItemContent` +- `type ImageFileContentBlock struct{…}` - Reasoning text content. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `Text string` + - `ImageFile ImageFile` - The reasoning text from the model. + - `FileID string` - - `Type ReasoningText` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The type of the reasoning text. Always `reasoning_text`. + - `Detail ImageFileDetail` - - `const ReasoningTextReasoningText ReasoningText = "reasoning_text"` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `EncryptedContent string` + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `const ImageFileDetailLow ImageFileDetail = "low"` - - `Status BetaResponseReasoningItemStatus` + - `const ImageFileDetailHigh ImageFileDetail = "high"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `Type ImageFile` - - `const BetaResponseReasoningItemStatusInProgress BetaResponseReasoningItemStatus = "in_progress"` + Always `image_file`. - - `const BetaResponseReasoningItemStatusCompleted BetaResponseReasoningItemStatus = "completed"` + - `const ImageFileImageFile ImageFile = "image_file"` - - `const BetaResponseReasoningItemStatusIncomplete BetaResponseReasoningItemStatus = "incomplete"` +### Image File Delta - - `type BetaResponseCompactionItemParamResp struct{…}` +- `type ImageFileDelta struct{…}` - A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + - `Detail ImageFileDeltaDetail` - - `EncryptedContent string` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - The encrypted content of the compaction summary. + - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` - - `Type Compaction` + - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` - The type of the item. Always `compaction`. + - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` - - `const CompactionCompaction Compaction = "compaction"` + - `FileID string` - - `ID string` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The ID of the compaction item. +### Image File Delta Block - - `Agent BetaResponseCompactionItemParamAgentResp` +- `type ImageFileDeltaBlock struct{…}` - The agent that produced this item. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `AgentName string` + - `Index int64` - The canonical name of the agent that produced this item. + The index of the content part in the message. - - `type BetaResponseInputItemImageGenerationCall struct{…}` + - `Type ImageFile` - An image generation request made by the model. + Always `image_file`. - - `ID string` + - `const ImageFileImageFile ImageFile = "image_file"` - The unique ID of the image generation call. + - `ImageFile ImageFileDelta` - - `Result string` + - `Detail ImageFileDeltaDetail` - The generated image encoded in base64. + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `Status string` + - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` - The status of the image generation call. + - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` - - `const BetaResponseInputItemImageGenerationCallStatusInProgress BetaResponseInputItemImageGenerationCallStatus = "in_progress"` + - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` - - `const BetaResponseInputItemImageGenerationCallStatusCompleted BetaResponseInputItemImageGenerationCallStatus = "completed"` + - `FileID string` - - `const BetaResponseInputItemImageGenerationCallStatusGenerating BetaResponseInputItemImageGenerationCallStatus = "generating"` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `const BetaResponseInputItemImageGenerationCallStatusFailed BetaResponseInputItemImageGenerationCallStatus = "failed"` +### Image URL - - `Type ImageGenerationCall` +- `type ImageURL struct{…}` - The type of the image generation call. Always `image_generation_call`. + - `URL string` - - `const ImageGenerationCallImageGenerationCall ImageGenerationCall = "image_generation_call"` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `Agent BetaResponseInputItemImageGenerationCallAgent` + - `Detail ImageURLDetail` - The agent that produced this item. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `AgentName string` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - The canonical name of the agent that produced this item. + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `type BetaResponseCodeInterpreterToolCall struct{…}` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - A tool call to run code. +### Image URL Content Block - - `ID string` +- `type ImageURLContentBlock struct{…}` - The unique ID of the code interpreter tool call. + References an image URL in the content of a message. - - `Code string` + - `ImageURL ImageURL` - The code to run, or null if not available. + - `URL string` - - `ContainerID string` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - The ID of the container used to run the code. + - `Detail ImageURLDetail` - - `Outputs []BetaResponseCodeInterpreterToolCallOutputUnion` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - - `type BetaResponseCodeInterpreterToolCallOutputLogs struct{…}` + - `const ImageURLDetailLow ImageURLDetail = "low"` - The logs output from the code interpreter. + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `Logs string` + - `Type ImageURL` - The logs output from the code interpreter. + The type of the content part. - - `Type Logs` + - `const ImageURLImageURL ImageURL = "image_url"` - The type of the output. Always `logs`. +### Image URL Delta - - `const LogsLogs Logs = "logs"` +- `type ImageURLDelta struct{…}` - - `type BetaResponseCodeInterpreterToolCallOutputImage struct{…}` + - `Detail ImageURLDeltaDetail` - The image output from the code interpreter. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `Type Image` + - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` - The type of the output. Always `image`. + - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` - - `const ImageImage Image = "image"` + - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` - `URL string` - The URL of the image output from the code interpreter. + The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `Status BetaResponseCodeInterpreterToolCallStatus` +### Image URL Delta Block - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. +- `type ImageURLDeltaBlock struct{…}` - - `const BetaResponseCodeInterpreterToolCallStatusInProgress BetaResponseCodeInterpreterToolCallStatus = "in_progress"` + References an image URL in the content of a message. - - `const BetaResponseCodeInterpreterToolCallStatusCompleted BetaResponseCodeInterpreterToolCallStatus = "completed"` + - `Index int64` - - `const BetaResponseCodeInterpreterToolCallStatusIncomplete BetaResponseCodeInterpreterToolCallStatus = "incomplete"` + The index of the content part in the message. - - `const BetaResponseCodeInterpreterToolCallStatusInterpreting BetaResponseCodeInterpreterToolCallStatus = "interpreting"` + - `Type ImageURL` - - `const BetaResponseCodeInterpreterToolCallStatusFailed BetaResponseCodeInterpreterToolCallStatus = "failed"` + Always `image_url`. - - `Type CodeInterpreterCall` + - `const ImageURLImageURL ImageURL = "image_url"` - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `ImageURL ImageURLDelta` - - `const CodeInterpreterCallCodeInterpreterCall CodeInterpreterCall = "code_interpreter_call"` + - `Detail ImageURLDeltaDetail` - - `Agent BetaResponseCodeInterpreterToolCallAgent` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - The agent that produced this item. + - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` - - `AgentName string` + - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` - The canonical name of the agent that produced this item. + - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` - - `type BetaResponseInputItemLocalShellCall struct{…}` + - `URL string` - A tool call to run a command on the local shell. + The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `ID string` +### Message - The unique ID of the local shell call. +- `type Message struct{…}` - - `Action BetaResponseInputItemLocalShellCallAction` + Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - Execute a shell command on the server. + - `ID string` - - `Command []string` + The identifier, which can be referenced in API endpoints. - The command to run. + - `AssistantID string` - - `Env map[string, string]` + If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - Environment variables to set for the command. + - `Attachments []MessageAttachment` - - `Type Exec` + A list of files attached to the message, and the tools they were added to. - The type of the local shell action. Always `exec`. + - `FileID string` - - `const ExecExec Exec = "exec"` + The ID of the file to attach to the message. - - `TimeoutMs int64` + - `Tools []MessageAttachmentToolUnion` - Optional timeout in milliseconds for the command. + The tools to add this file to. - - `User string` + - `type CodeInterpreterTool struct{…}` - Optional user to run the command as. + - `Type CodeInterpreter` - - `WorkingDirectory string` + The type of tool being defined: `code_interpreter` - Optional working directory to run the command in. + - `const CodeInterpreterCodeInterpreter CodeInterpreter = "code_interpreter"` - - `CallID string` + - `type MessageAttachmentToolAssistantToolsFileSearchTypeOnly struct{…}` - The unique ID of the local shell tool call generated by the model. + - `Type FileSearch` - - `Status string` + The type of tool being defined: `file_search` - The status of the local shell call. + - `const FileSearchFileSearch FileSearch = "file_search"` - - `const BetaResponseInputItemLocalShellCallStatusInProgress BetaResponseInputItemLocalShellCallStatus = "in_progress"` + - `CompletedAt int64` - - `const BetaResponseInputItemLocalShellCallStatusCompleted BetaResponseInputItemLocalShellCallStatus = "completed"` + The Unix timestamp (in seconds) for when the message was completed. - - `const BetaResponseInputItemLocalShellCallStatusIncomplete BetaResponseInputItemLocalShellCallStatus = "incomplete"` + - `Content []MessageContentUnion` - - `Type LocalShellCall` + The content of the message in array of text and/or images. - The type of the local shell call. Always `local_shell_call`. + - `type ImageFileContentBlock struct{…}` - - `const LocalShellCallLocalShellCall LocalShellCall = "local_shell_call"` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `Agent BetaResponseInputItemLocalShellCallAgent` + - `ImageFile ImageFile` - The agent that produced this item. + - `FileID string` - - `AgentName string` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The canonical name of the agent that produced this item. + - `Detail ImageFileDetail` - - `type BetaResponseInputItemLocalShellCallOutput struct{…}` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - The output of a local shell tool call. + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - - `ID string` + - `const ImageFileDetailLow ImageFileDetail = "low"` - The unique ID of the local shell tool call generated by the model. + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `Output string` + - `Type ImageFile` - A JSON string of the output of the local shell tool call. + Always `image_file`. - - `Type LocalShellCallOutput` + - `const ImageFileImageFile ImageFile = "image_file"` - The type of the local shell tool call output. Always `local_shell_call_output`. + - `type ImageURLContentBlock struct{…}` - - `const LocalShellCallOutputLocalShellCallOutput LocalShellCallOutput = "local_shell_call_output"` + References an image URL in the content of a message. - - `Agent BetaResponseInputItemLocalShellCallOutputAgent` + - `ImageURL ImageURL` - The agent that produced this item. + - `URL string` - - `AgentName string` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - The canonical name of the agent that produced this item. + - `Detail ImageURLDetail` - - `Status string` + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - - `const BetaResponseInputItemLocalShellCallOutputStatusInProgress BetaResponseInputItemLocalShellCallOutputStatus = "in_progress"` + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `const BetaResponseInputItemLocalShellCallOutputStatusCompleted BetaResponseInputItemLocalShellCallOutputStatus = "completed"` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - - `const BetaResponseInputItemLocalShellCallOutputStatusIncomplete BetaResponseInputItemLocalShellCallOutputStatus = "incomplete"` + - `Type ImageURL` - - `type BetaResponseInputItemShellCall struct{…}` + The type of the content part. - A tool representing a request to execute one or more shell commands. + - `const ImageURLImageURL ImageURL = "image_url"` - - `Action BetaResponseInputItemShellCallAction` + - `type TextContentBlock struct{…}` - The shell commands and limits that describe how to run the tool call. + The text content that is part of a message. - - `Commands []string` + - `Text Text` - Ordered shell commands for the execution environment to run. + - `Annotations []AnnotationUnion` - - `MaxOutputLength int64` + - `type FileCitationAnnotation struct{…}` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `TimeoutMs int64` + - `EndIndex int64` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + - `FileCitation FileCitationAnnotationFileCitation` - - `CallID string` + - `FileID string` - The unique ID of the shell tool call generated by the model. + The ID of the specific File the citation is from. - - `Type ShellCall` + - `StartIndex int64` - The type of the item. Always `shell_call`. + - `Text string` - - `const ShellCallShellCall ShellCall = "shell_call"` + The text in the message content that needs to be replaced. - - `ID string` + - `Type FileCitation` - The unique ID of the shell tool call. Populated when this item is returned via API. + Always `file_citation`. - - `Agent BetaResponseInputItemShellCallAgent` + - `const FileCitationFileCitation FileCitation = "file_citation"` - The agent that produced this item. + - `type FilePathAnnotation struct{…}` - - `AgentName string` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - The canonical name of the agent that produced this item. + - `EndIndex int64` - - `Caller BetaResponseInputItemShellCallCallerUnion` + - `FilePath FilePathAnnotationFilePath` - The execution context that produced this tool call. + - `FileID string` - - `type BetaResponseInputItemShellCallCallerDirect struct{…}` + The ID of the file that was generated. - - `Type Direct` + - `StartIndex int64` - The caller type. Always `direct`. + - `Text string` - - `const DirectDirect Direct = "direct"` + The text in the message content that needs to be replaced. - - `type BetaResponseInputItemShellCallCallerProgram struct{…}` + - `Type FilePath` - - `CallerID string` + Always `file_path`. - The call ID of the program item that produced this tool call. + - `const FilePathFilePath FilePath = "file_path"` - - `Type Program` + - `Value string` - The caller type. Always `program`. + The data that makes up the text. - - `const ProgramProgram Program = "program"` + - `Type Text` - - `Environment BetaResponseInputItemShellCallEnvironmentUnion` + Always `text`. - The environment to execute the shell commands in. + - `const TextText Text = "text"` - - `type BetaLocalEnvironment struct{…}` + - `type RefusalContentBlock struct{…}` - - `type BetaContainerReference struct{…}` + The refusal content generated by the assistant. - - `Status string` + - `Refusal string` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `Type Refusal` - - `const BetaResponseInputItemShellCallStatusInProgress BetaResponseInputItemShellCallStatus = "in_progress"` + Always `refusal`. - - `const BetaResponseInputItemShellCallStatusCompleted BetaResponseInputItemShellCallStatus = "completed"` + - `const RefusalRefusal Refusal = "refusal"` - - `const BetaResponseInputItemShellCallStatusIncomplete BetaResponseInputItemShellCallStatus = "incomplete"` + - `CreatedAt int64` - - `type BetaResponseInputItemShellCallOutput struct{…}` + The Unix timestamp (in seconds) for when the message was created. - The streamed output items emitted by a shell tool call. + - `IncompleteAt int64` - - `CallID string` + The Unix timestamp (in seconds) for when the message was marked as incomplete. - The unique ID of the shell tool call generated by the model. + - `IncompleteDetails MessageIncompleteDetails` - - `Output []BetaResponseFunctionShellCallOutputContent` + On an incomplete message, details about why the message is incomplete. - Captured chunks of stdout and stderr output, along with their associated outcomes. + - `Reason string` - - `Outcome BetaResponseFunctionShellCallOutputContentOutcomeUnion` + The reason the message is incomplete. - The exit or timeout outcome associated with this shell call. + - `const MessageIncompleteDetailsReasonContentFilter MessageIncompleteDetailsReason = "content_filter"` - - `type BetaResponseFunctionShellCallOutputContentOutcomeTimeout struct{…}` + - `const MessageIncompleteDetailsReasonMaxTokens MessageIncompleteDetailsReason = "max_tokens"` - Indicates that the shell call exceeded its configured time limit. + - `const MessageIncompleteDetailsReasonRunCancelled MessageIncompleteDetailsReason = "run_cancelled"` - - `Type Timeout` + - `const MessageIncompleteDetailsReasonRunExpired MessageIncompleteDetailsReason = "run_expired"` - The outcome type. Always `timeout`. + - `const MessageIncompleteDetailsReasonRunFailed MessageIncompleteDetailsReason = "run_failed"` - - `const TimeoutTimeout Timeout = "timeout"` + - `Metadata Metadata` - - `type BetaResponseFunctionShellCallOutputContentOutcomeExit struct{…}` + 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. - Indicates that the shell commands finished and returned an exit code. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `ExitCode int64` + - `Object ThreadMessage` - The exit code returned by the shell process. + The object type, which is always `thread.message`. - - `Type Exit` + - `const ThreadMessageThreadMessage ThreadMessage = "thread.message"` - The outcome type. Always `exit`. + - `Role MessageRole` - - `const ExitExit Exit = "exit"` + The entity that produced the message. One of `user` or `assistant`. - - `Stderr string` + - `const MessageRoleUser MessageRole = "user"` - Captured stderr output for the shell call. + - `const MessageRoleAssistant MessageRole = "assistant"` - - `Stdout string` + - `RunID string` - Captured stdout output for the shell call. + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. - - `Type ShellCallOutput` + - `Status MessageStatus` - The type of the item. Always `shell_call_output`. + The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - - `const ShellCallOutputShellCallOutput ShellCallOutput = "shell_call_output"` + - `const MessageStatusInProgress MessageStatus = "in_progress"` - - `ID string` + - `const MessageStatusIncomplete MessageStatus = "incomplete"` - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `const MessageStatusCompleted MessageStatus = "completed"` - - `Agent BetaResponseInputItemShellCallOutputAgent` + - `ThreadID string` - The agent that produced this item. + The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - - `AgentName string` +### Message Content - The canonical name of the agent that produced this item. +- `type MessageContentUnion interface{…}` - - `Caller BetaResponseInputItemShellCallOutputCallerUnion` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - The execution context that produced this tool call. + - `type ImageFileContentBlock struct{…}` - - `type BetaResponseInputItemShellCallOutputCallerDirect struct{…}` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `Type Direct` + - `ImageFile ImageFile` - The caller type. Always `direct`. + - `FileID string` - - `const DirectDirect Direct = "direct"` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `type BetaResponseInputItemShellCallOutputCallerProgram struct{…}` + - `Detail ImageFileDetail` - - `CallerID string` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - The call ID of the program item that produced this tool call. + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - - `Type Program` + - `const ImageFileDetailLow ImageFileDetail = "low"` - The caller type. Always `program`. + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `const ProgramProgram Program = "program"` + - `Type ImageFile` - - `MaxOutputLength int64` + Always `image_file`. - The maximum number of UTF-8 characters captured for this shell call's combined output. + - `const ImageFileImageFile ImageFile = "image_file"` - - `Status string` + - `type ImageURLContentBlock struct{…}` - The status of the shell call output. + References an image URL in the content of a message. - - `const BetaResponseInputItemShellCallOutputStatusInProgress BetaResponseInputItemShellCallOutputStatus = "in_progress"` + - `ImageURL ImageURL` - - `const BetaResponseInputItemShellCallOutputStatusCompleted BetaResponseInputItemShellCallOutputStatus = "completed"` + - `URL string` - - `const BetaResponseInputItemShellCallOutputStatusIncomplete BetaResponseInputItemShellCallOutputStatus = "incomplete"` + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `type BetaResponseInputItemApplyPatchCall struct{…}` + - `Detail ImageURLDetail` - A tool call representing a request to create, delete, or update files using diff patches. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `CallID string` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - The unique ID of the apply patch tool call generated by the model. + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `Operation BetaResponseInputItemApplyPatchCallOperationUnion` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - The specific create, delete, or update instruction for the apply_patch tool call. + - `Type ImageURL` - - `type BetaResponseInputItemApplyPatchCallOperationCreateFile struct{…}` + The type of the content part. - Instruction for creating a new file via the apply_patch tool. + - `const ImageURLImageURL ImageURL = "image_url"` - - `Diff string` + - `type TextContentBlock struct{…}` - Unified diff content to apply when creating the file. + The text content that is part of a message. - - `Path string` + - `Text Text` - Path of the file to create relative to the workspace root. + - `Annotations []AnnotationUnion` - - `Type CreateFile` + - `type FileCitationAnnotation struct{…}` - The operation type. Always `create_file`. + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `const CreateFileCreateFile CreateFile = "create_file"` + - `EndIndex int64` - - `type BetaResponseInputItemApplyPatchCallOperationDeleteFile struct{…}` + - `FileCitation FileCitationAnnotationFileCitation` - Instruction for deleting an existing file via the apply_patch tool. + - `FileID string` - - `Path string` + The ID of the specific File the citation is from. - Path of the file to delete relative to the workspace root. + - `StartIndex int64` - - `Type DeleteFile` + - `Text string` - The operation type. Always `delete_file`. + The text in the message content that needs to be replaced. - - `const DeleteFileDeleteFile DeleteFile = "delete_file"` + - `Type FileCitation` - - `type BetaResponseInputItemApplyPatchCallOperationUpdateFile struct{…}` + Always `file_citation`. - Instruction for updating an existing file via the apply_patch tool. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `Diff string` + - `type FilePathAnnotation struct{…}` - Unified diff content to apply to the existing file. + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `Path string` + - `EndIndex int64` - Path of the file to update relative to the workspace root. + - `FilePath FilePathAnnotationFilePath` - - `Type UpdateFile` + - `FileID string` - The operation type. Always `update_file`. + The ID of the file that was generated. - - `const UpdateFileUpdateFile UpdateFile = "update_file"` + - `StartIndex int64` - - `Status string` + - `Text string` - The status of the apply patch tool call. One of `in_progress` or `completed`. + The text in the message content that needs to be replaced. - - `const BetaResponseInputItemApplyPatchCallStatusInProgress BetaResponseInputItemApplyPatchCallStatus = "in_progress"` + - `Type FilePath` - - `const BetaResponseInputItemApplyPatchCallStatusCompleted BetaResponseInputItemApplyPatchCallStatus = "completed"` + Always `file_path`. - - `Type ApplyPatchCall` + - `const FilePathFilePath FilePath = "file_path"` - The type of the item. Always `apply_patch_call`. + - `Value string` - - `const ApplyPatchCallApplyPatchCall ApplyPatchCall = "apply_patch_call"` + The data that makes up the text. - - `ID string` + - `Type Text` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + Always `text`. - - `Agent BetaResponseInputItemApplyPatchCallAgent` + - `const TextText Text = "text"` - The agent that produced this item. + - `type RefusalContentBlock struct{…}` - - `AgentName string` + The refusal content generated by the assistant. - The canonical name of the agent that produced this item. + - `Refusal string` - - `Caller BetaResponseInputItemApplyPatchCallCallerUnion` + - `Type Refusal` - The execution context that produced this tool call. + Always `refusal`. - - `type BetaResponseInputItemApplyPatchCallCallerDirect struct{…}` + - `const RefusalRefusal Refusal = "refusal"` - - `Type Direct` +### Message Content Delta - The caller type. Always `direct`. +- `type MessageContentDeltaUnion interface{…}` - - `const DirectDirect Direct = "direct"` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `type BetaResponseInputItemApplyPatchCallCallerProgram struct{…}` + - `type ImageFileDeltaBlock struct{…}` - - `CallerID string` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - The call ID of the program item that produced this tool call. + - `Index int64` - - `Type Program` + The index of the content part in the message. - The caller type. Always `program`. + - `Type ImageFile` - - `const ProgramProgram Program = "program"` + Always `image_file`. - - `type BetaResponseInputItemApplyPatchCallOutput struct{…}` + - `const ImageFileImageFile ImageFile = "image_file"` - The streamed output emitted by an apply patch tool call. + - `ImageFile ImageFileDelta` - - `CallID string` + - `Detail ImageFileDeltaDetail` - The unique ID of the apply patch tool call generated by the model. + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `Status string` + - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusCompleted BetaResponseInputItemApplyPatchCallOutputStatus = "completed"` + - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` - - `const BetaResponseInputItemApplyPatchCallOutputStatusFailed BetaResponseInputItemApplyPatchCallOutputStatus = "failed"` + - `FileID string` - - `Type ApplyPatchCallOutput` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The type of the item. Always `apply_patch_call_output`. + - `type TextDeltaBlock struct{…}` - - `const ApplyPatchCallOutputApplyPatchCallOutput ApplyPatchCallOutput = "apply_patch_call_output"` + The text content that is part of a message. - - `ID string` + - `Index int64` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The index of the content part in the message. - - `Agent BetaResponseInputItemApplyPatchCallOutputAgent` + - `Type Text` - The agent that produced this item. + Always `text`. - - `AgentName string` + - `const TextText Text = "text"` - The canonical name of the agent that produced this item. + - `Text TextDelta` - - `Caller BetaResponseInputItemApplyPatchCallOutputCallerUnion` + - `Annotations []AnnotationDeltaUnion` - The execution context that produced this tool call. + - `type FileCitationDeltaAnnotation struct{…}` - - `type BetaResponseInputItemApplyPatchCallOutputCallerDirect struct{…}` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `Type Direct` + - `Index int64` - The caller type. Always `direct`. + The index of the annotation in the text content part. - - `const DirectDirect Direct = "direct"` + - `Type FileCitation` - - `type BetaResponseInputItemApplyPatchCallOutputCallerProgram struct{…}` + Always `file_citation`. - - `CallerID string` + - `const FileCitationFileCitation FileCitation = "file_citation"` - The call ID of the program item that produced this tool call. + - `EndIndex int64` - - `Type Program` + - `FileCitation FileCitationDeltaAnnotationFileCitation` - The caller type. Always `program`. + - `FileID string` - - `const ProgramProgram Program = "program"` + The ID of the specific File the citation is from. - - `Output string` + - `Quote string` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + The specific quote in the file. - - `type BetaResponseInputItemMcpListTools struct{…}` + - `StartIndex int64` - A list of tools available on an MCP server. + - `Text string` - - `ID string` + The text in the message content that needs to be replaced. - The unique ID of the list. + - `type FilePathDeltaAnnotation struct{…}` - - `ServerLabel string` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - The label of the MCP server. + - `Index int64` - - `Tools []BetaResponseInputItemMcpListToolsTool` + The index of the annotation in the text content part. - The tools available on the server. + - `Type FilePath` - - `InputSchema any` + Always `file_path`. - The JSON schema describing the tool's input. + - `const FilePathFilePath FilePath = "file_path"` - - `Name string` + - `EndIndex int64` - The name of the tool. + - `FilePath FilePathDeltaAnnotationFilePath` - - `Annotations any` + - `FileID string` - Additional annotations about the tool. + The ID of the file that was generated. - - `Description string` + - `StartIndex int64` - The description of the tool. + - `Text string` - - `Type McpListTools` + The text in the message content that needs to be replaced. - The type of the item. Always `mcp_list_tools`. + - `Value string` - - `const McpListToolsMcpListTools McpListTools = "mcp_list_tools"` + The data that makes up the text. - - `Agent BetaResponseInputItemMcpListToolsAgent` + - `type RefusalDeltaBlock struct{…}` - The agent that produced this item. + The refusal content that is part of a message. - - `AgentName string` + - `Index int64` - The canonical name of the agent that produced this item. + The index of the refusal part in the message. - - `Error string` + - `Type Refusal` - Error message if the server could not list tools. + Always `refusal`. - - `type BetaResponseInputItemMcpApprovalRequest struct{…}` + - `const RefusalRefusal Refusal = "refusal"` - A request for human approval of a tool invocation. + - `Refusal string` - - `ID string` + - `type ImageURLDeltaBlock struct{…}` - The unique ID of the approval request. + References an image URL in the content of a message. - - `Arguments string` + - `Index int64` - A JSON string of arguments for the tool. + The index of the content part in the message. - - `Name string` + - `Type ImageURL` - The name of the tool to run. + Always `image_url`. - - `ServerLabel string` + - `const ImageURLImageURL ImageURL = "image_url"` - The label of the MCP server making the request. + - `ImageURL ImageURLDelta` - - `Type McpApprovalRequest` + - `Detail ImageURLDeltaDetail` - The type of the item. Always `mcp_approval_request`. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `const McpApprovalRequestMcpApprovalRequest McpApprovalRequest = "mcp_approval_request"` + - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` - - `Agent BetaResponseInputItemMcpApprovalRequestAgent` + - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` - The agent that produced this item. + - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` - - `AgentName string` + - `URL string` - The canonical name of the agent that produced this item. + The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `type BetaResponseInputItemMcpApprovalResponse struct{…}` +### Message Content Part Param - A response to an MCP approval request. +- `type MessageContentPartParamUnionResp interface{…}` - - `ApprovalRequestID string` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - The ID of the approval request being answered. + - `type ImageFileContentBlock struct{…}` - - `Approve bool` + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - Whether the request was approved. + - `ImageFile ImageFile` - - `Type McpApprovalResponse` + - `FileID string` - The type of the item. Always `mcp_approval_response`. + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `const McpApprovalResponseMcpApprovalResponse McpApprovalResponse = "mcp_approval_response"` + - `Detail ImageFileDetail` - - `ID string` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - The unique ID of the approval response + - `const ImageFileDetailAuto ImageFileDetail = "auto"` - - `Agent BetaResponseInputItemMcpApprovalResponseAgent` + - `const ImageFileDetailLow ImageFileDetail = "low"` - The agent that produced this item. + - `const ImageFileDetailHigh ImageFileDetail = "high"` - - `AgentName string` + - `Type ImageFile` - The canonical name of the agent that produced this item. + Always `image_file`. - - `Reason string` + - `const ImageFileImageFile ImageFile = "image_file"` - Optional reason for the decision. + - `type ImageURLContentBlock struct{…}` - - `type BetaResponseInputItemMcpCall struct{…}` + References an image URL in the content of a message. - An invocation of a tool on an MCP server. + - `ImageURL ImageURL` - - `ID string` + - `URL string` - The unique ID of the tool call. + The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - `Arguments string` + - `Detail ImageURLDetail` - A JSON string of the arguments passed to the tool. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - - `Name string` + - `const ImageURLDetailAuto ImageURLDetail = "auto"` - The name of the tool that was run. + - `const ImageURLDetailLow ImageURLDetail = "low"` - - `ServerLabel string` + - `const ImageURLDetailHigh ImageURLDetail = "high"` - The label of the MCP server running the tool. + - `Type ImageURL` - - `Type McpCall` + The type of the content part. - The type of the item. Always `mcp_call`. + - `const ImageURLImageURL ImageURL = "image_url"` - - `const McpCallMcpCall McpCall = "mcp_call"` + - `type TextContentBlockParam struct{…}` - - `Agent BetaResponseInputItemMcpCallAgent` + The text content that is part of a message. - The agent that produced this item. + - `Text string` - - `AgentName string` + Text content to be sent to the model - The canonical name of the agent that produced this item. + - `Type Text` - - `ApprovalRequestID string` + Always `text`. - 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. + - `const TextText Text = "text"` - - `Error string` +### Message Deleted - The error from the tool call, if any. +- `type MessageDeleted struct{…}` - - `Output string` + - `ID string` - The output from the tool call. + - `Deleted bool` - - `Status string` + - `Object ThreadMessageDeleted` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `const ThreadMessageDeletedThreadMessageDeleted ThreadMessageDeleted = "thread.message.deleted"` - - `const BetaResponseInputItemMcpCallStatusInProgress BetaResponseInputItemMcpCallStatus = "in_progress"` +### Message Delta - - `const BetaResponseInputItemMcpCallStatusCompleted BetaResponseInputItemMcpCallStatus = "completed"` +- `type MessageDelta struct{…}` - - `const BetaResponseInputItemMcpCallStatusIncomplete BetaResponseInputItemMcpCallStatus = "incomplete"` + The delta containing the fields that have changed on the Message. - - `const BetaResponseInputItemMcpCallStatusCalling BetaResponseInputItemMcpCallStatus = "calling"` + - `Content []MessageContentDeltaUnion` - - `const BetaResponseInputItemMcpCallStatusFailed BetaResponseInputItemMcpCallStatus = "failed"` + The content of the message in array of text and/or images. - - `type BetaResponseCustomToolCallOutput struct{…}` + - `type ImageFileDeltaBlock struct{…}` - The output of a custom tool call from your code, being sent back to the model. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `CallID string` + - `Index int64` - The call ID, used to map this custom tool call output to a custom tool call. + The index of the content part in the message. - - `Output BetaResponseCustomToolCallOutputOutputUnion` + - `Type ImageFile` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + Always `image_file`. - - `string` + - `const ImageFileImageFile ImageFile = "image_file"` - - `type BetaResponseCustomToolCallOutputOutputOutputContentList []BetaResponseCustomToolCallOutputOutputOutputContentListItemUnion` + - `ImageFile ImageFileDelta` - Text, image, or file output of the custom tool call. + - `Detail ImageFileDeltaDetail` - - `type BetaResponseInputText struct{…}` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - A text input to the model. + - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` - - `type BetaResponseInputImage struct{…}` + - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` - An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` - - `type BetaResponseInputFile struct{…}` + - `FileID string` - A file input to the model. + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - - `Type CustomToolCallOutput` + - `type TextDeltaBlock struct{…}` - The type of the custom tool call output. Always `custom_tool_call_output`. + The text content that is part of a message. - - `const CustomToolCallOutputCustomToolCallOutput CustomToolCallOutput = "custom_tool_call_output"` + - `Index int64` - - `ID string` + The index of the content part in the message. - The unique ID of the custom tool call output in the OpenAI platform. + - `Type Text` - - `Agent BetaResponseCustomToolCallOutputAgent` + Always `text`. - The agent that produced this item. + - `const TextText Text = "text"` - - `AgentName string` + - `Text TextDelta` - The canonical name of the agent that produced this item. + - `Annotations []AnnotationDeltaUnion` - - `Caller BetaResponseCustomToolCallOutputCallerUnion` + - `type FileCitationDeltaAnnotation struct{…}` - The execution context that produced this tool call. + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `type BetaResponseCustomToolCallOutputCallerDirect struct{…}` + - `Index int64` - - `Type Direct` + The index of the annotation in the text content part. - The caller type. Always `direct`. + - `Type FileCitation` - - `const DirectDirect Direct = "direct"` + Always `file_citation`. - - `type BetaResponseCustomToolCallOutputCallerProgram struct{…}` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `CallerID string` + - `EndIndex int64` - The call ID of the program item that produced this tool call. + - `FileCitation FileCitationDeltaAnnotationFileCitation` - - `Type Program` + - `FileID string` - The caller type. Always `program`. + The ID of the specific File the citation is from. - - `const ProgramProgram Program = "program"` + - `Quote string` - - `type BetaResponseCustomToolCall struct{…}` + The specific quote in the file. - A call to a custom tool created by the model. + - `StartIndex int64` - - `CallID string` + - `Text string` - An identifier used to map this custom tool call to a tool call output. + The text in the message content that needs to be replaced. - - `Input string` + - `type FilePathDeltaAnnotation struct{…}` - The input for the custom tool call generated by the model. + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `Name string` + - `Index int64` - The name of the custom tool being called. + The index of the annotation in the text content part. - - `Type CustomToolCall` + - `Type FilePath` - The type of the custom tool call. Always `custom_tool_call`. + Always `file_path`. - - `const CustomToolCallCustomToolCall CustomToolCall = "custom_tool_call"` + - `const FilePathFilePath FilePath = "file_path"` - - `ID string` + - `EndIndex int64` - The unique ID of the custom tool call in the OpenAI platform. + - `FilePath FilePathDeltaAnnotationFilePath` - - `Agent BetaResponseCustomToolCallAgent` + - `FileID string` - The agent that produced this item. + The ID of the file that was generated. - - `AgentName string` + - `StartIndex int64` - The canonical name of the agent that produced this item. + - `Text string` - - `Caller BetaResponseCustomToolCallCallerUnion` + The text in the message content that needs to be replaced. - The execution context that produced this tool call. + - `Value string` - - `type BetaResponseCustomToolCallCallerDirect struct{…}` + The data that makes up the text. - - `Type Direct` + - `type RefusalDeltaBlock struct{…}` - - `const DirectDirect Direct = "direct"` + The refusal content that is part of a message. - - `type BetaResponseCustomToolCallCallerProgram struct{…}` + - `Index int64` - - `CallerID string` + The index of the refusal part in the message. - The call ID of the program item that produced this tool call. + - `Type Refusal` - - `Type Program` + Always `refusal`. - - `const ProgramProgram Program = "program"` + - `const RefusalRefusal Refusal = "refusal"` - - `Namespace string` + - `Refusal string` - The namespace of the custom tool being called. + - `type ImageURLDeltaBlock struct{…}` - - `type BetaResponseInputItemCompactionTrigger struct{…}` + References an image URL in the content of a message. - Compacts the current context. Must be the final input item. + - `Index int64` - - `Type CompactionTrigger` + The index of the content part in the message. - The type of the item. Always `compaction_trigger`. + - `Type ImageURL` - - `const CompactionTriggerCompactionTrigger CompactionTrigger = "compaction_trigger"` + Always `image_url`. - - `Agent BetaResponseInputItemCompactionTriggerAgent` + - `const ImageURLImageURL ImageURL = "image_url"` - The agent that produced this item. + - `ImageURL ImageURLDelta` - - `AgentName string` + - `Detail ImageURLDeltaDetail` - The canonical name of the agent that produced this item. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `type BetaResponseInputItemItemReference struct{…}` + - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` - An internal identifier for an item to reference. + - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` - - `ID string` + - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` - The ID of the item to reference. + - `URL string` - - `Agent BetaResponseInputItemItemReferenceAgent` + The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - The agent that produced this item. + - `Role MessageDeltaRole` - - `AgentName string` + The entity that produced the message. One of `user` or `assistant`. - The canonical name of the agent that produced this item. + - `const MessageDeltaRoleUser MessageDeltaRole = "user"` - - `Type string` + - `const MessageDeltaRoleAssistant MessageDeltaRole = "assistant"` - The type of item to reference. Always `item_reference`. +### Message Delta Event - - `const BetaResponseInputItemItemReferenceTypeItemReference BetaResponseInputItemItemReferenceType = "item_reference"` +- `type MessageDeltaEvent struct{…}` - - `type BetaResponseInputItemProgram struct{…}` + Represents a message delta i.e. any changed fields on a message during streaming. - `ID string` - The unique ID of this program item. + The identifier of the message, which can be referenced in API endpoints. - - `CallID string` + - `Delta MessageDelta` - The stable call ID of the program item. + The delta containing the fields that have changed on the Message. - - `Code string` + - `Content []MessageContentDeltaUnion` - The JavaScript source executed by programmatic tool calling. + The content of the message in array of text and/or images. - - `Fingerprint string` + - `type ImageFileDeltaBlock struct{…}` - Opaque program replay fingerprint that must be round-tripped. + References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - - `Type Program` + - `Index int64` - The item type. Always `program`. + The index of the content part in the message. - - `const ProgramProgram Program = "program"` + - `Type ImageFile` - - `Agent BetaResponseInputItemProgramAgent` + Always `image_file`. - The agent that produced this item. + - `const ImageFileImageFile ImageFile = "image_file"` - - `AgentName string` + - `ImageFile ImageFileDelta` - The canonical name of the agent that produced this item. + - `Detail ImageFileDeltaDetail` - - `type BetaResponseInputItemProgramOutput struct{…}` + Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `ID string` + - `const ImageFileDeltaDetailAuto ImageFileDeltaDetail = "auto"` - The unique ID of this program output item. + - `const ImageFileDeltaDetailLow ImageFileDeltaDetail = "low"` - - `CallID string` + - `const ImageFileDeltaDetailHigh ImageFileDeltaDetail = "high"` - The call ID of the program item. + - `FileID string` - - `Result string` + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - The result produced by the program item. + - `type TextDeltaBlock struct{…}` - - `Status string` + The text content that is part of a message. - The terminal status of the program output. + - `Index int64` - - `const BetaResponseInputItemProgramOutputStatusCompleted BetaResponseInputItemProgramOutputStatus = "completed"` + The index of the content part in the message. - - `const BetaResponseInputItemProgramOutputStatusIncomplete BetaResponseInputItemProgramOutputStatus = "incomplete"` + - `Type Text` - - `Type ProgramOutput` + Always `text`. - The item type. Always `program_output`. + - `const TextText Text = "text"` - - `const ProgramOutputProgramOutput ProgramOutput = "program_output"` + - `Text TextDelta` - - `Agent BetaResponseInputItemProgramOutputAgent` + - `Annotations []AnnotationDeltaUnion` - The agent that produced this item. + - `type FileCitationDeltaAnnotation struct{…}` - - `AgentName string` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - The canonical name of the agent that produced this item. + - `Index int64` - - `Instructions param.Field[string]` + The index of the annotation in the text content part. - Body param: A system (or developer) message inserted into the model's context. - When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. + - `Type FileCitation` - - `Model param.Field[string]` + Always `file_citation`. - Body param: Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and compare available models. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `ParallelToolCalls param.Field[bool]` + - `EndIndex int64` - Body param: Whether to allow the model to run tool calls in parallel. + - `FileCitation FileCitationDeltaAnnotationFileCitation` - - `Personality param.Field[InputTokenCountParamsPersonality]` + - `FileID string` - Body param: A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters. + The ID of the specific File the citation is from. - - `string` + - `Quote string` - - `type InputTokenCountParamsPersonality string` + The specific quote in the file. - A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters. + - `StartIndex int64` - - `const InputTokenCountParamsPersonalityFriendly InputTokenCountParamsPersonality = "friendly"` + - `Text string` - - `const InputTokenCountParamsPersonalityPragmatic InputTokenCountParamsPersonality = "pragmatic"` + The text in the message content that needs to be replaced. - - `PreviousResponseID param.Field[string]` + - `type FilePathDeltaAnnotation struct{…}` - Body param: The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `Reasoning param.Field[InputTokenCountParamsReasoning]` + - `Index int64` - Body param: **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning). + The index of the annotation in the text content part. - - `Context string` + - `Type FilePath` - Controls which reasoning items are rendered back to the model on later turns. - When returned on a response, this is the effective reasoning context mode - used for the response. + Always `file_path`. - - `const InputTokenCountParamsReasoningContextAuto InputTokenCountParamsReasoningContext = "auto"` + - `const FilePathFilePath FilePath = "file_path"` - - `const InputTokenCountParamsReasoningContextCurrentTurn InputTokenCountParamsReasoningContext = "current_turn"` + - `EndIndex int64` - - `const InputTokenCountParamsReasoningContextAllTurns InputTokenCountParamsReasoningContext = "all_turns"` + - `FilePath FilePathDeltaAnnotationFilePath` - - `Effort string` + - `FileID string` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + The ID of the file that was generated. - - `const InputTokenCountParamsReasoningEffortNone InputTokenCountParamsReasoningEffort = "none"` + - `StartIndex int64` - - `const InputTokenCountParamsReasoningEffortMinimal InputTokenCountParamsReasoningEffort = "minimal"` + - `Text string` - - `const InputTokenCountParamsReasoningEffortLow InputTokenCountParamsReasoningEffort = "low"` + The text in the message content that needs to be replaced. - - `const InputTokenCountParamsReasoningEffortMedium InputTokenCountParamsReasoningEffort = "medium"` + - `Value string` - - `const InputTokenCountParamsReasoningEffortHigh InputTokenCountParamsReasoningEffort = "high"` + The data that makes up the text. - - `const InputTokenCountParamsReasoningEffortXhigh InputTokenCountParamsReasoningEffort = "xhigh"` + - `type RefusalDeltaBlock struct{…}` - - `const InputTokenCountParamsReasoningEffortMax InputTokenCountParamsReasoningEffort = "max"` + The refusal content that is part of a message. - - `GenerateSummary string` + - `Index int64` - **Deprecated:** use `summary` instead. + The index of the refusal part in the message. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `Type Refusal` - - `const InputTokenCountParamsReasoningGenerateSummaryAuto InputTokenCountParamsReasoningGenerateSummary = "auto"` + Always `refusal`. - - `const InputTokenCountParamsReasoningGenerateSummaryConcise InputTokenCountParamsReasoningGenerateSummary = "concise"` + - `const RefusalRefusal Refusal = "refusal"` - - `const InputTokenCountParamsReasoningGenerateSummaryDetailed InputTokenCountParamsReasoningGenerateSummary = "detailed"` + - `Refusal string` - - `Mode string` + - `type ImageURLDeltaBlock struct{…}` - Controls the reasoning execution mode for the request. + References an image URL in the content of a message. - When returned on a response, this is the effective execution mode. + - `Index int64` - - `string` + The index of the content part in the message. - - `string` + - `Type ImageURL` - - `const InputTokenCountParamsReasoningModeStandard InputTokenCountParamsReasoningMode = "standard"` + Always `image_url`. - - `const InputTokenCountParamsReasoningModePro InputTokenCountParamsReasoningMode = "pro"` + - `const ImageURLImageURL ImageURL = "image_url"` - - `Summary string` + - `ImageURL ImageURLDelta` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `Detail ImageURLDeltaDetail` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - - `const InputTokenCountParamsReasoningSummaryAuto InputTokenCountParamsReasoningSummary = "auto"` + - `const ImageURLDeltaDetailAuto ImageURLDeltaDetail = "auto"` - - `const InputTokenCountParamsReasoningSummaryConcise InputTokenCountParamsReasoningSummary = "concise"` + - `const ImageURLDeltaDetailLow ImageURLDeltaDetail = "low"` - - `const InputTokenCountParamsReasoningSummaryDetailed InputTokenCountParamsReasoningSummary = "detailed"` + - `const ImageURLDeltaDetailHigh ImageURLDeltaDetail = "high"` - - `Text param.Field[InputTokenCountParamsText]` + - `URL string` - Body param: Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + - `Role MessageDeltaRole` - - `Format BetaResponseFormatTextConfigUnion` + The entity that produced the message. One of `user` or `assistant`. - An object specifying the format that the model must output. + - `const MessageDeltaRoleUser MessageDeltaRole = "user"` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + - `const MessageDeltaRoleAssistant MessageDeltaRole = "assistant"` - The default format is `{ "type": "text" }` with no additional options. + - `Object ThreadMessageDelta` - **Not recommended for gpt-4o and newer models:** + The object type, which is always `thread.message.delta`. - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `const ThreadMessageDeltaThreadMessageDelta ThreadMessageDelta = "thread.message.delta"` - - `type BetaResponseFormatTextConfigText struct{…}` +### Refusal Content Block - Default response format. Used to generate text responses. +- `type RefusalContentBlock struct{…}` - - `Type Text` + The refusal content generated by the assistant. - The type of response format being defined. Always `text`. + - `Refusal string` - - `const TextText Text = "text"` + - `Type Refusal` - - `type BetaResponseFormatTextJSONSchemaConfig struct{…}` + Always `refusal`. - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + - `const RefusalRefusal Refusal = "refusal"` - - `Name string` +### Refusal Delta Block - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. +- `type RefusalDeltaBlock struct{…}` - - `Schema map[string, any]` + The refusal content that is part of a message. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `Index int64` - - `Type JSONSchema` + The index of the refusal part in the message. - The type of response format being defined. Always `json_schema`. + - `Type Refusal` - - `const JSONSchemaJSONSchema JSONSchema = "json_schema"` + Always `refusal`. - - `Description string` + - `const RefusalRefusal Refusal = "refusal"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `Refusal string` - - `Strict bool` +### Text - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). +- `type Text struct{…}` - - `type BetaResponseFormatTextConfigJSONObject struct{…}` + - `Annotations []AnnotationUnion` - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `type FileCitationAnnotation struct{…}` - - `Type JSONObject` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - The type of response format being defined. Always `json_object`. + - `EndIndex int64` - - `const JSONObjectJSONObject JSONObject = "json_object"` + - `FileCitation FileCitationAnnotationFileCitation` - - `Verbosity string` + - `FileID string` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + The ID of the specific File the citation is from. - - `const InputTokenCountParamsTextVerbosityLow InputTokenCountParamsTextVerbosity = "low"` + - `StartIndex int64` - - `const InputTokenCountParamsTextVerbosityMedium InputTokenCountParamsTextVerbosity = "medium"` + - `Text string` - - `const InputTokenCountParamsTextVerbosityHigh InputTokenCountParamsTextVerbosity = "high"` + The text in the message content that needs to be replaced. - - `ToolChoice param.Field[InputTokenCountParamsToolChoiceUnion]` + - `Type FileCitation` - Body param: Controls which tool the model should use, if any. + Always `file_citation`. - - `type BetaToolChoiceOptions string` + - `const FileCitationFileCitation FileCitation = "file_citation"` - Controls which (if any) tool is called by the model. + - `type FilePathAnnotation struct{…}` - `none` means the model will not call any tool and instead generates a message. + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - `auto` means the model can pick between generating a message or calling one or - more tools. + - `EndIndex int64` - `required` means the model must call one or more tools. + - `FilePath FilePathAnnotationFilePath` - - `const BetaToolChoiceOptionsNone BetaToolChoiceOptions = "none"` + - `FileID string` - - `const BetaToolChoiceOptionsAuto BetaToolChoiceOptions = "auto"` + The ID of the file that was generated. - - `const BetaToolChoiceOptionsRequired BetaToolChoiceOptions = "required"` + - `StartIndex int64` - - `type BetaToolChoiceAllowed struct{…}` + - `Text string` - Constrains the tools available to the model to a pre-defined set. + The text in the message content that needs to be replaced. - - `Mode BetaToolChoiceAllowedMode` + - `Type FilePath` - Constrains the tools available to the model to a pre-defined set. + Always `file_path`. - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `const FilePathFilePath FilePath = "file_path"` - `required` requires the model to call one or more of the allowed tools. + - `Value string` - - `const BetaToolChoiceAllowedModeAuto BetaToolChoiceAllowedMode = "auto"` + The data that makes up the text. - - `const BetaToolChoiceAllowedModeRequired BetaToolChoiceAllowedMode = "required"` +### Text Content Block - - `Tools []map[string, any]` +- `type TextContentBlock struct{…}` - A list of tool definitions that the model should be allowed to call. + The text content that is part of a message. - For the Responses API, the list of tool definitions might look like: + - `Text Text` - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `Annotations []AnnotationUnion` - - `Type AllowedTools` + - `type FileCitationAnnotation struct{…}` - Allowed tool configuration type. Always `allowed_tools`. + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - - `const AllowedToolsAllowedTools AllowedTools = "allowed_tools"` + - `EndIndex int64` - - `type BetaToolChoiceTypes struct{…}` + - `FileCitation FileCitationAnnotationFileCitation` - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + - `FileID string` - - `Type BetaToolChoiceTypesType` + The ID of the specific File the citation is from. - The type of hosted tool the model should to use. Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). + - `StartIndex int64` - Allowed values are: + - `Text string` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + The text in the message content that needs to be replaced. - - `const BetaToolChoiceTypesTypeFileSearch BetaToolChoiceTypesType = "file_search"` + - `Type FileCitation` - - `const BetaToolChoiceTypesTypeWebSearchPreview BetaToolChoiceTypesType = "web_search_preview"` + Always `file_citation`. - - `const BetaToolChoiceTypesTypeComputer BetaToolChoiceTypesType = "computer"` + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const BetaToolChoiceTypesTypeComputerUsePreview BetaToolChoiceTypesType = "computer_use_preview"` + - `type FilePathAnnotation struct{…}` - - `const BetaToolChoiceTypesTypeComputerUse BetaToolChoiceTypesType = "computer_use"` + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `const BetaToolChoiceTypesTypeWebSearchPreview2025_03_11 BetaToolChoiceTypesType = "web_search_preview_2025_03_11"` + - `EndIndex int64` - - `const BetaToolChoiceTypesTypeImageGeneration BetaToolChoiceTypesType = "image_generation"` + - `FilePath FilePathAnnotationFilePath` - - `const BetaToolChoiceTypesTypeCodeInterpreter BetaToolChoiceTypesType = "code_interpreter"` + - `FileID string` - - `type BetaToolChoiceFunction struct{…}` + The ID of the file that was generated. - Use this option to force the model to call a specific function. + - `StartIndex int64` - - `Name string` + - `Text string` - The name of the function to call. + The text in the message content that needs to be replaced. - - `Type Function` + - `Type FilePath` - For function calling, the type is always `function`. + Always `file_path`. - - `const FunctionFunction Function = "function"` + - `const FilePathFilePath FilePath = "file_path"` - - `type BetaToolChoiceMcp struct{…}` + - `Value string` - Use this option to force the model to call a specific tool on a remote MCP server. + The data that makes up the text. - - `ServerLabel string` + - `Type Text` - The label of the MCP server to use. + Always `text`. - - `Type Mcp` + - `const TextText Text = "text"` - For MCP tools, the type is always `mcp`. +### Text Content Block Param - - `const McpMcp Mcp = "mcp"` +- `type TextContentBlockParam struct{…}` - - `Name string` + The text content that is part of a message. - The name of the tool to call on the server. + - `Text string` - - `type BetaToolChoiceCustom struct{…}` + Text content to be sent to the model - Use this option to force the model to call a specific custom tool. + - `Type Text` - - `Name string` + Always `text`. - The name of the custom tool to call. + - `const TextText Text = "text"` - - `Type Custom` +### Text Delta - For custom tool calling, the type is always `custom`. +- `type TextDelta struct{…}` - - `const CustomCustom Custom = "custom"` + - `Annotations []AnnotationDeltaUnion` - - `type InputTokenCountParamsToolChoiceBetaSpecificProgrammaticToolCallingParam struct{…}` + - `type FileCitationDeltaAnnotation struct{…}` - - `Type ProgrammaticToolCalling` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - The tool to call. Always `programmatic_tool_calling`. + - `Index int64` - - `const ProgrammaticToolCallingProgrammaticToolCalling ProgrammaticToolCalling = "programmatic_tool_calling"` + The index of the annotation in the text content part. - - `type BetaToolChoiceApplyPatch struct{…}` + - `Type FileCitation` - Forces the model to call the apply_patch tool when executing a tool call. + Always `file_citation`. - - `Type ApplyPatch` + - `const FileCitationFileCitation FileCitation = "file_citation"` - The tool to call. Always `apply_patch`. + - `EndIndex int64` - - `const ApplyPatchApplyPatch ApplyPatch = "apply_patch"` + - `FileCitation FileCitationDeltaAnnotationFileCitation` - - `type BetaToolChoiceShell struct{…}` + - `FileID string` - Forces the model to call the shell tool when a tool call is required. + The ID of the specific File the citation is from. - - `Type Shell` + - `Quote string` - The tool to call. Always `shell`. + The specific quote in the file. - - `const ShellShell Shell = "shell"` + - `StartIndex int64` - - `Tools param.Field[[]BetaToolUnion]` + - `Text string` - Body param: An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. + The text in the message content that needs to be replaced. - - `type BetaFunctionTool struct{…}` + - `type FilePathDeltaAnnotation struct{…}` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - - `type BetaFileSearchTool struct{…}` + - `Index int64` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + The index of the annotation in the text content part. - - `type BetaComputerTool struct{…}` + - `Type FilePath` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + Always `file_path`. - - `type BetaComputerUsePreviewTool struct{…}` + - `const FilePathFilePath FilePath = "file_path"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `EndIndex int64` - - `type BetaWebSearchTool struct{…}` + - `FilePath FilePathDeltaAnnotationFilePath` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `FileID string` - - `type BetaToolMcp struct{…}` + The ID of the file that was generated. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + - `StartIndex int64` - - `type BetaToolCodeInterpreter struct{…}` + - `Text string` - A tool that runs Python code to help generate a response to a prompt. + The text in the message content that needs to be replaced. - - `type BetaToolProgrammaticToolCalling struct{…}` + - `Value string` - - `type BetaToolImageGeneration struct{…}` + The data that makes up the text. - A tool that generates images using the GPT image models. +### Text Delta Block - - `type BetaToolLocalShell struct{…}` +- `type TextDeltaBlock struct{…}` - A tool that allows the model to execute shell commands in a local environment. + The text content that is part of a message. - - `type BetaFunctionShellTool struct{…}` + - `Index int64` - A tool that allows the model to execute shell commands. + The index of the content part in the message. - - `type BetaCustomTool struct{…}` + - `Type Text` - A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + Always `text`. - - `type BetaNamespaceTool struct{…}` + - `const TextText Text = "text"` - Groups function/custom tools under a shared namespace. + - `Text TextDelta` - - `type BetaToolSearchTool struct{…}` + - `Annotations []AnnotationDeltaUnion` - Hosted or BYOT tool search configuration for deferred tools. + - `type FileCitationDeltaAnnotation struct{…}` - - `type BetaWebSearchPreviewTool struct{…}` + A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `Index int64` - - `type BetaApplyPatchTool struct{…}` + The index of the annotation in the text content part. - Allows the assistant to create, delete, or update files using unified diffs. + - `Type FileCitation` - - `Truncation param.Field[InputTokenCountParamsTruncation]` + Always `file_citation`. - Body param: The truncation strategy to use for the model response. - `auto`: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. - `disabled` (default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. + - `const FileCitationFileCitation FileCitation = "file_citation"` - - `const InputTokenCountParamsTruncationAuto InputTokenCountParamsTruncation = "auto"` + - `EndIndex int64` - - `const InputTokenCountParamsTruncationDisabled InputTokenCountParamsTruncation = "disabled"` + - `FileCitation FileCitationDeltaAnnotationFileCitation` - - `Betas param.Field[[]string]` + - `FileID string` - Header param: Optional beta features to enable for this request. + The ID of the specific File the citation is from. - - `const InputTokenCountParamsOpenAIBetaResponsesMultiAgentV1 InputTokenCountParamsOpenAIBeta = "responses_multi_agent=v1"` + - `Quote string` -### Returns + The specific quote in the file. -- `type InputTokenCountResponse struct{…}` + - `StartIndex int64` - - `InputTokens int64` + - `Text string` - - `Object ResponseInputTokens` + The text in the message content that needs to be replaced. - - `const ResponseInputTokensResponseInputTokens ResponseInputTokens = "response.input_tokens"` + - `type FilePathDeltaAnnotation struct{…}` -### Example + A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. -```go -package main + - `Index int64` -import ( - "context" - "fmt" + The index of the annotation in the text content part. - "github.com/openai/openai-go" - "github.com/openai/openai-go/option" - "github.com/openai/openai-go/responses" -) + - `Type FilePath` -func main() { - client := openai.NewClient( - option.WithAPIKey("My API Key"), - ) - response, err := client.Beta.Responses.InputTokens.Count(context.TODO(), responses.InputTokenCountParams{ + Always `file_path`. - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", response.InputTokens) -} -``` + - `const FilePathFilePath FilePath = "file_path"` -#### Response + - `EndIndex int64` -```json -{ - "input_tokens": 123, - "object": "response.input_tokens" -} -``` + - `FilePath FilePathDeltaAnnotationFilePath` -### Example + - `FileID string` -```go -package main + The ID of the file that was generated. -import ( - "context" - "fmt" + - `StartIndex int64` - "github.com/openai/openai-go" - "github.com/openai/openai-go/responses" -) + - `Text string` -func main() { - client := openai.NewClient() - response, err := client.Responses.InputTokens.Count(context.TODO(), responses.InputTokenCountParams{ - Model: "gpt-5", - Input: "Tell me a joke.", - }) - if err != nil { - panic(err.Error()) - } - fmt.Printf("%+v\n", response.InputTokens) -} -``` + The text in the message content that needs to be replaced. -#### Response + - `Value string` -```json -{ - "object": "response.input_tokens", - "input_tokens": 11 -} -``` + The data that makes up the text.