Skip to content

Responses

Run OpenAI Responses API (OpenAI only)
client.Responses.New(ctx, body) (*ResponseNewResponseUnion, error)
POST/v5/responses
ModelsExpand Collapse
type ApplyPatchCall struct{…}

A tool call representing a request to create, delete, or update files using diff patches.

CallID string
Operation ApplyPatchCallOperationUnion

Instruction for creating a new file via the apply_patch tool.

One of the following:
type ApplyPatchCallOperationApplyPatchCallOperationCreateFile struct{…}

Instruction for creating a new file via the apply_patch tool.

Diff string
Path string
Type CreateFile
type ApplyPatchCallOperationApplyPatchCallOperationDeleteFile struct{…}

Instruction for deleting an existing file via the apply_patch tool.

Path string
Type DeleteFile
type ApplyPatchCallOperationApplyPatchCallOperationUpdateFile struct{…}

Instruction for updating an existing file via the apply_patch tool.

Diff string
Path string
Type UpdateFile
Status ApplyPatchCallStatus
One of the following:
const ApplyPatchCallStatusInProgress ApplyPatchCallStatus = "in_progress"
const ApplyPatchCallStatusCompleted ApplyPatchCallStatus = "completed"
Type ApplyPatchCall
ID stringOptional
type ApplyPatchCallOutput struct{…}

The streamed output emitted by an apply patch tool call.

CallID string
Status ApplyPatchCallOutputStatus
One of the following:
const ApplyPatchCallOutputStatusCompleted ApplyPatchCallOutputStatus = "completed"
const ApplyPatchCallOutputStatusFailed ApplyPatchCallOutputStatus = "failed"
Type ApplyPatchCallOutput
ID stringOptional
Output stringOptional
type ApplyPatchTool struct{…}

Allows the assistant to create, delete, or update files using unified diffs.

Type ApplyPatch
type ComputerTool struct{…}

A tool that controls a virtual computer.

Learn more about the computer tool.

DisplayHeight int64
DisplayWidth int64
Environment ComputerToolEnvironment
One of the following:
const ComputerToolEnvironmentWindows ComputerToolEnvironment = "windows"
const ComputerToolEnvironmentMac ComputerToolEnvironment = "mac"
const ComputerToolEnvironmentLinux ComputerToolEnvironment = "linux"
const ComputerToolEnvironmentUbuntu ComputerToolEnvironment = "ubuntu"
const ComputerToolEnvironmentBrowser ComputerToolEnvironment = "browser"
Type ComputerUsePreview
type ContainerNetworkPolicyAllowlist struct{…}
AllowedDomains []string
Type Allowlist
DomainSecrets []ContainerNetworkPolicyAllowlistDomainSecretOptional
Domain string
Name string
Value string
type ContainerNetworkPolicyDisabled struct{…}
Type Disabled
type ContainerReference struct{…}
ContainerID string
Type ContainerReference
type ContainerReferenceParamResp struct{…}
ContainerID string
Type ContainerReference
type Conversation struct{…}

The conversation that this response belonged to.

Input items and output items from this response were automatically added to this conversation.

ID string
type CustomTool struct{…}

A custom tool that processes input using a specified format.

Learn more about custom tools

Name string
Type Custom
Description stringOptional
Format CustomToolFormatUnionOptional

Unconstrained free-form text.

One of the following:
type CustomToolFormatText struct{…}

Unconstrained free-form text.

Type Text
type CustomToolFormatGrammar struct{…}

A grammar defined by the user.

Definition string
Syntax string
One of the following:
const CustomToolFormatGrammarSyntaxLark CustomToolFormatGrammarSyntax = "lark"
const CustomToolFormatGrammarSyntaxRegex CustomToolFormatGrammarSyntax = "regex"
Type Grammar
type EasyInputMessage struct{…}

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions.

Content EasyInputMessageContentUnion
One of the following:
string
type EasyInputMessageContentInputItems []EasyInputMessageContentInputItemUnion
One of the following:
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Role EasyInputMessageRole
One of the following:
const EasyInputMessageRoleUser EasyInputMessageRole = "user"
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant"
const EasyInputMessageRoleSystem EasyInputMessageRole = "system"
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
Phase EasyInputMessagePhaseOptional
One of the following:
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary"
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
Type EasyInputMessageTypeOptional
type FileSearchTool struct{…}

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

Type FileSearch
VectorStoreIDs []string
Filters FileSearchToolFiltersUnionOptional

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

One of the following:
type FileSearchToolFiltersComparisonFilter struct{…}

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

Key string
Type string
One of the following:
const FileSearchToolFiltersComparisonFilterTypeEq FileSearchToolFiltersComparisonFilterType = "eq"
const FileSearchToolFiltersComparisonFilterTypeNe FileSearchToolFiltersComparisonFilterType = "ne"
const FileSearchToolFiltersComparisonFilterTypeGt FileSearchToolFiltersComparisonFilterType = "gt"
const FileSearchToolFiltersComparisonFilterTypeGte FileSearchToolFiltersComparisonFilterType = "gte"
const FileSearchToolFiltersComparisonFilterTypeLt FileSearchToolFiltersComparisonFilterType = "lt"
const FileSearchToolFiltersComparisonFilterTypeLte FileSearchToolFiltersComparisonFilterType = "lte"
Value FileSearchToolFiltersComparisonFilterValueUnion
One of the following:
string
float64
bool
type FileSearchToolFiltersComparisonFilterValueArray []FileSearchToolFiltersComparisonFilterValueArrayItemUnion
One of the following:
string
float64
type FileSearchToolFiltersCompoundFilter struct{…}

Combine multiple filters using and or or.

Filters []FileSearchToolFiltersCompoundFilterFilter
One of the following:
type FileSearchToolFiltersCompoundFilterFilter struct{…}

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

Key string
Type string
One of the following:
const FileSearchToolFiltersCompoundFilterFilterTypeEq FileSearchToolFiltersCompoundFilterFilterType = "eq"
const FileSearchToolFiltersCompoundFilterFilterTypeNe FileSearchToolFiltersCompoundFilterFilterType = "ne"
const FileSearchToolFiltersCompoundFilterFilterTypeGt FileSearchToolFiltersCompoundFilterFilterType = "gt"
const FileSearchToolFiltersCompoundFilterFilterTypeGte FileSearchToolFiltersCompoundFilterFilterType = "gte"
const FileSearchToolFiltersCompoundFilterFilterTypeLt FileSearchToolFiltersCompoundFilterFilterType = "lt"
const FileSearchToolFiltersCompoundFilterFilterTypeLte FileSearchToolFiltersCompoundFilterFilterType = "lte"
Value FileSearchToolFiltersCompoundFilterFilterValueUnion
One of the following:
string
float64
bool
type FileSearchToolFiltersCompoundFilterFilterValueArray []FileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion
One of the following:
string
float64
Type string
One of the following:
const FileSearchToolFiltersCompoundFilterTypeAnd FileSearchToolFiltersCompoundFilterType = "and"
const FileSearchToolFiltersCompoundFilterTypeOr FileSearchToolFiltersCompoundFilterType = "or"
MaxNumResults int64Optional
RankingOptions FileSearchToolRankingOptionsOptional

Ranking options for search.

Ranker stringOptional
One of the following:
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto"
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
ScoreThreshold float64Optional
type FunctionShellTool struct{…}

A tool that allows the model to execute shell commands.

Type Shell
Environment FunctionShellToolEnvironmentUnionOptional
One of the following:
type FunctionShellToolEnvironmentContainerAuto struct{…}
Type ContainerAuto
FileIDs []stringOptional
MemoryLimit stringOptional
One of the following:
const FunctionShellToolEnvironmentContainerAutoMemoryLimit1g FunctionShellToolEnvironmentContainerAutoMemoryLimit = "1g"
const FunctionShellToolEnvironmentContainerAutoMemoryLimit4g FunctionShellToolEnvironmentContainerAutoMemoryLimit = "4g"
const FunctionShellToolEnvironmentContainerAutoMemoryLimit16g FunctionShellToolEnvironmentContainerAutoMemoryLimit = "16g"
const FunctionShellToolEnvironmentContainerAutoMemoryLimit64g FunctionShellToolEnvironmentContainerAutoMemoryLimit = "64g"
NetworkPolicy FunctionShellToolEnvironmentContainerAutoNetworkPolicyUnionOptional
One of the following:
type ContainerNetworkPolicyDisabled struct{…}
Type Disabled
type ContainerNetworkPolicyAllowlist struct{…}
AllowedDomains []string
Type Allowlist
DomainSecrets []ContainerNetworkPolicyAllowlistDomainSecretOptional
Domain string
Name string
Value string
Skills []FunctionShellToolEnvironmentContainerAutoSkillUnionOptional
One of the following:
type FunctionShellToolEnvironmentContainerAutoSkillSkillReference struct{…}
SkillID string
Type SkillReference
Version stringOptional
type FunctionShellToolEnvironmentContainerAutoSkillInlineSkill struct{…}
Description string
Name string
Source FunctionShellToolEnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

Data string
MediaType ApplicationZip
Type Base64
Type Inline
type LocalEnvironment struct{…}
Type Local
Skills []LocalEnvironmentSkillOptional
Description string
Name string
Path string
type ContainerReference struct{…}
ContainerID string
Type ContainerReference
type FunctionTool struct{…}

Defines a function in your own code the model can choose to call.

Learn more about function calling.

Name string
Type Function
Description stringOptional
Parameters map[string, any]Optional
Strict boolOptional
type IncompleteDetails struct{…}

Details about why the response is incomplete.

Reason IncompleteDetailsReasonOptional
One of the following:
const IncompleteDetailsReasonMaxOutputTokens IncompleteDetailsReason = "max_output_tokens"
const IncompleteDetailsReasonContentFilter IncompleteDetailsReason = "content_filter"
type LocalEnvironment struct{…}
Type Local
Skills []LocalEnvironmentSkillOptional
Description string
Name string
Path string
type LocalEnvironmentParamResp struct{…}
Type Local
Skills []LocalEnvironmentParamSkillRespOptional
Description string
Name string
Path string
type McpApprovalRequest struct{…}

A request for human approval of a tool invocation.

