Skip to content

Run OpenAI Responses API (OpenAI only)

responses.create(ResponseCreateParams**kwargs) -> ResponseCreateResponse
POST/v5/responses

Runs inference using the OpenAI Responses API contract, taking an input rather than a chat messages array.

This endpoint is restricted to OpenAI-vendor models: requests whose model (vendor/name) resolves to any other vendor are rejected with an unsupported-vendor error, unlike /v5/chat/completions and /v5/inference which support many vendors. Use it when you specifically need Responses API features such as previous_response_id chaining, instructions, or store; use /v5/chat/completions for the standard messages-based chat contract. When stream is set the response streams as server-sent events; otherwise a single response object is returned.

ParametersExpand Collapse
input: Union[str, Iterable[InputInputItem]]
One of the following:
str
Iterable[InputInputItem]
One of the following:
class InputInputItemEasyInputMessageParam: …

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: Union[str, Iterable[InputInputItemEasyInputMessageParamContentInputItem]]
One of the following:
str
Iterable[InputInputItemEasyInputMessageParamContentInputItem]
One of the following:
class OpenAIResponseInputTextParam: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImageParam: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFileParam: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
type: Optional[Literal["message"]]
class InputInputItemOpenAITypesResponsesResponseInputParamMessage: …

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: Iterable[InputInputItemOpenAITypesResponsesResponseInputParamMessageContent]
One of the following:
class OpenAIResponseInputTextParam: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImageParam: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFileParam: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "system", "developer"]
One of the following:
"user"
"system"
"developer"
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Optional[Literal["message"]]
class InputInputItemResponseOutputMessageParam: …

An output message from the model.

id: str
content: Iterable[InputInputItemResponseOutputMessageParamContent]
One of the following:
class InputInputItemResponseOutputMessageParamContentResponseOutputTextParam: …

A text output from the model.

