Skip to content

Items

Create items
client.Conversations.Items.New(ctx, conversationID, params) (*ConversationItemList, error)
POST/conversations/{conversation_id}/items
List items
client.Conversations.Items.List(ctx, conversationID, query) (*ConversationCursorPage[ConversationItemUnion], error)
GET/conversations/{conversation_id}/items
Retrieve an item
client.Conversations.Items.Get(ctx, conversationID, itemID, query) (*ConversationItemUnion, error)
GET/conversations/{conversation_id}/items/{item_id}
Delete an item
client.Conversations.Items.Delete(ctx, conversationID, itemID) (*Conversation, error)
DELETE/conversations/{conversation_id}/items/{item_id}
ModelsExpand Collapse
type ConversationItemUnion interface{…}

A single item within a conversation. The set of possible types are the same as the output type of a Response object.

Accepts one of the following:
type Message struct{…}

A message to or from the model.

ID string

The unique ID of the message.

Content []MessageContentUnion

The content of the message

Accepts one of the following:
type ResponseInputText struct{…}

A text input to the model.

Text string

The text input to the model.

Type InputText

The type of the input item. Always input_text.

type ResponseOutputText struct{…}

A text output from the model.

Annotations []ResponseOutputTextAnnotationUnion

The annotations of the text output.

Accepts one of the following:
type ResponseOutputTextAnnotationFileCitation struct{…}

A citation to a file.

FileID string

The ID of the file.

Filename string

The filename of the file cited.

Index int64

The index of the file in the list of files.

Type FileCitation

The type of the file citation. Always file_citation.

type ResponseOutputTextAnnotationURLCitation struct{…}

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

EndIndex int64

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

StartIndex int64

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

Title string

The title of the web resource.

Type URLCitation

The type of the URL citation. Always url_citation.

URL string

The URL of the web resource.

type ResponseOutputTextAnnotationContainerFileCitation struct{…}

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

ContainerID string

The ID of the container file.

EndIndex int64

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

FileID string

The ID of the file.

Filename string

The filename of the container file cited.

StartIndex int64

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

Type ContainerFileCitation

The type of the container file citation. Always container_file_citation.

type ResponseOutputTextAnnotationFilePath struct{…}

A path to a file.

FileID string

The ID of the file.

Index int64

The index of the file in the list of files.

Type FilePath

The type of the file path. Always file_path.

Text string

The text output from the model.

Type OutputText

The type of the output text. Always output_text.

Logprobs []ResponseOutputTextLogproboptional
Token string
Bytes []int64
Logprob float64
TopLogprobs []ResponseOutputTextLogprobTopLogprob
Token string
Bytes []int64
Logprob float64
type TextContent struct{…}

A text content.

Text string
Type Text
type SummaryTextContent struct{…}

A summary text from the model.

Text string

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

Type SummaryText

The type of the object. Always summary_text.

type MessageContentReasoningText struct{…}

Reasoning text from the model.

Text string

The reasoning text from the model.

Type ReasoningText

The type of the reasoning text. Always reasoning_text.

type ResponseOutputRefusal struct{…}

A refusal from the model.

Refusal string

The refusal explanation from the model.

Type Refusal

The type of the refusal. Always refusal.

type ResponseInputImage struct{…}

An image input to the model. Learn about image inputs.

Detail ResponseInputImageDetail

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

Accepts one of the following:
const ResponseInputImageDetailLow ResponseInputImageDetail = "low"
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"
Type InputImage

The type of the input item. Always input_image.

FileID stringoptional

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

ImageURL stringoptional

The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

type ComputerScreenshotContent struct{…}

A screenshot of a computer.

FileID string

The identifier of an uploaded file that contains the screenshot.

ImageURL string

The URL of the screenshot image.

Type ComputerScreenshot

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

type ResponseInputFile struct{…}

A file input to the model.

Type InputFile

The type of the input item. Always input_file.

FileData stringoptional

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

FileID stringoptional

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

FileURL stringoptional

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

Filename stringoptional

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

Role MessageRole

The role of the message. One of unknown, user, assistant, system, critic, discriminator, developer, or tool.

Accepts one of the following:
const MessageRoleUnknown MessageRole = "unknown"
const MessageRoleUser MessageRole = "user"
const MessageRoleAssistant MessageRole = "assistant"
const MessageRoleSystem MessageRole = "system"
const MessageRoleCritic MessageRole = "critic"
const MessageRoleDiscriminator MessageRole = "discriminator"
const MessageRoleDeveloper MessageRole = "developer"
const MessageRoleTool MessageRole = "tool"
Status MessageStatus

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

Accepts one of the following:
const MessageStatusInProgress MessageStatus = "in_progress"
const MessageStatusCompleted MessageStatus = "completed"
const MessageStatusIncomplete MessageStatus = "incomplete"
Type Message

The type of the message. Always set to message.

type ResponseFunctionToolCallItem struct{…}

A tool call to run a function. See the function calling guide for more information.

ID string

The unique ID of the function tool call.

type ResponseFunctionToolCallOutputItem struct{…}
ID string

The unique ID of the function call tool output.

CallID string

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

Output ResponseFunctionToolCallOutputItemOutputUnion

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

Accepts one of the following:
string
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion

Text, image, or file output of the function call.

Accepts one of the following:
type ResponseInputText struct{…}

A text input to the model.

Text string

The text input to the model.

Type InputText

The type of the input item. Always input_text.

type ResponseInputImage struct{…}

An image input to the model. Learn about image inputs.

Detail ResponseInputImageDetail

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

Accepts one of the following:
const ResponseInputImageDetailLow ResponseInputImageDetail = "low"
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"
Type InputImage