ID string
Arguments string
Name string
ServerLabel string
Type McpApprovalRequest
type OpenAIResponse struct{…}
ID string
CreatedAt float64
Model OpenAIResponseModel
One of the following:
type OpenAIResponseModel string
One of the following:
const OpenAIResponseModelGpt5_2 OpenAIResponseModel = "gpt-5.2"
const OpenAIResponseModelGpt5_2_2025_12_11 OpenAIResponseModel = "gpt-5.2-2025-12-11"
const OpenAIResponseModelGpt5_2ChatLatest OpenAIResponseModel = "gpt-5.2-chat-latest"
const OpenAIResponseModelGpt5_2Pro OpenAIResponseModel = "gpt-5.2-pro"
const OpenAIResponseModelGpt5_2Pro2025_12_11 OpenAIResponseModel = "gpt-5.2-pro-2025-12-11"
const OpenAIResponseModelGpt5_1 OpenAIResponseModel = "gpt-5.1"
const OpenAIResponseModelGpt5_1_2025_11_13 OpenAIResponseModel = "gpt-5.1-2025-11-13"
const OpenAIResponseModelGpt5_1Codex OpenAIResponseModel = "gpt-5.1-codex"
const OpenAIResponseModelGpt5_1Mini OpenAIResponseModel = "gpt-5.1-mini"
const OpenAIResponseModelGpt5_1ChatLatest OpenAIResponseModel = "gpt-5.1-chat-latest"
const OpenAIResponseModelGpt5 OpenAIResponseModel = "gpt-5"
const OpenAIResponseModelGpt5Mini OpenAIResponseModel = "gpt-5-mini"
const OpenAIResponseModelGpt5Nano OpenAIResponseModel = "gpt-5-nano"
const OpenAIResponseModelGpt5_2025_08_07 OpenAIResponseModel = "gpt-5-2025-08-07"
const OpenAIResponseModelGpt5Mini2025_08_07 OpenAIResponseModel = "gpt-5-mini-2025-08-07"
const OpenAIResponseModelGpt5Nano2025_08_07 OpenAIResponseModel = "gpt-5-nano-2025-08-07"
const OpenAIResponseModelGpt5ChatLatest OpenAIResponseModel = "gpt-5-chat-latest"
const OpenAIResponseModelGpt4_1 OpenAIResponseModel = "gpt-4.1"
const OpenAIResponseModelGpt4_1Mini OpenAIResponseModel = "gpt-4.1-mini"
const OpenAIResponseModelGpt4_1Nano OpenAIResponseModel = "gpt-4.1-nano"
const OpenAIResponseModelGpt4_1_2025_04_14 OpenAIResponseModel = "gpt-4.1-2025-04-14"
const OpenAIResponseModelGpt4_1Mini2025_04_14 OpenAIResponseModel = "gpt-4.1-mini-2025-04-14"
const OpenAIResponseModelGpt4_1Nano2025_04_14 OpenAIResponseModel = "gpt-4.1-nano-2025-04-14"
const OpenAIResponseModelO4Mini OpenAIResponseModel = "o4-mini"
const OpenAIResponseModelO4Mini2025_04_16 OpenAIResponseModel = "o4-mini-2025-04-16"
const OpenAIResponseModelO3 OpenAIResponseModel = "o3"
const OpenAIResponseModelO3_2025_04_16 OpenAIResponseModel = "o3-2025-04-16"
const OpenAIResponseModelO3Mini OpenAIResponseModel = "o3-mini"
const OpenAIResponseModelO3Mini2025_01_31 OpenAIResponseModel = "o3-mini-2025-01-31"
const OpenAIResponseModelO1 OpenAIResponseModel = "o1"
const OpenAIResponseModelO1_2024_12_17 OpenAIResponseModel = "o1-2024-12-17"
const OpenAIResponseModelO1Preview OpenAIResponseModel = "o1-preview"
const OpenAIResponseModelO1Preview2024_09_12 OpenAIResponseModel = "o1-preview-2024-09-12"
const OpenAIResponseModelO1Mini OpenAIResponseModel = "o1-mini"
const OpenAIResponseModelO1Mini2024_09_12 OpenAIResponseModel = "o1-mini-2024-09-12"
const OpenAIResponseModelGpt4o OpenAIResponseModel = "gpt-4o"
const OpenAIResponseModelGpt4o2024_11_20 OpenAIResponseModel = "gpt-4o-2024-11-20"
const OpenAIResponseModelGpt4o2024_08_06 OpenAIResponseModel = "gpt-4o-2024-08-06"
const OpenAIResponseModelGpt4o2024_05_13 OpenAIResponseModel = "gpt-4o-2024-05-13"
const OpenAIResponseModelGpt4oAudioPreview OpenAIResponseModel = "gpt-4o-audio-preview"
const OpenAIResponseModelGpt4oAudioPreview2024_10_01 OpenAIResponseModel = "gpt-4o-audio-preview-2024-10-01"
const OpenAIResponseModelGpt4oAudioPreview2024_12_17 OpenAIResponseModel = "gpt-4o-audio-preview-2024-12-17"
const OpenAIResponseModelGpt4oAudioPreview2025_06_03 OpenAIResponseModel = "gpt-4o-audio-preview-2025-06-03"
const OpenAIResponseModelGpt4oMiniAudioPreview OpenAIResponseModel = "gpt-4o-mini-audio-preview"
const OpenAIResponseModelGpt4oMiniAudioPreview2024_12_17 OpenAIResponseModel = "gpt-4o-mini-audio-preview-2024-12-17"
const OpenAIResponseModelGpt4oSearchPreview OpenAIResponseModel = "gpt-4o-search-preview"
const OpenAIResponseModelGpt4oMiniSearchPreview OpenAIResponseModel = "gpt-4o-mini-search-preview"
const OpenAIResponseModelGpt4oSearchPreview2025_03_11 OpenAIResponseModel = "gpt-4o-search-preview-2025-03-11"
const OpenAIResponseModelGpt4oMiniSearchPreview2025_03_11 OpenAIResponseModel = "gpt-4o-mini-search-preview-2025-03-11"
const OpenAIResponseModelChatgpt4oLatest OpenAIResponseModel = "chatgpt-4o-latest"
const OpenAIResponseModelCodexMiniLatest OpenAIResponseModel = "codex-mini-latest"
const OpenAIResponseModelGpt4oMini OpenAIResponseModel = "gpt-4o-mini"
const OpenAIResponseModelGpt4oMini2024_07_18 OpenAIResponseModel = "gpt-4o-mini-2024-07-18"
const OpenAIResponseModelGpt4Turbo OpenAIResponseModel = "gpt-4-turbo"
const OpenAIResponseModelGpt4Turbo2024_04_09 OpenAIResponseModel = "gpt-4-turbo-2024-04-09"
const OpenAIResponseModelGpt4_0125Preview OpenAIResponseModel = "gpt-4-0125-preview"
const OpenAIResponseModelGpt4TurboPreview OpenAIResponseModel = "gpt-4-turbo-preview"
const OpenAIResponseModelGpt4_1106Preview OpenAIResponseModel = "gpt-4-1106-preview"
const OpenAIResponseModelGpt4VisionPreview OpenAIResponseModel = "gpt-4-vision-preview"
const OpenAIResponseModelGpt4 OpenAIResponseModel = "gpt-4"
const OpenAIResponseModelGpt4_0314 OpenAIResponseModel = "gpt-4-0314"
const OpenAIResponseModelGpt4_0613 OpenAIResponseModel = "gpt-4-0613"
const OpenAIResponseModelGpt4_32k OpenAIResponseModel = "gpt-4-32k"
const OpenAIResponseModelGpt4_32k0314 OpenAIResponseModel = "gpt-4-32k-0314"
const OpenAIResponseModelGpt4_32k0613 OpenAIResponseModel = "gpt-4-32k-0613"
const OpenAIResponseModelGpt3_5Turbo OpenAIResponseModel = "gpt-3.5-turbo"
const OpenAIResponseModelGpt3_5Turbo16k OpenAIResponseModel = "gpt-3.5-turbo-16k"
const OpenAIResponseModelGpt3_5Turbo0301 OpenAIResponseModel = "gpt-3.5-turbo-0301"
const OpenAIResponseModelGpt3_5Turbo0613 OpenAIResponseModel = "gpt-3.5-turbo-0613"
const OpenAIResponseModelGpt3_5Turbo1106 OpenAIResponseModel = "gpt-3.5-turbo-1106"
const OpenAIResponseModelGpt3_5Turbo0125 OpenAIResponseModel = "gpt-3.5-turbo-0125"
const OpenAIResponseModelGpt3_5Turbo16k0613 OpenAIResponseModel = "gpt-3.5-turbo-16k-0613"
const OpenAIResponseModelO1Pro OpenAIResponseModel = "o1-pro"
const OpenAIResponseModelO1Pro2025_03_19 OpenAIResponseModel = "o1-pro-2025-03-19"
const OpenAIResponseModelO3Pro OpenAIResponseModel = "o3-pro"
const OpenAIResponseModelO3Pro2025_06_10 OpenAIResponseModel = "o3-pro-2025-06-10"
const OpenAIResponseModelO3DeepResearch OpenAIResponseModel = "o3-deep-research"
const OpenAIResponseModelO3DeepResearch2025_06_26 OpenAIResponseModel = "o3-deep-research-2025-06-26"
const OpenAIResponseModelO4MiniDeepResearch OpenAIResponseModel = "o4-mini-deep-research"
const OpenAIResponseModelO4MiniDeepResearch2025_06_26 OpenAIResponseModel = "o4-mini-deep-research-2025-06-26"
const OpenAIResponseModelComputerUsePreview OpenAIResponseModel = "computer-use-preview"
const OpenAIResponseModelComputerUsePreview2025_03_11 OpenAIResponseModel = "computer-use-preview-2025-03-11"
const OpenAIResponseModelGpt5Codex OpenAIResponseModel = "gpt-5-codex"
const OpenAIResponseModelGpt5Pro OpenAIResponseModel = "gpt-5-pro"
const OpenAIResponseModelGpt5Pro2025_10_06 OpenAIResponseModel = "gpt-5-pro-2025-10-06"
const OpenAIResponseModelGpt5_1CodexMax OpenAIResponseModel = "gpt-5.1-codex-max"
string
Object Response
Output []OpenAIResponseOutputUnion
One of the following:
type OpenAIResponseOutputMessage struct{…}

An output message from the model.

ID string
Content []OpenAIResponseOutputMessageContentUnion
One of the following:
type OpenAIResponseOutputText struct{…}

A text output from the model.

Annotations []OpenAIResponseOutputTextAnnotationUnion
One of the following:
type OpenAIResponseOutputTextAnnotationAnnotationFileCitation struct{…}

A citation to a file.

FileID string
Filename string
Index int64
Type FileCitation
type OpenAIResponseOutputTextAnnotationAnnotationURLCitation struct{…}

A citation for a web resource used to generate a model response.

EndIndex int64
StartIndex int64
Title string
Type URLCitation
URL string
type OpenAIResponseOutputTextAnnotationAnnotationContainerFileCitation struct{…}

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

ContainerID string
EndIndex int64
FileID string
Filename string
StartIndex int64
Type ContainerFileCitation
type OpenAIResponseOutputTextAnnotationAnnotationFilePath struct{…}

A path to a file.

FileID string
Index int64
Type FilePath
Text string
Type OutputText
Logprobs []OpenAIResponseOutputTextLogprobOptional
Token string
Bytes []int64
Logprob float64
TopLogprobs []OpenAIResponseOutputTextLogprobTopLogprob
Token string
Bytes []int64
Logprob float64
type OpenAIResponseOutputRefusal struct{…}

A refusal from the model.

Refusal string
Type Refusal
Role Assistant
Status OpenAIResponseOutputMessageStatus
One of the following:
const OpenAIResponseOutputMessageStatusInProgress OpenAIResponseOutputMessageStatus = "in_progress"
const OpenAIResponseOutputMessageStatusCompleted OpenAIResponseOutputMessageStatus = "completed"
const OpenAIResponseOutputMessageStatusIncomplete OpenAIResponseOutputMessageStatus = "incomplete"
Type Message
Phase OpenAIResponseOutputMessagePhaseOptional
One of the following:
const OpenAIResponseOutputMessagePhaseCommentary OpenAIResponseOutputMessagePhase = "commentary"
const OpenAIResponseOutputMessagePhaseFinalAnswer OpenAIResponseOutputMessagePhase = "final_answer"
type OpenAIResponseFileSearchToolCall struct{…}

The results of a file search tool call.

See the file search guide for more information.

ID string
Queries []string
Status OpenAIResponseFileSearchToolCallStatus
One of the following:
const OpenAIResponseFileSearchToolCallStatusInProgress OpenAIResponseFileSearchToolCallStatus = "in_progress"
const OpenAIResponseFileSearchToolCallStatusSearching OpenAIResponseFileSearchToolCallStatus = "searching"
const OpenAIResponseFileSearchToolCallStatusCompleted OpenAIResponseFileSearchToolCallStatus = "completed"
const OpenAIResponseFileSearchToolCallStatusIncomplete OpenAIResponseFileSearchToolCallStatus = "incomplete"
const OpenAIResponseFileSearchToolCallStatusFailed OpenAIResponseFileSearchToolCallStatus = "failed"
Type FileSearchCall
Results []OpenAIResponseFileSearchToolCallResultOptional
Attributes map[string, OpenAIResponseFileSearchToolCallResultAttributeUnion]Optional
One of the following:
string
float64
bool
FileID stringOptional
Filename stringOptional
Score float64Optional
Text stringOptional
type OpenAIResponseFunctionToolCall struct{…}

A tool call to run a function.

See the function calling guide for more information.

Arguments string
CallID string
Name string
Type FunctionCall
ID stringOptional
Status OpenAIResponseFunctionToolCallStatusOptional
One of the following:
const OpenAIResponseFunctionToolCallStatusInProgress OpenAIResponseFunctionToolCallStatus = "in_progress"
const OpenAIResponseFunctionToolCallStatusCompleted OpenAIResponseFunctionToolCallStatus = "completed"
const OpenAIResponseFunctionToolCallStatusIncomplete OpenAIResponseFunctionToolCallStatus = "incomplete"
One of the following:
One of the following:
type OpenAIResponseComputerToolCall struct{…}

A tool call to a computer use tool.

See the computer use guide for more information.

ID string
Action OpenAIResponseComputerToolCallActionUnion

A click action.

One of the following:
type OpenAIResponseComputerToolCallActionActionClick struct{…}

A click action.

Button string
One of the following:
const OpenAIResponseComputerToolCallActionActionClickButtonLeft OpenAIResponseComputerToolCallActionActionClickButton = "left"
const OpenAIResponseComputerToolCallActionActionClickButtonRight OpenAIResponseComputerToolCallActionActionClickButton = "right"
const OpenAIResponseComputerToolCallActionActionClickButtonWheel OpenAIResponseComputerToolCallActionActionClickButton = "wheel"
const OpenAIResponseComputerToolCallActionActionClickButtonBack OpenAIResponseComputerToolCallActionActionClickButton = "back"
const OpenAIResponseComputerToolCallActionActionClickButtonForward OpenAIResponseComputerToolCallActionActionClickButton = "forward"
Type Click
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionDoubleClick struct{…}

A double click action.

Type DoubleClick
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionDrag struct{…}

A drag action.

Path []OpenAIResponseComputerToolCallActionActionDragPath
X int64
Y int64
Type Drag
type OpenAIResponseComputerToolCallActionActionKeypress struct{…}

A collection of keypresses the model would like to perform.

Keys []string
Type Keypress
type OpenAIResponseComputerToolCallActionActionMove struct{…}

A mouse move action.

Type Move
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionScreenshot struct{…}

A screenshot action.

Type Screenshot
type OpenAIResponseComputerToolCallActionActionScroll struct{…}

A scroll action.

ScrollX int64
ScrollY int64
Type Scroll
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionType struct{…}

An action to type in text.

Text string
Type Type
type OpenAIResponseComputerToolCallActionActionWait struct{…}

A wait action.

Type Wait
CallID string
PendingSafetyChecks []OpenAIResponseComputerToolCallPendingSafetyCheck
ID string
Code stringOptional
Message stringOptional
Status OpenAIResponseComputerToolCallStatus
One of the following:
const OpenAIResponseComputerToolCallStatusInProgress OpenAIResponseComputerToolCallStatus = "in_progress"
const OpenAIResponseComputerToolCallStatusCompleted OpenAIResponseComputerToolCallStatus = "completed"
const OpenAIResponseComputerToolCallStatusIncomplete OpenAIResponseComputerToolCallStatus = "incomplete"
Type ComputerCall
type OpenAIResponseReasoningItem struct{…}

A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your input to the Responses API for subsequent turns of a conversation if you are manually managing context.

ID string
Summary []OpenAIResponseReasoningItemSummary
Text string
Type SummaryText
Type Reasoning
Content []OpenAIResponseReasoningItemContentOptional
Text string
Type ReasoningText
EncryptedContent stringOptional
Status OpenAIResponseReasoningItemStatusOptional
One of the following:
const OpenAIResponseReasoningItemStatusInProgress OpenAIResponseReasoningItemStatus = "in_progress"
const OpenAIResponseReasoningItemStatusCompleted OpenAIResponseReasoningItemStatus = "completed"
const OpenAIResponseReasoningItemStatusIncomplete OpenAIResponseReasoningItemStatus = "incomplete"
type ResponseCompactionItem struct{…}

A compaction item generated by the v1/responses/compact API.

ID string
EncryptedContent string
Type Compaction
CreatedBy stringOptional
type OpenAITypesResponsesResponseOutputItemImageGenerationCall struct{…}

An image generation request made by the model.

ID string
Status OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus
One of the following:
const OpenAITypesResponsesResponseOutputItemImageGenerationCallStatusInProgress OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus = "in_progress"
const OpenAITypesResponsesResponseOutputItemImageGenerationCallStatusCompleted OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus = "completed"
const OpenAITypesResponsesResponseOutputItemImageGenerationCallStatusGenerating OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus = "generating"
const OpenAITypesResponsesResponseOutputItemImageGenerationCallStatusFailed OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus = "failed"
Type ImageGenerationCall
Result stringOptional
type OpenAIResponseCodeInterpreterToolCall struct{…}

A tool call to run code.