annotations: Iterable[InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotation]
One of the following:
class InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationOpenAITypesResponsesResponseOutputTextParamAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class InputInputItemResponseOutputMessageParamContentResponseOutputTextParamAnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[Iterable[InputInputItemResponseOutputMessageParamContentResponseOutputTextParamLogprob]]
token: str
bytes: Iterable[int]
logprob: float
top_logprobs: Iterable[InputInputItemResponseOutputMessageParamContentResponseOutputTextParamLogprobTopLogprob]
token: str
bytes: Iterable[int]
logprob: float
class InputInputItemResponseOutputMessageParamContentResponseOutputRefusalParam: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class InputInputItemResponseFileSearchToolCallParam: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: Sequence[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[Iterable[InputInputItemResponseFileSearchToolCallParamResult]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class InputInputItemResponseComputerToolCallParam: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: InputInputItemResponseComputerToolCallParamAction

A click action.

One of the following:
class InputInputItemResponseComputerToolCallParamActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class InputInputItemResponseComputerToolCallParamActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class InputInputItemResponseComputerToolCallParamActionActionDrag: …

A drag action.

path: Iterable[InputInputItemResponseComputerToolCallParamActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class InputInputItemResponseComputerToolCallParamActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: Sequence[str]
type: Literal["keypress"]
class InputInputItemResponseComputerToolCallParamActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class InputInputItemResponseComputerToolCallParamActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class InputInputItemResponseComputerToolCallParamActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class InputInputItemResponseComputerToolCallParamActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class InputInputItemResponseComputerToolCallParamActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: Iterable[InputInputItemResponseComputerToolCallParamPendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
class InputInputItemOpenAITypesResponsesResponseInputParamComputerCallOutput: …

The output of a computer tool call.

call_id: str
output: InputInputItemOpenAITypesResponsesResponseInputParamComputerCallOutputOutput

A computer screenshot image used with the computer use tool.

type: Literal["computer_screenshot"]
file_id: Optional[str]
image_url: Optional[str]
type: Literal["computer_call_output"]
id: Optional[str]
acknowledged_safety_checks: Optional[Iterable[InputInputItemOpenAITypesResponsesResponseInputParamComputerCallOutputAcknowledgedSafetyCheck]]
id: str
code: Optional[str]
message: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class InputInputItemResponseFunctionWebSearchParam: …

The results of a web search tool call.

See the web search guide for more information.

id: str
action: InputInputItemResponseFunctionWebSearchParamAction

Action type “search” - Performs a web search query.

One of the following:
class InputInputItemResponseFunctionWebSearchParamActionOpenAITypesResponsesResponseFunctionWebSearchParamActionSearch: …

Action type “search” - Performs a web search query.

query: str
type: Literal["search"]
queries: Optional[Sequence[str]]
sources: Optional[Iterable[InputInputItemResponseFunctionWebSearchParamActionOpenAITypesResponsesResponseFunctionWebSearchParamActionSearchSource]]
type: Literal["url"]
url: str
class InputInputItemResponseFunctionWebSearchParamActionOpenAITypesResponsesResponseFunctionWebSearchParamActionOpenPage: …

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

type: Literal["open_page"]
url: Optional[str]
class InputInputItemResponseFunctionWebSearchParamActionActionFind: …

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

pattern: str
type: Literal["find_in_page"]
url: str
status: Literal["in_progress", "searching", "completed", "failed"]
One of the following:
"in_progress"
"searching"
"completed"
"failed"
type: Literal["web_search_call"]
class InputInputItemResponseFunctionToolCallParam: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutput: …

The output of a function tool call.

call_id: str
output: Union[str, Iterable[InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentList]]
One of the following:
str
Iterable[InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentList]
One of the following:
class InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentListResponseInputTextContentParam: …

A text input to the model.

text: str
type: Literal["input_text"]
class InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentListResponseInputImageContentParam: …

An image input to the model.

Learn about image inputs

type: Literal["input_image"]
detail: Optional[Literal["low", "high", "auto"]]
One of the following:
"low"
"high"
"auto"
file_id: Optional[str]
image_url: Optional[str]
class InputInputItemOpenAITypesResponsesResponseInputParamFunctionCallOutputOutputOutputContentListResponseInputFileContentParam: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["function_call_output"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class InputInputItemResponseReasoningItemParam: …

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: str
summary: Iterable[InputInputItemResponseReasoningItemParamSummary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[Iterable[InputInputItemResponseReasoningItemParamContent]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class InputInputItemResponseCompactionItemParamParam: …

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

encrypted_content: str
type: Literal["compaction"]
id: Optional[str]
class InputInputItemOpenAITypesResponsesResponseInputParamImageGenerationCall: …

An image generation request made by the model.

id: str
result: Optional[str]
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
class InputInputItemResponseCodeInterpreterToolCallParam: …

A tool call to run code.

id: str
code: Optional[str]
container_id: str
outputs: Optional[Iterable[InputInputItemResponseCodeInterpreterToolCallParamOutput]]
One of the following:
class InputInputItemResponseCodeInterpreterToolCallParamOutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class InputInputItemResponseCodeInterpreterToolCallParamOutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
class InputInputItemOpenAITypesResponsesResponseInputParamLocalShellCall: …

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

id: str
action: InputInputItemOpenAITypesResponsesResponseInputParamLocalShellCallAction

Execute a shell command on the server.

command: Sequence[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class InputInputItemOpenAITypesResponsesResponseInputParamLocalShellCallOutput: …

The output of a local shell tool call.

id: str
output: str
type: Literal["local_shell_call_output"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class InputInputItemOpenAITypesResponsesResponseInputParamShellCall: …

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

action: InputInputItemOpenAITypesResponsesResponseInputParamShellCallAction

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

commands: Sequence[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
type: Literal["shell_call"]
id: Optional[str]
environment: Optional[InputInputItemOpenAITypesResponsesResponseInputParamShellCallEnvironment]
One of the following:
class LocalEnvironmentParam: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReferenceParam: …
container_id: str
type: Literal["container_reference"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutput: …

The streamed output items emitted by a shell tool call.

call_id: str
output: Iterable[InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutputOutput]
outcome: InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutputOutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutputOutputOutcomeOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class InputInputItemOpenAITypesResponsesResponseInputParamShellCallOutputOutputOutcomeOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
type: Literal["shell_call_output"]
id: Optional[str]
max_output_length: Optional[int]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCall: …

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

call_id: str
operation: InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOperation

Instruction for creating a new file via the apply_patch tool.

One of the following:
class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOperationApplyPatchCallOperationCreateFile: …

Instruction for creating a new file via the apply_patch tool.

diff: str
path: str
type: Literal["create_file"]
class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOperationApplyPatchCallOperationDeleteFile: …

Instruction for deleting an existing file via the apply_patch tool.

path: str
type: Literal["delete_file"]
class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOperationApplyPatchCallOperationUpdateFile: …

Instruction for updating an existing file via the apply_patch tool.

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
id: Optional[str]
class InputInputItemOpenAITypesResponsesResponseInputParamApplyPatchCallOutput: …

The streamed output emitted by an apply patch tool call.

call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
id: Optional[str]
output: Optional[str]
class InputInputItemOpenAITypesResponsesResponseInputParamMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: Iterable[InputInputItemOpenAITypesResponsesResponseInputParamMcpListToolsTool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class InputInputItemOpenAITypesResponsesResponseInputParamMcpApprovalResponse: …

A response to an MCP approval request.

approval_request_id: str
approve: bool
type: Literal["mcp_approval_response"]
id: Optional[str]
reason: Optional[str]
class InputInputItemOpenAITypesResponsesResponseInputParamMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class InputInputItemResponseCustomToolCallOutputParam: …

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

call_id: str
output: Union[str, Iterable[InputInputItemResponseCustomToolCallOutputParamOutputOutputContentList]]
One of the following:
str
Iterable[InputInputItemResponseCustomToolCallOutputParamOutputOutputContentList]
One of the following:
class OpenAIResponseInputTextParam: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImageParam: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFileParam: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["custom_tool_call_output"]
id: Optional[str]
class InputInputItemResponseCustomToolCallParam: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
class InputInputItemOpenAITypesResponsesResponseInputParamItemReference: …

An internal identifier for an item to reference.

id: str
type: Optional[Literal["item_reference"]]
model: str

model specified as model_vendor/model, for example openai/gpt-4o

include: Optional[Sequence[str]]

Which fields to include in the response

instructions: Optional[str]

Instructions for the response generation

max_output_tokens: Optional[int]

Maximum number of output tokens

metadata: Optional[Dict[str, object]]

Metadata for the response

parallel_tool_calls: Optional[bool]

Whether to enable parallel tool calls

previous_response_id: Optional[str]

ID of the previous response for chaining

reasoning: Optional[Dict[str, object]]

Reasoning configuration for the response

store: Optional[bool]

Whether to store the response

stream: Optional[bool]

Whether to stream the response

temperature: Optional[float]

Sampling temperature for randomness control

maximum2
minimum0
text: Optional[Dict[str, object]]

Text configuration parameters

tool_choice: Optional[Union[str, Dict[str, object]]]

Tool choice configuration

One of the following:
str
Dict[str, object]
tools: Optional[Iterable[Dict[str, object]]]

Tools available for the response

top_p: Optional[float]

Top-p sampling parameter

maximum1
minimum0
truncation: Optional[Literal["auto", "disabled"]]

Truncation configuration

One of the following:
"auto"
"disabled"
ReturnsExpand Collapse

Emitted when there is a partial audio response.

One of the following:
class OpenAIResponse: …
id: str
created_at: float
model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]
One of the following:
Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more]
One of the following:
"gpt-5.2"
"gpt-5.2-2025-12-11"
"gpt-5.2-chat-latest"
"gpt-5.2-pro"
"gpt-5.2-pro-2025-12-11"
"gpt-5.1"
"gpt-5.1-2025-11-13"
"gpt-5.1-codex"
"gpt-5.1-mini"
"gpt-5.1-chat-latest"
"gpt-5"
"gpt-5-mini"
"gpt-5-nano"
"gpt-5-2025-08-07"
"gpt-5-mini-2025-08-07"
"gpt-5-nano-2025-08-07"
"gpt-5-chat-latest"
"gpt-4.1"
"gpt-4.1-mini"
"gpt-4.1-nano"
"gpt-4.1-2025-04-14"
"gpt-4.1-mini-2025-04-14"
"gpt-4.1-nano-2025-04-14"
"o4-mini"
"o4-mini-2025-04-16"
"o3"
"o3-2025-04-16"
"o3-mini"
"o3-mini-2025-01-31"
"o1"
"o1-2024-12-17"
"o1-preview"
"o1-preview-2024-09-12"
"o1-mini"
"o1-mini-2024-09-12"
"gpt-4o"
"gpt-4o-2024-11-20"
"gpt-4o-2024-08-06"
"gpt-4o-2024-05-13"
"gpt-4o-audio-preview"
"gpt-4o-audio-preview-2024-10-01"
"gpt-4o-audio-preview-2024-12-17"
"gpt-4o-audio-preview-2025-06-03"
"gpt-4o-mini-audio-preview"
"gpt-4o-mini-audio-preview-2024-12-17"
"gpt-4o-search-preview"
"gpt-4o-mini-search-preview"
"gpt-4o-search-preview-2025-03-11"
"gpt-4o-mini-search-preview-2025-03-11"
"chatgpt-4o-latest"
"codex-mini-latest"
"gpt-4o-mini"
"gpt-4o-mini-2024-07-18"
"gpt-4-turbo"
"gpt-4-turbo-2024-04-09"
"gpt-4-0125-preview"
"gpt-4-turbo-preview"
"gpt-4-1106-preview"
"gpt-4-vision-preview"
"gpt-4"
"gpt-4-0314"
"gpt-4-0613"
"gpt-4-32k"
"gpt-4-32k-0314"
"gpt-4-32k-0613"
"gpt-3.5-turbo"
"gpt-3.5-turbo-16k"
"gpt-3.5-turbo-0301"
"gpt-3.5-turbo-0613"
"gpt-3.5-turbo-1106"
"gpt-3.5-turbo-0125"
"gpt-3.5-turbo-16k-0613"
"o1-pro"
"o1-pro-2025-03-19"
"o3-pro"
"o3-pro-2025-06-10"
"o3-deep-research"
"o3-deep-research-2025-06-26"
"o4-mini-deep-research"
"o4-mini-deep-research-2025-06-26"
"computer-use-preview"
"computer-use-preview-2025-03-11"
"gpt-5-codex"
"gpt-5-pro"
"gpt-5-pro-2025-10-06"
"gpt-5.1-codex-max"
str
object: Literal["response"]
output: List[Output]
One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
parallel_tool_calls: bool
tool_choice: ToolChoice

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

One of the following:
Literal["none", "auto", "required"]
One of the following:
"none"
"auto"
"required"
class ToolChoiceAllowed: …

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

mode: Literal["auto", "required"]
One of the following:
"auto"
"required"
tools: List[Dict[str, object]]
type: Literal["allowed_tools"]
class ToolChoiceTypes: …

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

type: Literal["file_search", "web_search_preview", "computer_use_preview", 3 more]
One of the following:
"file_search"
"web_search_preview"
"computer_use_preview"
"web_search_preview_2025_03_11"
"image_generation"
"code_interpreter"
class ToolChoiceFunction: …

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

name: str
type: Literal["function"]
class ToolChoiceMcp: …

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

server_label: str
type: Literal["mcp"]
name: Optional[str]
class ToolChoiceCustom: …

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

name: str
type: Literal["custom"]
class ToolChoiceApplyPatch: …

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

type: Literal["apply_patch"]
class ToolChoiceShell: …

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

type: Literal["shell"]
tools: List[Tool]
One of the following:
class FunctionTool: …

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

Learn more about function calling.

name: str
type: Literal["function"]
description: Optional[str]
parameters: Optional[Dict[str, object]]
strict: Optional[bool]
class FileSearchTool: …

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

type: Literal["file_search"]
vector_store_ids: List[str]
filters: Optional[Filters]

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

One of the following:
class FiltersComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
class FiltersCompoundFilter: …

Combine multiple filters using and or or.

filters: List[FiltersCompoundFilterFilter]
One of the following:
class FiltersCompoundFilterFilterComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
object
type: Literal["and", "or"]
One of the following:
"and"
"or"
max_num_results: Optional[int]
ranking_options: Optional[RankingOptions]

Ranking options for search.

ranker: Optional[Literal["auto", "default-2024-11-15"]]
One of the following:
"auto"
"default-2024-11-15"
score_threshold: Optional[float]
class ComputerTool: …

A tool that controls a virtual computer.

Learn more about the computer tool.

display_height: int
display_width: int
environment: Literal["windows", "mac", "linux", 2 more]
One of the following:
"windows"
"mac"
"linux"
"ubuntu"
"browser"
type: Literal["computer_use_preview"]
class WebSearchTool: …

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

type: Literal["web_search", "web_search_2025_08_26"]
One of the following:
"web_search"
"web_search_2025_08_26"
filters: Optional[Filters]

Filters for the search.

allowed_domains: Optional[List[str]]
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The approximate location of the user.

city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
type: Optional[Literal["approximate"]]
class ToolMcp: …

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

server_label: str
type: Literal["mcp"]
allowed_tools: Optional[ToolMcpAllowedTools]

A filter object to specify which tools are allowed.

One of the following:
List[str]
class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
authorization: Optional[str]
connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", 5 more]]
One of the following:
"connector_dropbox"
"connector_gmail"
"connector_googlecalendar"
"connector_googledrive"
"connector_microsoftteams"
"connector_outlookcalendar"
"connector_outlookemail"
"connector_sharepoint"
headers: Optional[Dict[str, str]]
require_approval: Optional[ToolMcpRequireApproval]

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:
class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …

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: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
Literal["always", "never"]
One of the following:
"always"
"never"
server_description: Optional[str]
server_url: Optional[str]
class ToolCodeInterpreter: …

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

container: ToolCodeInterpreterContainer

Configuration for a code interpreter container.

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

One of the following:
str
class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …

Configuration for a code interpreter container.

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

type: Literal["auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
type: Literal["code_interpreter"]
class ToolImageGeneration: …

A tool that generates images using the GPT image models.

type: Literal["image_generation"]
action: Optional[Literal["generate", "edit", "auto"]]
One of the following:
"generate"
"edit"
"auto"
background: Optional[Literal["transparent", "opaque", "auto"]]
One of the following:
"transparent"
"opaque"
"auto"
input_fidelity: Optional[Literal["high", "low"]]
One of the following:
"high"
"low"
input_image_mask: Optional[ToolImageGenerationInputImageMask]

Optional mask for inpainting.

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

file_id: Optional[str]
image_url: Optional[str]
model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]
One of the following:
str
Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]
One of the following:
"gpt-image-1"
"gpt-image-1-mini"
"gpt-image-1.5"
moderation: Optional[Literal["auto", "low"]]
One of the following:
"auto"
"low"
output_compression: Optional[int]
output_format: Optional[Literal["png", "webp", "jpeg"]]
One of the following:
"png"
"webp"
"jpeg"
partial_images: Optional[int]
quality: Optional[Literal["low", "medium", "high", "auto"]]
One of the following:
"low"
"medium"
"high"
"auto"
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]
One of the following:
"1024x1024"
"1024x1536"
"1536x1024"
"auto"
class ToolLocalShell: …

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

type: Literal["local_shell"]
class FunctionShellTool: …

A tool that allows the model to execute shell commands.

type: Literal["shell"]
environment: Optional[Environment]
One of the following:
class EnvironmentContainerAuto: …
type: Literal["container_auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
skills: Optional[List[EnvironmentContainerAutoSkill]]
One of the following:
class EnvironmentContainerAutoSkillSkillReference: …
skill_id: str
type: Literal["skill_reference"]
version: Optional[str]
class EnvironmentContainerAutoSkillInlineSkill: …
description: str
name: str
source: EnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

data: str
media_type: Literal["application/zip"]
type: Literal["base64"]
type: Literal["inline"]
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
class CustomTool: …

A custom tool that processes input using a specified format.

Learn more about custom tools

name: str
type: Literal["custom"]
description: Optional[str]
format: Optional[Format]

Unconstrained free-form text.

One of the following:
class FormatText: …

Unconstrained free-form text.

type: Literal["text"]
class FormatGrammar: …

A grammar defined by the user.

definition: str
syntax: Literal["lark", "regex"]
One of the following:
"lark"
"regex"
type: Literal["grammar"]
class WebSearchPreviewTool: …

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

Learn more about the web search tool.

type: Literal["web_search_preview", "web_search_preview_2025_03_11"]
One of the following:
"web_search_preview"
"web_search_preview_2025_03_11"
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The user’s location.

type: Literal["approximate"]
city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
class ApplyPatchTool: …

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

type: Literal["apply_patch"]
background: Optional[bool]
completed_at: Optional[float]
conversation: Optional[Conversation]

The conversation that this response belonged to.

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

id: str
error: Optional[OpenAIResponseError]

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

code: Literal["server_error", "rate_limit_exceeded", "invalid_prompt", 15 more]
One of the following:
"server_error"
"rate_limit_exceeded"
"invalid_prompt"
"vector_store_timeout"
"invalid_image"
"invalid_image_format"
"invalid_base64_image"
"invalid_image_url"
"image_too_large"
"image_too_small"
"image_parse_error"
"image_content_policy_violation"
"invalid_image_mode"
"image_file_too_large"
"unsupported_image_media_type"
"empty_image_file"
"failed_to_download_image"
"image_file_not_found"
message: str
incomplete_details: Optional[IncompleteDetails]

Details about why the response is incomplete.

reason: Optional[Literal["max_output_tokens", "content_filter"]]
One of the following:
"max_output_tokens"
"content_filter"
instructions: Optional[Union[str, List[InstructionsInputItem], null]]
One of the following:
str
List[InstructionsInputItem]
One of the following:
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.

content: Union[str, List[ContentInputItem]]
One of the following:
str
List[ContentInputItem]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
type: Optional[Literal["message"]]
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.

content: List[Content]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "system", "developer"]
One of the following:
"user"
"system"
"developer"
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Optional[Literal["message"]]
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
class OpenAITypesResponsesResponseInputItemComputerCallOutput: …

The output of a computer tool call.

call_id: str

A computer screenshot image used with the computer use tool.

type: Literal["computer_screenshot"]
file_id: Optional[str]
image_url: Optional[str]
type: Literal["computer_call_output"]
id: Optional[str]
acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]
id: str
code: Optional[str]
message: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …

The output of a function tool call.

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OutputOutputContentListResponseInputTextContent: …

A text input to the model.

text: str
type: Literal["input_text"]
class OutputOutputContentListResponseInputImageContent: …

An image input to the model.

Learn about image inputs

type: Literal["input_image"]
detail: Optional[Literal["low", "high", "auto"]]
One of the following:
"low"
"high"
"auto"
file_id: Optional[str]
image_url: Optional[str]
class OutputOutputContentListResponseInputFileContent: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["function_call_output"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItemParam: …

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

encrypted_content: str
type: Literal["compaction"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseInputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …

The output of a local shell tool call.

id: str
output: str
type: Literal["local_shell_call_output"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCall: …

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

action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
type: Literal["shell_call"]
id: Optional[str]
environment: Optional[Environment]
One of the following:
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCallOutput: …

The streamed output items emitted by a shell tool call.

call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
type: Literal["shell_call_output"]
id: Optional[str]
max_output_length: Optional[int]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ApplyPatchCall: …

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

call_id: str
operation: Operation

Instruction for creating a new file via the apply_patch tool.

One of the following:
class OperationApplyPatchCallOperationCreateFile: …

Instruction for creating a new file via the apply_patch tool.

diff: str
path: str
type: Literal["create_file"]
class OperationApplyPatchCallOperationDeleteFile: …

Instruction for deleting an existing file via the apply_patch tool.

path: str
type: Literal["delete_file"]
class OperationApplyPatchCallOperationUpdateFile: …

Instruction for updating an existing file via the apply_patch tool.

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
id: Optional[str]
class ApplyPatchCallOutput: …

The streamed output emitted by an apply patch tool call.

call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
id: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …

A response to an MCP approval request.

approval_request_id: str
approve: bool
type: Literal["mcp_approval_response"]
id: Optional[str]
reason: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAIResponseCustomToolCallOutput: …

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

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["custom_tool_call_output"]
id: Optional[str]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemItemReference: …

An internal identifier for an item to reference.

id: str
type: Optional[Literal["item_reference"]]
max_output_tokens: Optional[int]
max_tool_calls: Optional[int]
metadata: Optional[Dict[str, str]]
previous_response_id: Optional[str]
prompt: Optional[OpenAIResponsePrompt]

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

id: str
variables: Optional[Dict[str, Variables]]
One of the following:
str
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
version: Optional[str]
prompt_cache_key: Optional[str]
prompt_cache_retention: Optional[Literal["in-memory", "24h"]]
One of the following:
"in-memory"
"24h"
reasoning: Optional[Reasoning]

gpt-5 and o-series models only

Configuration options for reasoning models.

effort: Optional[Literal["none", "minimal", "low", 3 more]]
One of the following:
"none"
"minimal"
"low"
"medium"
"high"
"xhigh"
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
safety_identifier: Optional[str]
service_tier: Optional[Literal["auto", "default", "flex", 2 more]]
One of the following:
"auto"
"default"
"flex"
"scale"
"priority"
status: Optional[Literal["completed", "failed", "in_progress", 3 more]]
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
temperature: Optional[float]
text: Optional[OpenAIResponseTextConfig]

Configuration options for a text response from the model.

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

format: Optional[Format]

Default response format. Used to generate text responses.

One of the following:
class FormatResponseFormatText: …

Default response format. Used to generate text responses.

type: Literal["text"]
class FormatResponseFormatTextJsonSchemaConfig: …

JSON Schema response format.

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

name: str
schema: Dict[str, object]
type: Literal["json_schema"]
description: Optional[str]
strict: Optional[bool]
class FormatResponseFormatJsonObject: …

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: Literal["json_object"]
verbosity: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
top_logprobs: Optional[int]
top_p: Optional[float]
truncation: Optional[Literal["auto", "disabled"]]
One of the following:
"auto"
"disabled"
usage: Optional[OpenAIResponseUsage]

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

input_tokens: int
input_tokens_details: InputTokensDetails

A detailed breakdown of the input tokens.

cached_tokens: int
output_tokens: int
output_tokens_details: OutputTokensDetails

A detailed breakdown of the output tokens.

reasoning_tokens: int
total_tokens: int
user: Optional[str]
class ResponseAudioDeltaEvent: …

Emitted when there is a partial audio response.

delta: str
sequence_number: int
type: Literal["response.audio.delta"]
class ResponseAudioDoneEvent: …

Emitted when the audio response is complete.

sequence_number: int
type: Literal["response.audio.done"]
class ResponseAudioTranscriptDeltaEvent: …

Emitted when there is a partial transcript of audio.

delta: str
sequence_number: int
type: Literal["response.audio.transcript.delta"]
class ResponseAudioTranscriptDoneEvent: …

Emitted when the full audio transcript is completed.

sequence_number: int
type: Literal["response.audio.transcript.done"]
class ResponseCodeInterpreterCallCodeDeltaEvent: …

Emitted when a partial code snippet is streamed by the code interpreter.

delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.code_interpreter_call_code.delta"]
class ResponseCodeInterpreterCallCodeDoneEvent: …

Emitted when the code snippet is finalized by the code interpreter.

code: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.code_interpreter_call_code.done"]
class ResponseCodeInterpreterCallCompletedEvent: …

Emitted when the code interpreter call is completed.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.code_interpreter_call.completed"]
class ResponseCodeInterpreterCallInProgressEvent: …

Emitted when a code interpreter call is in progress.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.code_interpreter_call.in_progress"]
class ResponseCodeInterpreterCallInterpretingEvent: …

Emitted when the code interpreter is actively interpreting the code snippet.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.code_interpreter_call.interpreting"]
class ResponseCompletedEvent: …

Emitted when the model response is complete.

response: OpenAIResponse
id: str
created_at: float
model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]
One of the following:
Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more]
One of the following:
"gpt-5.2"
"gpt-5.2-2025-12-11"
"gpt-5.2-chat-latest"
"gpt-5.2-pro"
"gpt-5.2-pro-2025-12-11"
"gpt-5.1"
"gpt-5.1-2025-11-13"
"gpt-5.1-codex"
"gpt-5.1-mini"
"gpt-5.1-chat-latest"
"gpt-5"
"gpt-5-mini"
"gpt-5-nano"
"gpt-5-2025-08-07"
"gpt-5-mini-2025-08-07"
"gpt-5-nano-2025-08-07"
"gpt-5-chat-latest"
"gpt-4.1"
"gpt-4.1-mini"
"gpt-4.1-nano"
"gpt-4.1-2025-04-14"
"gpt-4.1-mini-2025-04-14"
"gpt-4.1-nano-2025-04-14"
"o4-mini"
"o4-mini-2025-04-16"
"o3"
"o3-2025-04-16"
"o3-mini"
"o3-mini-2025-01-31"
"o1"
"o1-2024-12-17"
"o1-preview"
"o1-preview-2024-09-12"
"o1-mini"
"o1-mini-2024-09-12"
"gpt-4o"
"gpt-4o-2024-11-20"
"gpt-4o-2024-08-06"
"gpt-4o-2024-05-13"
"gpt-4o-audio-preview"
"gpt-4o-audio-preview-2024-10-01"
"gpt-4o-audio-preview-2024-12-17"
"gpt-4o-audio-preview-2025-06-03"
"gpt-4o-mini-audio-preview"
"gpt-4o-mini-audio-preview-2024-12-17"
"gpt-4o-search-preview"
"gpt-4o-mini-search-preview"
"gpt-4o-search-preview-2025-03-11"
"gpt-4o-mini-search-preview-2025-03-11"
"chatgpt-4o-latest"
"codex-mini-latest"
"gpt-4o-mini"
"gpt-4o-mini-2024-07-18"
"gpt-4-turbo"
"gpt-4-turbo-2024-04-09"
"gpt-4-0125-preview"
"gpt-4-turbo-preview"
"gpt-4-1106-preview"
"gpt-4-vision-preview"
"gpt-4"
"gpt-4-0314"
"gpt-4-0613"
"gpt-4-32k"
"gpt-4-32k-0314"
"gpt-4-32k-0613"
"gpt-3.5-turbo"
"gpt-3.5-turbo-16k"
"gpt-3.5-turbo-0301"
"gpt-3.5-turbo-0613"
"gpt-3.5-turbo-1106"
"gpt-3.5-turbo-0125"
"gpt-3.5-turbo-16k-0613"
"o1-pro"
"o1-pro-2025-03-19"
"o3-pro"
"o3-pro-2025-06-10"
"o3-deep-research"
"o3-deep-research-2025-06-26"
"o4-mini-deep-research"
"o4-mini-deep-research-2025-06-26"
"computer-use-preview"
"computer-use-preview-2025-03-11"
"gpt-5-codex"
"gpt-5-pro"
"gpt-5-pro-2025-10-06"
"gpt-5.1-codex-max"
str
object: Literal["response"]
output: List[Output]
One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
parallel_tool_calls: bool
tool_choice: ToolChoice

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

One of the following:
Literal["none", "auto", "required"]
One of the following:
"none"
"auto"
"required"
class ToolChoiceAllowed: …

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

mode: Literal["auto", "required"]
One of the following:
"auto"
"required"
tools: List[Dict[str, object]]
type: Literal["allowed_tools"]
class ToolChoiceTypes: …

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

type: Literal["file_search", "web_search_preview", "computer_use_preview", 3 more]
One of the following:
"file_search"
"web_search_preview"
"computer_use_preview"
"web_search_preview_2025_03_11"
"image_generation"
"code_interpreter"
class ToolChoiceFunction: …

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

name: str
type: Literal["function"]
class ToolChoiceMcp: …

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

server_label: str
type: Literal["mcp"]
name: Optional[str]
class ToolChoiceCustom: …

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

name: str
type: Literal["custom"]
class ToolChoiceApplyPatch: …

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

type: Literal["apply_patch"]
class ToolChoiceShell: …

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

type: Literal["shell"]
tools: List[Tool]
One of the following:
class FunctionTool: …

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

Learn more about function calling.

name: str
type: Literal["function"]
description: Optional[str]
parameters: Optional[Dict[str, object]]
strict: Optional[bool]
class FileSearchTool: …

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

type: Literal["file_search"]
vector_store_ids: List[str]
filters: Optional[Filters]

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

One of the following:
class FiltersComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
class FiltersCompoundFilter: …

Combine multiple filters using and or or.

filters: List[FiltersCompoundFilterFilter]
One of the following:
class FiltersCompoundFilterFilterComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
object
type: Literal["and", "or"]
One of the following:
"and"
"or"
max_num_results: Optional[int]
ranking_options: Optional[RankingOptions]

Ranking options for search.

ranker: Optional[Literal["auto", "default-2024-11-15"]]
One of the following:
"auto"
"default-2024-11-15"
score_threshold: Optional[float]
class ComputerTool: …

A tool that controls a virtual computer.

Learn more about the computer tool.

display_height: int
display_width: int
environment: Literal["windows", "mac", "linux", 2 more]
One of the following:
"windows"
"mac"
"linux"
"ubuntu"
"browser"
type: Literal["computer_use_preview"]
class WebSearchTool: …

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

type: Literal["web_search", "web_search_2025_08_26"]
One of the following:
"web_search"
"web_search_2025_08_26"
filters: Optional[Filters]

Filters for the search.

allowed_domains: Optional[List[str]]
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The approximate location of the user.

city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
type: Optional[Literal["approximate"]]
class ToolMcp: …

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

server_label: str
type: Literal["mcp"]
allowed_tools: Optional[ToolMcpAllowedTools]

A filter object to specify which tools are allowed.

One of the following:
List[str]
class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
authorization: Optional[str]
connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", 5 more]]
One of the following:
"connector_dropbox"
"connector_gmail"
"connector_googlecalendar"
"connector_googledrive"
"connector_microsoftteams"
"connector_outlookcalendar"
"connector_outlookemail"
"connector_sharepoint"
headers: Optional[Dict[str, str]]
require_approval: Optional[ToolMcpRequireApproval]

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:
class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …

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: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
Literal["always", "never"]
One of the following:
"always"
"never"
server_description: Optional[str]
server_url: Optional[str]
class ToolCodeInterpreter: …

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

container: ToolCodeInterpreterContainer

Configuration for a code interpreter container.

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

One of the following:
str
class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …

Configuration for a code interpreter container.

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

type: Literal["auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
type: Literal["code_interpreter"]
class ToolImageGeneration: …

A tool that generates images using the GPT image models.

type: Literal["image_generation"]
action: Optional[Literal["generate", "edit", "auto"]]
One of the following:
"generate"
"edit"
"auto"
background: Optional[Literal["transparent", "opaque", "auto"]]
One of the following:
"transparent"
"opaque"
"auto"
input_fidelity: Optional[Literal["high", "low"]]
One of the following:
"high"
"low"
input_image_mask: Optional[ToolImageGenerationInputImageMask]

Optional mask for inpainting.

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

file_id: Optional[str]
image_url: Optional[str]
model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]
One of the following:
str
Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]
One of the following:
"gpt-image-1"
"gpt-image-1-mini"
"gpt-image-1.5"
moderation: Optional[Literal["auto", "low"]]
One of the following:
"auto"
"low"
output_compression: Optional[int]
output_format: Optional[Literal["png", "webp", "jpeg"]]
One of the following:
"png"
"webp"
"jpeg"
partial_images: Optional[int]
quality: Optional[Literal["low", "medium", "high", "auto"]]
One of the following:
"low"
"medium"
"high"
"auto"
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]
One of the following:
"1024x1024"
"1024x1536"
"1536x1024"
"auto"
class ToolLocalShell: …

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

type: Literal["local_shell"]
class FunctionShellTool: …

A tool that allows the model to execute shell commands.

type: Literal["shell"]
environment: Optional[Environment]
One of the following:
class EnvironmentContainerAuto: …
type: Literal["container_auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
skills: Optional[List[EnvironmentContainerAutoSkill]]
One of the following:
class EnvironmentContainerAutoSkillSkillReference: …
skill_id: str
type: Literal["skill_reference"]
version: Optional[str]
class EnvironmentContainerAutoSkillInlineSkill: …
description: str
name: str
source: EnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

data: str
media_type: Literal["application/zip"]
type: Literal["base64"]
type: Literal["inline"]
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
class CustomTool: …

A custom tool that processes input using a specified format.

Learn more about custom tools

name: str
type: Literal["custom"]
description: Optional[str]
format: Optional[Format]

Unconstrained free-form text.

One of the following:
class FormatText: …

Unconstrained free-form text.

type: Literal["text"]
class FormatGrammar: …

A grammar defined by the user.

definition: str
syntax: Literal["lark", "regex"]
One of the following:
"lark"
"regex"
type: Literal["grammar"]
class WebSearchPreviewTool: …

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

Learn more about the web search tool.

type: Literal["web_search_preview", "web_search_preview_2025_03_11"]
One of the following:
"web_search_preview"
"web_search_preview_2025_03_11"
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The user’s location.

type: Literal["approximate"]
city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
class ApplyPatchTool: …

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

type: Literal["apply_patch"]
background: Optional[bool]
completed_at: Optional[float]
conversation: Optional[Conversation]

The conversation that this response belonged to.

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

id: str
error: Optional[OpenAIResponseError]

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

code: Literal["server_error", "rate_limit_exceeded", "invalid_prompt", 15 more]
One of the following:
"server_error"
"rate_limit_exceeded"
"invalid_prompt"
"vector_store_timeout"
"invalid_image"
"invalid_image_format"
"invalid_base64_image"
"invalid_image_url"
"image_too_large"
"image_too_small"
"image_parse_error"
"image_content_policy_violation"
"invalid_image_mode"
"image_file_too_large"
"unsupported_image_media_type"
"empty_image_file"
"failed_to_download_image"
"image_file_not_found"
message: str
incomplete_details: Optional[IncompleteDetails]

Details about why the response is incomplete.

reason: Optional[Literal["max_output_tokens", "content_filter"]]
One of the following:
"max_output_tokens"
"content_filter"
instructions: Optional[Union[str, List[InstructionsInputItem], null]]
One of the following:
str
List[InstructionsInputItem]
One of the following:
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.

content: Union[str, List[ContentInputItem]]
One of the following:
str
List[ContentInputItem]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
type: Optional[Literal["message"]]
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.

content: List[Content]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "system", "developer"]
One of the following:
"user"
"system"
"developer"
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Optional[Literal["message"]]
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
class OpenAITypesResponsesResponseInputItemComputerCallOutput: …

The output of a computer tool call.

call_id: str

A computer screenshot image used with the computer use tool.

type: Literal["computer_screenshot"]
file_id: Optional[str]
image_url: Optional[str]
type: Literal["computer_call_output"]
id: Optional[str]
acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]
id: str
code: Optional[str]
message: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …

The output of a function tool call.

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OutputOutputContentListResponseInputTextContent: …

A text input to the model.

text: str
type: Literal["input_text"]
class OutputOutputContentListResponseInputImageContent: …

An image input to the model.

Learn about image inputs

type: Literal["input_image"]
detail: Optional[Literal["low", "high", "auto"]]
One of the following:
"low"
"high"
"auto"
file_id: Optional[str]
image_url: Optional[str]
class OutputOutputContentListResponseInputFileContent: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["function_call_output"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItemParam: …

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

encrypted_content: str
type: Literal["compaction"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseInputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …

The output of a local shell tool call.

id: str
output: str
type: Literal["local_shell_call_output"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCall: …

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

action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
type: Literal["shell_call"]
id: Optional[str]
environment: Optional[Environment]
One of the following:
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCallOutput: …

The streamed output items emitted by a shell tool call.

call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
type: Literal["shell_call_output"]
id: Optional[str]
max_output_length: Optional[int]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ApplyPatchCall: …

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

call_id: str
operation: Operation

Instruction for creating a new file via the apply_patch tool.

One of the following:
class OperationApplyPatchCallOperationCreateFile: …

Instruction for creating a new file via the apply_patch tool.

diff: str
path: str
type: Literal["create_file"]
class OperationApplyPatchCallOperationDeleteFile: …

Instruction for deleting an existing file via the apply_patch tool.

path: str
type: Literal["delete_file"]
class OperationApplyPatchCallOperationUpdateFile: …

Instruction for updating an existing file via the apply_patch tool.

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
id: Optional[str]
class ApplyPatchCallOutput: …

The streamed output emitted by an apply patch tool call.

call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
id: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …

A response to an MCP approval request.

approval_request_id: str
approve: bool
type: Literal["mcp_approval_response"]
id: Optional[str]
reason: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAIResponseCustomToolCallOutput: …

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

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["custom_tool_call_output"]
id: Optional[str]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemItemReference: …

An internal identifier for an item to reference.

id: str
type: Optional[Literal["item_reference"]]
max_output_tokens: Optional[int]
max_tool_calls: Optional[int]
metadata: Optional[Dict[str, str]]
previous_response_id: Optional[str]
prompt: Optional[OpenAIResponsePrompt]

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

id: str
variables: Optional[Dict[str, Variables]]
One of the following:
str
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
version: Optional[str]
prompt_cache_key: Optional[str]
prompt_cache_retention: Optional[Literal["in-memory", "24h"]]
One of the following:
"in-memory"
"24h"
reasoning: Optional[Reasoning]

gpt-5 and o-series models only

Configuration options for reasoning models.

effort: Optional[Literal["none", "minimal", "low", 3 more]]
One of the following:
"none"
"minimal"
"low"
"medium"
"high"
"xhigh"
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
safety_identifier: Optional[str]
service_tier: Optional[Literal["auto", "default", "flex", 2 more]]
One of the following:
"auto"
"default"
"flex"
"scale"
"priority"
status: Optional[Literal["completed", "failed", "in_progress", 3 more]]
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
temperature: Optional[float]
text: Optional[OpenAIResponseTextConfig]

Configuration options for a text response from the model.

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

format: Optional[Format]

Default response format. Used to generate text responses.

One of the following:
class FormatResponseFormatText: …

Default response format. Used to generate text responses.

type: Literal["text"]
class FormatResponseFormatTextJsonSchemaConfig: …

JSON Schema response format.

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

name: str
schema: Dict[str, object]
type: Literal["json_schema"]
description: Optional[str]
strict: Optional[bool]
class FormatResponseFormatJsonObject: …

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: Literal["json_object"]
verbosity: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
top_logprobs: Optional[int]
top_p: Optional[float]
truncation: Optional[Literal["auto", "disabled"]]
One of the following:
"auto"
"disabled"
usage: Optional[OpenAIResponseUsage]

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

input_tokens: int
input_tokens_details: InputTokensDetails

A detailed breakdown of the input tokens.

cached_tokens: int
output_tokens: int
output_tokens_details: OutputTokensDetails

A detailed breakdown of the output tokens.

reasoning_tokens: int
total_tokens: int
user: Optional[str]
sequence_number: int
type: Literal["response.completed"]
class ResponseContentPartAddedEvent: …

Emitted when a new content part is added.

content_index: int
item_id: str
output_index: int
part: ResponseContentPartAddedEventPart

A text output from the model.

One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
class PartReasoningText: …

Reasoning text from the model.

text: str
type: Literal["reasoning_text"]
sequence_number: int
type: Literal["response.content_part.added"]
class ResponseContentPartDoneEvent: …

Emitted when a content part is done.

content_index: int
item_id: str
output_index: int
part: ResponseContentPartDoneEventPart

A text output from the model.

One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
class PartReasoningText: …

Reasoning text from the model.

text: str
type: Literal["reasoning_text"]
sequence_number: int
type: Literal["response.content_part.done"]
class ResponseCreatedEvent: …

An event that is emitted when a response is created.

response: OpenAIResponse
id: str
created_at: float
model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]
One of the following:
Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more]
One of the following:
"gpt-5.2"
"gpt-5.2-2025-12-11"
"gpt-5.2-chat-latest"
"gpt-5.2-pro"
"gpt-5.2-pro-2025-12-11"
"gpt-5.1"
"gpt-5.1-2025-11-13"
"gpt-5.1-codex"
"gpt-5.1-mini"
"gpt-5.1-chat-latest"
"gpt-5"
"gpt-5-mini"
"gpt-5-nano"
"gpt-5-2025-08-07"
"gpt-5-mini-2025-08-07"
"gpt-5-nano-2025-08-07"
"gpt-5-chat-latest"
"gpt-4.1"
"gpt-4.1-mini"
"gpt-4.1-nano"
"gpt-4.1-2025-04-14"
"gpt-4.1-mini-2025-04-14"
"gpt-4.1-nano-2025-04-14"
"o4-mini"
"o4-mini-2025-04-16"
"o3"
"o3-2025-04-16"
"o3-mini"
"o3-mini-2025-01-31"
"o1"
"o1-2024-12-17"
"o1-preview"
"o1-preview-2024-09-12"
"o1-mini"
"o1-mini-2024-09-12"
"gpt-4o"
"gpt-4o-2024-11-20"
"gpt-4o-2024-08-06"
"gpt-4o-2024-05-13"
"gpt-4o-audio-preview"
"gpt-4o-audio-preview-2024-10-01"
"gpt-4o-audio-preview-2024-12-17"
"gpt-4o-audio-preview-2025-06-03"
"gpt-4o-mini-audio-preview"
"gpt-4o-mini-audio-preview-2024-12-17"
"gpt-4o-search-preview"
"gpt-4o-mini-search-preview"
"gpt-4o-search-preview-2025-03-11"
"gpt-4o-mini-search-preview-2025-03-11"
"chatgpt-4o-latest"
"codex-mini-latest"
"gpt-4o-mini"
"gpt-4o-mini-2024-07-18"
"gpt-4-turbo"
"gpt-4-turbo-2024-04-09"
"gpt-4-0125-preview"
"gpt-4-turbo-preview"
"gpt-4-1106-preview"
"gpt-4-vision-preview"
"gpt-4"
"gpt-4-0314"
"gpt-4-0613"
"gpt-4-32k"
"gpt-4-32k-0314"
"gpt-4-32k-0613"
"gpt-3.5-turbo"
"gpt-3.5-turbo-16k"
"gpt-3.5-turbo-0301"
"gpt-3.5-turbo-0613"
"gpt-3.5-turbo-1106"
"gpt-3.5-turbo-0125"
"gpt-3.5-turbo-16k-0613"
"o1-pro"
"o1-pro-2025-03-19"
"o3-pro"
"o3-pro-2025-06-10"
"o3-deep-research"
"o3-deep-research-2025-06-26"
"o4-mini-deep-research"
"o4-mini-deep-research-2025-06-26"
"computer-use-preview"
"computer-use-preview-2025-03-11"
"gpt-5-codex"
"gpt-5-pro"
"gpt-5-pro-2025-10-06"
"gpt-5.1-codex-max"
str
object: Literal["response"]
output: List[Output]
One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
parallel_tool_calls: bool
tool_choice: ToolChoice

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

One of the following:
Literal["none", "auto", "required"]
One of the following:
"none"
"auto"
"required"
class ToolChoiceAllowed: …

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

mode: Literal["auto", "required"]
One of the following:
"auto"
"required"
tools: List[Dict[str, object]]
type: Literal["allowed_tools"]
class ToolChoiceTypes: …

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

type: Literal["file_search", "web_search_preview", "computer_use_preview", 3 more]
One of the following:
"file_search"
"web_search_preview"
"computer_use_preview"
"web_search_preview_2025_03_11"
"image_generation"
"code_interpreter"
class ToolChoiceFunction: …

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

name: str
type: Literal["function"]
class ToolChoiceMcp: …

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

server_label: str
type: Literal["mcp"]
name: Optional[str]
class ToolChoiceCustom: …

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

name: str
type: Literal["custom"]
class ToolChoiceApplyPatch: …

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

type: Literal["apply_patch"]
class ToolChoiceShell: …

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

type: Literal["shell"]
tools: List[Tool]
One of the following:
class FunctionTool: …

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

Learn more about function calling.

name: str
type: Literal["function"]
description: Optional[str]
parameters: Optional[Dict[str, object]]
strict: Optional[bool]
class FileSearchTool: …

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

type: Literal["file_search"]
vector_store_ids: List[str]
filters: Optional[Filters]

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

One of the following:
class FiltersComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
class FiltersCompoundFilter: …

Combine multiple filters using and or or.

filters: List[FiltersCompoundFilterFilter]
One of the following:
class FiltersCompoundFilterFilterComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
object
type: Literal["and", "or"]
One of the following:
"and"
"or"
max_num_results: Optional[int]
ranking_options: Optional[RankingOptions]

Ranking options for search.

ranker: Optional[Literal["auto", "default-2024-11-15"]]
One of the following:
"auto"
"default-2024-11-15"
score_threshold: Optional[float]
class ComputerTool: …

A tool that controls a virtual computer.

Learn more about the computer tool.

display_height: int
display_width: int
environment: Literal["windows", "mac", "linux", 2 more]
One of the following:
"windows"
"mac"
"linux"
"ubuntu"
"browser"
type: Literal["computer_use_preview"]
class WebSearchTool: …

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

type: Literal["web_search", "web_search_2025_08_26"]
One of the following:
"web_search"
"web_search_2025_08_26"
filters: Optional[Filters]

Filters for the search.

allowed_domains: Optional[List[str]]
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The approximate location of the user.

city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
type: Optional[Literal["approximate"]]
class ToolMcp: …

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

server_label: str
type: Literal["mcp"]
allowed_tools: Optional[ToolMcpAllowedTools]

A filter object to specify which tools are allowed.

One of the following:
List[str]
class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
authorization: Optional[str]
connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", 5 more]]
One of the following:
"connector_dropbox"
"connector_gmail"
"connector_googlecalendar"
"connector_googledrive"
"connector_microsoftteams"
"connector_outlookcalendar"
"connector_outlookemail"
"connector_sharepoint"
headers: Optional[Dict[str, str]]
require_approval: Optional[ToolMcpRequireApproval]

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:
class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …

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: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
Literal["always", "never"]
One of the following:
"always"
"never"
server_description: Optional[str]
server_url: Optional[str]
class ToolCodeInterpreter: …

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

container: ToolCodeInterpreterContainer

Configuration for a code interpreter container.

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

One of the following:
str
class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …

Configuration for a code interpreter container.

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

type: Literal["auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
type: Literal["code_interpreter"]
class ToolImageGeneration: …

A tool that generates images using the GPT image models.

type: Literal["image_generation"]
action: Optional[Literal["generate", "edit", "auto"]]
One of the following:
"generate"
"edit"
"auto"
background: Optional[Literal["transparent", "opaque", "auto"]]
One of the following:
"transparent"
"opaque"
"auto"
input_fidelity: Optional[Literal["high", "low"]]
One of the following:
"high"
"low"
input_image_mask: Optional[ToolImageGenerationInputImageMask]

Optional mask for inpainting.

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

file_id: Optional[str]
image_url: Optional[str]
model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]
One of the following:
str
Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]
One of the following:
"gpt-image-1"
"gpt-image-1-mini"
"gpt-image-1.5"
moderation: Optional[Literal["auto", "low"]]
One of the following:
"auto"
"low"
output_compression: Optional[int]
output_format: Optional[Literal["png", "webp", "jpeg"]]
One of the following:
"png"
"webp"
"jpeg"
partial_images: Optional[int]
quality: Optional[Literal["low", "medium", "high", "auto"]]
One of the following:
"low"
"medium"
"high"
"auto"
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]
One of the following:
"1024x1024"
"1024x1536"
"1536x1024"
"auto"
class ToolLocalShell: …

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

type: Literal["local_shell"]
class FunctionShellTool: …

A tool that allows the model to execute shell commands.

type: Literal["shell"]
environment: Optional[Environment]
One of the following:
class EnvironmentContainerAuto: …
type: Literal["container_auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
skills: Optional[List[EnvironmentContainerAutoSkill]]
One of the following:
class EnvironmentContainerAutoSkillSkillReference: …
skill_id: str
type: Literal["skill_reference"]
version: Optional[str]
class EnvironmentContainerAutoSkillInlineSkill: …
description: str
name: str
source: EnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

data: str
media_type: Literal["application/zip"]
type: Literal["base64"]
type: Literal["inline"]
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
class CustomTool: …

A custom tool that processes input using a specified format.

Learn more about custom tools

name: str
type: Literal["custom"]
description: Optional[str]
format: Optional[Format]

Unconstrained free-form text.

One of the following:
class FormatText: …

Unconstrained free-form text.

type: Literal["text"]
class FormatGrammar: …

A grammar defined by the user.

definition: str
syntax: Literal["lark", "regex"]
One of the following:
"lark"
"regex"
type: Literal["grammar"]
class WebSearchPreviewTool: …

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

Learn more about the web search tool.

type: Literal["web_search_preview", "web_search_preview_2025_03_11"]
One of the following:
"web_search_preview"
"web_search_preview_2025_03_11"
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The user’s location.

type: Literal["approximate"]
city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
class ApplyPatchTool: …

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

type: Literal["apply_patch"]
background: Optional[bool]
completed_at: Optional[float]
conversation: Optional[Conversation]

The conversation that this response belonged to.

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

id: str
error: Optional[OpenAIResponseError]

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

code: Literal["server_error", "rate_limit_exceeded", "invalid_prompt", 15 more]
One of the following:
"server_error"
"rate_limit_exceeded"
"invalid_prompt"
"vector_store_timeout"
"invalid_image"
"invalid_image_format"
"invalid_base64_image"
"invalid_image_url"
"image_too_large"
"image_too_small"
"image_parse_error"
"image_content_policy_violation"
"invalid_image_mode"
"image_file_too_large"
"unsupported_image_media_type"
"empty_image_file"
"failed_to_download_image"
"image_file_not_found"
message: str
incomplete_details: Optional[IncompleteDetails]

Details about why the response is incomplete.

reason: Optional[Literal["max_output_tokens", "content_filter"]]
One of the following:
"max_output_tokens"
"content_filter"
instructions: Optional[Union[str, List[InstructionsInputItem], null]]
One of the following:
str
List[InstructionsInputItem]
One of the following:
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.

content: Union[str, List[ContentInputItem]]
One of the following:
str
List[ContentInputItem]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
type: Optional[Literal["message"]]
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.

content: List[Content]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "system", "developer"]
One of the following:
"user"
"system"
"developer"
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Optional[Literal["message"]]
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
class OpenAITypesResponsesResponseInputItemComputerCallOutput: …

The output of a computer tool call.

call_id: str

A computer screenshot image used with the computer use tool.

type: Literal["computer_screenshot"]
file_id: Optional[str]
image_url: Optional[str]
type: Literal["computer_call_output"]
id: Optional[str]
acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]
id: str
code: Optional[str]
message: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …

The output of a function tool call.

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OutputOutputContentListResponseInputTextContent: …

A text input to the model.

text: str
type: Literal["input_text"]
class OutputOutputContentListResponseInputImageContent: …

An image input to the model.

Learn about image inputs

type: Literal["input_image"]
detail: Optional[Literal["low", "high", "auto"]]
One of the following:
"low"
"high"
"auto"
file_id: Optional[str]
image_url: Optional[str]
class OutputOutputContentListResponseInputFileContent: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["function_call_output"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItemParam: …

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

encrypted_content: str
type: Literal["compaction"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseInputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …

The output of a local shell tool call.

id: str
output: str
type: Literal["local_shell_call_output"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCall: …

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

action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
type: Literal["shell_call"]
id: Optional[str]
environment: Optional[Environment]
One of the following:
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCallOutput: …

The streamed output items emitted by a shell tool call.

call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
type: Literal["shell_call_output"]
id: Optional[str]
max_output_length: Optional[int]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ApplyPatchCall: …

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

call_id: str
operation: Operation

Instruction for creating a new file via the apply_patch tool.

One of the following:
class OperationApplyPatchCallOperationCreateFile: …

Instruction for creating a new file via the apply_patch tool.

diff: str
path: str
type: Literal["create_file"]
class OperationApplyPatchCallOperationDeleteFile: …

Instruction for deleting an existing file via the apply_patch tool.

path: str
type: Literal["delete_file"]
class OperationApplyPatchCallOperationUpdateFile: …

Instruction for updating an existing file via the apply_patch tool.

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
id: Optional[str]
class ApplyPatchCallOutput: …

The streamed output emitted by an apply patch tool call.

call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
id: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …

A response to an MCP approval request.

approval_request_id: str
approve: bool
type: Literal["mcp_approval_response"]
id: Optional[str]
reason: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAIResponseCustomToolCallOutput: …

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

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["custom_tool_call_output"]
id: Optional[str]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemItemReference: …

An internal identifier for an item to reference.

id: str
type: Optional[Literal["item_reference"]]
max_output_tokens: Optional[int]
max_tool_calls: Optional[int]
metadata: Optional[Dict[str, str]]
previous_response_id: Optional[str]
prompt: Optional[OpenAIResponsePrompt]

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

id: str
variables: Optional[Dict[str, Variables]]
One of the following:
str
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
version: Optional[str]
prompt_cache_key: Optional[str]
prompt_cache_retention: Optional[Literal["in-memory", "24h"]]
One of the following:
"in-memory"
"24h"
reasoning: Optional[Reasoning]

gpt-5 and o-series models only

Configuration options for reasoning models.

effort: Optional[Literal["none", "minimal", "low", 3 more]]
One of the following:
"none"
"minimal"
"low"
"medium"
"high"
"xhigh"
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
safety_identifier: Optional[str]
service_tier: Optional[Literal["auto", "default", "flex", 2 more]]
One of the following:
"auto"
"default"
"flex"
"scale"
"priority"
status: Optional[Literal["completed", "failed", "in_progress", 3 more]]
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
temperature: Optional[float]
text: Optional[OpenAIResponseTextConfig]

Configuration options for a text response from the model.

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

format: Optional[Format]

Default response format. Used to generate text responses.

One of the following:
class FormatResponseFormatText: …

Default response format. Used to generate text responses.

type: Literal["text"]
class FormatResponseFormatTextJsonSchemaConfig: …

JSON Schema response format.

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

name: str
schema: Dict[str, object]
type: Literal["json_schema"]
description: Optional[str]
strict: Optional[bool]
class FormatResponseFormatJsonObject: …

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: Literal["json_object"]
verbosity: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
top_logprobs: Optional[int]
top_p: Optional[float]
truncation: Optional[Literal["auto", "disabled"]]
One of the following:
"auto"
"disabled"
usage: Optional[OpenAIResponseUsage]

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

input_tokens: int
input_tokens_details: InputTokensDetails

A detailed breakdown of the input tokens.

cached_tokens: int
output_tokens: int
output_tokens_details: OutputTokensDetails

A detailed breakdown of the output tokens.

reasoning_tokens: int
total_tokens: int
user: Optional[str]
sequence_number: int
type: Literal["response.created"]
class ResponseErrorEvent: …

Emitted when an error occurs.

message: str
sequence_number: int
type: Literal["error"]
code: Optional[str]
param: Optional[str]
class ResponseFileSearchCallCompletedEvent: …

Emitted when a file search call is completed (results found).

item_id: str
output_index: int
sequence_number: int
type: Literal["response.file_search_call.completed"]
class ResponseFileSearchCallInProgressEvent: …

Emitted when a file search call is initiated.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.file_search_call.in_progress"]
class ResponseFileSearchCallSearchingEvent: …

Emitted when a file search is currently searching.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.file_search_call.searching"]
class ResponseFunctionCallArgumentsDeltaEvent: …

Emitted when there is a partial function-call arguments delta.

delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.function_call_arguments.delta"]
class ResponseFunctionCallArgumentsDoneEvent: …

Emitted when function-call arguments are finalized.

arguments: str
item_id: str
name: str
output_index: int
sequence_number: int
type: Literal["response.function_call_arguments.done"]
class ResponseInProgressEvent: …

Emitted when the response is in progress.

response: OpenAIResponse
id: str
created_at: float
model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]
One of the following:
Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more]
One of the following:
"gpt-5.2"
"gpt-5.2-2025-12-11"
"gpt-5.2-chat-latest"
"gpt-5.2-pro"
"gpt-5.2-pro-2025-12-11"
"gpt-5.1"
"gpt-5.1-2025-11-13"
"gpt-5.1-codex"
"gpt-5.1-mini"
"gpt-5.1-chat-latest"
"gpt-5"
"gpt-5-mini"
"gpt-5-nano"
"gpt-5-2025-08-07"
"gpt-5-mini-2025-08-07"
"gpt-5-nano-2025-08-07"
"gpt-5-chat-latest"
"gpt-4.1"
"gpt-4.1-mini"
"gpt-4.1-nano"
"gpt-4.1-2025-04-14"
"gpt-4.1-mini-2025-04-14"
"gpt-4.1-nano-2025-04-14"
"o4-mini"
"o4-mini-2025-04-16"
"o3"
"o3-2025-04-16"
"o3-mini"
"o3-mini-2025-01-31"
"o1"
"o1-2024-12-17"
"o1-preview"
"o1-preview-2024-09-12"
"o1-mini"
"o1-mini-2024-09-12"
"gpt-4o"
"gpt-4o-2024-11-20"
"gpt-4o-2024-08-06"
"gpt-4o-2024-05-13"
"gpt-4o-audio-preview"
"gpt-4o-audio-preview-2024-10-01"
"gpt-4o-audio-preview-2024-12-17"
"gpt-4o-audio-preview-2025-06-03"
"gpt-4o-mini-audio-preview"
"gpt-4o-mini-audio-preview-2024-12-17"
"gpt-4o-search-preview"
"gpt-4o-mini-search-preview"
"gpt-4o-search-preview-2025-03-11"
"gpt-4o-mini-search-preview-2025-03-11"
"chatgpt-4o-latest"
"codex-mini-latest"
"gpt-4o-mini"
"gpt-4o-mini-2024-07-18"
"gpt-4-turbo"
"gpt-4-turbo-2024-04-09"
"gpt-4-0125-preview"
"gpt-4-turbo-preview"
"gpt-4-1106-preview"
"gpt-4-vision-preview"
"gpt-4"
"gpt-4-0314"
"gpt-4-0613"
"gpt-4-32k"
"gpt-4-32k-0314"
"gpt-4-32k-0613"
"gpt-3.5-turbo"
"gpt-3.5-turbo-16k"
"gpt-3.5-turbo-0301"
"gpt-3.5-turbo-0613"
"gpt-3.5-turbo-1106"
"gpt-3.5-turbo-0125"
"gpt-3.5-turbo-16k-0613"
"o1-pro"
"o1-pro-2025-03-19"
"o3-pro"
"o3-pro-2025-06-10"
"o3-deep-research"
"o3-deep-research-2025-06-26"
"o4-mini-deep-research"
"o4-mini-deep-research-2025-06-26"
"computer-use-preview"
"computer-use-preview-2025-03-11"
"gpt-5-codex"
"gpt-5-pro"
"gpt-5-pro-2025-10-06"
"gpt-5.1-codex-max"
str
object: Literal["response"]
output: List[Output]
One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
parallel_tool_calls: bool
tool_choice: ToolChoice

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

One of the following:
Literal["none", "auto", "required"]
One of the following:
"none"
"auto"
"required"
class ToolChoiceAllowed: …

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

mode: Literal["auto", "required"]
One of the following:
"auto"
"required"
tools: List[Dict[str, object]]
type: Literal["allowed_tools"]
class ToolChoiceTypes: …

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

type: Literal["file_search", "web_search_preview", "computer_use_preview", 3 more]
One of the following:
"file_search"
"web_search_preview"
"computer_use_preview"
"web_search_preview_2025_03_11"
"image_generation"
"code_interpreter"
class ToolChoiceFunction: …

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

name: str
type: Literal["function"]
class ToolChoiceMcp: …

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

server_label: str
type: Literal["mcp"]
name: Optional[str]
class ToolChoiceCustom: …

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

name: str
type: Literal["custom"]
class ToolChoiceApplyPatch: …

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

type: Literal["apply_patch"]
class ToolChoiceShell: …

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

type: Literal["shell"]
tools: List[Tool]
One of the following:
class FunctionTool: …

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

Learn more about function calling.

name: str
type: Literal["function"]
description: Optional[str]
parameters: Optional[Dict[str, object]]
strict: Optional[bool]
class FileSearchTool: …

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

type: Literal["file_search"]
vector_store_ids: List[str]
filters: Optional[Filters]

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

One of the following:
class FiltersComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
class FiltersCompoundFilter: …

Combine multiple filters using and or or.

filters: List[FiltersCompoundFilterFilter]
One of the following:
class FiltersCompoundFilterFilterComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
object
type: Literal["and", "or"]
One of the following:
"and"
"or"
max_num_results: Optional[int]
ranking_options: Optional[RankingOptions]

Ranking options for search.

ranker: Optional[Literal["auto", "default-2024-11-15"]]
One of the following:
"auto"
"default-2024-11-15"
score_threshold: Optional[float]
class ComputerTool: …

A tool that controls a virtual computer.

Learn more about the computer tool.

display_height: int
display_width: int
environment: Literal["windows", "mac", "linux", 2 more]
One of the following:
"windows"
"mac"
"linux"
"ubuntu"
"browser"
type: Literal["computer_use_preview"]
class WebSearchTool: …

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

type: Literal["web_search", "web_search_2025_08_26"]
One of the following:
"web_search"
"web_search_2025_08_26"
filters: Optional[Filters]

Filters for the search.

allowed_domains: Optional[List[str]]
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The approximate location of the user.

city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
type: Optional[Literal["approximate"]]
class ToolMcp: …

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

server_label: str
type: Literal["mcp"]
allowed_tools: Optional[ToolMcpAllowedTools]

A filter object to specify which tools are allowed.

One of the following:
List[str]
class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
authorization: Optional[str]
connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", 5 more]]
One of the following:
"connector_dropbox"
"connector_gmail"
"connector_googlecalendar"
"connector_googledrive"
"connector_microsoftteams"
"connector_outlookcalendar"
"connector_outlookemail"
"connector_sharepoint"
headers: Optional[Dict[str, str]]
require_approval: Optional[ToolMcpRequireApproval]

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:
class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …

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: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
Literal["always", "never"]
One of the following:
"always"
"never"
server_description: Optional[str]
server_url: Optional[str]
class ToolCodeInterpreter: …

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

container: ToolCodeInterpreterContainer

Configuration for a code interpreter container.

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

One of the following:
str
class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …

Configuration for a code interpreter container.

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

type: Literal["auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
type: Literal["code_interpreter"]
class ToolImageGeneration: …

A tool that generates images using the GPT image models.

type: Literal["image_generation"]
action: Optional[Literal["generate", "edit", "auto"]]
One of the following:
"generate"
"edit"
"auto"
background: Optional[Literal["transparent", "opaque", "auto"]]
One of the following:
"transparent"
"opaque"
"auto"
input_fidelity: Optional[Literal["high", "low"]]
One of the following:
"high"
"low"
input_image_mask: Optional[ToolImageGenerationInputImageMask]

Optional mask for inpainting.

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

file_id: Optional[str]
image_url: Optional[str]
model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]
One of the following:
str
Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]
One of the following:
"gpt-image-1"
"gpt-image-1-mini"
"gpt-image-1.5"
moderation: Optional[Literal["auto", "low"]]
One of the following:
"auto"
"low"
output_compression: Optional[int]
output_format: Optional[Literal["png", "webp", "jpeg"]]
One of the following:
"png"
"webp"
"jpeg"
partial_images: Optional[int]
quality: Optional[Literal["low", "medium", "high", "auto"]]
One of the following:
"low"
"medium"
"high"
"auto"
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]
One of the following:
"1024x1024"
"1024x1536"
"1536x1024"
"auto"
class ToolLocalShell: …

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

type: Literal["local_shell"]
class FunctionShellTool: …

A tool that allows the model to execute shell commands.

type: Literal["shell"]
environment: Optional[Environment]
One of the following:
class EnvironmentContainerAuto: …
type: Literal["container_auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
skills: Optional[List[EnvironmentContainerAutoSkill]]
One of the following:
class EnvironmentContainerAutoSkillSkillReference: …
skill_id: str
type: Literal["skill_reference"]
version: Optional[str]
class EnvironmentContainerAutoSkillInlineSkill: …
description: str
name: str
source: EnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

data: str
media_type: Literal["application/zip"]
type: Literal["base64"]
type: Literal["inline"]
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
class CustomTool: …

A custom tool that processes input using a specified format.

Learn more about custom tools

name: str
type: Literal["custom"]
description: Optional[str]
format: Optional[Format]

Unconstrained free-form text.

One of the following:
class FormatText: …

Unconstrained free-form text.

type: Literal["text"]
class FormatGrammar: …

A grammar defined by the user.

definition: str
syntax: Literal["lark", "regex"]
One of the following:
"lark"
"regex"
type: Literal["grammar"]
class WebSearchPreviewTool: …

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

Learn more about the web search tool.

type: Literal["web_search_preview", "web_search_preview_2025_03_11"]
One of the following:
"web_search_preview"
"web_search_preview_2025_03_11"
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The user’s location.

type: Literal["approximate"]
city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
class ApplyPatchTool: …

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

type: Literal["apply_patch"]
background: Optional[bool]
completed_at: Optional[float]
conversation: Optional[Conversation]

The conversation that this response belonged to.

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

id: str
error: Optional[OpenAIResponseError]

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

code: Literal["server_error", "rate_limit_exceeded", "invalid_prompt", 15 more]
One of the following:
"server_error"
"rate_limit_exceeded"
"invalid_prompt"
"vector_store_timeout"
"invalid_image"
"invalid_image_format"
"invalid_base64_image"
"invalid_image_url"
"image_too_large"
"image_too_small"
"image_parse_error"
"image_content_policy_violation"
"invalid_image_mode"
"image_file_too_large"
"unsupported_image_media_type"
"empty_image_file"
"failed_to_download_image"
"image_file_not_found"
message: str
incomplete_details: Optional[IncompleteDetails]

Details about why the response is incomplete.

reason: Optional[Literal["max_output_tokens", "content_filter"]]
One of the following:
"max_output_tokens"
"content_filter"
instructions: Optional[Union[str, List[InstructionsInputItem], null]]
One of the following:
str
List[InstructionsInputItem]
One of the following:
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.

content: Union[str, List[ContentInputItem]]
One of the following:
str
List[ContentInputItem]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
type: Optional[Literal["message"]]
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.

content: List[Content]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "system", "developer"]
One of the following:
"user"
"system"
"developer"
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Optional[Literal["message"]]
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
class OpenAITypesResponsesResponseInputItemComputerCallOutput: …

The output of a computer tool call.

call_id: str

A computer screenshot image used with the computer use tool.

type: Literal["computer_screenshot"]
file_id: Optional[str]
image_url: Optional[str]
type: Literal["computer_call_output"]
id: Optional[str]
acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]
id: str
code: Optional[str]
message: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …

The output of a function tool call.

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OutputOutputContentListResponseInputTextContent: …

A text input to the model.

text: str
type: Literal["input_text"]
class OutputOutputContentListResponseInputImageContent: …

An image input to the model.

Learn about image inputs

type: Literal["input_image"]
detail: Optional[Literal["low", "high", "auto"]]
One of the following:
"low"
"high"
"auto"
file_id: Optional[str]
image_url: Optional[str]
class OutputOutputContentListResponseInputFileContent: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["function_call_output"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItemParam: …

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

encrypted_content: str
type: Literal["compaction"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseInputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …

The output of a local shell tool call.

id: str
output: str
type: Literal["local_shell_call_output"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCall: …

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

action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
type: Literal["shell_call"]
id: Optional[str]
environment: Optional[Environment]
One of the following:
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCallOutput: …

The streamed output items emitted by a shell tool call.

call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
type: Literal["shell_call_output"]
id: Optional[str]
max_output_length: Optional[int]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ApplyPatchCall: …

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

call_id: str
operation: Operation

Instruction for creating a new file via the apply_patch tool.

One of the following:
class OperationApplyPatchCallOperationCreateFile: …

Instruction for creating a new file via the apply_patch tool.

diff: str
path: str
type: Literal["create_file"]
class OperationApplyPatchCallOperationDeleteFile: …

Instruction for deleting an existing file via the apply_patch tool.

path: str
type: Literal["delete_file"]
class OperationApplyPatchCallOperationUpdateFile: …

Instruction for updating an existing file via the apply_patch tool.

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
id: Optional[str]
class ApplyPatchCallOutput: …

The streamed output emitted by an apply patch tool call.

call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
id: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …

A response to an MCP approval request.

approval_request_id: str
approve: bool
type: Literal["mcp_approval_response"]
id: Optional[str]
reason: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAIResponseCustomToolCallOutput: …

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

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["custom_tool_call_output"]
id: Optional[str]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemItemReference: …

An internal identifier for an item to reference.

id: str
type: Optional[Literal["item_reference"]]
max_output_tokens: Optional[int]
max_tool_calls: Optional[int]
metadata: Optional[Dict[str, str]]
previous_response_id: Optional[str]
prompt: Optional[OpenAIResponsePrompt]

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

id: str
variables: Optional[Dict[str, Variables]]
One of the following:
str
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
version: Optional[str]
prompt_cache_key: Optional[str]
prompt_cache_retention: Optional[Literal["in-memory", "24h"]]
One of the following:
"in-memory"
"24h"
reasoning: Optional[Reasoning]

gpt-5 and o-series models only

Configuration options for reasoning models.

effort: Optional[Literal["none", "minimal", "low", 3 more]]
One of the following:
"none"
"minimal"
"low"
"medium"
"high"
"xhigh"
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
safety_identifier: Optional[str]
service_tier: Optional[Literal["auto", "default", "flex", 2 more]]
One of the following:
"auto"
"default"
"flex"
"scale"
"priority"
status: Optional[Literal["completed", "failed", "in_progress", 3 more]]
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
temperature: Optional[float]
text: Optional[OpenAIResponseTextConfig]

Configuration options for a text response from the model.

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

format: Optional[Format]

Default response format. Used to generate text responses.

One of the following:
class FormatResponseFormatText: …

Default response format. Used to generate text responses.

type: Literal["text"]
class FormatResponseFormatTextJsonSchemaConfig: …

JSON Schema response format.

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

name: str
schema: Dict[str, object]
type: Literal["json_schema"]
description: Optional[str]
strict: Optional[bool]
class FormatResponseFormatJsonObject: …

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: Literal["json_object"]
verbosity: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
top_logprobs: Optional[int]
top_p: Optional[float]
truncation: Optional[Literal["auto", "disabled"]]
One of the following:
"auto"
"disabled"
usage: Optional[OpenAIResponseUsage]

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

input_tokens: int
input_tokens_details: InputTokensDetails

A detailed breakdown of the input tokens.

cached_tokens: int
output_tokens: int
output_tokens_details: OutputTokensDetails

A detailed breakdown of the output tokens.

reasoning_tokens: int
total_tokens: int
user: Optional[str]
sequence_number: int
type: Literal["response.in_progress"]
class ResponseFailedEvent: …

An event that is emitted when a response fails.

response: OpenAIResponse
id: str
created_at: float
model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]
One of the following:
Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more]
One of the following:
"gpt-5.2"
"gpt-5.2-2025-12-11"
"gpt-5.2-chat-latest"
"gpt-5.2-pro"
"gpt-5.2-pro-2025-12-11"
"gpt-5.1"
"gpt-5.1-2025-11-13"
"gpt-5.1-codex"
"gpt-5.1-mini"
"gpt-5.1-chat-latest"
"gpt-5"
"gpt-5-mini"
"gpt-5-nano"
"gpt-5-2025-08-07"
"gpt-5-mini-2025-08-07"
"gpt-5-nano-2025-08-07"
"gpt-5-chat-latest"
"gpt-4.1"
"gpt-4.1-mini"
"gpt-4.1-nano"
"gpt-4.1-2025-04-14"
"gpt-4.1-mini-2025-04-14"
"gpt-4.1-nano-2025-04-14"
"o4-mini"
"o4-mini-2025-04-16"
"o3"
"o3-2025-04-16"
"o3-mini"
"o3-mini-2025-01-31"
"o1"
"o1-2024-12-17"
"o1-preview"
"o1-preview-2024-09-12"
"o1-mini"
"o1-mini-2024-09-12"
"gpt-4o"
"gpt-4o-2024-11-20"
"gpt-4o-2024-08-06"
"gpt-4o-2024-05-13"
"gpt-4o-audio-preview"
"gpt-4o-audio-preview-2024-10-01"
"gpt-4o-audio-preview-2024-12-17"
"gpt-4o-audio-preview-2025-06-03"
"gpt-4o-mini-audio-preview"
"gpt-4o-mini-audio-preview-2024-12-17"
"gpt-4o-search-preview"
"gpt-4o-mini-search-preview"
"gpt-4o-search-preview-2025-03-11"
"gpt-4o-mini-search-preview-2025-03-11"
"chatgpt-4o-latest"
"codex-mini-latest"
"gpt-4o-mini"
"gpt-4o-mini-2024-07-18"
"gpt-4-turbo"
"gpt-4-turbo-2024-04-09"
"gpt-4-0125-preview"
"gpt-4-turbo-preview"
"gpt-4-1106-preview"
"gpt-4-vision-preview"
"gpt-4"
"gpt-4-0314"
"gpt-4-0613"
"gpt-4-32k"
"gpt-4-32k-0314"
"gpt-4-32k-0613"
"gpt-3.5-turbo"
"gpt-3.5-turbo-16k"
"gpt-3.5-turbo-0301"
"gpt-3.5-turbo-0613"
"gpt-3.5-turbo-1106"
"gpt-3.5-turbo-0125"
"gpt-3.5-turbo-16k-0613"
"o1-pro"
"o1-pro-2025-03-19"
"o3-pro"
"o3-pro-2025-06-10"
"o3-deep-research"
"o3-deep-research-2025-06-26"
"o4-mini-deep-research"
"o4-mini-deep-research-2025-06-26"
"computer-use-preview"
"computer-use-preview-2025-03-11"
"gpt-5-codex"
"gpt-5-pro"
"gpt-5-pro-2025-10-06"
"gpt-5.1-codex-max"
str
object: Literal["response"]
output: List[Output]
One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
parallel_tool_calls: bool
tool_choice: ToolChoice

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

One of the following:
Literal["none", "auto", "required"]
One of the following:
"none"
"auto"
"required"
class ToolChoiceAllowed: …

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

mode: Literal["auto", "required"]
One of the following:
"auto"
"required"
tools: List[Dict[str, object]]
type: Literal["allowed_tools"]
class ToolChoiceTypes: …

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

type: Literal["file_search", "web_search_preview", "computer_use_preview", 3 more]
One of the following:
"file_search"
"web_search_preview"
"computer_use_preview"
"web_search_preview_2025_03_11"
"image_generation"
"code_interpreter"
class ToolChoiceFunction: …

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

name: str
type: Literal["function"]
class ToolChoiceMcp: …

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

server_label: str
type: Literal["mcp"]
name: Optional[str]
class ToolChoiceCustom: …

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

name: str
type: Literal["custom"]
class ToolChoiceApplyPatch: …

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

type: Literal["apply_patch"]
class ToolChoiceShell: …

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

type: Literal["shell"]
tools: List[Tool]
One of the following:
class FunctionTool: …

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

Learn more about function calling.

name: str
type: Literal["function"]
description: Optional[str]
parameters: Optional[Dict[str, object]]
strict: Optional[bool]
class FileSearchTool: …

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

type: Literal["file_search"]
vector_store_ids: List[str]
filters: Optional[Filters]

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

One of the following:
class FiltersComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
class FiltersCompoundFilter: …

Combine multiple filters using and or or.

filters: List[FiltersCompoundFilterFilter]
One of the following:
class FiltersCompoundFilterFilterComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
object
type: Literal["and", "or"]
One of the following:
"and"
"or"
max_num_results: Optional[int]
ranking_options: Optional[RankingOptions]

Ranking options for search.

ranker: Optional[Literal["auto", "default-2024-11-15"]]
One of the following:
"auto"
"default-2024-11-15"
score_threshold: Optional[float]
class ComputerTool: …

A tool that controls a virtual computer.

Learn more about the computer tool.

display_height: int
display_width: int
environment: Literal["windows", "mac", "linux", 2 more]
One of the following:
"windows"
"mac"
"linux"
"ubuntu"
"browser"
type: Literal["computer_use_preview"]
class WebSearchTool: …

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

type: Literal["web_search", "web_search_2025_08_26"]
One of the following:
"web_search"
"web_search_2025_08_26"
filters: Optional[Filters]

Filters for the search.

allowed_domains: Optional[List[str]]
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The approximate location of the user.

city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
type: Optional[Literal["approximate"]]
class ToolMcp: …

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

server_label: str
type: Literal["mcp"]
allowed_tools: Optional[ToolMcpAllowedTools]

A filter object to specify which tools are allowed.

One of the following:
List[str]
class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
authorization: Optional[str]
connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", 5 more]]
One of the following:
"connector_dropbox"
"connector_gmail"
"connector_googlecalendar"
"connector_googledrive"
"connector_microsoftteams"
"connector_outlookcalendar"
"connector_outlookemail"
"connector_sharepoint"
headers: Optional[Dict[str, str]]
require_approval: Optional[ToolMcpRequireApproval]

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:
class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …

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: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
Literal["always", "never"]
One of the following:
"always"
"never"
server_description: Optional[str]
server_url: Optional[str]
class ToolCodeInterpreter: …

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

container: ToolCodeInterpreterContainer

Configuration for a code interpreter container.

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

One of the following:
str
class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …

Configuration for a code interpreter container.

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

type: Literal["auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
type: Literal["code_interpreter"]
class ToolImageGeneration: …

A tool that generates images using the GPT image models.

type: Literal["image_generation"]
action: Optional[Literal["generate", "edit", "auto"]]
One of the following:
"generate"
"edit"
"auto"
background: Optional[Literal["transparent", "opaque", "auto"]]
One of the following:
"transparent"
"opaque"
"auto"
input_fidelity: Optional[Literal["high", "low"]]
One of the following:
"high"
"low"
input_image_mask: Optional[ToolImageGenerationInputImageMask]

Optional mask for inpainting.

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

file_id: Optional[str]
image_url: Optional[str]
model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]
One of the following:
str
Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]
One of the following:
"gpt-image-1"
"gpt-image-1-mini"
"gpt-image-1.5"
moderation: Optional[Literal["auto", "low"]]
One of the following:
"auto"
"low"
output_compression: Optional[int]
output_format: Optional[Literal["png", "webp", "jpeg"]]
One of the following:
"png"
"webp"
"jpeg"
partial_images: Optional[int]
quality: Optional[Literal["low", "medium", "high", "auto"]]
One of the following:
"low"
"medium"
"high"
"auto"
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]
One of the following:
"1024x1024"
"1024x1536"
"1536x1024"
"auto"
class ToolLocalShell: …

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