The type of the input item. Always input_image.

FileID stringoptional

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

ImageURL stringoptional

The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

type ResponseInputFile struct{…}

A file input to the model.

Type InputFile

The type of the input item. Always input_file.

FileData stringoptional

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

FileID stringoptional

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

FileURL stringoptional

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

Filename stringoptional

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

Type FunctionCallOutput

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

Status ResponseFunctionToolCallOutputItemStatusoptional

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

Accepts one of the following:
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress"
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed"
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
type ResponseFileSearchToolCall struct{…}

The results of a file search tool call. See the file search guide for more information.

ID string

The unique ID of the file search tool call.

Queries []string

The queries used to search for files.

Status ResponseFileSearchToolCallStatus

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

Accepts one of the following:
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress"
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching"
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed"
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete"
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
Type FileSearchCall

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

Results []ResponseFileSearchToolCallResultoptional

The results of the file search tool call.

Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]optional

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.

Accepts one of the following:
string
float64
bool
FileID stringoptional

The unique ID of the file.

Filename stringoptional

The name of the file.

Score float64optional

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

formatfloat
Text stringoptional

The text that was retrieved from the file.

Accepts one of the following:
Accepts one of the following:
type ConversationItemImageGenerationCall struct{…}

An image generation request made by the model.

ID string

The unique ID of the image generation call.

Result string

The generated image encoded in base64.

Status string

The status of the image generation call.

Accepts one of the following:
const ConversationItemImageGenerationCallStatusInProgress ConversationItemImageGenerationCallStatus = "in_progress"
const ConversationItemImageGenerationCallStatusCompleted ConversationItemImageGenerationCallStatus = "completed"
const ConversationItemImageGenerationCallStatusGenerating ConversationItemImageGenerationCallStatus = "generating"
const ConversationItemImageGenerationCallStatusFailed ConversationItemImageGenerationCallStatus = "failed"
Type ImageGenerationCall

The type of the image generation call. Always image_generation_call.

type ResponseComputerToolCall struct{…}

A tool call to a computer use tool. See the computer use guide for more information.

ID string

The unique ID of the computer call.

Action ResponseComputerToolCallActionUnion

A click action.

Accepts one of the following:
type ResponseComputerToolCallActionClick struct{…}

A click action.

Button string

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

Accepts one of the following:
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left"
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right"
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel"
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back"
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
Type Click

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

X int64

The x-coordinate where the click occurred.

Y int64

The y-coordinate where the click occurred.

type ResponseComputerToolCallActionDoubleClick struct{…}

A double click action.

Type DoubleClick

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

X int64

The x-coordinate where the double click occurred.

Y int64

The y-coordinate where the double click occurred.

type ResponseComputerToolCallActionDrag struct{…}

A drag action.

Path []ResponseComputerToolCallActionDragPath

An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg

[
  { x: 100, y: 200 },
  { x: 200, y: 300 }
]
X int64

The x-coordinate.

Y int64

The y-coordinate.

Type Drag

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

type ResponseComputerToolCallActionKeypress struct{…}

A collection of keypresses the model would like to perform.

Keys []string

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

Type Keypress

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

type ResponseComputerToolCallActionMove struct{…}

A mouse move action.

Type Move

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

X int64

The x-coordinate to move to.

Y int64

The y-coordinate to move to.

type ResponseComputerToolCallActionScreenshot struct{…}

A screenshot action.

Type Screenshot

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

type ResponseComputerToolCallActionScroll struct{…}

A scroll action.

ScrollX int64

The horizontal scroll distance.

ScrollY int64

The vertical scroll distance.

Type Scroll

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

X int64

The x-coordinate where the scroll occurred.

Y int64

The y-coordinate where the scroll occurred.

type ResponseComputerToolCallActionType struct{…}

An action to type in text.

Text string

The text to type.

Type Type

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

type ResponseComputerToolCallActionWait struct{…}

A wait action.

Type Wait

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

CallID string

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

PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheck

The pending safety checks for the computer call.

ID string

The ID of the pending safety check.

Code stringoptional

The type of the pending safety check.

Message stringoptional

Details about the pending safety check.

Status ResponseComputerToolCallStatus

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

Accepts one of the following:
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress"
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed"
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
Type ResponseComputerToolCallType

The type of the computer call. Always computer_call.

type ResponseComputerToolCallOutputItem struct{…}
ID string

The unique ID of the computer call tool output.

CallID string

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

A computer screenshot image used with the computer use tool.

Type ComputerCallOutput

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

AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckoptional

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

ID string

The ID of the pending safety check.

Code stringoptional

The type of the pending safety check.

Message stringoptional

Details about the pending safety check.

Status ResponseComputerToolCallOutputItemStatusoptional

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

Accepts one of the following:
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed"
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete"
type ResponseReasoningItem struct{…}

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

ID string

The unique identifier of the reasoning content.

Summary []ResponseReasoningItemSummary

Reasoning summary content.

Text string

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

Type SummaryText

The type of the object. Always summary_text.

Type Reasoning

The type of the object. Always reasoning.

Content []ResponseReasoningItemContentoptional

Reasoning text content.

Text string

The reasoning text from the model.

Type ReasoningText

The type of the reasoning text. Always reasoning_text.

EncryptedContent stringoptional

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

Status ResponseReasoningItemStatusoptional

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

Accepts one of the following:
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress"
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed"
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
type ResponseCodeInterpreterToolCall struct{…}

A tool call to run code.

ID string

The unique ID of the code interpreter tool call.

Code string

The code to run, or null if not available.