ID string
ContainerID string
Status OpenAIResponseCodeInterpreterToolCallStatus
One of the following:
const OpenAIResponseCodeInterpreterToolCallStatusInProgress OpenAIResponseCodeInterpreterToolCallStatus = "in_progress"
const OpenAIResponseCodeInterpreterToolCallStatusCompleted OpenAIResponseCodeInterpreterToolCallStatus = "completed"
const OpenAIResponseCodeInterpreterToolCallStatusIncomplete OpenAIResponseCodeInterpreterToolCallStatus = "incomplete"
const OpenAIResponseCodeInterpreterToolCallStatusInterpreting OpenAIResponseCodeInterpreterToolCallStatus = "interpreting"
const OpenAIResponseCodeInterpreterToolCallStatusFailed OpenAIResponseCodeInterpreterToolCallStatus = "failed"
Type CodeInterpreterCall
Code stringOptional
Outputs []OpenAIResponseCodeInterpreterToolCallOutputUnionOptional
One of the following:
type OpenAIResponseCodeInterpreterToolCallOutputOutputLogs struct{…}

The logs output from the code interpreter.

Logs string
Type Logs
type OpenAIResponseCodeInterpreterToolCallOutputOutputImage struct{…}

The image output from the code interpreter.

Type Image
URL string
type OpenAITypesResponsesResponseOutputItemLocalShellCall struct{…}

A tool call to run a command on the local shell.

ID string
Action OpenAITypesResponsesResponseOutputItemLocalShellCallAction

Execute a shell command on the server.

Command []string
Env map[string, string]
Type Exec
TimeoutMs int64Optional
User stringOptional
WorkingDirectory stringOptional
CallID string
Status OpenAITypesResponsesResponseOutputItemLocalShellCallStatus
One of the following:
const OpenAITypesResponsesResponseOutputItemLocalShellCallStatusInProgress OpenAITypesResponsesResponseOutputItemLocalShellCallStatus = "in_progress"
const OpenAITypesResponsesResponseOutputItemLocalShellCallStatusCompleted OpenAITypesResponsesResponseOutputItemLocalShellCallStatus = "completed"
const OpenAITypesResponsesResponseOutputItemLocalShellCallStatusIncomplete OpenAITypesResponsesResponseOutputItemLocalShellCallStatus = "incomplete"
Type LocalShellCall
type ResponseFunctionShellToolCall struct{…}

A tool call that executes one or more shell commands in a managed environment.

ID string
Action ResponseFunctionShellToolCallAction

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

Commands []string
MaxOutputLength int64Optional
TimeoutMs int64Optional
CallID string
Status ResponseFunctionShellToolCallStatus
One of the following:
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress"
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed"
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
Type ShellCall
CreatedBy stringOptional
Environment ResponseFunctionShellToolCallEnvironmentUnionOptional

Represents the use of a local environment to perform shell actions.

One of the following:
type ResponseFunctionShellToolCallEnvironmentResponseLocalEnvironment struct{…}

Represents the use of a local environment to perform shell actions.

Type Local
type ResponseFunctionShellToolCallEnvironmentResponseContainerReference struct{…}

Represents a container created with /v1/containers.

ContainerID string
Type ContainerReference
type ResponseFunctionShellToolCallOutput struct{…}

The output of a shell tool call that was emitted.

ID string
CallID string
Output []ResponseFunctionShellToolCallOutputOutput
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnion

Indicates that the shell call exceeded its configured time limit.

One of the following:
type ResponseFunctionShellToolCallOutputOutputOutcomeOutputOutcomeTimeout struct{…}

Indicates that the shell call exceeded its configured time limit.

Type Timeout
type ResponseFunctionShellToolCallOutputOutputOutcomeOutputOutcomeExit struct{…}

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

ExitCode int64
Type Exit
Stderr string
Stdout string
CreatedBy stringOptional
Status ResponseFunctionShellToolCallOutputStatus
One of the following:
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress"
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed"
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
Type ShellCallOutput
CreatedBy stringOptional
MaxOutputLength int64Optional
type ResponseApplyPatchToolCall struct{…}

A tool call that applies file diffs by creating, deleting, or updating files.

ID string
CallID string
Operation ResponseApplyPatchToolCallOperationUnion

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

One of the following:
type ResponseApplyPatchToolCallOperationOperationCreateFile struct{…}

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

Diff string
Path string
Type CreateFile
type ResponseApplyPatchToolCallOperationOperationDeleteFile struct{…}

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

Path string
Type DeleteFile
type ResponseApplyPatchToolCallOperationOperationUpdateFile struct{…}

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

Diff string
Path string
Type UpdateFile
Status ResponseApplyPatchToolCallStatus
One of the following:
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress"
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
Type ApplyPatchCall
CreatedBy stringOptional
type ResponseApplyPatchToolCallOutput struct{…}

The output emitted by an apply patch tool call.

ID string
CallID string
Status ResponseApplyPatchToolCallOutputStatus
One of the following:
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed"
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
Type ApplyPatchCallOutput
CreatedBy stringOptional
Output stringOptional
type OpenAITypesResponsesResponseOutputItemMcpCall struct{…}

An invocation of a tool on an MCP server.

ID string
Arguments string
Name string
ServerLabel string
Type McpCall
ApprovalRequestID stringOptional
Error stringOptional
Output stringOptional
Status OpenAITypesResponsesResponseOutputItemMcpCallStatusOptional
One of the following:
const OpenAITypesResponsesResponseOutputItemMcpCallStatusInProgress OpenAITypesResponsesResponseOutputItemMcpCallStatus = "in_progress"
const OpenAITypesResponsesResponseOutputItemMcpCallStatusCompleted OpenAITypesResponsesResponseOutputItemMcpCallStatus = "completed"
const OpenAITypesResponsesResponseOutputItemMcpCallStatusIncomplete OpenAITypesResponsesResponseOutputItemMcpCallStatus = "incomplete"
const OpenAITypesResponsesResponseOutputItemMcpCallStatusCalling OpenAITypesResponsesResponseOutputItemMcpCallStatus = "calling"
const OpenAITypesResponsesResponseOutputItemMcpCallStatusFailed OpenAITypesResponsesResponseOutputItemMcpCallStatus = "failed"
type OpenAITypesResponsesResponseOutputItemMcpListTools struct{…}

A list of tools available on an MCP server.

ID string
ServerLabel string
Tools []OpenAITypesResponsesResponseOutputItemMcpListToolsTool
InputSchema any
Name string
Annotations anyOptional
Description stringOptional
Type McpListTools
Error stringOptional
type McpApprovalRequest struct{…}

A request for human approval of a tool invocation.

ID string
Arguments string
Name string
ServerLabel string
Type McpApprovalRequest
type OpenAIResponseCustomToolCall struct{…}

A call to a custom tool created by the model.

CallID string
Input string
Name string
Type CustomToolCall
ID stringOptional
ParallelToolCalls bool
ToolChoice OpenAIResponseToolChoiceUnion

Constrains the tools available to the model to a pre-defined set.

One of the following:
type OpenAIResponseToolChoiceString string
One of the following:
const OpenAIResponseToolChoiceStringNone OpenAIResponseToolChoiceString = "none"
const OpenAIResponseToolChoiceStringAuto OpenAIResponseToolChoiceString = "auto"
const OpenAIResponseToolChoiceStringRequired OpenAIResponseToolChoiceString = "required"
type ToolChoiceAllowed struct{…}

Constrains the tools available to the model to a pre-defined set.

Mode ToolChoiceAllowedMode
One of the following:
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto"
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
Tools []map[string, any]
Type AllowedTools
type ToolChoiceTypes struct{…}

Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.

Type ToolChoiceTypesType
One of the following:
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search"
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview"
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview"
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11"
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation"
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
type ToolChoiceFunction struct{…}

Use this option to force the model to call a specific function.

Name string
Type Function
type ToolChoiceMcp struct{…}

Use this option to force the model to call a specific tool on a remote MCP server.

ServerLabel string
Type Mcp
Name stringOptional
type ToolChoiceCustom struct{…}

Use this option to force the model to call a specific custom tool.

Name string
Type Custom
type ToolChoiceApplyPatch struct{…}

Forces the model to call the apply_patch tool when executing a tool call.

Type ApplyPatch
type ToolChoiceShell struct{…}

Forces the model to call the shell tool when a tool call is required.

Type Shell
Tools []OpenAIResponseToolUnion
One of the following:
type FunctionTool struct{…}

Defines a function in your own code the model can choose to call.

Learn more about function calling.

Name string
Type Function
Description stringOptional
Parameters map[string, any]Optional
Strict boolOptional
type FileSearchTool struct{…}

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

Type FileSearch
VectorStoreIDs []string
Filters FileSearchToolFiltersUnionOptional

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

One of the following:
type FileSearchToolFiltersComparisonFilter struct{…}

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

Key string
Type string
One of the following:
const FileSearchToolFiltersComparisonFilterTypeEq FileSearchToolFiltersComparisonFilterType = "eq"
const FileSearchToolFiltersComparisonFilterTypeNe FileSearchToolFiltersComparisonFilterType = "ne"
const FileSearchToolFiltersComparisonFilterTypeGt FileSearchToolFiltersComparisonFilterType = "gt"
const FileSearchToolFiltersComparisonFilterTypeGte FileSearchToolFiltersComparisonFilterType = "gte"
const FileSearchToolFiltersComparisonFilterTypeLt FileSearchToolFiltersComparisonFilterType = "lt"
const FileSearchToolFiltersComparisonFilterTypeLte FileSearchToolFiltersComparisonFilterType = "lte"
Value FileSearchToolFiltersComparisonFilterValueUnion
One of the following:
string
float64
bool
type FileSearchToolFiltersComparisonFilterValueArray []FileSearchToolFiltersComparisonFilterValueArrayItemUnion
One of the following:
string
float64
type FileSearchToolFiltersCompoundFilter struct{…}

Combine multiple filters using and or or.

Filters []FileSearchToolFiltersCompoundFilterFilter
One of the following:
type FileSearchToolFiltersCompoundFilterFilter struct{…}

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

Key string
Type string
One of the following:
const FileSearchToolFiltersCompoundFilterFilterTypeEq FileSearchToolFiltersCompoundFilterFilterType = "eq"
const FileSearchToolFiltersCompoundFilterFilterTypeNe FileSearchToolFiltersCompoundFilterFilterType = "ne"
const FileSearchToolFiltersCompoundFilterFilterTypeGt FileSearchToolFiltersCompoundFilterFilterType = "gt"
const FileSearchToolFiltersCompoundFilterFilterTypeGte FileSearchToolFiltersCompoundFilterFilterType = "gte"
const FileSearchToolFiltersCompoundFilterFilterTypeLt FileSearchToolFiltersCompoundFilterFilterType = "lt"
const FileSearchToolFiltersCompoundFilterFilterTypeLte FileSearchToolFiltersCompoundFilterFilterType = "lte"
Value FileSearchToolFiltersCompoundFilterFilterValueUnion
One of the following:
string
float64
bool
type FileSearchToolFiltersCompoundFilterFilterValueArray []FileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion
One of the following:
string
float64
Type string
One of the following:
const FileSearchToolFiltersCompoundFilterTypeAnd FileSearchToolFiltersCompoundFilterType = "and"
const FileSearchToolFiltersCompoundFilterTypeOr FileSearchToolFiltersCompoundFilterType = "or"
MaxNumResults int64Optional
RankingOptions FileSearchToolRankingOptionsOptional

Ranking options for search.

Ranker stringOptional
One of the following:
const FileSearchToolRankingOptionsRankerAuto FileSearchToolRankingOptionsRanker = "auto"
const FileSearchToolRankingOptionsRankerDefault2024_11_15 FileSearchToolRankingOptionsRanker = "default-2024-11-15"
ScoreThreshold float64Optional
type ComputerTool struct{…}

A tool that controls a virtual computer.

Learn more about the computer tool.

DisplayHeight int64
DisplayWidth int64
Environment ComputerToolEnvironment
One of the following:
const ComputerToolEnvironmentWindows ComputerToolEnvironment = "windows"
const ComputerToolEnvironmentMac ComputerToolEnvironment = "mac"
const ComputerToolEnvironmentLinux ComputerToolEnvironment = "linux"
const ComputerToolEnvironmentUbuntu ComputerToolEnvironment = "ubuntu"
const ComputerToolEnvironmentBrowser ComputerToolEnvironment = "browser"
Type ComputerUsePreview
type WebSearchTool struct{…}

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

Type WebSearchToolType
One of the following:
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search"
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
Filters WebSearchToolFiltersOptional

Filters for the search.

AllowedDomains []stringOptional
SearchContextSize WebSearchToolSearchContextSizeOptional
One of the following:
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low"
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium"
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
UserLocation WebSearchToolUserLocationOptional

The approximate location of the user.

City stringOptional
Country stringOptional
Region stringOptional
Timezone stringOptional
Type stringOptional
type OpenAIResponseToolMcp struct{…}

Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.

ServerLabel string
Type Mcp
AllowedTools OpenAIResponseToolMcpAllowedToolsUnionOptional

A filter object to specify which tools are allowed.

One of the following:
type OpenAIResponseToolMcpAllowedToolsArray []string
type OpenAIResponseToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter struct{…}

A filter object to specify which tools are allowed.

ReadOnly boolOptional
ToolNames []stringOptional
Authorization stringOptional
ConnectorID stringOptional
One of the following:
const OpenAIResponseToolMcpConnectorIDConnectorDropbox OpenAIResponseToolMcpConnectorID = "connector_dropbox"
const OpenAIResponseToolMcpConnectorIDConnectorGmail OpenAIResponseToolMcpConnectorID = "connector_gmail"
const OpenAIResponseToolMcpConnectorIDConnectorGooglecalendar OpenAIResponseToolMcpConnectorID = "connector_googlecalendar"
const OpenAIResponseToolMcpConnectorIDConnectorGoogledrive OpenAIResponseToolMcpConnectorID = "connector_googledrive"
const OpenAIResponseToolMcpConnectorIDConnectorMicrosoftteams OpenAIResponseToolMcpConnectorID = "connector_microsoftteams"
const OpenAIResponseToolMcpConnectorIDConnectorOutlookcalendar OpenAIResponseToolMcpConnectorID = "connector_outlookcalendar"
const OpenAIResponseToolMcpConnectorIDConnectorOutlookemail OpenAIResponseToolMcpConnectorID = "connector_outlookemail"
const OpenAIResponseToolMcpConnectorIDConnectorSharepoint OpenAIResponseToolMcpConnectorID = "connector_sharepoint"
Headers map[string, string]Optional
RequireApproval OpenAIResponseToolMcpRequireApprovalUnionOptional

Specify which of the MCP server’s tools require approval.

Can be always, never, or a filter object associated with tools that require approval.

One of the following:
type OpenAIResponseToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter struct{…}

Specify which of the MCP server’s tools require approval.