type: Literal["local_shell"]
class FunctionShellTool: …

A tool that allows the model to execute shell commands.

type: Literal["shell"]
environment: Optional[Environment]
One of the following:
class EnvironmentContainerAuto: …
type: Literal["container_auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
skills: Optional[List[EnvironmentContainerAutoSkill]]
One of the following:
class EnvironmentContainerAutoSkillSkillReference: …
skill_id: str
type: Literal["skill_reference"]
version: Optional[str]
class EnvironmentContainerAutoSkillInlineSkill: …
description: str
name: str
source: EnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

data: str
media_type: Literal["application/zip"]
type: Literal["base64"]
type: Literal["inline"]
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
class CustomTool: …

A custom tool that processes input using a specified format.

Learn more about custom tools

name: str
type: Literal["custom"]
description: Optional[str]
format: Optional[Format]

Unconstrained free-form text.

One of the following:
class FormatText: …

Unconstrained free-form text.

type: Literal["text"]
class FormatGrammar: …

A grammar defined by the user.

definition: str
syntax: Literal["lark", "regex"]
One of the following:
"lark"
"regex"
type: Literal["grammar"]
class WebSearchPreviewTool: …

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

Learn more about the web search tool.

type: Literal["web_search_preview", "web_search_preview_2025_03_11"]
One of the following:
"web_search_preview"
"web_search_preview_2025_03_11"
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The user’s location.

type: Literal["approximate"]
city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
class ApplyPatchTool: …

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

type: Literal["apply_patch"]
background: Optional[bool]
completed_at: Optional[float]
conversation: Optional[Conversation]

The conversation that this response belonged to.

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

id: str
error: Optional[OpenAIResponseError]

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

code: Literal["server_error", "rate_limit_exceeded", "invalid_prompt", 15 more]
One of the following:
"server_error"
"rate_limit_exceeded"
"invalid_prompt"
"vector_store_timeout"
"invalid_image"
"invalid_image_format"
"invalid_base64_image"
"invalid_image_url"
"image_too_large"
"image_too_small"
"image_parse_error"
"image_content_policy_violation"
"invalid_image_mode"
"image_file_too_large"
"unsupported_image_media_type"
"empty_image_file"
"failed_to_download_image"
"image_file_not_found"
message: str
incomplete_details: Optional[IncompleteDetails]

Details about why the response is incomplete.

reason: Optional[Literal["max_output_tokens", "content_filter"]]
One of the following:
"max_output_tokens"
"content_filter"
instructions: Optional[Union[str, List[InstructionsInputItem], null]]
One of the following:
str
List[InstructionsInputItem]
One of the following:
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.

content: Union[str, List[ContentInputItem]]
One of the following:
str
List[ContentInputItem]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
type: Optional[Literal["message"]]
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.

content: List[Content]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "system", "developer"]
One of the following:
"user"
"system"
"developer"
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Optional[Literal["message"]]
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
class OpenAITypesResponsesResponseInputItemComputerCallOutput: …