ContainerID string

The ID of the container used to run the code.

Outputs []ResponseCodeInterpreterToolCallOutputUnion

The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.

Accepts one of the following:
type ResponseCodeInterpreterToolCallOutputLogs struct{…}

The logs output from the code interpreter.

Logs string

The logs output from the code interpreter.

Type Logs

The type of the output. Always logs.

type ResponseCodeInterpreterToolCallOutputImage struct{…}

The image output from the code interpreter.

Type Image

The type of the output. Always image.

URL string

The URL of the image output from the code interpreter.

Status ResponseCodeInterpreterToolCallStatus

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

Accepts one of the following:
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress"
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed"
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete"
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting"
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
Type CodeInterpreterCall

The type of the code interpreter tool call. Always code_interpreter_call.

type ConversationItemLocalShellCall struct{…}

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

ID string

The unique ID of the local shell call.

Action ConversationItemLocalShellCallAction

Execute a shell command on the server.

Command []string

The command to run.

Env map[string, string]

Environment variables to set for the command.

Type Exec

The type of the local shell action. Always exec.

TimeoutMs int64optional

Optional timeout in milliseconds for the command.

User stringoptional

Optional user to run the command as.

WorkingDirectory stringoptional

Optional working directory to run the command in.

CallID string

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

Status string

The status of the local shell call.

Accepts one of the following:
const ConversationItemLocalShellCallStatusInProgress ConversationItemLocalShellCallStatus = "in_progress"
const ConversationItemLocalShellCallStatusCompleted ConversationItemLocalShellCallStatus = "completed"
const ConversationItemLocalShellCallStatusIncomplete ConversationItemLocalShellCallStatus = "incomplete"
Type LocalShellCall

The type of the local shell call. Always local_shell_call.

type ConversationItemLocalShellCallOutput struct{…}

The output of a local shell tool call.

ID string

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

Output string

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

Type LocalShellCallOutput

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

Status stringoptional

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

Accepts one of the following:
const ConversationItemLocalShellCallOutputStatusInProgress ConversationItemLocalShellCallOutputStatus = "in_progress"
const ConversationItemLocalShellCallOutputStatusCompleted ConversationItemLocalShellCallOutputStatus = "completed"
const ConversationItemLocalShellCallOutputStatusIncomplete ConversationItemLocalShellCallOutputStatus = "incomplete"
type ResponseFunctionShellToolCall struct{…}

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

ID string

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

Action ResponseFunctionShellToolCallAction

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

Commands []string
MaxOutputLength int64

Optional maximum number of characters to return from each command.

TimeoutMs int64

Optional timeout in milliseconds for the commands.

CallID string

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

Status ResponseFunctionShellToolCallStatus

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

Accepts one of the following:
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress"
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed"
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
Type ShellCall

The type of the item. Always shell_call.

CreatedBy stringoptional

The ID of the entity that created this tool call.

type ResponseFunctionShellToolCallOutput struct{…}

The output of a shell tool call that was emitted.

ID string

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

CallID string

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

MaxOutputLength int64

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

Output []ResponseFunctionShellToolCallOutputOutput

An array of shell call output contents

Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnion

Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

Accepts one of the following:
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}

Indicates that the shell call exceeded its configured time limit.

Type Timeout

The outcome type. Always timeout.

type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}

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

ExitCode int64

Exit code from the shell process.

Type Exit

The outcome type. Always exit.

Stderr string

The standard error output that was captured.

Stdout string

The standard output that was captured.

CreatedBy stringoptional

The identifier of the actor that created the item.

Status ResponseFunctionShellToolCallOutputStatus

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

Accepts one of the following:
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress"
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed"
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
Type ShellCallOutput

The type of the shell call output. Always shell_call_output.

CreatedBy stringoptional

The identifier of the actor that created the item.

type ResponseApplyPatchToolCall struct{…}

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

ID string

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

CallID string

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

Operation ResponseApplyPatchToolCallOperationUnion

One of the create_file, delete_file, or update_file operations applied via apply_patch.

Accepts one of the following:
type ResponseApplyPatchToolCallOperationCreateFile struct{…}

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

Diff string

Diff to apply.

Path string

Path of the file to create.

Type CreateFile

Create a new file with the provided diff.

type ResponseApplyPatchToolCallOperationDeleteFile struct{…}

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

Path string

Path of the file to delete.

Type DeleteFile

Delete the specified file.

type ResponseApplyPatchToolCallOperationUpdateFile struct{…}

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

Diff string

Diff to apply.

Path string

Path of the file to update.

Type UpdateFile

Update an existing file with the provided diff.

Status ResponseApplyPatchToolCallStatus

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

Accepts one of the following:
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress"
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
Type ApplyPatchCall

The type of the item. Always apply_patch_call.

CreatedBy stringoptional

The ID of the entity that created this tool call.

type ResponseApplyPatchToolCallOutput struct{…}

The output emitted by an apply patch tool call.

ID string

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

CallID string

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

Status ResponseApplyPatchToolCallOutputStatus

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

Accepts one of the following:
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed"
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
Type ApplyPatchCallOutput

The type of the item. Always apply_patch_call_output.

CreatedBy stringoptional

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

Output stringoptional

Optional textual output returned by the apply patch tool.

type ConversationItemMcpListTools struct{…}

A list of tools available on an MCP server.

ID string

The unique ID of the list.

ServerLabel string

The label of the MCP server.

Tools []ConversationItemMcpListToolsTool

The tools available on the server.

InputSchema any

The JSON schema describing the tool's input.

Name string

The name of the tool.

Annotations anyoptional