Can be always, never, or a filter object associated with tools that require approval.

Always OpenAIResponseToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlwaysOptional

A filter object to specify which tools are allowed.

ReadOnly boolOptional
ToolNames []stringOptional
Never OpenAIResponseToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNeverOptional

A filter object to specify which tools are allowed.

ReadOnly boolOptional
ToolNames []stringOptional
type OpenAIResponseToolMcpRequireApprovalString string
One of the following:
const OpenAIResponseToolMcpRequireApprovalStringAlways OpenAIResponseToolMcpRequireApprovalString = "always"
const OpenAIResponseToolMcpRequireApprovalStringNever OpenAIResponseToolMcpRequireApprovalString = "never"
ServerDescription stringOptional
ServerURL stringOptional
type OpenAIResponseToolCodeInterpreter struct{…}

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

Container OpenAIResponseToolCodeInterpreterContainerUnion

Configuration for a code interpreter container.

Optionally specify the IDs of the files to run the code on.

One of the following:
string
type OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto struct{…}

Configuration for a code interpreter container.

Optionally specify the IDs of the files to run the code on.

Type Auto
FileIDs []stringOptional
MemoryLimit stringOptional
One of the following:
const OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"
const OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"
const OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"
const OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
NetworkPolicy OpenAIResponseToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionOptional
One of the following:
type ContainerNetworkPolicyDisabled struct{…}
Type Disabled
type ContainerNetworkPolicyAllowlist struct{…}
AllowedDomains []string
Type Allowlist
DomainSecrets []ContainerNetworkPolicyAllowlistDomainSecretOptional
Domain string
Name string
Value string
Type CodeInterpreter
type OpenAIResponseToolImageGeneration struct{…}

A tool that generates images using the GPT image models.

Type ImageGeneration
Action stringOptional
One of the following:
const OpenAIResponseToolImageGenerationActionGenerate OpenAIResponseToolImageGenerationAction = "generate"
const OpenAIResponseToolImageGenerationActionEdit OpenAIResponseToolImageGenerationAction = "edit"
const OpenAIResponseToolImageGenerationActionAuto OpenAIResponseToolImageGenerationAction = "auto"
Background stringOptional
One of the following:
const OpenAIResponseToolImageGenerationBackgroundTransparent OpenAIResponseToolImageGenerationBackground = "transparent"
const OpenAIResponseToolImageGenerationBackgroundOpaque OpenAIResponseToolImageGenerationBackground = "opaque"
const OpenAIResponseToolImageGenerationBackgroundAuto OpenAIResponseToolImageGenerationBackground = "auto"
InputFidelity stringOptional
One of the following:
const OpenAIResponseToolImageGenerationInputFidelityHigh OpenAIResponseToolImageGenerationInputFidelity = "high"
const OpenAIResponseToolImageGenerationInputFidelityLow OpenAIResponseToolImageGenerationInputFidelity = "low"
InputImageMask OpenAIResponseToolImageGenerationInputImageMaskOptional

Optional mask for inpainting.

Contains image_url (string, optional) and file_id (string, optional).

FileID stringOptional
ImageURL stringOptional
Model stringOptional
One of the following:
string
string
One of the following:
const OpenAIResponseToolImageGenerationModelGptImage1 OpenAIResponseToolImageGenerationModel = "gpt-image-1"
const OpenAIResponseToolImageGenerationModelGptImage1Mini OpenAIResponseToolImageGenerationModel = "gpt-image-1-mini"
const OpenAIResponseToolImageGenerationModelGptImage1_5 OpenAIResponseToolImageGenerationModel = "gpt-image-1.5"
Moderation stringOptional
One of the following:
const OpenAIResponseToolImageGenerationModerationAuto OpenAIResponseToolImageGenerationModeration = "auto"
const OpenAIResponseToolImageGenerationModerationLow OpenAIResponseToolImageGenerationModeration = "low"
OutputCompression int64Optional
OutputFormat stringOptional
One of the following:
const OpenAIResponseToolImageGenerationOutputFormatPng OpenAIResponseToolImageGenerationOutputFormat = "png"
const OpenAIResponseToolImageGenerationOutputFormatWebp OpenAIResponseToolImageGenerationOutputFormat = "webp"
const OpenAIResponseToolImageGenerationOutputFormatJpeg OpenAIResponseToolImageGenerationOutputFormat = "jpeg"
PartialImages int64Optional
Quality stringOptional
One of the following:
const OpenAIResponseToolImageGenerationQualityLow OpenAIResponseToolImageGenerationQuality = "low"
const OpenAIResponseToolImageGenerationQualityMedium OpenAIResponseToolImageGenerationQuality = "medium"
const OpenAIResponseToolImageGenerationQualityHigh OpenAIResponseToolImageGenerationQuality = "high"
const OpenAIResponseToolImageGenerationQualityAuto OpenAIResponseToolImageGenerationQuality = "auto"
Size stringOptional
One of the following:
const OpenAIResponseToolImageGenerationSize1024x1024 OpenAIResponseToolImageGenerationSize = "1024x1024"
const OpenAIResponseToolImageGenerationSize1024x1536 OpenAIResponseToolImageGenerationSize = "1024x1536"
const OpenAIResponseToolImageGenerationSize1536x1024 OpenAIResponseToolImageGenerationSize = "1536x1024"
const OpenAIResponseToolImageGenerationSizeAuto OpenAIResponseToolImageGenerationSize = "auto"
type OpenAIResponseToolLocalShell struct{…}

A tool that allows the model to execute shell commands in a local environment.

Type LocalShell
type FunctionShellTool struct{…}

A tool that allows the model to execute shell commands.

Type Shell
Environment FunctionShellToolEnvironmentUnionOptional
One of the following:
type FunctionShellToolEnvironmentContainerAuto struct{…}
Type ContainerAuto
FileIDs []stringOptional
MemoryLimit stringOptional
One of the following:
const FunctionShellToolEnvironmentContainerAutoMemoryLimit1g FunctionShellToolEnvironmentContainerAutoMemoryLimit = "1g"
const FunctionShellToolEnvironmentContainerAutoMemoryLimit4g FunctionShellToolEnvironmentContainerAutoMemoryLimit = "4g"
const FunctionShellToolEnvironmentContainerAutoMemoryLimit16g FunctionShellToolEnvironmentContainerAutoMemoryLimit = "16g"
const FunctionShellToolEnvironmentContainerAutoMemoryLimit64g FunctionShellToolEnvironmentContainerAutoMemoryLimit = "64g"
NetworkPolicy FunctionShellToolEnvironmentContainerAutoNetworkPolicyUnionOptional
One of the following:
type ContainerNetworkPolicyDisabled struct{…}
Type Disabled
type ContainerNetworkPolicyAllowlist struct{…}
AllowedDomains []string
Type Allowlist
DomainSecrets []ContainerNetworkPolicyAllowlistDomainSecretOptional
Domain string
Name string
Value string
Skills []FunctionShellToolEnvironmentContainerAutoSkillUnionOptional
One of the following:
type FunctionShellToolEnvironmentContainerAutoSkillSkillReference struct{…}
SkillID string
Type SkillReference
Version stringOptional
type FunctionShellToolEnvironmentContainerAutoSkillInlineSkill struct{…}
Description string
Name string
Source FunctionShellToolEnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

Data string
MediaType ApplicationZip
Type Base64
Type Inline
type LocalEnvironment struct{…}
Type Local
Skills []LocalEnvironmentSkillOptional
Description string
Name string
Path string
type ContainerReference struct{…}
ContainerID string
Type ContainerReference
type CustomTool struct{…}

A custom tool that processes input using a specified format.

Learn more about custom tools

Name string
Type Custom
Description stringOptional
Format CustomToolFormatUnionOptional

Unconstrained free-form text.

One of the following:
type CustomToolFormatText struct{…}

Unconstrained free-form text.

Type Text
type CustomToolFormatGrammar struct{…}

A grammar defined by the user.

Definition string
Syntax string
One of the following:
const CustomToolFormatGrammarSyntaxLark CustomToolFormatGrammarSyntax = "lark"
const CustomToolFormatGrammarSyntaxRegex CustomToolFormatGrammarSyntax = "regex"
Type Grammar
type WebSearchPreviewTool struct{…}

This tool searches the web for relevant results to use in a response.

Learn more about the web search tool.

Type WebSearchPreviewToolType
One of the following:
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview"
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
SearchContextSize WebSearchPreviewToolSearchContextSizeOptional
One of the following:
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low"
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium"
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
UserLocation WebSearchPreviewToolUserLocationOptional

The user’s location.

Type Approximate
City stringOptional
Country stringOptional
Region stringOptional
Timezone stringOptional
type ApplyPatchTool struct{…}

Allows the assistant to create, delete, or update files using unified diffs.

Type ApplyPatch
Background boolOptional
CompletedAt float64Optional
Conversation ConversationOptional

The conversation that this response belonged to.

Input items and output items from this response were automatically added to this conversation.

ID string
Error OpenAIResponseErrorOptional

An error object returned when the model fails to generate a Response.

Code OpenAIResponseErrorCode
One of the following:
const OpenAIResponseErrorCodeServerError OpenAIResponseErrorCode = "server_error"
const OpenAIResponseErrorCodeRateLimitExceeded OpenAIResponseErrorCode = "rate_limit_exceeded"
const OpenAIResponseErrorCodeInvalidPrompt OpenAIResponseErrorCode = "invalid_prompt"
const OpenAIResponseErrorCodeVectorStoreTimeout OpenAIResponseErrorCode = "vector_store_timeout"
const OpenAIResponseErrorCodeInvalidImage OpenAIResponseErrorCode = "invalid_image"
const OpenAIResponseErrorCodeInvalidImageFormat OpenAIResponseErrorCode = "invalid_image_format"
const OpenAIResponseErrorCodeInvalidBase64Image OpenAIResponseErrorCode = "invalid_base64_image"
const OpenAIResponseErrorCodeInvalidImageURL OpenAIResponseErrorCode = "invalid_image_url"
const OpenAIResponseErrorCodeImageTooLarge OpenAIResponseErrorCode = "image_too_large"
const OpenAIResponseErrorCodeImageTooSmall OpenAIResponseErrorCode = "image_too_small"
const OpenAIResponseErrorCodeImageParseError OpenAIResponseErrorCode = "image_parse_error"
const OpenAIResponseErrorCodeImageContentPolicyViolation OpenAIResponseErrorCode = "image_content_policy_violation"
const OpenAIResponseErrorCodeInvalidImageMode OpenAIResponseErrorCode = "invalid_image_mode"
const OpenAIResponseErrorCodeImageFileTooLarge OpenAIResponseErrorCode = "image_file_too_large"
const OpenAIResponseErrorCodeUnsupportedImageMediaType OpenAIResponseErrorCode = "unsupported_image_media_type"
const OpenAIResponseErrorCodeEmptyImageFile OpenAIResponseErrorCode = "empty_image_file"
const OpenAIResponseErrorCodeFailedToDownloadImage OpenAIResponseErrorCode = "failed_to_download_image"
const OpenAIResponseErrorCodeImageFileNotFound OpenAIResponseErrorCode = "image_file_not_found"
Message string
IncompleteDetails IncompleteDetailsOptional

Details about why the response is incomplete.

Reason IncompleteDetailsReasonOptional
One of the following:
const IncompleteDetailsReasonMaxOutputTokens IncompleteDetailsReason = "max_output_tokens"
const IncompleteDetailsReasonContentFilter IncompleteDetailsReason = "content_filter"
Instructions OpenAIResponseInstructionsUnionOptional
One of the following:
string
type OpenAIResponseInstructionsInputItems []OpenAIResponseInstructionsInputItemUnion
One of the following:
type EasyInputMessage struct{…}

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions.

Content EasyInputMessageContentUnion
One of the following:
string
type EasyInputMessageContentInputItems []EasyInputMessageContentInputItemUnion
One of the following:
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Role EasyInputMessageRole
One of the following:
const EasyInputMessageRoleUser EasyInputMessageRole = "user"
const EasyInputMessageRoleAssistant EasyInputMessageRole = "assistant"
const EasyInputMessageRoleSystem EasyInputMessageRole = "system"
const EasyInputMessageRoleDeveloper EasyInputMessageRole = "developer"
Phase EasyInputMessagePhaseOptional
One of the following:
const EasyInputMessagePhaseCommentary EasyInputMessagePhase = "commentary"
const EasyInputMessagePhaseFinalAnswer EasyInputMessagePhase = "final_answer"
Type EasyInputMessageTypeOptional
type OpenAITypesResponsesResponseInputItemMessage struct{…}

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role.

Content []OpenAITypesResponsesResponseInputItemMessageContentUnion
One of the following:
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Role OpenAITypesResponsesResponseInputItemMessageRole
One of the following:
const OpenAITypesResponsesResponseInputItemMessageRoleUser OpenAITypesResponsesResponseInputItemMessageRole = "user"
const OpenAITypesResponsesResponseInputItemMessageRoleSystem OpenAITypesResponsesResponseInputItemMessageRole = "system"
const OpenAITypesResponsesResponseInputItemMessageRoleDeveloper OpenAITypesResponsesResponseInputItemMessageRole = "developer"
Status OpenAITypesResponsesResponseInputItemMessageStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemMessageStatusInProgress OpenAITypesResponsesResponseInputItemMessageStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemMessageStatusCompleted OpenAITypesResponsesResponseInputItemMessageStatus = "completed"
const OpenAITypesResponsesResponseInputItemMessageStatusIncomplete OpenAITypesResponsesResponseInputItemMessageStatus = "incomplete"
Type OpenAITypesResponsesResponseInputItemMessageTypeOptional
type OpenAIResponseOutputMessage struct{…}

An output message from the model.

ID string
Content []OpenAIResponseOutputMessageContentUnion
One of the following:
type OpenAIResponseOutputText struct{…}

A text output from the model.

Annotations []OpenAIResponseOutputTextAnnotationUnion
One of the following:
type OpenAIResponseOutputTextAnnotationAnnotationFileCitation struct{…}

A citation to a file.

FileID string
Filename string
Index int64
Type FileCitation
type OpenAIResponseOutputTextAnnotationAnnotationURLCitation struct{…}

A citation for a web resource used to generate a model response.

EndIndex int64
StartIndex int64
Title string
Type URLCitation
URL string
type OpenAIResponseOutputTextAnnotationAnnotationContainerFileCitation struct{…}

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