The output of a computer tool call.

call_id: str

A computer screenshot image used with the computer use tool.

type: Literal["computer_screenshot"]
file_id: Optional[str]
image_url: Optional[str]
type: Literal["computer_call_output"]
id: Optional[str]
acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]
id: str
code: Optional[str]
message: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …

The output of a function tool call.

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OutputOutputContentListResponseInputTextContent: …

A text input to the model.

text: str
type: Literal["input_text"]
class OutputOutputContentListResponseInputImageContent: …

An image input to the model.

Learn about image inputs

type: Literal["input_image"]
detail: Optional[Literal["low", "high", "auto"]]
One of the following:
"low"
"high"
"auto"
file_id: Optional[str]
image_url: Optional[str]
class OutputOutputContentListResponseInputFileContent: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["function_call_output"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItemParam: …

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

encrypted_content: str
type: Literal["compaction"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseInputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …

The output of a local shell tool call.

id: str
output: str
type: Literal["local_shell_call_output"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCall: …

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

action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
type: Literal["shell_call"]
id: Optional[str]
environment: Optional[Environment]
One of the following:
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCallOutput: …

The streamed output items emitted by a shell tool call.

call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
type: Literal["shell_call_output"]
id: Optional[str]
max_output_length: Optional[int]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ApplyPatchCall: …

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

call_id: str
operation: Operation

Instruction for creating a new file via the apply_patch tool.

One of the following:
class OperationApplyPatchCallOperationCreateFile: …

Instruction for creating a new file via the apply_patch tool.

diff: str
path: str
type: Literal["create_file"]
class OperationApplyPatchCallOperationDeleteFile: …

Instruction for deleting an existing file via the apply_patch tool.

path: str
type: Literal["delete_file"]
class OperationApplyPatchCallOperationUpdateFile: …

Instruction for updating an existing file via the apply_patch tool.

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
id: Optional[str]
class ApplyPatchCallOutput: …

The streamed output emitted by an apply patch tool call.

call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
id: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …

A response to an MCP approval request.

approval_request_id: str
approve: bool
type: Literal["mcp_approval_response"]
id: Optional[str]
reason: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAIResponseCustomToolCallOutput: …

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

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["custom_tool_call_output"]
id: Optional[str]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemItemReference: …

An internal identifier for an item to reference.

id: str
type: Optional[Literal["item_reference"]]
max_output_tokens: Optional[int]
max_tool_calls: Optional[int]
metadata: Optional[Dict[str, str]]
previous_response_id: Optional[str]
prompt: Optional[OpenAIResponsePrompt]

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

id: str
variables: Optional[Dict[str, Variables]]
One of the following:
str
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
version: Optional[str]
prompt_cache_key: Optional[str]
prompt_cache_retention: Optional[Literal["in-memory", "24h"]]
One of the following:
"in-memory"
"24h"
reasoning: Optional[Reasoning]

gpt-5 and o-series models only

Configuration options for reasoning models.

effort: Optional[Literal["none", "minimal", "low", 3 more]]
One of the following:
"none"
"minimal"
"low"
"medium"
"high"
"xhigh"
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
safety_identifier: Optional[str]
service_tier: Optional[Literal["auto", "default", "flex", 2 more]]
One of the following:
"auto"
"default"
"flex"
"scale"
"priority"
status: Optional[Literal["completed", "failed", "in_progress", 3 more]]
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
temperature: Optional[float]
text: Optional[OpenAIResponseTextConfig]

Configuration options for a text response from the model.

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

format: Optional[Format]

Default response format. Used to generate text responses.

One of the following:
class FormatResponseFormatText: …

Default response format. Used to generate text responses.

type: Literal["text"]
class FormatResponseFormatTextJsonSchemaConfig: …

JSON Schema response format.

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

name: str
schema: Dict[str, object]
type: Literal["json_schema"]
description: Optional[str]
strict: Optional[bool]
class FormatResponseFormatJsonObject: …

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: Literal["json_object"]
verbosity: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
top_logprobs: Optional[int]
top_p: Optional[float]
truncation: Optional[Literal["auto", "disabled"]]
One of the following:
"auto"
"disabled"
usage: Optional[OpenAIResponseUsage]

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

input_tokens: int
input_tokens_details: InputTokensDetails

A detailed breakdown of the input tokens.

cached_tokens: int
output_tokens: int
output_tokens_details: OutputTokensDetails

A detailed breakdown of the output tokens.

reasoning_tokens: int
total_tokens: int
user: Optional[str]
sequence_number: int
type: Literal["response.failed"]
class ResponseIncompleteEvent: …

An event that is emitted when a response finishes as incomplete.

response: OpenAIResponse
id: str
created_at: float
model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]
One of the following:
Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more]
One of the following:
"gpt-5.2"
"gpt-5.2-2025-12-11"
"gpt-5.2-chat-latest"
"gpt-5.2-pro"
"gpt-5.2-pro-2025-12-11"
"gpt-5.1"
"gpt-5.1-2025-11-13"
"gpt-5.1-codex"
"gpt-5.1-mini"
"gpt-5.1-chat-latest"
"gpt-5"
"gpt-5-mini"
"gpt-5-nano"
"gpt-5-2025-08-07"
"gpt-5-mini-2025-08-07"
"gpt-5-nano-2025-08-07"
"gpt-5-chat-latest"
"gpt-4.1"
"gpt-4.1-mini"
"gpt-4.1-nano"
"gpt-4.1-2025-04-14"
"gpt-4.1-mini-2025-04-14"
"gpt-4.1-nano-2025-04-14"
"o4-mini"
"o4-mini-2025-04-16"
"o3"
"o3-2025-04-16"
"o3-mini"
"o3-mini-2025-01-31"
"o1"
"o1-2024-12-17"
"o1-preview"
"o1-preview-2024-09-12"
"o1-mini"
"o1-mini-2024-09-12"
"gpt-4o"
"gpt-4o-2024-11-20"
"gpt-4o-2024-08-06"
"gpt-4o-2024-05-13"
"gpt-4o-audio-preview"
"gpt-4o-audio-preview-2024-10-01"
"gpt-4o-audio-preview-2024-12-17"
"gpt-4o-audio-preview-2025-06-03"
"gpt-4o-mini-audio-preview"
"gpt-4o-mini-audio-preview-2024-12-17"
"gpt-4o-search-preview"
"gpt-4o-mini-search-preview"
"gpt-4o-search-preview-2025-03-11"
"gpt-4o-mini-search-preview-2025-03-11"
"chatgpt-4o-latest"
"codex-mini-latest"
"gpt-4o-mini"
"gpt-4o-mini-2024-07-18"
"gpt-4-turbo"
"gpt-4-turbo-2024-04-09"
"gpt-4-0125-preview"
"gpt-4-turbo-preview"
"gpt-4-1106-preview"
"gpt-4-vision-preview"
"gpt-4"
"gpt-4-0314"
"gpt-4-0613"
"gpt-4-32k"
"gpt-4-32k-0314"
"gpt-4-32k-0613"
"gpt-3.5-turbo"
"gpt-3.5-turbo-16k"
"gpt-3.5-turbo-0301"
"gpt-3.5-turbo-0613"
"gpt-3.5-turbo-1106"
"gpt-3.5-turbo-0125"
"gpt-3.5-turbo-16k-0613"
"o1-pro"
"o1-pro-2025-03-19"
"o3-pro"
"o3-pro-2025-06-10"
"o3-deep-research"
"o3-deep-research-2025-06-26"
"o4-mini-deep-research"
"o4-mini-deep-research-2025-06-26"
"computer-use-preview"
"computer-use-preview-2025-03-11"
"gpt-5-codex"
"gpt-5-pro"
"gpt-5-pro-2025-10-06"
"gpt-5.1-codex-max"
str
object: Literal["response"]
output: List[Output]
One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
parallel_tool_calls: bool
tool_choice: ToolChoice

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

One of the following:
Literal["none", "auto", "required"]
One of the following:
"none"
"auto"
"required"
class ToolChoiceAllowed: …

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

mode: Literal["auto", "required"]
One of the following:
"auto"
"required"
tools: List[Dict[str, object]]
type: Literal["allowed_tools"]
class ToolChoiceTypes: …

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

type: Literal["file_search", "web_search_preview", "computer_use_preview", 3 more]
One of the following:
"file_search"
"web_search_preview"
"computer_use_preview"
"web_search_preview_2025_03_11"
"image_generation"
"code_interpreter"
class ToolChoiceFunction: …

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

name: str
type: Literal["function"]
class ToolChoiceMcp: …

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

server_label: str
type: Literal["mcp"]
name: Optional[str]
class ToolChoiceCustom: …

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

name: str
type: Literal["custom"]
class ToolChoiceApplyPatch: …

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

type: Literal["apply_patch"]
class ToolChoiceShell: …

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

type: Literal["shell"]
tools: List[Tool]
One of the following:
class FunctionTool: …

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

Learn more about function calling.

name: str
type: Literal["function"]
description: Optional[str]
parameters: Optional[Dict[str, object]]
strict: Optional[bool]
class FileSearchTool: …

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

type: Literal["file_search"]
vector_store_ids: List[str]
filters: Optional[Filters]

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

One of the following:
class FiltersComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
class FiltersCompoundFilter: …

Combine multiple filters using and or or.

filters: List[FiltersCompoundFilterFilter]
One of the following:
class FiltersCompoundFilterFilterComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
object
type: Literal["and", "or"]
One of the following:
"and"
"or"
max_num_results: Optional[int]
ranking_options: Optional[RankingOptions]

Ranking options for search.

ranker: Optional[Literal["auto", "default-2024-11-15"]]
One of the following:
"auto"
"default-2024-11-15"
score_threshold: Optional[float]
class ComputerTool: …

A tool that controls a virtual computer.

Learn more about the computer tool.

display_height: int
display_width: int
environment: Literal["windows", "mac", "linux", 2 more]
One of the following:
"windows"
"mac"
"linux"
"ubuntu"
"browser"
type: Literal["computer_use_preview"]
class WebSearchTool: …

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

type: Literal["web_search", "web_search_2025_08_26"]
One of the following:
"web_search"
"web_search_2025_08_26"
filters: Optional[Filters]

Filters for the search.

allowed_domains: Optional[List[str]]
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The approximate location of the user.

city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
type: Optional[Literal["approximate"]]
class ToolMcp: …

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

server_label: str
type: Literal["mcp"]
allowed_tools: Optional[ToolMcpAllowedTools]

A filter object to specify which tools are allowed.

One of the following:
List[str]
class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
authorization: Optional[str]
connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", 5 more]]
One of the following:
"connector_dropbox"
"connector_gmail"
"connector_googlecalendar"
"connector_googledrive"
"connector_microsoftteams"
"connector_outlookcalendar"
"connector_outlookemail"
"connector_sharepoint"
headers: Optional[Dict[str, str]]
require_approval: Optional[ToolMcpRequireApproval]

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:
class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …

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: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
Literal["always", "never"]
One of the following:
"always"
"never"
server_description: Optional[str]
server_url: Optional[str]
class ToolCodeInterpreter: …

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

container: ToolCodeInterpreterContainer

Configuration for a code interpreter container.

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

One of the following:
str
class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …

Configuration for a code interpreter container.

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

type: Literal["auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
type: Literal["code_interpreter"]
class ToolImageGeneration: …

A tool that generates images using the GPT image models.

type: Literal["image_generation"]
action: Optional[Literal["generate", "edit", "auto"]]
One of the following:
"generate"
"edit"
"auto"
background: Optional[Literal["transparent", "opaque", "auto"]]
One of the following:
"transparent"
"opaque"
"auto"
input_fidelity: Optional[Literal["high", "low"]]
One of the following:
"high"
"low"
input_image_mask: Optional[ToolImageGenerationInputImageMask]

Optional mask for inpainting.

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

file_id: Optional[str]
image_url: Optional[str]
model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]
One of the following:
str
Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]
One of the following:
"gpt-image-1"
"gpt-image-1-mini"
"gpt-image-1.5"
moderation: Optional[Literal["auto", "low"]]
One of the following:
"auto"
"low"
output_compression: Optional[int]
output_format: Optional[Literal["png", "webp", "jpeg"]]
One of the following:
"png"
"webp"
"jpeg"
partial_images: Optional[int]
quality: Optional[Literal["low", "medium", "high", "auto"]]
One of the following:
"low"
"medium"
"high"
"auto"
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]
One of the following:
"1024x1024"
"1024x1536"
"1536x1024"
"auto"
class ToolLocalShell: …

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