Additional annotations about the tool.

Description stringoptional

The description of the tool.

Type McpListTools

The type of the item. Always mcp_list_tools.

Error stringoptional

Error message if the server could not list tools.

type ConversationItemMcpApprovalRequest struct{…}

A request for human approval of a tool invocation.

ID string

The unique ID of the approval request.

Arguments string

A JSON string of arguments for the tool.

Name string

The name of the tool to run.

ServerLabel string

The label of the MCP server making the request.

Type McpApprovalRequest

The type of the item. Always mcp_approval_request.

type ConversationItemMcpApprovalResponse struct{…}

A response to an MCP approval request.

ID string

The unique ID of the approval response

ApprovalRequestID string

The ID of the approval request being answered.

Approve bool

Whether the request was approved.

Type McpApprovalResponse

The type of the item. Always mcp_approval_response.

Reason stringoptional

Optional reason for the decision.

type ConversationItemMcpCall struct{…}

An invocation of a tool on an MCP server.

ID string

The unique ID of the tool call.

Arguments string

A JSON string of the arguments passed to the tool.

Name string

The name of the tool that was run.

ServerLabel string

The label of the MCP server running the tool.

Type McpCall

The type of the item. Always mcp_call.

ApprovalRequestID stringoptional

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

Error stringoptional

The error from the tool call, if any.

Output stringoptional

The output from the tool call.

Status stringoptional

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

Accepts one of the following:
const ConversationItemMcpCallStatusInProgress ConversationItemMcpCallStatus = "in_progress"
const ConversationItemMcpCallStatusCompleted ConversationItemMcpCallStatus = "completed"
const ConversationItemMcpCallStatusIncomplete ConversationItemMcpCallStatus = "incomplete"
const ConversationItemMcpCallStatusCalling ConversationItemMcpCallStatus = "calling"
const ConversationItemMcpCallStatusFailed ConversationItemMcpCallStatus = "failed"
type ResponseCustomToolCall struct{…}

A call to a custom tool created by the model.

CallID string

An identifier used to map this custom tool call to a tool call output.

Input string

The input for the custom tool call generated by the model.

Name string

The name of the custom tool being called.

Type CustomToolCall

The type of the custom tool call. Always custom_tool_call.

ID stringoptional

The unique ID of the custom tool call in the OpenAI platform.

type ResponseCustomToolCallOutput struct{…}

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

CallID string

The call ID, used to map this custom tool call output to a custom tool call.

Output ResponseCustomToolCallOutputOutputUnion

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

Accepts one of the following:
string
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnion

Text, image, or file output of the custom tool call.

Accepts one of the following:
type ResponseInputText struct{…}

A text input to the model.

Text string

The text input to the model.

Type InputText

The type of the input item. Always input_text.

type ResponseInputImage struct{…}

An image input to the model. Learn about image inputs.

Detail ResponseInputImageDetail

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

Accepts one of the following:
const ResponseInputImageDetailLow ResponseInputImageDetail = "low"
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"
Type InputImage

The type of the input item. Always input_image.

FileID stringoptional

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

ImageURL stringoptional

The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

type ResponseInputFile struct{…}

A file input to the model.

Type InputFile

The type of the input item. Always input_file.

FileData stringoptional

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

FileID stringoptional

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

FileURL stringoptional

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

Filename stringoptional

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

Type CustomToolCallOutput

The type of the custom tool call output. Always custom_tool_call_output.

ID stringoptional

The unique ID of the custom tool call output in the OpenAI platform.

type ConversationItemList struct{…}

A list of Conversation items.

A list of conversation items.

Accepts one of the following:
type Message struct{…}

A message to or from the model.

ID string

The unique ID of the message.

Content []MessageContentUnion

The content of the message

Accepts one of the following:
type ResponseInputText struct{…}

A text input to the model.

Text string

The text input to the model.

Type InputText

The type of the input item. Always input_text.

type ResponseOutputText struct{…}

A text output from the model.

Annotations []ResponseOutputTextAnnotationUnion

The annotations of the text output.

Accepts one of the following:
type ResponseOutputTextAnnotationFileCitation struct{…}

A citation to a file.

FileID string

The ID of the file.

Filename string

The filename of the file cited.

Index int64

The index of the file in the list of files.

Type FileCitation

The type of the file citation. Always file_citation.

type ResponseOutputTextAnnotationURLCitation struct{…}

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

EndIndex int64

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

StartIndex int64

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

Title string

The title of the web resource.

Type URLCitation

The type of the URL citation. Always url_citation.

URL string

The URL of the web resource.

type ResponseOutputTextAnnotationContainerFileCitation struct{…}

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

ContainerID string

The ID of the container file.

EndIndex int64

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

FileID string

The ID of the file.

Filename string

The filename of the container file cited.

StartIndex int64

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

Type ContainerFileCitation

The type of the container file citation. Always container_file_citation.

type ResponseOutputTextAnnotationFilePath struct{…}

A path to a file.

FileID string

The ID of the file.

Index int64

The index of the file in the list of files.

Type FilePath

The type of the file path. Always file_path.

Text string

The text output from the model.

Type OutputText

The type of the output text. Always output_text.

Logprobs []ResponseOutputTextLogproboptional
Token string
Bytes []int64
Logprob float64
TopLogprobs []ResponseOutputTextLogprobTopLogprob
Token string
Bytes []int64
Logprob float64
type TextContent struct{…}

A text content.

Text string
Type Text
type SummaryTextContent struct{…}

A summary text from the model.

Text string

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

Type SummaryText

The type of the object. Always summary_text.

type MessageContentReasoningText struct{…}