ContainerID string
EndIndex int64
FileID string
Filename string
StartIndex int64
Type ContainerFileCitation
type OpenAIResponseOutputTextAnnotationAnnotationFilePath struct{…}

A path to a file.

FileID string
Index int64
Type FilePath
Text string
Type OutputText
Logprobs []OpenAIResponseOutputTextLogprobOptional
Token string
Bytes []int64
Logprob float64
TopLogprobs []OpenAIResponseOutputTextLogprobTopLogprob
Token string
Bytes []int64
Logprob float64
type OpenAIResponseOutputRefusal struct{…}

A refusal from the model.

Refusal string
Type Refusal
Role Assistant
Status OpenAIResponseOutputMessageStatus
One of the following:
const OpenAIResponseOutputMessageStatusInProgress OpenAIResponseOutputMessageStatus = "in_progress"
const OpenAIResponseOutputMessageStatusCompleted OpenAIResponseOutputMessageStatus = "completed"
const OpenAIResponseOutputMessageStatusIncomplete OpenAIResponseOutputMessageStatus = "incomplete"
Type Message
Phase OpenAIResponseOutputMessagePhaseOptional
One of the following:
const OpenAIResponseOutputMessagePhaseCommentary OpenAIResponseOutputMessagePhase = "commentary"
const OpenAIResponseOutputMessagePhaseFinalAnswer OpenAIResponseOutputMessagePhase = "final_answer"
type OpenAIResponseFileSearchToolCall struct{…}

The results of a file search tool call.

See the file search guide for more information.

ID string
Queries []string
Status OpenAIResponseFileSearchToolCallStatus
One of the following:
const OpenAIResponseFileSearchToolCallStatusInProgress OpenAIResponseFileSearchToolCallStatus = "in_progress"
const OpenAIResponseFileSearchToolCallStatusSearching OpenAIResponseFileSearchToolCallStatus = "searching"
const OpenAIResponseFileSearchToolCallStatusCompleted OpenAIResponseFileSearchToolCallStatus = "completed"
const OpenAIResponseFileSearchToolCallStatusIncomplete OpenAIResponseFileSearchToolCallStatus = "incomplete"
const OpenAIResponseFileSearchToolCallStatusFailed OpenAIResponseFileSearchToolCallStatus = "failed"
Type FileSearchCall
Results []OpenAIResponseFileSearchToolCallResultOptional
Attributes map[string, OpenAIResponseFileSearchToolCallResultAttributeUnion]Optional
One of the following:
string
float64
bool
FileID stringOptional
Filename stringOptional
Score float64Optional
Text stringOptional
type OpenAIResponseComputerToolCall struct{…}

A tool call to a computer use tool.

See the computer use guide for more information.

ID string
Action OpenAIResponseComputerToolCallActionUnion

A click action.

One of the following:
type OpenAIResponseComputerToolCallActionActionClick struct{…}

A click action.

Button string
One of the following:
const OpenAIResponseComputerToolCallActionActionClickButtonLeft OpenAIResponseComputerToolCallActionActionClickButton = "left"
const OpenAIResponseComputerToolCallActionActionClickButtonRight OpenAIResponseComputerToolCallActionActionClickButton = "right"
const OpenAIResponseComputerToolCallActionActionClickButtonWheel OpenAIResponseComputerToolCallActionActionClickButton = "wheel"
const OpenAIResponseComputerToolCallActionActionClickButtonBack OpenAIResponseComputerToolCallActionActionClickButton = "back"
const OpenAIResponseComputerToolCallActionActionClickButtonForward OpenAIResponseComputerToolCallActionActionClickButton = "forward"
Type Click
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionDoubleClick struct{…}

A double click action.

Type DoubleClick
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionDrag struct{…}

A drag action.

Path []OpenAIResponseComputerToolCallActionActionDragPath
X int64
Y int64
Type Drag
type OpenAIResponseComputerToolCallActionActionKeypress struct{…}

A collection of keypresses the model would like to perform.

Keys []string
Type Keypress
type OpenAIResponseComputerToolCallActionActionMove struct{…}

A mouse move action.

Type Move
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionScreenshot struct{…}

A screenshot action.

Type Screenshot
type OpenAIResponseComputerToolCallActionActionScroll struct{…}

A scroll action.

ScrollX int64
ScrollY int64
Type Scroll
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionType struct{…}

An action to type in text.

Text string
Type Type
type OpenAIResponseComputerToolCallActionActionWait struct{…}

A wait action.

Type Wait
CallID string
PendingSafetyChecks []OpenAIResponseComputerToolCallPendingSafetyCheck
ID string
Code stringOptional
Message stringOptional
Status OpenAIResponseComputerToolCallStatus
One of the following:
const OpenAIResponseComputerToolCallStatusInProgress OpenAIResponseComputerToolCallStatus = "in_progress"
const OpenAIResponseComputerToolCallStatusCompleted OpenAIResponseComputerToolCallStatus = "completed"
const OpenAIResponseComputerToolCallStatusIncomplete OpenAIResponseComputerToolCallStatus = "incomplete"
Type ComputerCall
type OpenAITypesResponsesResponseInputItemComputerCallOutput struct{…}

The output of a computer tool call.

CallID string

A computer screenshot image used with the computer use tool.

Type ComputerScreenshot
FileID stringOptional
ImageURL stringOptional
Type ComputerCallOutput
ID stringOptional
AcknowledgedSafetyChecks []OpenAITypesResponsesResponseInputItemComputerCallOutputAcknowledgedSafetyCheckOptional
ID string
Code stringOptional
Message stringOptional
Status OpenAITypesResponsesResponseInputItemComputerCallOutputStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemComputerCallOutputStatusInProgress OpenAITypesResponsesResponseInputItemComputerCallOutputStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemComputerCallOutputStatusCompleted OpenAITypesResponsesResponseInputItemComputerCallOutputStatus = "completed"
const OpenAITypesResponsesResponseInputItemComputerCallOutputStatusIncomplete OpenAITypesResponsesResponseInputItemComputerCallOutputStatus = "incomplete"
One of the following:
One of the following:
type OpenAIResponseFunctionToolCall struct{…}

A tool call to run a function.

See the function calling guide for more information.

Arguments string
CallID string
Name string
Type FunctionCall
ID stringOptional
Status OpenAIResponseFunctionToolCallStatusOptional
One of the following:
const OpenAIResponseFunctionToolCallStatusInProgress OpenAIResponseFunctionToolCallStatus = "in_progress"
const OpenAIResponseFunctionToolCallStatusCompleted OpenAIResponseFunctionToolCallStatus = "completed"
const OpenAIResponseFunctionToolCallStatusIncomplete OpenAIResponseFunctionToolCallStatus = "incomplete"
type OpenAITypesResponsesResponseInputItemFunctionCallOutput struct{…}

The output of a function tool call.

CallID string
Output OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputUnion
One of the following:
string
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentList []OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemUnion
One of the following:
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputTextContent struct{…}

A text input to the model.

Text string
Type InputText
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContent struct{…}

An image input to the model.

Learn about image inputs

Type InputImage
Detail stringOptional
One of the following:
const OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetailLow OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetail = "low"
const OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetailHigh OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetail = "high"
const OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetailAuto OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetail = "auto"
FileID stringOptional
ImageURL stringOptional
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputFileContent struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Type FunctionCallOutput
ID stringOptional
Status OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusInProgress OpenAITypesResponsesResponseInputItemFunctionCallOutputStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusCompleted OpenAITypesResponsesResponseInputItemFunctionCallOutputStatus = "completed"
const OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusIncomplete OpenAITypesResponsesResponseInputItemFunctionCallOutputStatus = "incomplete"
type OpenAIResponseReasoningItem struct{…}

A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your input to the Responses API for subsequent turns of a conversation if you are manually managing context.

ID string
Summary []OpenAIResponseReasoningItemSummary
Text string
Type SummaryText
Type Reasoning
Content []OpenAIResponseReasoningItemContentOptional
Text string
Type ReasoningText
EncryptedContent stringOptional
Status OpenAIResponseReasoningItemStatusOptional
One of the following:
const OpenAIResponseReasoningItemStatusInProgress OpenAIResponseReasoningItemStatus = "in_progress"
const OpenAIResponseReasoningItemStatusCompleted OpenAIResponseReasoningItemStatus = "completed"
const OpenAIResponseReasoningItemStatusIncomplete OpenAIResponseReasoningItemStatus = "incomplete"
type ResponseCompactionItemParamResp struct{…}

A compaction item generated by the v1/responses/compact API.

EncryptedContent string
Type Compaction
ID stringOptional
type OpenAITypesResponsesResponseInputItemImageGenerationCall struct{…}

An image generation request made by the model.

ID string
Status OpenAITypesResponsesResponseInputItemImageGenerationCallStatus
One of the following:
const OpenAITypesResponsesResponseInputItemImageGenerationCallStatusInProgress OpenAITypesResponsesResponseInputItemImageGenerationCallStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemImageGenerationCallStatusCompleted OpenAITypesResponsesResponseInputItemImageGenerationCallStatus = "completed"
const OpenAITypesResponsesResponseInputItemImageGenerationCallStatusGenerating OpenAITypesResponsesResponseInputItemImageGenerationCallStatus = "generating"
const OpenAITypesResponsesResponseInputItemImageGenerationCallStatusFailed OpenAITypesResponsesResponseInputItemImageGenerationCallStatus = "failed"
Type ImageGenerationCall
Result stringOptional
type OpenAIResponseCodeInterpreterToolCall struct{…}

A tool call to run code.

ID string
ContainerID string
Status OpenAIResponseCodeInterpreterToolCallStatus
One of the following:
const OpenAIResponseCodeInterpreterToolCallStatusInProgress OpenAIResponseCodeInterpreterToolCallStatus = "in_progress"
const OpenAIResponseCodeInterpreterToolCallStatusCompleted OpenAIResponseCodeInterpreterToolCallStatus = "completed"
const OpenAIResponseCodeInterpreterToolCallStatusIncomplete OpenAIResponseCodeInterpreterToolCallStatus = "incomplete"
const OpenAIResponseCodeInterpreterToolCallStatusInterpreting OpenAIResponseCodeInterpreterToolCallStatus = "interpreting"
const OpenAIResponseCodeInterpreterToolCallStatusFailed OpenAIResponseCodeInterpreterToolCallStatus = "failed"
Type CodeInterpreterCall
Code stringOptional
Outputs []OpenAIResponseCodeInterpreterToolCallOutputUnionOptional
One of the following:
type OpenAIResponseCodeInterpreterToolCallOutputOutputLogs struct{…}

The logs output from the code interpreter.

Logs string
Type Logs
type OpenAIResponseCodeInterpreterToolCallOutputOutputImage struct{…}

The image output from the code interpreter.

Type Image
URL string
type OpenAITypesResponsesResponseInputItemLocalShellCall struct{…}

A tool call to run a command on the local shell.

ID string
Action OpenAITypesResponsesResponseInputItemLocalShellCallAction

Execute a shell command on the server.

Command []string
Env map[string, string]
Type Exec
TimeoutMs int64Optional
User stringOptional
WorkingDirectory stringOptional
CallID string
Status OpenAITypesResponsesResponseInputItemLocalShellCallStatus
One of the following:
const OpenAITypesResponsesResponseInputItemLocalShellCallStatusInProgress OpenAITypesResponsesResponseInputItemLocalShellCallStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemLocalShellCallStatusCompleted OpenAITypesResponsesResponseInputItemLocalShellCallStatus = "completed"
const OpenAITypesResponsesResponseInputItemLocalShellCallStatusIncomplete OpenAITypesResponsesResponseInputItemLocalShellCallStatus = "incomplete"
Type LocalShellCall
type OpenAITypesResponsesResponseInputItemLocalShellCallOutput struct{…}

The output of a local shell tool call.

ID string
Output string
Type LocalShellCallOutput
Status OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusInProgress OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusCompleted OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatus = "completed"
const OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusIncomplete OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatus = "incomplete"
type ShellCall struct{…}

A tool representing a request to execute one or more shell commands.

Action ShellCallAction

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

Commands []string
MaxOutputLength int64Optional
TimeoutMs int64Optional
CallID string
Type ShellCall
ID stringOptional
Environment ShellCallEnvironmentUnionOptional
One of the following:
type LocalEnvironment struct{…}
Type Local
Skills []LocalEnvironmentSkillOptional
Description string
Name string
Path string
type ContainerReference struct{…}
ContainerID string
Type ContainerReference
Status ShellCallStatusOptional
One of the following:
const ShellCallStatusInProgress ShellCallStatus = "in_progress"
const ShellCallStatusCompleted ShellCallStatus = "completed"
const ShellCallStatusIncomplete ShellCallStatus = "incomplete"
type ShellCallOutput struct{…}

The streamed output items emitted by a shell tool call.

CallID string
Output []ShellCallOutputOutput
Outcome ShellCallOutputOutputOutcomeUnion

Indicates that the shell call exceeded its configured time limit.

One of the following:
type ShellCallOutputOutputOutcomeOutcomeTimeout struct{…}

Indicates that the shell call exceeded its configured time limit.

Type Timeout
type ShellCallOutputOutputOutcomeOutcomeExit struct{…}

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

ExitCode int64
Type Exit
Stderr string
Stdout string
Type ShellCallOutput
ID stringOptional
MaxOutputLength int64Optional
Status ShellCallOutputStatusOptional
One of the following:
const ShellCallOutputStatusInProgress ShellCallOutputStatus = "in_progress"
const ShellCallOutputStatusCompleted ShellCallOutputStatus = "completed"
const ShellCallOutputStatusIncomplete ShellCallOutputStatus = "incomplete"
type ApplyPatchCall struct{…}

A tool call representing a request to create, delete, or update files using diff patches.

CallID string
Operation ApplyPatchCallOperationUnion

Instruction for creating a new file via the apply_patch tool.

One of the following:
type ApplyPatchCallOperationApplyPatchCallOperationCreateFile struct{…}

Instruction for creating a new file via the apply_patch tool.

Diff string
Path string
Type CreateFile
type ApplyPatchCallOperationApplyPatchCallOperationDeleteFile struct{…}

Instruction for deleting an existing file via the apply_patch tool.

Path string
Type DeleteFile
type ApplyPatchCallOperationApplyPatchCallOperationUpdateFile struct{…}

Instruction for updating an existing file via the apply_patch tool.