type: Literal["local_shell"]
class FunctionShellTool: …

A tool that allows the model to execute shell commands.

type: Literal["shell"]
environment: Optional[Environment]
One of the following:
class EnvironmentContainerAuto: …
type: Literal["container_auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
skills: Optional[List[EnvironmentContainerAutoSkill]]
One of the following:
class EnvironmentContainerAutoSkillSkillReference: …
skill_id: str
type: Literal["skill_reference"]
version: Optional[str]
class EnvironmentContainerAutoSkillInlineSkill: …
description: str
name: str
source: EnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

data: str
media_type: Literal["application/zip"]
type: Literal["base64"]
type: Literal["inline"]
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
class CustomTool: …

A custom tool that processes input using a specified format.

Learn more about custom tools

name: str
type: Literal["custom"]
description: Optional[str]
format: Optional[Format]

Unconstrained free-form text.

One of the following:
class FormatText: …

Unconstrained free-form text.

type: Literal["text"]
class FormatGrammar: …

A grammar defined by the user.

definition: str
syntax: Literal["lark", "regex"]
One of the following:
"lark"
"regex"
type: Literal["grammar"]
class WebSearchPreviewTool: …

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

Learn more about the web search tool.

type: Literal["web_search_preview", "web_search_preview_2025_03_11"]
One of the following:
"web_search_preview"
"web_search_preview_2025_03_11"
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The user’s location.

type: Literal["approximate"]
city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
class ApplyPatchTool: …

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

type: Literal["apply_patch"]
background: Optional[bool]
completed_at: Optional[float]
conversation: Optional[Conversation]

The conversation that this response belonged to.

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

id: str
error: Optional[OpenAIResponseError]

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

code: Literal["server_error", "rate_limit_exceeded", "invalid_prompt", 15 more]
One of the following:
"server_error"
"rate_limit_exceeded"
"invalid_prompt"
"vector_store_timeout"
"invalid_image"
"invalid_image_format"
"invalid_base64_image"
"invalid_image_url"
"image_too_large"
"image_too_small"
"image_parse_error"
"image_content_policy_violation"
"invalid_image_mode"
"image_file_too_large"
"unsupported_image_media_type"
"empty_image_file"
"failed_to_download_image"
"image_file_not_found"
message: str
incomplete_details: Optional[IncompleteDetails]

Details about why the response is incomplete.

reason: Optional[Literal["max_output_tokens", "content_filter"]]
One of the following:
"max_output_tokens"
"content_filter"
instructions: Optional[Union[str, List[InstructionsInputItem], null]]
One of the following:
str
List[InstructionsInputItem]
One of the following:
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.

content: Union[str, List[ContentInputItem]]
One of the following:
str
List[ContentInputItem]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
type: Optional[Literal["message"]]
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.

content: List[Content]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "system", "developer"]
One of the following:
"user"
"system"
"developer"
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Optional[Literal["message"]]
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
class OpenAITypesResponsesResponseInputItemComputerCallOutput: …