Reasoning text from the model.

Text string

The reasoning text from the model.

Type ReasoningText

The type of the reasoning text. Always reasoning_text.

type ResponseOutputRefusal struct{…}

A refusal from the model.

Refusal string

The refusal explanation from the model.

Type Refusal

The type of the refusal. Always refusal.

type ResponseInputImage struct{…}

An image input to the model. Learn about image inputs.

Detail ResponseInputImageDetail

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

Accepts one of the following:
const ResponseInputImageDetailLow ResponseInputImageDetail = "low"
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"
Type InputImage

The type of the input item. Always input_image.

FileID stringoptional

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

ImageURL stringoptional

The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

type ComputerScreenshotContent struct{…}

A screenshot of a computer.

FileID string

The identifier of an uploaded file that contains the screenshot.

ImageURL string

The URL of the screenshot image.

Type ComputerScreenshot

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

type ResponseInputFile struct{…}

A file input to the model.

Type InputFile

The type of the input item. Always input_file.

FileData stringoptional

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

FileID stringoptional

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

FileURL stringoptional

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

Filename stringoptional

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

Role MessageRole

The role of the message. One of unknown, user, assistant, system, critic, discriminator, developer, or tool.

Accepts one of the following:
const MessageRoleUnknown MessageRole = "unknown"
const MessageRoleUser MessageRole = "user"
const MessageRoleAssistant MessageRole = "assistant"
const MessageRoleSystem MessageRole = "system"
const MessageRoleCritic MessageRole = "critic"
const MessageRoleDiscriminator MessageRole = "discriminator"
const MessageRoleDeveloper MessageRole = "developer"
const MessageRoleTool MessageRole = "tool"
Status MessageStatus

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

Accepts one of the following:
const MessageStatusInProgress MessageStatus = "in_progress"
const MessageStatusCompleted MessageStatus = "completed"
const MessageStatusIncomplete MessageStatus = "incomplete"
Type Message

The type of the message. Always set to message.

type ResponseFunctionToolCallItem struct{…}

A tool call to run a function. See the function calling guide for more information.

ID string

The unique ID of the function tool call.

type ResponseFunctionToolCallOutputItem struct{…}
ID string

The unique ID of the function call tool output.

CallID string

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

Output ResponseFunctionToolCallOutputItemOutputUnion

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

Accepts one of the following:
string
type ResponseFunctionToolCallOutputItemOutputOutputContentList []ResponseFunctionToolCallOutputItemOutputOutputContentListItemUnion

Text, image, or file output of the function call.

Accepts one of the following:
type ResponseInputText struct{…}

A text input to the model.

Text string

The text input to the model.

Type InputText

The type of the input item. Always input_text.

type ResponseInputImage struct{…}

An image input to the model. Learn about image inputs.

Detail ResponseInputImageDetail

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

Accepts one of the following:
const ResponseInputImageDetailLow ResponseInputImageDetail = "low"
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"
Type InputImage

The type of the input item. Always input_image.

FileID stringoptional

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

ImageURL stringoptional

The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

type ResponseInputFile struct{…}

A file input to the model.

Type InputFile

The type of the input item. Always input_file.

FileData stringoptional

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

FileID stringoptional

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

FileURL stringoptional

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

Filename stringoptional

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

Type FunctionCallOutput

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

Status ResponseFunctionToolCallOutputItemStatusoptional

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

Accepts one of the following:
const ResponseFunctionToolCallOutputItemStatusInProgress ResponseFunctionToolCallOutputItemStatus = "in_progress"
const ResponseFunctionToolCallOutputItemStatusCompleted ResponseFunctionToolCallOutputItemStatus = "completed"
const ResponseFunctionToolCallOutputItemStatusIncomplete ResponseFunctionToolCallOutputItemStatus = "incomplete"
type ResponseFileSearchToolCall struct{…}

The results of a file search tool call. See the file search guide for more information.

ID string

The unique ID of the file search tool call.

Queries []string

The queries used to search for files.

Status ResponseFileSearchToolCallStatus

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

Accepts one of the following:
const ResponseFileSearchToolCallStatusInProgress ResponseFileSearchToolCallStatus = "in_progress"
const ResponseFileSearchToolCallStatusSearching ResponseFileSearchToolCallStatus = "searching"
const ResponseFileSearchToolCallStatusCompleted ResponseFileSearchToolCallStatus = "completed"
const ResponseFileSearchToolCallStatusIncomplete ResponseFileSearchToolCallStatus = "incomplete"
const ResponseFileSearchToolCallStatusFailed ResponseFileSearchToolCallStatus = "failed"
Type FileSearchCall

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

Results []ResponseFileSearchToolCallResultoptional

The results of the file search tool call.

Attributes map[string, ResponseFileSearchToolCallResultAttributeUnion]optional

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.

Accepts one of the following:
string
float64
bool
FileID stringoptional

The unique ID of the file.

Filename stringoptional

The name of the file.

Score float64optional

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

formatfloat
Text stringoptional

The text that was retrieved from the file.

Accepts one of the following:
Accepts one of the following:
type ConversationItemImageGenerationCall struct{…}

An image generation request made by the model.

ID string

The unique ID of the image generation call.

Result string

The generated image encoded in base64.

Status string

The status of the image generation call.

Accepts one of the following:
const ConversationItemImageGenerationCallStatusInProgress ConversationItemImageGenerationCallStatus = "in_progress"
const ConversationItemImageGenerationCallStatusCompleted ConversationItemImageGenerationCallStatus = "completed"
const ConversationItemImageGenerationCallStatusGenerating ConversationItemImageGenerationCallStatus = "generating"
const ConversationItemImageGenerationCallStatusFailed ConversationItemImageGenerationCallStatus = "failed"
Type ImageGenerationCall