Diff string
Path string
Type UpdateFile
Status ApplyPatchCallStatus
One of the following:
const ApplyPatchCallStatusInProgress ApplyPatchCallStatus = "in_progress"
const ApplyPatchCallStatusCompleted ApplyPatchCallStatus = "completed"
Type ApplyPatchCall
ID stringOptional
type ApplyPatchCallOutput struct{…}

The streamed output emitted by an apply patch tool call.

CallID string
Status ApplyPatchCallOutputStatus
One of the following:
const ApplyPatchCallOutputStatusCompleted ApplyPatchCallOutputStatus = "completed"
const ApplyPatchCallOutputStatusFailed ApplyPatchCallOutputStatus = "failed"
Type ApplyPatchCallOutput
ID stringOptional
Output stringOptional
type OpenAITypesResponsesResponseInputItemMcpListTools struct{…}

A list of tools available on an MCP server.

ID string
ServerLabel string
Tools []OpenAITypesResponsesResponseInputItemMcpListToolsTool
InputSchema any
Name string
Annotations anyOptional
Description stringOptional
Type McpListTools
Error stringOptional
type McpApprovalRequest struct{…}

A request for human approval of a tool invocation.

ID string
Arguments string
Name string
ServerLabel string
Type McpApprovalRequest
type OpenAITypesResponsesResponseInputItemMcpApprovalResponse struct{…}

A response to an MCP approval request.

ApprovalRequestID string
Approve bool
Type McpApprovalResponse
ID stringOptional
Reason stringOptional
type OpenAITypesResponsesResponseInputItemMcpCall struct{…}

An invocation of a tool on an MCP server.

ID string
Arguments string
Name string
ServerLabel string
Type McpCall
ApprovalRequestID stringOptional
Error stringOptional
Output stringOptional
Status OpenAITypesResponsesResponseInputItemMcpCallStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemMcpCallStatusInProgress OpenAITypesResponsesResponseInputItemMcpCallStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemMcpCallStatusCompleted OpenAITypesResponsesResponseInputItemMcpCallStatus = "completed"
const OpenAITypesResponsesResponseInputItemMcpCallStatusIncomplete OpenAITypesResponsesResponseInputItemMcpCallStatus = "incomplete"
const OpenAITypesResponsesResponseInputItemMcpCallStatusCalling OpenAITypesResponsesResponseInputItemMcpCallStatus = "calling"
const OpenAITypesResponsesResponseInputItemMcpCallStatusFailed OpenAITypesResponsesResponseInputItemMcpCallStatus = "failed"
type OpenAIResponseCustomToolCallOutput struct{…}

The output of a custom tool call from your code, being sent back to the model.

CallID string
Output OpenAIResponseCustomToolCallOutputOutputUnion
One of the following:
string
type OpenAIResponseCustomToolCallOutputOutputOutputContentList []OpenAIResponseCustomToolCallOutputOutputOutputContentListItemUnion
One of the following:
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Type CustomToolCallOutput
ID stringOptional
type OpenAIResponseCustomToolCall struct{…}

A call to a custom tool created by the model.

CallID string
Input string
Name string
Type CustomToolCall
ID stringOptional
type OpenAITypesResponsesResponseInputItemItemReference struct{…}

An internal identifier for an item to reference.

ID string
Type OpenAITypesResponsesResponseInputItemItemReferenceTypeOptional
MaxOutputTokens int64Optional
MaxToolCalls int64Optional
Metadata map[string, string]Optional
PreviousResponseID stringOptional
Prompt OpenAIResponsePromptOptional

Reference to a prompt template and its variables. Learn more.

ID string
Variables map[string, OpenAIResponsePromptVariableUnion]Optional
One of the following:
string
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Version stringOptional
PromptCacheKey stringOptional
PromptCacheRetention OpenAIResponsePromptCacheRetentionOptional
One of the following:
const OpenAIResponsePromptCacheRetentionInMemory OpenAIResponsePromptCacheRetention = "in-memory"
const OpenAIResponsePromptCacheRetention24h OpenAIResponsePromptCacheRetention = "24h"
Reasoning ReasoningOptional

gpt-5 and o-series models only

Configuration options for reasoning models.

Effort ReasoningEffortOptional
One of the following:
const ReasoningEffortNone ReasoningEffort = "none"
const ReasoningEffortMinimal ReasoningEffort = "minimal"
const ReasoningEffortLow ReasoningEffort = "low"
const ReasoningEffortMedium ReasoningEffort = "medium"
const ReasoningEffortHigh ReasoningEffort = "high"
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
GenerateSummary ReasoningGenerateSummaryOptional
One of the following:
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto"
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise"
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
Summary ReasoningSummaryOptional
One of the following:
const ReasoningSummaryAuto ReasoningSummary = "auto"
const ReasoningSummaryConcise ReasoningSummary = "concise"
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
SafetyIdentifier stringOptional
ServiceTier OpenAIResponseServiceTierOptional
One of the following:
const OpenAIResponseServiceTierAuto OpenAIResponseServiceTier = "auto"
const OpenAIResponseServiceTierDefault OpenAIResponseServiceTier = "default"
const OpenAIResponseServiceTierFlex OpenAIResponseServiceTier = "flex"
const OpenAIResponseServiceTierScale OpenAIResponseServiceTier = "scale"
const OpenAIResponseServiceTierPriority OpenAIResponseServiceTier = "priority"
Status OpenAIResponseStatusOptional
One of the following:
const OpenAIResponseStatusCompleted OpenAIResponseStatus = "completed"
const OpenAIResponseStatusFailed OpenAIResponseStatus = "failed"
const OpenAIResponseStatusInProgress OpenAIResponseStatus = "in_progress"
const OpenAIResponseStatusCancelled OpenAIResponseStatus = "cancelled"
const OpenAIResponseStatusQueued OpenAIResponseStatus = "queued"
const OpenAIResponseStatusIncomplete OpenAIResponseStatus = "incomplete"
Temperature float64Optional

Configuration options for a text response from the model.

Can be plain text or structured JSON data. Learn more:

Format OpenAIResponseTextConfigFormatUnionOptional

Default response format. Used to generate text responses.

One of the following:
type OpenAIResponseTextConfigFormatResponseFormatText struct{…}

Default response format. Used to generate text responses.

Type Text
type OpenAIResponseTextConfigFormatResponseFormatTextJsonSchemaConfig struct{…}

JSON Schema response format.

Used to generate structured JSON responses. Learn more about Structured Outputs.

Name string
Schema map[string, any]
Type JsonSchema
Description stringOptional
Strict boolOptional
type OpenAIResponseTextConfigFormatResponseFormatJsonObject struct{…}

JSON object response format.

An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.

Type JsonObject
Verbosity OpenAIResponseTextConfigVerbosityOptional
One of the following:
const OpenAIResponseTextConfigVerbosityLow OpenAIResponseTextConfigVerbosity = "low"
const OpenAIResponseTextConfigVerbosityMedium OpenAIResponseTextConfigVerbosity = "medium"
const OpenAIResponseTextConfigVerbosityHigh OpenAIResponseTextConfigVerbosity = "high"
TopLogprobs int64Optional
TopP float64Optional
Truncation OpenAIResponseTruncationOptional
One of the following:
const OpenAIResponseTruncationAuto OpenAIResponseTruncation = "auto"
const OpenAIResponseTruncationDisabled OpenAIResponseTruncation = "disabled"
Usage OpenAIResponseUsageOptional

Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.

InputTokens int64
InputTokensDetails OpenAIResponseUsageInputTokensDetails

A detailed breakdown of the input tokens.

CachedTokens int64
OutputTokens int64
OutputTokensDetails OpenAIResponseUsageOutputTokensDetails

A detailed breakdown of the output tokens.

ReasoningTokens int64
TotalTokens int64
User stringOptional
type OpenAIResponseCodeInterpreterToolCall struct{…}

A tool call to run code.

ID string
ContainerID string
Status OpenAIResponseCodeInterpreterToolCallStatus
One of the following:
const OpenAIResponseCodeInterpreterToolCallStatusInProgress OpenAIResponseCodeInterpreterToolCallStatus = "in_progress"
const OpenAIResponseCodeInterpreterToolCallStatusCompleted OpenAIResponseCodeInterpreterToolCallStatus = "completed"
const OpenAIResponseCodeInterpreterToolCallStatusIncomplete OpenAIResponseCodeInterpreterToolCallStatus = "incomplete"
const OpenAIResponseCodeInterpreterToolCallStatusInterpreting OpenAIResponseCodeInterpreterToolCallStatus = "interpreting"
const OpenAIResponseCodeInterpreterToolCallStatusFailed OpenAIResponseCodeInterpreterToolCallStatus = "failed"
Type CodeInterpreterCall
Code stringOptional
Outputs []OpenAIResponseCodeInterpreterToolCallOutputUnionOptional
One of the following:
type OpenAIResponseCodeInterpreterToolCallOutputOutputLogs struct{…}

The logs output from the code interpreter.

Logs string
Type Logs
type OpenAIResponseCodeInterpreterToolCallOutputOutputImage struct{…}

The image output from the code interpreter.

Type Image
URL string
type OpenAIResponseComputerToolCall struct{…}

A tool call to a computer use tool.

See the computer use guide for more information.

ID string
Action OpenAIResponseComputerToolCallActionUnion

A click action.

One of the following:
type OpenAIResponseComputerToolCallActionActionClick struct{…}

A click action.

Button string
One of the following:
const OpenAIResponseComputerToolCallActionActionClickButtonLeft OpenAIResponseComputerToolCallActionActionClickButton = "left"
const OpenAIResponseComputerToolCallActionActionClickButtonRight OpenAIResponseComputerToolCallActionActionClickButton = "right"
const OpenAIResponseComputerToolCallActionActionClickButtonWheel OpenAIResponseComputerToolCallActionActionClickButton = "wheel"
const OpenAIResponseComputerToolCallActionActionClickButtonBack OpenAIResponseComputerToolCallActionActionClickButton = "back"
const OpenAIResponseComputerToolCallActionActionClickButtonForward OpenAIResponseComputerToolCallActionActionClickButton = "forward"
Type Click
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionDoubleClick struct{…}

A double click action.

Type DoubleClick
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionDrag struct{…}

A drag action.

Path []OpenAIResponseComputerToolCallActionActionDragPath
X int64
Y int64
Type Drag
type OpenAIResponseComputerToolCallActionActionKeypress struct{…}

A collection of keypresses the model would like to perform.

Keys []string
Type Keypress
type OpenAIResponseComputerToolCallActionActionMove struct{…}

A mouse move action.

Type Move
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionScreenshot struct{…}

A screenshot action.

Type Screenshot
type OpenAIResponseComputerToolCallActionActionScroll struct{…}

A scroll action.

ScrollX int64
ScrollY int64
Type Scroll
X int64
Y int64
type OpenAIResponseComputerToolCallActionActionType struct{…}

An action to type in text.

Text string
Type Type
type OpenAIResponseComputerToolCallActionActionWait struct{…}

A wait action.

Type Wait
CallID string
PendingSafetyChecks []OpenAIResponseComputerToolCallPendingSafetyCheck
ID string
Code stringOptional
Message stringOptional
Status OpenAIResponseComputerToolCallStatus
One of the following:
const OpenAIResponseComputerToolCallStatusInProgress OpenAIResponseComputerToolCallStatus = "in_progress"
const OpenAIResponseComputerToolCallStatusCompleted OpenAIResponseComputerToolCallStatus = "completed"
const OpenAIResponseComputerToolCallStatusIncomplete OpenAIResponseComputerToolCallStatus = "incomplete"
Type ComputerCall
type OpenAIResponseCustomToolCall struct{…}

A call to a custom tool created by the model.

CallID string
Input string
Name string
Type CustomToolCall
ID stringOptional
type OpenAIResponseCustomToolCallOutput struct{…}

The output of a custom tool call from your code, being sent back to the model.

CallID string
Output OpenAIResponseCustomToolCallOutputOutputUnion
One of the following:
string
type OpenAIResponseCustomToolCallOutputOutputOutputContentList []OpenAIResponseCustomToolCallOutputOutputOutputContentListItemUnion
One of the following:
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Type CustomToolCallOutput
ID stringOptional
type OpenAIResponseError struct{…}

An error object returned when the model fails to generate a Response.

Code OpenAIResponseErrorCode
One of the following:
const OpenAIResponseErrorCodeServerError OpenAIResponseErrorCode = "server_error"
const OpenAIResponseErrorCodeRateLimitExceeded OpenAIResponseErrorCode = "rate_limit_exceeded"
const OpenAIResponseErrorCodeInvalidPrompt OpenAIResponseErrorCode = "invalid_prompt"
const OpenAIResponseErrorCodeVectorStoreTimeout OpenAIResponseErrorCode = "vector_store_timeout"
const OpenAIResponseErrorCodeInvalidImage OpenAIResponseErrorCode = "invalid_image"
const OpenAIResponseErrorCodeInvalidImageFormat OpenAIResponseErrorCode = "invalid_image_format"
const OpenAIResponseErrorCodeInvalidBase64Image OpenAIResponseErrorCode = "invalid_base64_image"
const OpenAIResponseErrorCodeInvalidImageURL OpenAIResponseErrorCode = "invalid_image_url"
const OpenAIResponseErrorCodeImageTooLarge OpenAIResponseErrorCode = "image_too_large"
const OpenAIResponseErrorCodeImageTooSmall OpenAIResponseErrorCode = "image_too_small"
const OpenAIResponseErrorCodeImageParseError OpenAIResponseErrorCode = "image_parse_error"
const OpenAIResponseErrorCodeImageContentPolicyViolation OpenAIResponseErrorCode = "image_content_policy_violation"
const OpenAIResponseErrorCodeInvalidImageMode OpenAIResponseErrorCode = "invalid_image_mode"
const OpenAIResponseErrorCodeImageFileTooLarge OpenAIResponseErrorCode = "image_file_too_large"
const OpenAIResponseErrorCodeUnsupportedImageMediaType OpenAIResponseErrorCode = "unsupported_image_media_type"
const OpenAIResponseErrorCodeEmptyImageFile OpenAIResponseErrorCode = "empty_image_file"
const OpenAIResponseErrorCodeFailedToDownloadImage OpenAIResponseErrorCode = "failed_to_download_image"
const OpenAIResponseErrorCodeImageFileNotFound OpenAIResponseErrorCode = "image_file_not_found"
Message string
type OpenAIResponseFileSearchToolCall struct{…}

The results of a file search tool call.

See the file search guide for more information.