The output of a computer tool call.

call_id: str

A computer screenshot image used with the computer use tool.

type: Literal["computer_screenshot"]
file_id: Optional[str]
image_url: Optional[str]
type: Literal["computer_call_output"]
id: Optional[str]
acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]
id: str
code: Optional[str]
message: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …

The output of a function tool call.

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OutputOutputContentListResponseInputTextContent: …

A text input to the model.

text: str
type: Literal["input_text"]
class OutputOutputContentListResponseInputImageContent: …

An image input to the model.

Learn about image inputs

type: Literal["input_image"]
detail: Optional[Literal["low", "high", "auto"]]
One of the following:
"low"
"high"
"auto"
file_id: Optional[str]
image_url: Optional[str]
class OutputOutputContentListResponseInputFileContent: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["function_call_output"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItemParam: …

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

encrypted_content: str
type: Literal["compaction"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseInputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …

The output of a local shell tool call.

id: str
output: str
type: Literal["local_shell_call_output"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCall: …

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

action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
type: Literal["shell_call"]
id: Optional[str]
environment: Optional[Environment]
One of the following:
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCallOutput: …

The streamed output items emitted by a shell tool call.

call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
type: Literal["shell_call_output"]
id: Optional[str]
max_output_length: Optional[int]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ApplyPatchCall: …

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

call_id: str
operation: Operation

Instruction for creating a new file via the apply_patch tool.

One of the following:
class OperationApplyPatchCallOperationCreateFile: …

Instruction for creating a new file via the apply_patch tool.

diff: str
path: str
type: Literal["create_file"]
class OperationApplyPatchCallOperationDeleteFile: …

Instruction for deleting an existing file via the apply_patch tool.

path: str
type: Literal["delete_file"]
class OperationApplyPatchCallOperationUpdateFile: …

Instruction for updating an existing file via the apply_patch tool.

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
id: Optional[str]
class ApplyPatchCallOutput: …

The streamed output emitted by an apply patch tool call.

call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
id: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …

A response to an MCP approval request.

approval_request_id: str
approve: bool
type: Literal["mcp_approval_response"]
id: Optional[str]
reason: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAIResponseCustomToolCallOutput: …

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

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["custom_tool_call_output"]
id: Optional[str]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemItemReference: …

An internal identifier for an item to reference.

id: str
type: Optional[Literal["item_reference"]]
max_output_tokens: Optional[int]
max_tool_calls: Optional[int]
metadata: Optional[Dict[str, str]]
previous_response_id: Optional[str]
prompt: Optional[OpenAIResponsePrompt]

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

id: str
variables: Optional[Dict[str, Variables]]
One of the following:
str
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
version: Optional[str]
prompt_cache_key: Optional[str]
prompt_cache_retention: Optional[Literal["in-memory", "24h"]]
One of the following:
"in-memory"
"24h"
reasoning: Optional[Reasoning]

gpt-5 and o-series models only

Configuration options for reasoning models.

effort: Optional[Literal["none", "minimal", "low", 3 more]]
One of the following:
"none"
"minimal"
"low"
"medium"
"high"
"xhigh"
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
safety_identifier: Optional[str]
service_tier: Optional[Literal["auto", "default", "flex", 2 more]]
One of the following:
"auto"
"default"
"flex"
"scale"
"priority"
status: Optional[Literal["completed", "failed", "in_progress", 3 more]]
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
temperature: Optional[float]
text: Optional[OpenAIResponseTextConfig]

Configuration options for a text response from the model.

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

format: Optional[Format]

Default response format. Used to generate text responses.

One of the following:
class FormatResponseFormatText: …

Default response format. Used to generate text responses.

type: Literal["text"]
class FormatResponseFormatTextJsonSchemaConfig: …

JSON Schema response format.

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

name: str
schema: Dict[str, object]
type: Literal["json_schema"]
description: Optional[str]
strict: Optional[bool]
class FormatResponseFormatJsonObject: …

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: Literal["json_object"]
verbosity: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
top_logprobs: Optional[int]
top_p: Optional[float]
truncation: Optional[Literal["auto", "disabled"]]
One of the following:
"auto"
"disabled"
usage: Optional[OpenAIResponseUsage]

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

input_tokens: int
input_tokens_details: InputTokensDetails

A detailed breakdown of the input tokens.

cached_tokens: int
output_tokens: int
output_tokens_details: OutputTokensDetails

A detailed breakdown of the output tokens.

reasoning_tokens: int
total_tokens: int
user: Optional[str]
sequence_number: int
type: Literal["response.incomplete"]
class ResponseOutputItemAddedEvent: …

Emitted when a new output item is added.

item: ResponseOutputItemAddedEventItem

An output message from the model.

One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
output_index: int
sequence_number: int
type: Literal["response.output_item.added"]
class ResponseOutputItemDoneEvent: …

Emitted when an output item is marked done.

item: ResponseOutputItemDoneEventItem

An output message from the model.

One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
output_index: int
sequence_number: int
type: Literal["response.output_item.done"]
class ResponseReasoningSummaryPartAddedEvent: …

Emitted when a new reasoning summary part is added.

item_id: str
output_index: int
part: ResponseReasoningSummaryPartAddedEventPart

The summary part that was added.

text: str
type: Literal["summary_text"]
sequence_number: int
summary_index: int
type: Literal["response.reasoning_summary_part.added"]
class ResponseReasoningSummaryPartDoneEvent: …

Emitted when a reasoning summary part is completed.

item_id: str
output_index: int
part: ResponseReasoningSummaryPartDoneEventPart

The completed summary part.

text: str
type: Literal["summary_text"]
sequence_number: int
summary_index: int
type: Literal["response.reasoning_summary_part.done"]
class ResponseReasoningSummaryTextDeltaEvent: …

Emitted when a delta is added to a reasoning summary text.

delta: str
item_id: str
output_index: int
sequence_number: int
summary_index: int
type: Literal["response.reasoning_summary_text.delta"]
class ResponseReasoningSummaryTextDoneEvent: …

Emitted when a reasoning summary text is completed.

item_id: str
output_index: int
sequence_number: int
summary_index: int
text: str
type: Literal["response.reasoning_summary_text.done"]
class ResponseReasoningTextDeltaEvent: …

Emitted when a delta is added to a reasoning text.

content_index: int
delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.reasoning_text.delta"]
class ResponseReasoningTextDoneEvent: …

Emitted when a reasoning text is completed.

content_index: int
item_id: str
output_index: int
sequence_number: int
text: str
type: Literal["response.reasoning_text.done"]
class ResponseRefusalDeltaEvent: …

Emitted when there is a partial refusal text.

content_index: int
delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.refusal.delta"]
class ResponseRefusalDoneEvent: …

Emitted when refusal text is finalized.

content_index: int
item_id: str
output_index: int
refusal: str
sequence_number: int
type: Literal["response.refusal.done"]
class ResponseTextDeltaEvent: …

Emitted when there is an additional text delta.

content_index: int
delta: str
item_id: str
logprobs: List[ResponseTextDeltaEventLogprob]
token: str
logprob: float
top_logprobs: Optional[List[ResponseTextDeltaEventLogprobTopLogprob]]
token: Optional[str]
logprob: Optional[float]
output_index: int
sequence_number: int
type: Literal["response.output_text.delta"]
class ResponseTextDoneEvent: …

Emitted when text content is finalized.

content_index: int
item_id: str
logprobs: List[ResponseTextDoneEventLogprob]
token: str
logprob: float
top_logprobs: Optional[List[ResponseTextDoneEventLogprobTopLogprob]]
token: Optional[str]
logprob: Optional[float]
output_index: int
sequence_number: int
text: str
type: Literal["response.output_text.done"]
class ResponseWebSearchCallCompletedEvent: …

Emitted when a web search call is completed.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.web_search_call.completed"]
class ResponseWebSearchCallInProgressEvent: …

Emitted when a web search call is initiated.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.web_search_call.in_progress"]
class ResponseWebSearchCallSearchingEvent: …

Emitted when a web search call is executing.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.web_search_call.searching"]
class ResponseImageGenCallCompletedEvent: …

Emitted when an image generation tool call has completed and the final image is available.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.image_generation_call.completed"]
class ResponseImageGenCallGeneratingEvent: …

Emitted when an image generation tool call is actively generating an image (intermediate state).

item_id: str
output_index: int
sequence_number: int
type: Literal["response.image_generation_call.generating"]
class ResponseImageGenCallInProgressEvent: …

Emitted when an image generation tool call is in progress.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.image_generation_call.in_progress"]
class ResponseImageGenCallPartialImageEvent: …

Emitted when a partial image is available during image generation streaming.

item_id: str
output_index: int
partial_image_b64: str
partial_image_index: int
sequence_number: int
type: Literal["response.image_generation_call.partial_image"]
class ResponseMcpCallArgumentsDeltaEvent: …

Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_call_arguments.delta"]
class ResponseMcpCallArgumentsDoneEvent: …

Emitted when the arguments for an MCP tool call are finalized.

arguments: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_call_arguments.done"]
class ResponseMcpCallCompletedEvent: …

Emitted when an MCP tool call has completed successfully.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_call.completed"]
class ResponseMcpCallFailedEvent: …

Emitted when an MCP tool call has failed.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_call.failed"]
class ResponseMcpCallInProgressEvent: …

Emitted when an MCP tool call is in progress.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_call.in_progress"]
class ResponseMcpListToolsCompletedEvent: …

Emitted when the list of available MCP tools has been successfully retrieved.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_list_tools.completed"]
class ResponseMcpListToolsFailedEvent: …

Emitted when the attempt to list available MCP tools has failed.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_list_tools.failed"]
class ResponseMcpListToolsInProgressEvent: …

Emitted when the system is in the process of retrieving the list of available MCP tools.

item_id: str
output_index: int
sequence_number: int
type: Literal["response.mcp_list_tools.in_progress"]
class ResponseOutputTextAnnotationAddedEvent: …

Emitted when an annotation is added to output text content.

annotation: object
annotation_index: int
content_index: int
item_id: str
output_index: int
sequence_number: int
type: Literal["response.output_text.annotation.added"]
class ResponseQueuedEvent: …

Emitted when a response is queued and waiting to be processed.

response: OpenAIResponse
id: str
created_at: float
model: Union[Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more], str]
One of the following:
Literal["gpt-5.2", "gpt-5.2-2025-12-11", "gpt-5.2-chat-latest", 83 more]
One of the following:
"gpt-5.2"
"gpt-5.2-2025-12-11"
"gpt-5.2-chat-latest"
"gpt-5.2-pro"
"gpt-5.2-pro-2025-12-11"
"gpt-5.1"
"gpt-5.1-2025-11-13"
"gpt-5.1-codex"
"gpt-5.1-mini"
"gpt-5.1-chat-latest"
"gpt-5"
"gpt-5-mini"
"gpt-5-nano"
"gpt-5-2025-08-07"
"gpt-5-mini-2025-08-07"
"gpt-5-nano-2025-08-07"
"gpt-5-chat-latest"
"gpt-4.1"
"gpt-4.1-mini"
"gpt-4.1-nano"
"gpt-4.1-2025-04-14"
"gpt-4.1-mini-2025-04-14"
"gpt-4.1-nano-2025-04-14"
"o4-mini"
"o4-mini-2025-04-16"
"o3"
"o3-2025-04-16"
"o3-mini"
"o3-mini-2025-01-31"
"o1"
"o1-2024-12-17"
"o1-preview"
"o1-preview-2024-09-12"
"o1-mini"
"o1-mini-2024-09-12"
"gpt-4o"
"gpt-4o-2024-11-20"
"gpt-4o-2024-08-06"
"gpt-4o-2024-05-13"
"gpt-4o-audio-preview"
"gpt-4o-audio-preview-2024-10-01"
"gpt-4o-audio-preview-2024-12-17"
"gpt-4o-audio-preview-2025-06-03"
"gpt-4o-mini-audio-preview"
"gpt-4o-mini-audio-preview-2024-12-17"
"gpt-4o-search-preview"
"gpt-4o-mini-search-preview"
"gpt-4o-search-preview-2025-03-11"
"gpt-4o-mini-search-preview-2025-03-11"
"chatgpt-4o-latest"
"codex-mini-latest"
"gpt-4o-mini"
"gpt-4o-mini-2024-07-18"
"gpt-4-turbo"
"gpt-4-turbo-2024-04-09"
"gpt-4-0125-preview"
"gpt-4-turbo-preview"
"gpt-4-1106-preview"
"gpt-4-vision-preview"
"gpt-4"
"gpt-4-0314"
"gpt-4-0613"
"gpt-4-32k"
"gpt-4-32k-0314"
"gpt-4-32k-0613"
"gpt-3.5-turbo"
"gpt-3.5-turbo-16k"
"gpt-3.5-turbo-0301"
"gpt-3.5-turbo-0613"
"gpt-3.5-turbo-1106"
"gpt-3.5-turbo-0125"
"gpt-3.5-turbo-16k-0613"
"o1-pro"
"o1-pro-2025-03-19"
"o3-pro"
"o3-pro-2025-06-10"
"o3-deep-research"
"o3-deep-research-2025-06-26"
"o4-mini-deep-research"
"o4-mini-deep-research-2025-06-26"
"computer-use-preview"
"computer-use-preview-2025-03-11"
"gpt-5-codex"
"gpt-5-pro"
"gpt-5-pro-2025-10-06"
"gpt-5.1-codex-max"
str
object: Literal["response"]
output: List[Output]
One of the following:
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItem: …

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

id: str
encrypted_content: str
type: Literal["compaction"]
created_by: Optional[str]
class OpenAITypesResponsesResponseOutputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseOutputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class ResponseFunctionShellToolCall: …

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

id: str
action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call"]
created_by: Optional[str]
environment: Optional[Environment]

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

One of the following:
class EnvironmentResponseLocalEnvironment: …

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

type: Literal["local"]
class EnvironmentResponseContainerReference: …

Represents a container created with /v1/containers.

container_id: str
type: Literal["container_reference"]
class ResponseFunctionShellToolCallOutput: …

The output of a shell tool call that was emitted.

id: str
call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutputOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutputOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
created_by: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["shell_call_output"]
created_by: Optional[str]
max_output_length: Optional[int]
class ResponseApplyPatchToolCall: …

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

id: str
call_id: str
operation: Operation

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

One of the following:
class OperationOperationCreateFile: …

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

diff: str
path: str
type: Literal["create_file"]
class OperationOperationDeleteFile: …

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

path: str
type: Literal["delete_file"]
class OperationOperationUpdateFile: …

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

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
created_by: Optional[str]
class ResponseApplyPatchToolCallOutput: …

The output emitted by an apply patch tool call.

id: str
call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
created_by: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseOutputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAITypesResponsesResponseOutputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
parallel_tool_calls: bool
tool_choice: ToolChoice

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

One of the following:
Literal["none", "auto", "required"]
One of the following:
"none"
"auto"
"required"
class ToolChoiceAllowed: …

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

mode: Literal["auto", "required"]
One of the following:
"auto"
"required"
tools: List[Dict[str, object]]
type: Literal["allowed_tools"]
class ToolChoiceTypes: …

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

type: Literal["file_search", "web_search_preview", "computer_use_preview", 3 more]
One of the following:
"file_search"
"web_search_preview"
"computer_use_preview"
"web_search_preview_2025_03_11"
"image_generation"
"code_interpreter"
class ToolChoiceFunction: …

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

name: str
type: Literal["function"]
class ToolChoiceMcp: …

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

server_label: str
type: Literal["mcp"]
name: Optional[str]
class ToolChoiceCustom: …

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

name: str
type: Literal["custom"]
class ToolChoiceApplyPatch: …

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

type: Literal["apply_patch"]
class ToolChoiceShell: …

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

type: Literal["shell"]
tools: List[Tool]
One of the following:
class FunctionTool: …

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

Learn more about function calling.

name: str
type: Literal["function"]
description: Optional[str]
parameters: Optional[Dict[str, object]]
strict: Optional[bool]
class FileSearchTool: …

A tool that searches for relevant content from uploaded files.

Learn more about the file search tool.

type: Literal["file_search"]
vector_store_ids: List[str]
filters: Optional[Filters]

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

One of the following:
class FiltersComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
class FiltersCompoundFilter: …

Combine multiple filters using and or or.

filters: List[FiltersCompoundFilterFilter]
One of the following:
class FiltersCompoundFilterFilterComparisonFilter: …

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

key: str
type: Literal["eq", "ne", "gt", 3 more]
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
value: Union[str, float, bool, List[Union[str, float]]]
One of the following:
str
float
bool
List[Union[str, float]]
One of the following:
str
float
object
type: Literal["and", "or"]
One of the following:
"and"
"or"
max_num_results: Optional[int]
ranking_options: Optional[RankingOptions]

Ranking options for search.

ranker: Optional[Literal["auto", "default-2024-11-15"]]
One of the following:
"auto"
"default-2024-11-15"
score_threshold: Optional[float]
class ComputerTool: …

A tool that controls a virtual computer.

Learn more about the computer tool.

display_height: int
display_width: int
environment: Literal["windows", "mac", "linux", 2 more]
One of the following:
"windows"
"mac"
"linux"
"ubuntu"
"browser"
type: Literal["computer_use_preview"]
class WebSearchTool: …

Search the Internet for sources related to the prompt.

Learn more about the web search tool.

type: Literal["web_search", "web_search_2025_08_26"]
One of the following:
"web_search"
"web_search_2025_08_26"
filters: Optional[Filters]

Filters for the search.

allowed_domains: Optional[List[str]]
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The approximate location of the user.

city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
type: Optional[Literal["approximate"]]
class ToolMcp: …

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

server_label: str
type: Literal["mcp"]
allowed_tools: Optional[ToolMcpAllowedTools]

A filter object to specify which tools are allowed.

One of the following:
List[str]
class ToolMcpAllowedToolsMcpAllowedToolsMcpToolFilter: …

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
authorization: Optional[str]
connector_id: Optional[Literal["connector_dropbox", "connector_gmail", "connector_googlecalendar", 5 more]]
One of the following:
"connector_dropbox"
"connector_gmail"
"connector_googlecalendar"
"connector_googledrive"
"connector_microsoftteams"
"connector_outlookcalendar"
"connector_outlookemail"
"connector_sharepoint"
headers: Optional[Dict[str, str]]
require_approval: Optional[ToolMcpRequireApproval]

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:
class ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilter: …

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: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterAlways]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
never: Optional[ToolMcpRequireApprovalMcpRequireApprovalMcpToolApprovalFilterNever]

A filter object to specify which tools are allowed.

read_only: Optional[bool]
tool_names: Optional[List[str]]
Literal["always", "never"]
One of the following:
"always"
"never"
server_description: Optional[str]
server_url: Optional[str]
class ToolCodeInterpreter: …

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

container: ToolCodeInterpreterContainer

Configuration for a code interpreter container.

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

One of the following:
str
class ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAuto: …

Configuration for a code interpreter container.

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

type: Literal["auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[ToolCodeInterpreterContainerCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
type: Literal["code_interpreter"]
class ToolImageGeneration: …

A tool that generates images using the GPT image models.

type: Literal["image_generation"]
action: Optional[Literal["generate", "edit", "auto"]]
One of the following:
"generate"
"edit"
"auto"
background: Optional[Literal["transparent", "opaque", "auto"]]
One of the following:
"transparent"
"opaque"
"auto"
input_fidelity: Optional[Literal["high", "low"]]
One of the following:
"high"
"low"
input_image_mask: Optional[ToolImageGenerationInputImageMask]

Optional mask for inpainting.

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

file_id: Optional[str]
image_url: Optional[str]
model: Optional[Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], null]]
One of the following:
str
Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]
One of the following:
"gpt-image-1"
"gpt-image-1-mini"
"gpt-image-1.5"
moderation: Optional[Literal["auto", "low"]]
One of the following:
"auto"
"low"
output_compression: Optional[int]
output_format: Optional[Literal["png", "webp", "jpeg"]]
One of the following:
"png"
"webp"
"jpeg"
partial_images: Optional[int]
quality: Optional[Literal["low", "medium", "high", "auto"]]
One of the following:
"low"
"medium"
"high"
"auto"
size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]
One of the following:
"1024x1024"
"1024x1536"
"1536x1024"
"auto"
class ToolLocalShell: …

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

