Responses

ResponsesResource

Methods

create() ->
post/v5/responses

Responses

Domain types

class ApplyPatchCall: ...

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

class ApplyPatchCallOutput: ...

The streamed output emitted by an apply patch tool call.

class ApplyPatchTool: ...

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

class ComputerTool: ...

A tool that controls a virtual computer.

Learn more about the computer tool.

class ContainerNetworkPolicyAllowlist: ...
class ContainerNetworkPolicyDisabled: ...
class ContainerReference: ...
class ContainerReferenceParam: ...
class Conversation: ...

The conversation that this response belonged to.

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

class CustomTool: ...

A custom tool that processes input using a specified format.

Learn more about custom tools

class EasyInputMessage: ...

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.

class FileSearchTool: ...

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

class FunctionShellTool: ...

A tool that allows the model to execute shell commands.

class FunctionTool: ...

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

Learn more about function calling.

class IncompleteDetails: ...

Details about why the response is incomplete.

class LocalEnvironment: ...
class LocalEnvironmentParam: ...
class McpApprovalRequest: ...

A request for human approval of a tool invocation.

class OpenAIResponse: ...
class OpenAIResponseCodeInterpreterToolCall: ...

A tool call to run code.

class OpenAIResponseComputerToolCall: ...

A tool call to a computer use tool.

See the computer use guide for more information.

class OpenAIResponseCustomToolCall: ...

A call to a custom tool created by the model.

class OpenAIResponseCustomToolCallOutput: ...

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

class OpenAIResponseError: ...

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

class OpenAIResponseFileSearchToolCall: ...

The results of a file search tool call.

See the file search guide for more information.

class OpenAIResponseFunctionToolCall: ...

A tool call to run a function.

See the function calling guide for more information.

class OpenAIResponseFunctionWebSearch: ...

The results of a web search tool call.

See the web search guide for more information.

class OpenAIResponseInputFile: ...

A file input to the model.

class OpenAIResponseInputFileParam: ...

A file input to the model.

class OpenAIResponseInputImage: ...

An image input to the model.

Learn about image inputs.

class OpenAIResponseInputImageParam: ...

An image input to the model.

Learn about image inputs.

class OpenAIResponseInputText: ...

A text input to the model.

class OpenAIResponseInputTextParam: ...

A text input to the model.

class OpenAIResponseOutputMessage: ...

An output message from the model.

class OpenAIResponseOutputRefusal: ...

A refusal from the model.

class OpenAIResponseOutputText: ...

A text output from the model.

class OpenAIResponsePrompt: ...

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

class OpenAIResponseReasoningItem: ...

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.

class OpenAIResponseTextConfig: ...

Configuration options for a text response from the model.

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

class OpenAIResponseUsage: ...

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

class OpenAITypesResponsesResponseInputItemComputerCallOutput: ...

The output of a computer tool call.

class OpenAITypesResponsesResponseInputItemFunctionCallOutput: ...

The output of a function tool call.

class OpenAITypesResponsesResponseInputItemImageGenerationCall: ...

An image generation request made by the model.

class OpenAITypesResponsesResponseInputItemItemReference: ...

An internal identifier for an item to reference.

class OpenAITypesResponsesResponseInputItemLocalShellCall: ...

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

class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: ...

The output of a local shell tool call.

class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: ...

A response to an MCP approval request.

class OpenAITypesResponsesResponseInputItemMcpCall: ...

An invocation of a tool on an MCP server.

class OpenAITypesResponsesResponseInputItemMcpListTools: ...

A list of tools available on an MCP server.

class OpenAITypesResponsesResponseInputItemMessage: ...

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.

class OpenAITypesResponsesResponseOutputItemImageGenerationCall: ...

An image generation request made by the model.

class OpenAITypesResponsesResponseOutputItemLocalShellCall: ...

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

class OpenAITypesResponsesResponseOutputItemMcpCall: ...

An invocation of a tool on an MCP server.

class OpenAITypesResponsesResponseOutputItemMcpListTools: ...

A list of tools available on an MCP server.

class PartReasoningText: ...

Reasoning text from the model.

class Reasoning: ...

gpt-5 and o-series models only

Configuration options for reasoning models.

class ResponseApplyPatchToolCall: ...

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

class ResponseApplyPatchToolCallOutput: ...

The output emitted by an apply patch tool call.

class ResponseCompactionItem: ...

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

class ResponseCompactionItemParam: ...

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

class ResponseComputerToolCallOutputScreenshot: ...

A computer screenshot image used with the computer use tool.

Emitted when there is a partial audio response.

class ResponseFunctionShellToolCall: ...

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

class ResponseFunctionShellToolCallOutput: ...

The output of a shell tool call that was emitted.

class ShellCall: ...

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

class ShellCallOutput: ...

The streamed output items emitted by a shell tool call.

class ToolChoiceAllowed: ...

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

class ToolChoiceApplyPatch: ...

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

class ToolChoiceCustom: ...

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

class ToolChoiceFunction: ...

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

class ToolChoiceMcp: ...

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

class ToolChoiceShell: ...

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

class ToolChoiceTypes: ...

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

class WebSearchPreviewTool: ...

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

Learn more about the web search tool.

class WebSearchTool: ...

Search the Internet for sources related to the prompt.

Learn more about the web search tool.