The type of the image generation call. Always image_generation_call.

type ResponseComputerToolCall struct{…}

A tool call to a computer use tool. See the computer use guide for more information.

ID string

The unique ID of the computer call.

Action ResponseComputerToolCallActionUnion

A click action.

Accepts one of the following:
type ResponseComputerToolCallActionClick struct{…}

A click action.

Button string

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

Accepts one of the following:
const ResponseComputerToolCallActionClickButtonLeft ResponseComputerToolCallActionClickButton = "left"
const ResponseComputerToolCallActionClickButtonRight ResponseComputerToolCallActionClickButton = "right"
const ResponseComputerToolCallActionClickButtonWheel ResponseComputerToolCallActionClickButton = "wheel"
const ResponseComputerToolCallActionClickButtonBack ResponseComputerToolCallActionClickButton = "back"
const ResponseComputerToolCallActionClickButtonForward ResponseComputerToolCallActionClickButton = "forward"
Type Click

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

X int64

The x-coordinate where the click occurred.

Y int64

The y-coordinate where the click occurred.

type ResponseComputerToolCallActionDoubleClick struct{…}

A double click action.

Type DoubleClick

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

X int64

The x-coordinate where the double click occurred.

Y int64

The y-coordinate where the double click occurred.

type ResponseComputerToolCallActionDrag struct{…}

A drag action.

Path []ResponseComputerToolCallActionDragPath

An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg

[
  { x: 100, y: 200 },
  { x: 200, y: 300 }
]
X int64

The x-coordinate.

Y int64

The y-coordinate.

Type Drag

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

type ResponseComputerToolCallActionKeypress struct{…}

A collection of keypresses the model would like to perform.

Keys []string

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

Type Keypress

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

type ResponseComputerToolCallActionMove struct{…}

A mouse move action.

Type Move

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

X int64

The x-coordinate to move to.

Y int64

The y-coordinate to move to.

type ResponseComputerToolCallActionScreenshot struct{…}

A screenshot action.

Type Screenshot

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

type ResponseComputerToolCallActionScroll struct{…}

A scroll action.

ScrollX int64

The horizontal scroll distance.

ScrollY int64

The vertical scroll distance.

Type Scroll

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

X int64

The x-coordinate where the scroll occurred.

Y int64

The y-coordinate where the scroll occurred.

type ResponseComputerToolCallActionType struct{…}

An action to type in text.

Text string

The text to type.

Type Type

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

type ResponseComputerToolCallActionWait struct{…}

A wait action.

Type Wait

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

CallID string

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

PendingSafetyChecks []ResponseComputerToolCallPendingSafetyCheck

The pending safety checks for the computer call.

ID string

The ID of the pending safety check.

Code stringoptional

The type of the pending safety check.

Message stringoptional

Details about the pending safety check.

Status ResponseComputerToolCallStatus

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

Accepts one of the following:
const ResponseComputerToolCallStatusInProgress ResponseComputerToolCallStatus = "in_progress"
const ResponseComputerToolCallStatusCompleted ResponseComputerToolCallStatus = "completed"
const ResponseComputerToolCallStatusIncomplete ResponseComputerToolCallStatus = "incomplete"
Type ResponseComputerToolCallType

The type of the computer call. Always computer_call.

type ResponseComputerToolCallOutputItem struct{…}
ID string

The unique ID of the computer call tool output.

CallID string

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

A computer screenshot image used with the computer use tool.

Type ComputerCallOutput

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

AcknowledgedSafetyChecks []ResponseComputerToolCallOutputItemAcknowledgedSafetyCheckoptional

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

ID string

The ID of the pending safety check.

Code stringoptional

The type of the pending safety check.

Message stringoptional

Details about the pending safety check.

Status ResponseComputerToolCallOutputItemStatusoptional

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

Accepts one of the following:
const ResponseComputerToolCallOutputItemStatusInProgress ResponseComputerToolCallOutputItemStatus = "in_progress"
const ResponseComputerToolCallOutputItemStatusCompleted ResponseComputerToolCallOutputItemStatus = "completed"
const ResponseComputerToolCallOutputItemStatusIncomplete ResponseComputerToolCallOutputItemStatus = "incomplete"
type ResponseReasoningItem struct{…}

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

ID string

The unique identifier of the reasoning content.

Summary []ResponseReasoningItemSummary

Reasoning summary content.

Text string

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

Type SummaryText

The type of the object. Always summary_text.

Type Reasoning

The type of the object. Always reasoning.

Content []ResponseReasoningItemContentoptional

Reasoning text content.

Text string

The reasoning text from the model.

Type ReasoningText

The type of the reasoning text. Always reasoning_text.

EncryptedContent stringoptional

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

Status ResponseReasoningItemStatusoptional

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

Accepts one of the following:
const ResponseReasoningItemStatusInProgress ResponseReasoningItemStatus = "in_progress"
const ResponseReasoningItemStatusCompleted ResponseReasoningItemStatus = "completed"
const ResponseReasoningItemStatusIncomplete ResponseReasoningItemStatus = "incomplete"
type ResponseCodeInterpreterToolCall struct{…}

A tool call to run code.

ID string

The unique ID of the code interpreter tool call.

Code string

The code to run, or null if not available.

ContainerID string

The ID of the container used to run the code.

Outputs []ResponseCodeInterpreterToolCallOutputUnion

The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.

Accepts one of the following:
type ResponseCodeInterpreterToolCallOutputLogs struct{…}