type: Literal["local_shell"]
class FunctionShellTool: …

A tool that allows the model to execute shell commands.

type: Literal["shell"]
environment: Optional[Environment]
One of the following:
class EnvironmentContainerAuto: …
type: Literal["container_auto"]
file_ids: Optional[List[str]]
memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]]
One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy: Optional[EnvironmentContainerAutoNetworkPolicy]
One of the following:
class ContainerNetworkPolicyDisabled: …
type: Literal["disabled"]
class ContainerNetworkPolicyAllowlist: …
allowed_domains: List[str]
type: Literal["allowlist"]
domain_secrets: Optional[List[DomainSecret]]
domain: str
name: str
value: str
skills: Optional[List[EnvironmentContainerAutoSkill]]
One of the following:
class EnvironmentContainerAutoSkillSkillReference: …
skill_id: str
type: Literal["skill_reference"]
version: Optional[str]
class EnvironmentContainerAutoSkillInlineSkill: …
description: str
name: str
source: EnvironmentContainerAutoSkillInlineSkillSource

Inline skill payload

data: str
media_type: Literal["application/zip"]
type: Literal["base64"]
type: Literal["inline"]
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
class CustomTool: …

A custom tool that processes input using a specified format.

Learn more about custom tools

name: str
type: Literal["custom"]
description: Optional[str]
format: Optional[Format]

Unconstrained free-form text.

One of the following:
class FormatText: …

Unconstrained free-form text.

type: Literal["text"]
class FormatGrammar: …

A grammar defined by the user.

definition: str
syntax: Literal["lark", "regex"]
One of the following:
"lark"
"regex"
type: Literal["grammar"]
class WebSearchPreviewTool: …

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

Learn more about the web search tool.

type: Literal["web_search_preview", "web_search_preview_2025_03_11"]
One of the following:
"web_search_preview"
"web_search_preview_2025_03_11"
search_context_size: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
user_location: Optional[UserLocation]

The user’s location.

type: Literal["approximate"]
city: Optional[str]
country: Optional[str]
region: Optional[str]
timezone: Optional[str]
class ApplyPatchTool: …

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

type: Literal["apply_patch"]
background: Optional[bool]
completed_at: Optional[float]
conversation: Optional[Conversation]

The conversation that this response belonged to.

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

id: str
error: Optional[OpenAIResponseError]

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