ID string
Queries []string
Status OpenAIResponseFileSearchToolCallStatus
One of the following:
const OpenAIResponseFileSearchToolCallStatusInProgress OpenAIResponseFileSearchToolCallStatus = "in_progress"
const OpenAIResponseFileSearchToolCallStatusSearching OpenAIResponseFileSearchToolCallStatus = "searching"
const OpenAIResponseFileSearchToolCallStatusCompleted OpenAIResponseFileSearchToolCallStatus = "completed"
const OpenAIResponseFileSearchToolCallStatusIncomplete OpenAIResponseFileSearchToolCallStatus = "incomplete"
const OpenAIResponseFileSearchToolCallStatusFailed OpenAIResponseFileSearchToolCallStatus = "failed"
Type FileSearchCall
Results []OpenAIResponseFileSearchToolCallResultOptional
Attributes map[string, OpenAIResponseFileSearchToolCallResultAttributeUnion]Optional
One of the following:
string
float64
bool
FileID stringOptional
Filename stringOptional
Score float64Optional
Text stringOptional
type OpenAIResponseFunctionToolCall struct{…}

A tool call to run a function.

See the function calling guide for more information.

Arguments string
CallID string
Name string
Type FunctionCall
ID stringOptional
Status OpenAIResponseFunctionToolCallStatusOptional
One of the following:
const OpenAIResponseFunctionToolCallStatusInProgress OpenAIResponseFunctionToolCallStatus = "in_progress"
const OpenAIResponseFunctionToolCallStatusCompleted OpenAIResponseFunctionToolCallStatus = "completed"
const OpenAIResponseFunctionToolCallStatusIncomplete OpenAIResponseFunctionToolCallStatus = "incomplete"
One of the following:
One of the following:
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
type OpenAIResponseInputFileParamResp struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputImageParamResp struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageParamDetail
One of the following:
const OpenAIResponseInputImageParamDetailLow OpenAIResponseInputImageParamDetail = "low"
const OpenAIResponseInputImageParamDetailHigh OpenAIResponseInputImageParamDetail = "high"
const OpenAIResponseInputImageParamDetailAuto OpenAIResponseInputImageParamDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputTextParamResp struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseOutputMessage struct{…}

An output message from the model.

ID string
Content []OpenAIResponseOutputMessageContentUnion
One of the following:
type OpenAIResponseOutputText struct{…}

A text output from the model.

Annotations []OpenAIResponseOutputTextAnnotationUnion
One of the following:
type OpenAIResponseOutputTextAnnotationAnnotationFileCitation struct{…}

A citation to a file.

FileID string
Filename string
Index int64
Type FileCitation
type OpenAIResponseOutputTextAnnotationAnnotationURLCitation struct{…}

A citation for a web resource used to generate a model response.

EndIndex int64
StartIndex int64
Title string
Type URLCitation
URL string
type OpenAIResponseOutputTextAnnotationAnnotationContainerFileCitation struct{…}

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

ContainerID string
EndIndex int64
FileID string
Filename string
StartIndex int64
Type ContainerFileCitation
type OpenAIResponseOutputTextAnnotationAnnotationFilePath struct{…}

A path to a file.

FileID string
Index int64
Type FilePath
Text string
Type OutputText
Logprobs []OpenAIResponseOutputTextLogprobOptional
Token string
Bytes []int64
Logprob float64
TopLogprobs []OpenAIResponseOutputTextLogprobTopLogprob
Token string
Bytes []int64
Logprob float64
type OpenAIResponseOutputRefusal struct{…}

A refusal from the model.

Refusal string
Type Refusal
Role Assistant
Status OpenAIResponseOutputMessageStatus
One of the following:
const OpenAIResponseOutputMessageStatusInProgress OpenAIResponseOutputMessageStatus = "in_progress"
const OpenAIResponseOutputMessageStatusCompleted OpenAIResponseOutputMessageStatus = "completed"
const OpenAIResponseOutputMessageStatusIncomplete OpenAIResponseOutputMessageStatus = "incomplete"
Type Message
Phase OpenAIResponseOutputMessagePhaseOptional
One of the following:
const OpenAIResponseOutputMessagePhaseCommentary OpenAIResponseOutputMessagePhase = "commentary"
const OpenAIResponseOutputMessagePhaseFinalAnswer OpenAIResponseOutputMessagePhase = "final_answer"
type OpenAIResponseOutputRefusal struct{…}

A refusal from the model.

Refusal string
Type Refusal
type OpenAIResponseOutputText struct{…}

A text output from the model.

Annotations []OpenAIResponseOutputTextAnnotationUnion
One of the following:
type OpenAIResponseOutputTextAnnotationAnnotationFileCitation struct{…}

A citation to a file.

FileID string
Filename string
Index int64
Type FileCitation
type OpenAIResponseOutputTextAnnotationAnnotationURLCitation struct{…}

A citation for a web resource used to generate a model response.

EndIndex int64
StartIndex int64
Title string
Type URLCitation
URL string
type OpenAIResponseOutputTextAnnotationAnnotationContainerFileCitation struct{…}

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

ContainerID string
EndIndex int64
FileID string
Filename string
StartIndex int64
Type ContainerFileCitation
type OpenAIResponseOutputTextAnnotationAnnotationFilePath struct{…}

A path to a file.

FileID string
Index int64
Type FilePath
Text string
Type OutputText
Logprobs []OpenAIResponseOutputTextLogprobOptional
Token string
Bytes []int64
Logprob float64
TopLogprobs []OpenAIResponseOutputTextLogprobTopLogprob
Token string
Bytes []int64
Logprob float64
type OpenAIResponsePrompt struct{…}

Reference to a prompt template and its variables. Learn more.

ID string
Variables map[string, OpenAIResponsePromptVariableUnion]Optional
One of the following:
string
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Version stringOptional
type OpenAIResponseReasoningItem struct{…}

A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your input to the Responses API for subsequent turns of a conversation if you are manually managing context.

ID string
Summary []OpenAIResponseReasoningItemSummary
Text string
Type SummaryText
Type Reasoning
Content []OpenAIResponseReasoningItemContentOptional
Text string
Type ReasoningText
EncryptedContent stringOptional
Status OpenAIResponseReasoningItemStatusOptional
One of the following:
const OpenAIResponseReasoningItemStatusInProgress OpenAIResponseReasoningItemStatus = "in_progress"
const OpenAIResponseReasoningItemStatusCompleted OpenAIResponseReasoningItemStatus = "completed"
const OpenAIResponseReasoningItemStatusIncomplete OpenAIResponseReasoningItemStatus = "incomplete"
type OpenAIResponseTextConfig struct{…}

Configuration options for a text response from the model.

Can be plain text or structured JSON data. Learn more:

Format OpenAIResponseTextConfigFormatUnionOptional

Default response format. Used to generate text responses.

One of the following:
type OpenAIResponseTextConfigFormatResponseFormatText struct{…}

Default response format. Used to generate text responses.

Type Text
type OpenAIResponseTextConfigFormatResponseFormatTextJsonSchemaConfig struct{…}

JSON Schema response format.

Used to generate structured JSON responses. Learn more about Structured Outputs.

Name string
Schema map[string, any]
Type JsonSchema
Description stringOptional
Strict boolOptional
type OpenAIResponseTextConfigFormatResponseFormatJsonObject struct{…}

JSON object response format.

An older method of generating JSON responses. Using json_schema is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.

Type JsonObject
Verbosity OpenAIResponseTextConfigVerbosityOptional
One of the following:
const OpenAIResponseTextConfigVerbosityLow OpenAIResponseTextConfigVerbosity = "low"
const OpenAIResponseTextConfigVerbosityMedium OpenAIResponseTextConfigVerbosity = "medium"
const OpenAIResponseTextConfigVerbosityHigh OpenAIResponseTextConfigVerbosity = "high"
type OpenAIResponseUsage struct{…}

Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.

InputTokens int64
InputTokensDetails OpenAIResponseUsageInputTokensDetails

A detailed breakdown of the input tokens.

CachedTokens int64
OutputTokens int64
OutputTokensDetails OpenAIResponseUsageOutputTokensDetails

A detailed breakdown of the output tokens.

ReasoningTokens int64
TotalTokens int64
type OpenAITypesResponsesResponseInputItemComputerCallOutput struct{…}

The output of a computer tool call.

CallID string

A computer screenshot image used with the computer use tool.

Type ComputerScreenshot
FileID stringOptional
ImageURL stringOptional
Type ComputerCallOutput
ID stringOptional
AcknowledgedSafetyChecks []OpenAITypesResponsesResponseInputItemComputerCallOutputAcknowledgedSafetyCheckOptional
ID string
Code stringOptional
Message stringOptional
Status OpenAITypesResponsesResponseInputItemComputerCallOutputStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemComputerCallOutputStatusInProgress OpenAITypesResponsesResponseInputItemComputerCallOutputStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemComputerCallOutputStatusCompleted OpenAITypesResponsesResponseInputItemComputerCallOutputStatus = "completed"
const OpenAITypesResponsesResponseInputItemComputerCallOutputStatusIncomplete OpenAITypesResponsesResponseInputItemComputerCallOutputStatus = "incomplete"
type OpenAITypesResponsesResponseInputItemFunctionCallOutput struct{…}

The output of a function tool call.

CallID string
Output OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputUnion
One of the following:
string
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentList []OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemUnion
One of the following:
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputTextContent struct{…}

A text input to the model.

Text string
Type InputText
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContent struct{…}

An image input to the model.

Learn about image inputs

Type InputImage
Detail stringOptional
One of the following:
const OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetailLow OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetail = "low"
const OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetailHigh OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetail = "high"
const OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetailAuto OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputImageContentDetail = "auto"
FileID stringOptional
ImageURL stringOptional
type OpenAITypesResponsesResponseInputItemFunctionCallOutputOutputOutputContentListItemResponseInputFileContent struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Type FunctionCallOutput
ID stringOptional
Status OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusInProgress OpenAITypesResponsesResponseInputItemFunctionCallOutputStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusCompleted OpenAITypesResponsesResponseInputItemFunctionCallOutputStatus = "completed"
const OpenAITypesResponsesResponseInputItemFunctionCallOutputStatusIncomplete OpenAITypesResponsesResponseInputItemFunctionCallOutputStatus = "incomplete"
type OpenAITypesResponsesResponseInputItemImageGenerationCall struct{…}

An image generation request made by the model.

ID string
Status OpenAITypesResponsesResponseInputItemImageGenerationCallStatus
One of the following:
const OpenAITypesResponsesResponseInputItemImageGenerationCallStatusInProgress OpenAITypesResponsesResponseInputItemImageGenerationCallStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemImageGenerationCallStatusCompleted OpenAITypesResponsesResponseInputItemImageGenerationCallStatus = "completed"
const OpenAITypesResponsesResponseInputItemImageGenerationCallStatusGenerating OpenAITypesResponsesResponseInputItemImageGenerationCallStatus = "generating"
const OpenAITypesResponsesResponseInputItemImageGenerationCallStatusFailed OpenAITypesResponsesResponseInputItemImageGenerationCallStatus = "failed"
Type ImageGenerationCall
Result stringOptional
type OpenAITypesResponsesResponseInputItemItemReference struct{…}

An internal identifier for an item to reference.

ID string
Type OpenAITypesResponsesResponseInputItemItemReferenceTypeOptional
type OpenAITypesResponsesResponseInputItemLocalShellCall struct{…}

A tool call to run a command on the local shell.

ID string
Action OpenAITypesResponsesResponseInputItemLocalShellCallAction

Execute a shell command on the server.

Command []string
Env map[string, string]
Type Exec
TimeoutMs int64Optional
User stringOptional
WorkingDirectory stringOptional
CallID string
Status OpenAITypesResponsesResponseInputItemLocalShellCallStatus
One of the following:
const OpenAITypesResponsesResponseInputItemLocalShellCallStatusInProgress OpenAITypesResponsesResponseInputItemLocalShellCallStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemLocalShellCallStatusCompleted OpenAITypesResponsesResponseInputItemLocalShellCallStatus = "completed"
const OpenAITypesResponsesResponseInputItemLocalShellCallStatusIncomplete OpenAITypesResponsesResponseInputItemLocalShellCallStatus = "incomplete"
Type LocalShellCall
type OpenAITypesResponsesResponseInputItemLocalShellCallOutput struct{…}

The output of a local shell tool call.

ID string
Output string
Type LocalShellCallOutput
Status OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusInProgress OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusCompleted OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatus = "completed"
const OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatusIncomplete OpenAITypesResponsesResponseInputItemLocalShellCallOutputStatus = "incomplete"
type OpenAITypesResponsesResponseInputItemMcpApprovalResponse struct{…}

A response to an MCP approval request.

ApprovalRequestID string
Approve bool
Type McpApprovalResponse
ID stringOptional
Reason stringOptional
type OpenAITypesResponsesResponseInputItemMcpCall struct{…}

An invocation of a tool on an MCP server.

ID string
Arguments string
Name string
ServerLabel string
Type McpCall
ApprovalRequestID stringOptional
Error stringOptional
Output stringOptional
Status OpenAITypesResponsesResponseInputItemMcpCallStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemMcpCallStatusInProgress OpenAITypesResponsesResponseInputItemMcpCallStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemMcpCallStatusCompleted OpenAITypesResponsesResponseInputItemMcpCallStatus = "completed"
const OpenAITypesResponsesResponseInputItemMcpCallStatusIncomplete OpenAITypesResponsesResponseInputItemMcpCallStatus = "incomplete"
const OpenAITypesResponsesResponseInputItemMcpCallStatusCalling OpenAITypesResponsesResponseInputItemMcpCallStatus = "calling"
const OpenAITypesResponsesResponseInputItemMcpCallStatusFailed OpenAITypesResponsesResponseInputItemMcpCallStatus = "failed"
type OpenAITypesResponsesResponseInputItemMcpListTools struct{…}

A list of tools available on an MCP server.

ID string
ServerLabel string
Tools []OpenAITypesResponsesResponseInputItemMcpListToolsTool
InputSchema any
Name string
Annotations anyOptional
Description stringOptional
Type McpListTools
Error stringOptional
type OpenAITypesResponsesResponseInputItemMessage struct{…}

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role.

Content []OpenAITypesResponsesResponseInputItemMessageContentUnion
One of the following:
type OpenAIResponseInputText struct{…}

A text input to the model.

Text string
Type InputText
type OpenAIResponseInputImage struct{…}

An image input to the model.

Learn about image inputs.