The logs output from the code interpreter.

Logs string

The logs output from the code interpreter.

Type Logs

The type of the output. Always logs.

type ResponseCodeInterpreterToolCallOutputImage struct{…}

The image output from the code interpreter.

Type Image

The type of the output. Always image.

URL string

The URL of the image output from the code interpreter.

Status ResponseCodeInterpreterToolCallStatus

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

Accepts one of the following:
const ResponseCodeInterpreterToolCallStatusInProgress ResponseCodeInterpreterToolCallStatus = "in_progress"
const ResponseCodeInterpreterToolCallStatusCompleted ResponseCodeInterpreterToolCallStatus = "completed"
const ResponseCodeInterpreterToolCallStatusIncomplete ResponseCodeInterpreterToolCallStatus = "incomplete"
const ResponseCodeInterpreterToolCallStatusInterpreting ResponseCodeInterpreterToolCallStatus = "interpreting"
const ResponseCodeInterpreterToolCallStatusFailed ResponseCodeInterpreterToolCallStatus = "failed"
Type CodeInterpreterCall

The type of the code interpreter tool call. Always code_interpreter_call.

type ConversationItemLocalShellCall struct{…}

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

ID string

The unique ID of the local shell call.

Action ConversationItemLocalShellCallAction

Execute a shell command on the server.

Command []string

The command to run.

Env map[string, string]

Environment variables to set for the command.

Type Exec

The type of the local shell action. Always exec.

TimeoutMs int64optional

Optional timeout in milliseconds for the command.

User stringoptional

Optional user to run the command as.

WorkingDirectory stringoptional

Optional working directory to run the command in.

CallID string

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

Status string

The status of the local shell call.

Accepts one of the following:
const ConversationItemLocalShellCallStatusInProgress ConversationItemLocalShellCallStatus = "in_progress"
const ConversationItemLocalShellCallStatusCompleted ConversationItemLocalShellCallStatus = "completed"
const ConversationItemLocalShellCallStatusIncomplete ConversationItemLocalShellCallStatus = "incomplete"
Type LocalShellCall

The type of the local shell call. Always local_shell_call.

type ConversationItemLocalShellCallOutput struct{…}

The output of a local shell tool call.

ID string

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

Output string

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

Type LocalShellCallOutput

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

Status stringoptional

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

Accepts one of the following:
const ConversationItemLocalShellCallOutputStatusInProgress ConversationItemLocalShellCallOutputStatus = "in_progress"
const ConversationItemLocalShellCallOutputStatusCompleted ConversationItemLocalShellCallOutputStatus = "completed"
const ConversationItemLocalShellCallOutputStatusIncomplete ConversationItemLocalShellCallOutputStatus = "incomplete"
type ResponseFunctionShellToolCall struct{…}

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

ID string

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

Action ResponseFunctionShellToolCallAction

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

Commands []string
MaxOutputLength int64

Optional maximum number of characters to return from each command.

TimeoutMs int64

Optional timeout in milliseconds for the commands.

CallID string

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

Status ResponseFunctionShellToolCallStatus

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

Accepts one of the following:
const ResponseFunctionShellToolCallStatusInProgress ResponseFunctionShellToolCallStatus = "in_progress"
const ResponseFunctionShellToolCallStatusCompleted ResponseFunctionShellToolCallStatus = "completed"
const ResponseFunctionShellToolCallStatusIncomplete ResponseFunctionShellToolCallStatus = "incomplete"
Type ShellCall

The type of the item. Always shell_call.

CreatedBy stringoptional

The ID of the entity that created this tool call.

type ResponseFunctionShellToolCallOutput struct{…}

The output of a shell tool call that was emitted.

ID string

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

CallID string

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

MaxOutputLength int64

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

Output []ResponseFunctionShellToolCallOutputOutput

An array of shell call output contents

Outcome ResponseFunctionShellToolCallOutputOutputOutcomeUnion

Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.

Accepts one of the following:
type ResponseFunctionShellToolCallOutputOutputOutcomeTimeout struct{…}

Indicates that the shell call exceeded its configured time limit.

Type Timeout

The outcome type. Always timeout.

type ResponseFunctionShellToolCallOutputOutputOutcomeExit struct{…}

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

ExitCode int64

Exit code from the shell process.

Type Exit

The outcome type. Always exit.

Stderr string

The standard error output that was captured.

Stdout string

The standard output that was captured.

CreatedBy stringoptional

The identifier of the actor that created the item.

Status ResponseFunctionShellToolCallOutputStatus

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

Accepts one of the following:
const ResponseFunctionShellToolCallOutputStatusInProgress ResponseFunctionShellToolCallOutputStatus = "in_progress"
const ResponseFunctionShellToolCallOutputStatusCompleted ResponseFunctionShellToolCallOutputStatus = "completed"
const ResponseFunctionShellToolCallOutputStatusIncomplete ResponseFunctionShellToolCallOutputStatus = "incomplete"
Type ShellCallOutput

The type of the shell call output. Always shell_call_output.

CreatedBy stringoptional

The identifier of the actor that created the item.

type ResponseApplyPatchToolCall struct{…}

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

ID string

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

CallID string

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

Operation ResponseApplyPatchToolCallOperationUnion

One of the create_file, delete_file, or update_file operations applied via apply_patch.

Accepts one of the following:
type ResponseApplyPatchToolCallOperationCreateFile struct{…}

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

Diff string

Diff to apply.

Path string

Path of the file to create.

Type CreateFile

Create a new file with the provided diff.

type ResponseApplyPatchToolCallOperationDeleteFile struct{…}

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

Path string

Path of the file to delete.

Type DeleteFile