code: Literal["server_error", "rate_limit_exceeded", "invalid_prompt", 15 more]
One of the following:
"server_error"
"rate_limit_exceeded"
"invalid_prompt"
"vector_store_timeout"
"invalid_image"
"invalid_image_format"
"invalid_base64_image"
"invalid_image_url"
"image_too_large"
"image_too_small"
"image_parse_error"
"image_content_policy_violation"
"invalid_image_mode"
"image_file_too_large"
"unsupported_image_media_type"
"empty_image_file"
"failed_to_download_image"
"image_file_not_found"
message: str
incomplete_details: Optional[IncompleteDetails]

Details about why the response is incomplete.

reason: Optional[Literal["max_output_tokens", "content_filter"]]
One of the following:
"max_output_tokens"
"content_filter"
instructions: Optional[Union[str, List[InstructionsInputItem], null]]
One of the following:
str
List[InstructionsInputItem]
One of the following:
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.

content: Union[str, List[ContentInputItem]]
One of the following:
str
List[ContentInputItem]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "assistant", "system", "developer"]
One of the following:
"user"
"assistant"
"system"
"developer"
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
type: Optional[Literal["message"]]
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.

content: List[Content]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
role: Literal["user", "system", "developer"]
One of the following:
"user"
"system"
"developer"
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Optional[Literal["message"]]
class OpenAIResponseOutputMessage: …

An output message from the model.

id: str
content: List[Content]
One of the following:
class OpenAIResponseOutputText: …

A text output from the model.

annotations: List[Annotation]
One of the following:
class AnnotationAnnotationFileCitation: …

A citation to a file.

file_id: str
filename: str
index: int
type: Literal["file_citation"]
class AnnotationOpenAITypesResponsesResponseOutputTextAnnotationURLCitation: …

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

end_index: int
start_index: int
title: str
type: Literal["url_citation"]
url: str
class AnnotationAnnotationContainerFileCitation: …

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

container_id: str
end_index: int
file_id: str
filename: str
start_index: int
type: Literal["container_file_citation"]
class AnnotationAnnotationFilePath: …

A path to a file.

file_id: str
index: int
type: Literal["file_path"]
text: str
type: Literal["output_text"]
logprobs: Optional[List[Logprob]]
token: str
bytes: List[int]
logprob: float
top_logprobs: List[LogprobTopLogprob]
token: str
bytes: List[int]
logprob: float
class OpenAIResponseOutputRefusal: …

A refusal from the model.

refusal: str
type: Literal["refusal"]
role: Literal["assistant"]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["message"]
phase: Optional[Literal["commentary", "final_answer"]]
One of the following:
"commentary"
"final_answer"
class OpenAIResponseFileSearchToolCall: …

The results of a file search tool call.

See the file search guide for more information.

id: str
queries: List[str]
status: Literal["in_progress", "searching", "completed", 2 more]
One of the following:
"in_progress"
"searching"
"completed"
"incomplete"
"failed"
type: Literal["file_search_call"]
results: Optional[List[Result]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
file_id: Optional[str]
filename: Optional[str]
score: Optional[float]
text: Optional[str]
class OpenAIResponseComputerToolCall: …

A tool call to a computer use tool.

See the computer use guide for more information.

id: str
action: Action

A click action.

One of the following:
class ActionActionClick: …

A click action.

button: Literal["left", "right", "wheel", 2 more]
One of the following:
"left"
"right"
"wheel"
"back"
"forward"
type: Literal["click"]
x: int
y: int
class ActionActionDoubleClick: …

A double click action.

type: Literal["double_click"]
x: int
y: int
class ActionActionDrag: …

A drag action.

path: List[ActionActionDragPath]
x: int
y: int
type: Literal["drag"]
class ActionActionKeypress: …

A collection of keypresses the model would like to perform.

keys: List[str]
type: Literal["keypress"]
class ActionActionMove: …

A mouse move action.

type: Literal["move"]
x: int
y: int
class ActionActionScreenshot: …

A screenshot action.

type: Literal["screenshot"]
class ActionActionScroll: …

A scroll action.

scroll_x: int
scroll_y: int
type: Literal["scroll"]
x: int
y: int
class ActionActionType: …

An action to type in text.

text: str
type: Literal["type"]
class ActionActionWait: …

A wait action.

type: Literal["wait"]
call_id: str
pending_safety_checks: List[PendingSafetyCheck]
id: str
code: Optional[str]
message: Optional[str]
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["computer_call"]
class OpenAITypesResponsesResponseInputItemComputerCallOutput: …

The output of a computer tool call.

call_id: str

A computer screenshot image used with the computer use tool.

type: Literal["computer_screenshot"]
file_id: Optional[str]
image_url: Optional[str]
type: Literal["computer_call_output"]
id: Optional[str]
acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]]
id: str
code: Optional[str]
message: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
One of the following:
One of the following:
class OpenAIResponseFunctionToolCall: …

A tool call to run a function.

See the function calling guide for more information.

arguments: str
call_id: str
name: str
type: Literal["function_call"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class OpenAITypesResponsesResponseInputItemFunctionCallOutput: …

The output of a function tool call.

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OutputOutputContentListResponseInputTextContent: …

A text input to the model.

text: str
type: Literal["input_text"]
class OutputOutputContentListResponseInputImageContent: …

An image input to the model.

Learn about image inputs

type: Literal["input_image"]
detail: Optional[Literal["low", "high", "auto"]]
One of the following:
"low"
"high"
"auto"
file_id: Optional[str]
image_url: Optional[str]
class OutputOutputContentListResponseInputFileContent: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["function_call_output"]
id: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
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.

id: str
summary: List[Summary]
text: str
type: Literal["summary_text"]
type: Literal["reasoning"]
content: Optional[List[Content]]
text: str
type: Literal["reasoning_text"]
encrypted_content: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ResponseCompactionItemParam: …

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

encrypted_content: str
type: Literal["compaction"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemImageGenerationCall: …

An image generation request made by the model.

id: str
status: Literal["in_progress", "completed", "generating", "failed"]
One of the following:
"in_progress"
"completed"
"generating"
"failed"
type: Literal["image_generation_call"]
result: Optional[str]
class OpenAIResponseCodeInterpreterToolCall: …

A tool call to run code.

id: str
container_id: str
status: Literal["in_progress", "completed", "incomplete", 2 more]
One of the following:
"in_progress"
"completed"
"incomplete"
"interpreting"
"failed"
type: Literal["code_interpreter_call"]
code: Optional[str]
outputs: Optional[List[Output]]
One of the following:
class OutputOutputLogs: …

The logs output from the code interpreter.

logs: str
type: Literal["logs"]
class OutputOutputImage: …

The image output from the code interpreter.

type: Literal["image"]
url: str
class OpenAITypesResponsesResponseInputItemLocalShellCall: …

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

id: str
action: Action

Execute a shell command on the server.

command: List[str]
env: Dict[str, str]
type: Literal["exec"]
timeout_ms: Optional[int]
user: Optional[str]
working_directory: Optional[str]
call_id: str
status: Literal["in_progress", "completed", "incomplete"]
One of the following:
"in_progress"
"completed"
"incomplete"
type: Literal["local_shell_call"]
class OpenAITypesResponsesResponseInputItemLocalShellCallOutput: …

The output of a local shell tool call.

id: str
output: str
type: Literal["local_shell_call_output"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCall: …

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

action: Action

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

commands: List[str]
max_output_length: Optional[int]
timeout_ms: Optional[int]
call_id: str
type: Literal["shell_call"]
id: Optional[str]
environment: Optional[Environment]
One of the following:
class LocalEnvironment: …
type: Literal["local"]
skills: Optional[List[Skill]]
description: str
name: str
path: str
class ContainerReference: …
container_id: str
type: Literal["container_reference"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ShellCallOutput: …

The streamed output items emitted by a shell tool call.

call_id: str
output: List[Output]
outcome: OutputOutcome

Indicates that the shell call exceeded its configured time limit.

One of the following:
class OutputOutcomeOutcomeTimeout: …

Indicates that the shell call exceeded its configured time limit.

type: Literal["timeout"]
class OutputOutcomeOutcomeExit: …

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

exit_code: int
type: Literal["exit"]
stderr: str
stdout: str
type: Literal["shell_call_output"]
id: Optional[str]
max_output_length: Optional[int]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
One of the following:
"in_progress"
"completed"
"incomplete"
class ApplyPatchCall: …

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

call_id: str
operation: Operation

Instruction for creating a new file via the apply_patch tool.

One of the following:
class OperationApplyPatchCallOperationCreateFile: …

Instruction for creating a new file via the apply_patch tool.

diff: str
path: str
type: Literal["create_file"]
class OperationApplyPatchCallOperationDeleteFile: …

Instruction for deleting an existing file via the apply_patch tool.

path: str
type: Literal["delete_file"]
class OperationApplyPatchCallOperationUpdateFile: …

Instruction for updating an existing file via the apply_patch tool.

diff: str
path: str
type: Literal["update_file"]
status: Literal["in_progress", "completed"]
One of the following:
"in_progress"
"completed"
type: Literal["apply_patch_call"]
id: Optional[str]
class ApplyPatchCallOutput: …

The streamed output emitted by an apply patch tool call.

call_id: str
status: Literal["completed", "failed"]
One of the following:
"completed"
"failed"
type: Literal["apply_patch_call_output"]
id: Optional[str]
output: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpListTools: …

A list of tools available on an MCP server.

id: str
server_label: str
tools: List[Tool]
input_schema: object
name: str
annotations: Optional[object]
description: Optional[str]
type: Literal["mcp_list_tools"]
error: Optional[str]
class McpApprovalRequest: …

A request for human approval of a tool invocation.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_approval_request"]
class OpenAITypesResponsesResponseInputItemMcpApprovalResponse: …

A response to an MCP approval request.

approval_request_id: str
approve: bool
type: Literal["mcp_approval_response"]
id: Optional[str]
reason: Optional[str]
class OpenAITypesResponsesResponseInputItemMcpCall: …

An invocation of a tool on an MCP server.

id: str
arguments: str
name: str
server_label: str
type: Literal["mcp_call"]
approval_request_id: Optional[str]
error: Optional[str]
output: Optional[str]
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
One of the following:
"in_progress"
"completed"
"incomplete"
"calling"
"failed"
class OpenAIResponseCustomToolCallOutput: …

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

call_id: str
output: Union[str, List[OutputOutputContentList]]
One of the following:
str
List[OutputOutputContentList]
One of the following:
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
type: Literal["custom_tool_call_output"]
id: Optional[str]
class OpenAIResponseCustomToolCall: …

A call to a custom tool created by the model.

call_id: str
input: str
name: str
type: Literal["custom_tool_call"]
id: Optional[str]
class OpenAITypesResponsesResponseInputItemItemReference: …

An internal identifier for an item to reference.

id: str
type: Optional[Literal["item_reference"]]
max_output_tokens: Optional[int]
max_tool_calls: Optional[int]
metadata: Optional[Dict[str, str]]
previous_response_id: Optional[str]
prompt: Optional[OpenAIResponsePrompt]

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

id: str
variables: Optional[Dict[str, Variables]]
One of the following:
str
class OpenAIResponseInputText: …

A text input to the model.

text: str
type: Literal["input_text"]
class OpenAIResponseInputImage: …

An image input to the model.

Learn about image inputs.

detail: Literal["low", "high", "auto"]
One of the following:
"low"
"high"
"auto"
type: Literal["input_image"]
file_id: Optional[str]
image_url: Optional[str]
class OpenAIResponseInputFile: …

A file input to the model.

type: Literal["input_file"]
file_data: Optional[str]
file_id: Optional[str]
file_url: Optional[str]
filename: Optional[str]
version: Optional[str]
prompt_cache_key: Optional[str]
prompt_cache_retention: Optional[Literal["in-memory", "24h"]]
One of the following:
"in-memory"
"24h"
reasoning: Optional[Reasoning]

gpt-5 and o-series models only

Configuration options for reasoning models.

effort: Optional[Literal["none", "minimal", "low", 3 more]]
One of the following:
"none"
"minimal"
"low"
"medium"
"high"
"xhigh"
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
summary: Optional[Literal["auto", "concise", "detailed"]]
One of the following:
"auto"
"concise"
"detailed"
safety_identifier: Optional[str]
service_tier: Optional[Literal["auto", "default", "flex", 2 more]]
One of the following:
"auto"
"default"
"flex"
"scale"
"priority"
status: Optional[Literal["completed", "failed", "in_progress", 3 more]]
One of the following:
"completed"
"failed"
"in_progress"
"cancelled"
"queued"
"incomplete"
temperature: Optional[float]
text: Optional[OpenAIResponseTextConfig]

Configuration options for a text response from the model.

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

format: Optional[Format]

Default response format. Used to generate text responses.

One of the following:
class FormatResponseFormatText: …

Default response format. Used to generate text responses.

type: Literal["text"]
class FormatResponseFormatTextJsonSchemaConfig: …

JSON Schema response format.

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

name: str
schema: Dict[str, object]
type: Literal["json_schema"]
description: Optional[str]
strict: Optional[bool]
class FormatResponseFormatJsonObject: …

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: Literal["json_object"]
verbosity: Optional[Literal["low", "medium", "high"]]
One of the following:
"low"
"medium"
"high"
top_logprobs: Optional[int]
top_p: Optional[float]
truncation: Optional[Literal["auto", "disabled"]]
One of the following:
"auto"
"disabled"
usage: Optional[OpenAIResponseUsage]

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

input_tokens: int
input_tokens_details: InputTokensDetails

A detailed breakdown of the input tokens.

cached_tokens: int
output_tokens: int
output_tokens_details: OutputTokensDetails

A detailed breakdown of the output tokens.

reasoning_tokens: int
total_tokens: int
user: Optional[str]
sequence_number: int
type: Literal["response.queued"]
class ResponseCustomToolCallInputDeltaEvent: …

Event representing a delta (partial update) to the input of a custom tool call.

delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.custom_tool_call_input.delta"]
class ResponseCustomToolCallInputDoneEvent: …

Event indicating that input for a custom tool call is complete.

input: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.custom_tool_call_input.done"]
class GenericResponseEvent: …
type: str

Run OpenAI Responses API (OpenAI only)

import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
response = client.responses.create(
    input="string",
    model="model",
)
print(response)
{
  "id": "id",
  "created_at": 0,
  "model": "gpt-5.2",
  "object": "response",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "annotations": [
            {
              "file_id": "file_id",
              "filename": "filename",
              "index": 0,
              "type": "file_citation"
            }
          ],
          "text": "text",
          "type": "output_text",
          "logprobs": [
            {
              "token": "token",
              "bytes": [
                0
              ],
              "logprob": 0,
              "top_logprobs": [
                {
                  "token": "token",
                  "bytes": [
                    0
                  ],
                  "logprob": 0
                }
              ]
            }
          ]
        }
      ],
      "role": "assistant",
      "status": "in_progress",
      "type": "message",
      "phase": "commentary"
    }
  ],
  "parallel_tool_calls": true,
  "tool_choice": "none",
  "tools": [
    {
      "name": "name",
      "type": "function",
      "description": "description",
      "parameters": {
        "foo": "bar"
      },
      "strict": true
    }
  ],
  "background": true,
  "completed_at": 0,
  "conversation": {
    "id": "id"
  },
  "error": {
    "code": "server_error",
    "message": "message"
  },
  "incomplete_details": {
    "reason": "max_output_tokens"
  },
  "instructions": "string",
  "max_output_tokens": 0,
  "max_tool_calls": 0,
  "metadata": {
    "foo": "string"
  },
  "previous_response_id": "previous_response_id",
  "prompt": {
    "id": "id",
    "variables": {
      "foo": "string"
    },
    "version": "version"
  },
  "prompt_cache_key": "prompt_cache_key",
  "prompt_cache_retention": "in-memory",
  "reasoning": {
    "effort": "none",
    "generate_summary": "auto",
    "summary": "auto"
  },
  "safety_identifier": "safety_identifier",
  "service_tier": "auto",
  "status": "completed",
  "temperature": 0,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "top_logprobs": 0,
  "top_p": 0,
  "truncation": "auto",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  },
  "user": "user"
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "model": "gpt-5.2",
  "object": "response",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "annotations": [
            {
              "file_id": "file_id",
              "filename": "filename",
              "index": 0,
              "type": "file_citation"
            }
          ],
          "text": "text",
          "type": "output_text",
          "logprobs": [
            {
              "token": "token",
              "bytes": [
                0
              ],
              "logprob": 0,
              "top_logprobs": [
                {
                  "token": "token",
                  "bytes": [
                    0
                  ],
                  "logprob": 0
                }
              ]
            }
          ]
        }
      ],
      "role": "assistant",
      "status": "in_progress",
      "type": "message",
      "phase": "commentary"
    }
  ],
  "parallel_tool_calls": true,
  "tool_choice": "none",
  "tools": [
    {
      "name": "name",
      "type": "function",
      "description": "description",
      "parameters": {
        "foo": "bar"
      },
      "strict": true
    }
  ],
  "background": true,
  "completed_at": 0,
  "conversation": {
    "id": "id"
  },
  "error": {
    "code": "server_error",
    "message": "message"
  },
  "incomplete_details": {
    "reason": "max_output_tokens"
  },
  "instructions": "string",
  "max_output_tokens": 0,
  "max_tool_calls": 0,
  "metadata": {
    "foo": "string"
  },
  "previous_response_id": "previous_response_id",
  "prompt": {
    "id": "id",
    "variables": {
      "foo": "string"
    },
    "version": "version"
  },
  "prompt_cache_key": "prompt_cache_key",
  "prompt_cache_retention": "in-memory",
  "reasoning": {
    "effort": "none",
    "generate_summary": "auto",
    "summary": "auto"
  },
  "safety_identifier": "safety_identifier",
  "service_tier": "auto",
  "status": "completed",
  "temperature": 0,
  "text": {
    "format": {
      "type": "text"
    },
    "verbosity": "low"
  },
  "top_logprobs": 0,
  "top_p": 0,
  "truncation": "auto",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  },
  "user": "user"
}