Detail OpenAIResponseInputImageDetail
One of the following:
const OpenAIResponseInputImageDetailLow OpenAIResponseInputImageDetail = "low"
const OpenAIResponseInputImageDetailHigh OpenAIResponseInputImageDetail = "high"
const OpenAIResponseInputImageDetailAuto OpenAIResponseInputImageDetail = "auto"
Type InputImage
FileID stringOptional
ImageURL stringOptional
type OpenAIResponseInputFile struct{…}

A file input to the model.

Type InputFile
FileData stringOptional
FileID stringOptional
FileURL stringOptional
Filename stringOptional
Role OpenAITypesResponsesResponseInputItemMessageRole
One of the following:
const OpenAITypesResponsesResponseInputItemMessageRoleUser OpenAITypesResponsesResponseInputItemMessageRole = "user"
const OpenAITypesResponsesResponseInputItemMessageRoleSystem OpenAITypesResponsesResponseInputItemMessageRole = "system"
const OpenAITypesResponsesResponseInputItemMessageRoleDeveloper OpenAITypesResponsesResponseInputItemMessageRole = "developer"
Status OpenAITypesResponsesResponseInputItemMessageStatusOptional
One of the following:
const OpenAITypesResponsesResponseInputItemMessageStatusInProgress OpenAITypesResponsesResponseInputItemMessageStatus = "in_progress"
const OpenAITypesResponsesResponseInputItemMessageStatusCompleted OpenAITypesResponsesResponseInputItemMessageStatus = "completed"
const OpenAITypesResponsesResponseInputItemMessageStatusIncomplete OpenAITypesResponsesResponseInputItemMessageStatus = "incomplete"
Type OpenAITypesResponsesResponseInputItemMessageTypeOptional
type OpenAITypesResponsesResponseOutputItemImageGenerationCall struct{…}

An image generation request made by the model.

ID string
Status OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus
One of the following:
const OpenAITypesResponsesResponseOutputItemImageGenerationCallStatusInProgress OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus = "in_progress"
const OpenAITypesResponsesResponseOutputItemImageGenerationCallStatusCompleted OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus = "completed"
const OpenAITypesResponsesResponseOutputItemImageGenerationCallStatusGenerating OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus = "generating"
const OpenAITypesResponsesResponseOutputItemImageGenerationCallStatusFailed OpenAITypesResponsesResponseOutputItemImageGenerationCallStatus = "failed"
Type ImageGenerationCall
Result stringOptional
type OpenAITypesResponsesResponseOutputItemLocalShellCall struct{…}

A tool call to run a command on the local shell.

ID string
Action OpenAITypesResponsesResponseOutputItemLocalShellCallAction

Execute a shell command on the server.

Command []string
Env map[string, string]
Type Exec
TimeoutMs int64Optional
User stringOptional
WorkingDirectory stringOptional
CallID string
Status OpenAITypesResponsesResponseOutputItemLocalShellCallStatus
One of the following:
const OpenAITypesResponsesResponseOutputItemLocalShellCallStatusInProgress OpenAITypesResponsesResponseOutputItemLocalShellCallStatus = "in_progress"
const OpenAITypesResponsesResponseOutputItemLocalShellCallStatusCompleted OpenAITypesResponsesResponseOutputItemLocalShellCallStatus = "completed"
const OpenAITypesResponsesResponseOutputItemLocalShellCallStatusIncomplete OpenAITypesResponsesResponseOutputItemLocalShellCallStatus = "incomplete"
Type LocalShellCall
type OpenAITypesResponsesResponseOutputItemMcpCall struct{…}

An invocation of a tool on an MCP server.

ID string
Arguments string
Name string
ServerLabel string
Type McpCall
ApprovalRequestID stringOptional
Error stringOptional
Output stringOptional
Status OpenAITypesResponsesResponseOutputItemMcpCallStatusOptional
One of the following:
const OpenAITypesResponsesResponseOutputItemMcpCallStatusInProgress OpenAITypesResponsesResponseOutputItemMcpCallStatus = "in_progress"
const OpenAITypesResponsesResponseOutputItemMcpCallStatusCompleted OpenAITypesResponsesResponseOutputItemMcpCallStatus = "completed"
const OpenAITypesResponsesResponseOutputItemMcpCallStatusIncomplete OpenAITypesResponsesResponseOutputItemMcpCallStatus = "incomplete"
const OpenAITypesResponsesResponseOutputItemMcpCallStatusCalling OpenAITypesResponsesResponseOutputItemMcpCallStatus = "calling"
const OpenAITypesResponsesResponseOutputItemMcpCallStatusFailed OpenAITypesResponsesResponseOutputItemMcpCallStatus = "failed"
type OpenAITypesResponsesResponseOutputItemMcpListTools struct{…}

A list of tools available on an MCP server.

ID string
ServerLabel string
Tools []OpenAITypesResponsesResponseOutputItemMcpListToolsTool
InputSchema any
Name string
Annotations anyOptional
Description stringOptional
Type McpListTools
Error stringOptional
type PartReasoningText struct{…}

Reasoning text from the model.

Text string
Type ReasoningText
type Reasoning struct{…}

gpt-5 and o-series models only

Configuration options for reasoning models.

Effort ReasoningEffortOptional
One of the following:
const ReasoningEffortNone ReasoningEffort = "none"
const ReasoningEffortMinimal ReasoningEffort = "minimal"
const ReasoningEffortLow ReasoningEffort = "low"
const ReasoningEffortMedium ReasoningEffort = "medium"
const ReasoningEffortHigh ReasoningEffort = "high"
const ReasoningEffortXhigh ReasoningEffort = "xhigh"
GenerateSummary ReasoningGenerateSummaryOptional
One of the following:
const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto"
const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise"
const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"
Summary ReasoningSummaryOptional
One of the following:
const ReasoningSummaryAuto ReasoningSummary = "auto"
const ReasoningSummaryConcise ReasoningSummary = "concise"
const ReasoningSummaryDetailed ReasoningSummary = "detailed"
type ResponseApplyPatchToolCall struct{…}

A tool call that applies file diffs by creating, deleting, or updating files.

ID string
CallID string
Operation ResponseApplyPatchToolCallOperationUnion

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

One of the following:
type ResponseApplyPatchToolCallOperationOperationCreateFile struct{…}

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

Diff string
Path string
Type CreateFile
type ResponseApplyPatchToolCallOperationOperationDeleteFile struct{…}

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

Path string
Type DeleteFile
type ResponseApplyPatchToolCallOperationOperationUpdateFile struct{…}

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

Diff string
Path string
Type UpdateFile
Status ResponseApplyPatchToolCallStatus
One of the following:
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress"
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
Type ApplyPatchCall
CreatedBy stringOptional
type ResponseApplyPatchToolCallOutput struct{…}

The output emitted by an apply patch tool call.

ID string
CallID string
Status ResponseApplyPatchToolCallOutputStatus
One of the following:
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed"
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
Type ApplyPatchCallOutput
CreatedBy stringOptional
Output stringOptional
type ResponseCompactionItem struct{…}

A compaction item generated by the v1/responses/compact API.

ID string
EncryptedContent string
Type Compaction
CreatedBy stringOptional
type ResponseCompactionItemParamResp struct{…}

A compaction item generated by the v1/responses/compact API.

EncryptedContent string
Type Compaction
ID stringOptional
type ResponseComputerToolCallOutputScreenshot struct{…}

A computer screenshot image used with the computer use tool.

Type ComputerScreenshot
FileID stringOptional
ImageURL stringOptional
type ResponseFunctionShellToolCall struct{…}

A tool call that executes one or more shell commands in a managed environment.

ID string
Action ResponseFunctionShellToolCallAction

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

Commands []string
MaxOutputLength int64Optional
TimeoutMs int64Optional
CallID string
Status ResponseFunctionShellToolCallStatus
One of the following:
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress"
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed"
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
Type ShellCall
CreatedBy stringOptional
Environment ResponseFunctionShellToolCallEnvironmentUnionOptional

Represents the use of a local environment to perform shell actions.

One of the following:
type ResponseFunctionShellToolCallEnvironmentResponseLocalEnvironment struct{…}

Represents the use of a local environment to perform shell actions.

Type Local
type ResponseFunctionShellToolCallEnvironmentResponseContainerReference struct{…}

Represents a container created with /v1/containers.

ContainerID string
Type ContainerReference
type ResponseFunctionShellToolCallOutput struct{…}

The output of a shell tool call that was emitted.

ID string
CallID string
Output []ResponseFunctionShellToolCallOutputOutput
Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnion

Indicates that the shell call exceeded its configured time limit.

One of the following:
type ResponseFunctionShellToolCallOutputOutputOutcomeOutputOutcomeTimeout struct{…}

Indicates that the shell call exceeded its configured time limit.

Type Timeout
type ResponseFunctionShellToolCallOutputOutputOutcomeOutputOutcomeExit struct{…}

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

ExitCode int64
Type Exit
Stderr string
Stdout string
CreatedBy stringOptional
Status ResponseFunctionShellToolCallOutputStatus
One of the following:
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress"
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed"
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
Type ShellCallOutput
CreatedBy stringOptional
MaxOutputLength int64Optional
type ShellCall struct{…}

A tool representing a request to execute one or more shell commands.

Action ShellCallAction

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

Commands []string
MaxOutputLength int64Optional
TimeoutMs int64Optional
CallID string
Type ShellCall
ID stringOptional
Environment ShellCallEnvironmentUnionOptional
One of the following:
type LocalEnvironment struct{…}
Type Local
Skills []LocalEnvironmentSkillOptional
Description string
Name string
Path string
type ContainerReference struct{…}
ContainerID string
Type ContainerReference
Status ShellCallStatusOptional
One of the following:
const ShellCallStatusInProgress ShellCallStatus = "in_progress"
const ShellCallStatusCompleted ShellCallStatus = "completed"
const ShellCallStatusIncomplete ShellCallStatus = "incomplete"
type ShellCallOutput struct{…}

The streamed output items emitted by a shell tool call.

CallID string
Output []ShellCallOutputOutput
Outcome ShellCallOutputOutputOutcomeUnion

Indicates that the shell call exceeded its configured time limit.

One of the following:
type ShellCallOutputOutputOutcomeOutcomeTimeout struct{…}

Indicates that the shell call exceeded its configured time limit.

Type Timeout
type ShellCallOutputOutputOutcomeOutcomeExit struct{…}

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

ExitCode int64
Type Exit
Stderr string
Stdout string
Type ShellCallOutput
ID stringOptional
MaxOutputLength int64Optional
Status ShellCallOutputStatusOptional
One of the following:
const ShellCallOutputStatusInProgress ShellCallOutputStatus = "in_progress"
const ShellCallOutputStatusCompleted ShellCallOutputStatus = "completed"
const ShellCallOutputStatusIncomplete ShellCallOutputStatus = "incomplete"
type ToolChoiceAllowed struct{…}

Constrains the tools available to the model to a pre-defined set.

Mode ToolChoiceAllowedMode
One of the following:
const ToolChoiceAllowedModeAuto ToolChoiceAllowedMode = "auto"
const ToolChoiceAllowedModeRequired ToolChoiceAllowedMode = "required"
Tools []map[string, any]
Type AllowedTools
type ToolChoiceApplyPatch struct{…}

Forces the model to call the apply_patch tool when executing a tool call.

Type ApplyPatch
type ToolChoiceCustom struct{…}

Use this option to force the model to call a specific custom tool.

Name string
Type Custom
type ToolChoiceFunction struct{…}

Use this option to force the model to call a specific function.

Name string
Type Function
type ToolChoiceMcp struct{…}

Use this option to force the model to call a specific tool on a remote MCP server.

ServerLabel string
Type Mcp
Name stringOptional
type ToolChoiceShell struct{…}

Forces the model to call the shell tool when a tool call is required.

Type Shell
type ToolChoiceTypes struct{…}

Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.

Type ToolChoiceTypesType
One of the following:
const ToolChoiceTypesTypeFileSearch ToolChoiceTypesType = "file_search"
const ToolChoiceTypesTypeWebSearchPreview ToolChoiceTypesType = "web_search_preview"
const ToolChoiceTypesTypeComputerUsePreview ToolChoiceTypesType = "computer_use_preview"
const ToolChoiceTypesTypeWebSearchPreview2025_03_11 ToolChoiceTypesType = "web_search_preview_2025_03_11"
const ToolChoiceTypesTypeImageGeneration ToolChoiceTypesType = "image_generation"
const ToolChoiceTypesTypeCodeInterpreter ToolChoiceTypesType = "code_interpreter"
type WebSearchPreviewTool struct{…}

This tool searches the web for relevant results to use in a response.

Learn more about the web search tool.

Type WebSearchPreviewToolType
One of the following:
const WebSearchPreviewToolTypeWebSearchPreview WebSearchPreviewToolType = "web_search_preview"
const WebSearchPreviewToolTypeWebSearchPreview2025_03_11 WebSearchPreviewToolType = "web_search_preview_2025_03_11"
SearchContextSize WebSearchPreviewToolSearchContextSizeOptional
One of the following:
const WebSearchPreviewToolSearchContextSizeLow WebSearchPreviewToolSearchContextSize = "low"
const WebSearchPreviewToolSearchContextSizeMedium WebSearchPreviewToolSearchContextSize = "medium"
const WebSearchPreviewToolSearchContextSizeHigh WebSearchPreviewToolSearchContextSize = "high"
UserLocation WebSearchPreviewToolUserLocationOptional

The user’s location.

Type Approximate
City stringOptional
Country stringOptional
Region stringOptional
Timezone stringOptional
type WebSearchTool struct{…}

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

Type WebSearchToolType
One of the following:
const WebSearchToolTypeWebSearch WebSearchToolType = "web_search"
const WebSearchToolTypeWebSearch2025_08_26 WebSearchToolType = "web_search_2025_08_26"
Filters WebSearchToolFiltersOptional

Filters for the search.

AllowedDomains []stringOptional
SearchContextSize WebSearchToolSearchContextSizeOptional
One of the following:
const WebSearchToolSearchContextSizeLow WebSearchToolSearchContextSize = "low"
const WebSearchToolSearchContextSizeMedium WebSearchToolSearchContextSize = "medium"
const WebSearchToolSearchContextSizeHigh WebSearchToolSearchContextSize = "high"
UserLocation WebSearchToolUserLocationOptional

The approximate location of the user.

City stringOptional
Country stringOptional
Region stringOptional
Timezone stringOptional
Type stringOptional