Delete the specified file.

type ResponseApplyPatchToolCallOperationUpdateFile struct{…}

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

Diff string

Diff to apply.

Path string

Path of the file to update.

Type UpdateFile

Update an existing file with the provided diff.

Status ResponseApplyPatchToolCallStatus

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

Accepts one of the following:
const ResponseApplyPatchToolCallStatusInProgress ResponseApplyPatchToolCallStatus = "in_progress"
const ResponseApplyPatchToolCallStatusCompleted ResponseApplyPatchToolCallStatus = "completed"
Type ApplyPatchCall

The type of the item. Always apply_patch_call.

CreatedBy stringoptional

The ID of the entity that created this tool call.

type ResponseApplyPatchToolCallOutput struct{…}

The output emitted by an apply patch tool call.

ID string

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

CallID string

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

Status ResponseApplyPatchToolCallOutputStatus

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

Accepts one of the following:
const ResponseApplyPatchToolCallOutputStatusCompleted ResponseApplyPatchToolCallOutputStatus = "completed"
const ResponseApplyPatchToolCallOutputStatusFailed ResponseApplyPatchToolCallOutputStatus = "failed"
Type ApplyPatchCallOutput

The type of the item. Always apply_patch_call_output.

CreatedBy stringoptional

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

Output stringoptional

Optional textual output returned by the apply patch tool.

type ConversationItemMcpListTools struct{…}

A list of tools available on an MCP server.

ID string

The unique ID of the list.

ServerLabel string

The label of the MCP server.

Tools []ConversationItemMcpListToolsTool

The tools available on the server.

InputSchema any

The JSON schema describing the tool's input.

Name string

The name of the tool.

Annotations anyoptional

Additional annotations about the tool.

Description stringoptional

The description of the tool.

Type McpListTools

The type of the item. Always mcp_list_tools.

Error stringoptional

Error message if the server could not list tools.

type ConversationItemMcpApprovalRequest struct{…}

A request for human approval of a tool invocation.

ID string

The unique ID of the approval request.

Arguments string

A JSON string of arguments for the tool.

Name string

The name of the tool to run.

ServerLabel string

The label of the MCP server making the request.

Type McpApprovalRequest

The type of the item. Always mcp_approval_request.

type ConversationItemMcpApprovalResponse struct{…}

A response to an MCP approval request.

ID string

The unique ID of the approval response

ApprovalRequestID string

The ID of the approval request being answered.

Approve bool

Whether the request was approved.

Type McpApprovalResponse

The type of the item. Always mcp_approval_response.

Reason stringoptional

Optional reason for the decision.

type ConversationItemMcpCall struct{…}

An invocation of a tool on an MCP server.

ID string

The unique ID of the tool call.

Arguments string

A JSON string of the arguments passed to the tool.

Name string

The name of the tool that was run.

ServerLabel string

The label of the MCP server running the tool.

Type McpCall

The type of the item. Always mcp_call.

ApprovalRequestID stringoptional

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

Error stringoptional

The error from the tool call, if any.

Output stringoptional

The output from the tool call.

Status stringoptional

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

Accepts one of the following:
const ConversationItemMcpCallStatusInProgress ConversationItemMcpCallStatus = "in_progress"
const ConversationItemMcpCallStatusCompleted ConversationItemMcpCallStatus = "completed"
const ConversationItemMcpCallStatusIncomplete ConversationItemMcpCallStatus = "incomplete"
const ConversationItemMcpCallStatusCalling ConversationItemMcpCallStatus = "calling"
const ConversationItemMcpCallStatusFailed ConversationItemMcpCallStatus = "failed"
type ResponseCustomToolCall struct{…}

A call to a custom tool created by the model.

CallID string

An identifier used to map this custom tool call to a tool call output.

Input string

The input for the custom tool call generated by the model.

Name string

The name of the custom tool being called.

Type CustomToolCall

The type of the custom tool call. Always custom_tool_call.

ID stringoptional

The unique ID of the custom tool call in the OpenAI platform.

type ResponseCustomToolCallOutput struct{…}

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

CallID string

The call ID, used to map this custom tool call output to a custom tool call.

Output ResponseCustomToolCallOutputOutputUnion

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

Accepts one of the following:
string
type ResponseCustomToolCallOutputOutputOutputContentList []ResponseCustomToolCallOutputOutputOutputContentListItemUnion

Text, image, or file output of the custom tool call.

Accepts one of the following:
type ResponseInputText struct{…}

A text input to the model.

Text string

The text input to the model.

Type InputText

The type of the input item. Always input_text.

type ResponseInputImage struct{…}

An image input to the model. Learn about image inputs.

Detail ResponseInputImageDetail

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

Accepts one of the following:
const ResponseInputImageDetailLow ResponseInputImageDetail = "low"
const ResponseInputImageDetailHigh ResponseInputImageDetail = "high"
const ResponseInputImageDetailAuto ResponseInputImageDetail = "auto"
Type InputImage

The type of the input item. Always input_image.

FileID stringoptional

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

ImageURL stringoptional

The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

type ResponseInputFile struct{…}

A file input to the model.

Type InputFile

The type of the input item. Always input_file.

FileData stringoptional

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

FileID stringoptional

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

FileURL stringoptional

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

Filename stringoptional

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

Type CustomToolCallOutput

The type of the custom tool call output. Always custom_tool_call_output.

ID stringoptional

The unique ID of the custom tool call output in the OpenAI platform.

FirstID string

The ID of the first item in the list.

HasMore bool

Whether there are more items available.

LastID string

The ID of the last item in the list.

Object List

The type of object returned, must be list.