diff --git a/en/resources/beta/subresources/responses/index.md b/en/resources/beta/subresources/responses/index.md index 65dde925..6370b806 100644 --- a/en/resources/beta/subresources/responses/index.md +++ b/en/resources/beta/subresources/responses/index.md @@ -1,16 +1,12 @@ # Responses -## Create a model response +## Cancel a response -**post** `/responses?beta=true` +**post** `/responses/{response_id}/cancel?beta=true` -Creates a model response. Provide [text](/docs/guides/text) or -[image](/docs/guides/images) inputs to generate [text](/docs/guides/text) -or [JSON](/docs/guides/structured-outputs) outputs. Have the model call -your own [custom code](/docs/guides/function-calling) or use built-in -[tools](/docs/guides/tools) like [web search](/docs/guides/tools-web-search) -or [file search](/docs/guides/tools-file-search) to use your own data -as input for the model's response. +Cancels a model response with the given ID. Only responses created with +the `background` parameter set to `true` can be cancelled. +[Learn more](/docs/guides/background). ### Header Parameters @@ -18,86 +14,98 @@ as input for the model's response. - `"responses_multi_agent=v1"` -### Body Parameters +### Path Parameters -- `background: optional boolean` +- `response_id: string` - Whether to run the model response in the background. - [Learn more](/docs/guides/background). +### Returns -- `context_management: optional array of object { type, compact_threshold }` +- `BetaResponse object { id, created_at, error, 32 more }` - Context management configuration for this request. + - `id: string` - - `type: string` + Unique identifier for this Response. - The context management entry type. Currently only 'compaction' is supported. + - `created_at: number` - - `compact_threshold: optional number` + Unix timestamp (in seconds) of when this Response was created. - Token threshold at which compaction should be triggered for this entry. + - `error: BetaResponseError` -- `conversation: optional string or BetaResponseConversationParam` + An error object returned when the model fails to generate a Response. - The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. - Input items and output items from this response are automatically added to this conversation after this response completes. + - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 17 more` - - `ConversationID = string` + The error code for the response. - The unique ID of the conversation. + - `"server_error"` - - `BetaResponseConversationParam object { id }` + - `"rate_limit_exceeded"` - The conversation that this response belongs to. + - `"invalid_prompt"` - - `id: string` + - `"data_residency_mismatch"` - The unique ID of the conversation. + - `"bio_policy"` -- `include: optional array of BetaResponseIncludable` + - `"vector_store_timeout"` - Specify additional output data to include in the model response. Currently supported values are: + - `"invalid_image"` - - `web_search_call.action.sources`: Include the sources of the web search tool call. - - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - - `computer_call_output.output.image_url`: Include image urls from the computer call output. - - `file_search_call.results`: Include the search results of the file search tool call. - - `message.input_image.image_url`: Include image urls from the input message. - - `message.output_text.logprobs`: Include logprobs with assistant messages. - - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). + - `"invalid_image_format"` - - `"file_search_call.results"` + - `"invalid_base64_image"` - - `"web_search_call.results"` + - `"invalid_image_url"` - - `"web_search_call.action.sources"` + - `"image_too_large"` - - `"message.input_image.image_url"` + - `"image_too_small"` - - `"computer_call_output.output.image_url"` + - `"image_parse_error"` - - `"code_interpreter_call.outputs"` + - `"image_content_policy_violation"` - - `"reasoning.encrypted_content"` + - `"invalid_image_mode"` - - `"message.output_text.logprobs"` + - `"image_file_too_large"` -- `input: optional string or array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` + - `"unsupported_image_media_type"` - Text, image, or file inputs to the model, used to generate a response. + - `"empty_image_file"` - Learn more: + - `"failed_to_download_image"` - - [Text inputs and outputs](/docs/guides/text) - - [Image inputs](/docs/guides/images) - - [File inputs](/docs/guides/pdf-files) - - [Conversation state](/docs/guides/conversation-state) - - [Function calling](/docs/guides/function-calling) + - `"image_file_not_found"` - - `TextInput = string` + - `message: string` + + A human-readable description of the error. + + - `incomplete_details: object { reason }` + + Details about why the response is incomplete. + + - `reason: optional "max_output_tokens" or "content_filter"` + + The reason why the response is incomplete. + + - `"max_output_tokens"` + + - `"content_filter"` + + - `instructions: string or array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + + - `string` A text input to the model, equivalent to a text input with the - `user` role. + `developer` role. - `InputItemList = array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` @@ -4876,23 +4884,7 @@ as input for the model's response. The canonical name of the agent that produced this item. -- `instructions: optional string` - - A system (or developer) message inserted into the model's context. - - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. - -- `max_output_tokens: optional number` - - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning). - -- `max_tool_calls: optional number` - - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - -- `metadata: optional map[string]` + - `metadata: map[string]` Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured @@ -4901,7 +4893,7 @@ as input for the model's response. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. -- `model: optional "gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more or string` + - `model: "gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more or string` Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance @@ -5107,868 +5099,1255 @@ as input for the model's response. - `string` -- `moderation: optional object { model, policy }` + - `object: "response"` - Configuration for running moderation on the input and output of this response. + The object type of this resource - always set to `response`. - - `model: string` + - `"response"` - The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'. + - `output: array of BetaResponseOutputItem` - - `policy: optional object { input, output }` + An array of content items generated by the model. - The policy to apply to moderated response input and output. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - - `input: optional object { mode }` + - `BetaResponseOutputMessage object { id, content, role, 4 more }` - The moderation policy for the response input. + An output message from the model. - - `mode: "score" or "block"` + - `FileSearchCall object { id, queries, status, 3 more }` - - `"score"` + The results of a file search tool call. See the + [file search guide](/docs/guides/tools-file-search) for more information. - - `"block"` + - `id: string` - - `output: optional object { mode }` + The unique ID of the file search tool call. - The moderation policy for the response output. + - `queries: array of string` - - `mode: "score" or "block"` + The queries used to search for files. - - `"score"` + - `status: "in_progress" or "searching" or "completed" or 2 more` - - `"block"` + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, -- `multi_agent: optional object { enabled, max_concurrent_subagents }` + - `"in_progress"` - Configuration for server-hosted multi-agent execution. + - `"searching"` - - `enabled: boolean` + - `"completed"` - Whether to enable server-hosted multi-agent execution for this response. + - `"incomplete"` - - `max_concurrent_subagents: optional number` + - `"failed"` - `max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent. - The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run. + - `type: "file_search_call"` -- `parallel_tool_calls: optional boolean` + The type of the file search tool call. Always `file_search_call`. - Whether to allow the model to run tool calls in parallel. + - `"file_search_call"` -- `previous_response_id: optional string` + - `agent: optional object { agent_name }` - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + The agent that produced this item. -- `prompt: optional BetaResponsePrompt` + - `agent_name: string` - Reference to a prompt template and its variables. - [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts). + The canonical name of the agent that produced this item. - - `id: string` + - `results: optional array of object { attributes, file_id, filename, 2 more }` - The unique identifier of the prompt template to use. + The results of the file search tool call. - - `variables: optional map[string or BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile]` + - `attributes: optional map[string or number or boolean]` - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. Keys are strings + with a maximum length of 64 characters. Values are strings with a maximum + length of 512 characters, booleans, or numbers. - `string` - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + - `number` - A text input to the model. + - `boolean` - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + - `file_id: optional string` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + The unique ID of the file. - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + - `filename: optional string` - A file input to the model. + The name of the file. - - `version: optional string` + - `score: optional number` - Optional version of the prompt template. + The relevance score of the file - a value between 0 and 1. -- `prompt_cache_key: optional string` + - `text: optional string` - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching). + The text that was retrieved from the file. -- `prompt_cache_options: optional object { mode, ttl }` + - `FunctionCall object { arguments, call_id, name, 6 more }` - Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](/docs/guides/prompt-caching) for current details. + A tool call to run a function. See the + [function calling guide](/docs/guides/function-calling) for more information. - - `mode: optional "implicit" or "explicit"` + - `arguments: string` - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. + A JSON string of the arguments to pass to the function. - - `"implicit"` + - `call_id: string` - - `"explicit"` + The unique ID of the function tool call generated by the model. - - `ttl: optional "30m"` + - `name: string` - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. + The name of the function to run. - - `"30m"` + - `type: "function_call"` -- `prompt_cache_retention: optional "in_memory" or "24h"` + The type of the function tool call. Always `function_call`. - Deprecated. Use `prompt_cache_options.ttl` instead. + - `"function_call"` - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + - `id: optional string` - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + The unique ID of the function tool call. - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + - `agent: optional object { agent_name }` - - `"in_memory"` + The agent that produced this item. - - `"24h"` + - `agent_name: string` -- `reasoning: optional object { context, effort, generate_summary, 2 more }` + The canonical name of the agent that produced this item. - **gpt-5 and o-series models only** + - `caller: optional object { type } or object { caller_id, type }` - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + The execution context that produced this tool call. - - `context: optional "auto" or "current_turn" or "all_turns"` + - `Direct object { type }` - Controls which reasoning items are rendered back to the model on later turns. - If omitted or set to `auto`, the model determines the context mode. The - `gpt-5.6` model family defaults to `all_turns`; earlier models default to - `current_turn`. + - `type: "direct"` - When returned on a response, this is the effective reasoning context mode - used for the response. + - `"direct"` - - `"auto"` + - `Program object { caller_id, type }` - - `"current_turn"` + - `caller_id: string` - - `"all_turns"` + The call ID of the program item that produced this tool call. - - `effort: optional "none" or "minimal" or "low" or 4 more` + - `type: "program"` - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. + - `"program"` - - `"none"` + - `namespace: optional string` - - `"minimal"` + The namespace of the function to run. - - `"low"` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"medium"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `"high"` + - `"in_progress"` - - `"xhigh"` + - `"completed"` - - `"max"` + - `"incomplete"` - - `generate_summary: optional "auto" or "concise" or "detailed"` + - `FunctionCallOutput object { id, call_id, output, 5 more }` - **Deprecated:** use `summary` instead. + - `id: string` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + The unique ID of the function call tool output. - - `"auto"` + - `call_id: string` - - `"concise"` + The unique ID of the function tool call generated by the model. - - `"detailed"` + - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - - `mode: optional string or "standard" or "pro"` + The output from the function call generated by your code. + Can be a string or an list of output content. - Controls the reasoning execution mode for the request. + - `StringOutput = string` - When returned on a response, this is the effective execution mode. + A string of the output of the function call. - - `string` + - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - - `"standard" or "pro"` + Text, image, or file output of the function call. - Controls the reasoning execution mode for the request. + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - When returned on a response, this is the effective execution mode. + A text input to the model. - - `"standard"` + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - - `"pro"` + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `summary: optional "auto" or "concise" or "detailed"` + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + A file input to the model. - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + - `status: "in_progress" or "completed" or "incomplete"` - - `"auto"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `"concise"` + - `"in_progress"` - - `"detailed"` + - `"completed"` -- `safety_identifier: optional string` + - `"incomplete"` - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). + - `type: "function_call_output"` -- `service_tier: optional "auto" or "default" or "flex" or 2 more` + The type of the function tool call output. Always `function_call_output`. - Specifies the processing type used for serving the request. + - `"function_call_output"` - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `agent: optional object { agent_name }` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + The agent that produced this item. - - `"auto"` + - `agent_name: string` - - `"default"` + The canonical name of the agent that produced this item. - - `"flex"` + - `caller: optional object { type } or object { caller_id, type }` - - `"scale"` + The execution context that produced this tool call. - - `"priority"` + - `Direct object { type }` -- `store: optional boolean` + - `type: "direct"` - Whether to store the generated model response for later retrieval via - API. + The caller type. Always `direct`. -- `stream: optional boolean` + - `"direct"` - If set to true, the model response data will be streamed to the client - as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). - See the [Streaming section below](/docs/api-reference/responses-streaming) - for more information. + - `Program object { caller_id, type }` -- `stream_options: optional object { include_obfuscation }` + - `caller_id: string` - Options for streaming responses. Only set this when you set `stream: true`. + The call ID of the program item that produced this tool call. - - `include_obfuscation: optional boolean` + - `type: "program"` - When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events to - normalize payload sizes as a mitigation to certain side-channel attacks. - These obfuscation fields are included by default, but add a small amount - of overhead to the data stream. You can set `include_obfuscation` to - false to optimize for bandwidth if you trust the network links between - your application and the OpenAI API. + The caller type. Always `program`. -- `temperature: optional number` + - `"program"` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `created_by: optional string` -- `text: optional BetaResponseTextConfig` + The identifier of the actor that created the item. - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `AgentMessage object { id, author, content, 3 more }` - - [Text inputs and outputs](/docs/guides/text) - - [Structured Outputs](/docs/guides/structured-outputs) + - `id: string` - - `format: optional BetaResponseFormatTextConfig` + The unique ID of the agent message. - An object specifying the format that the model must output. + - `author: string` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](/docs/guides/structured-outputs). + The sending agent identity. - The default format is `{ "type": "text" }` with no additional options. + - `content: array of BetaResponseInputText or BetaResponseOutputText or object { text, type } or 7 more` - **Not recommended for gpt-4o and newer models:** + Encrypted content sent between agents. - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - `Text object { type }` + A text input to the model. - Default response format. Used to generate text responses. + - `BetaResponseOutputText object { annotations, logprobs, text, type }` - - `type: "text"` + A text output from the model. - The type of response format being defined. Always `text`. + - `Text object { text, type }` - - `"text"` + A text content. - - `BetaResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }` + - `text: string` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). + - `type: "text"` - - `name: string` + - `"text"` - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. + - `SummaryText object { text, type }` - - `schema: map[unknown]` + A summary text from the model. - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `text: string` - - `type: "json_schema"` + A summary of the reasoning output from the model so far. - The type of response format being defined. Always `json_schema`. + - `type: "summary_text"` - - `"json_schema"` + The type of the object. Always `summary_text`. - - `description: optional string` + - `"summary_text"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + - `ReasoningText object { text, type }` - - `strict: optional boolean` + Reasoning text from the model. - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). + - `text: string` - - `JSONObject object { type }` + The reasoning text from the model. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `type: "reasoning_text"` - - `type: "json_object"` + The type of the reasoning text. Always `reasoning_text`. - The type of response format being defined. Always `json_object`. + - `"reasoning_text"` - - `"json_object"` + - `BetaResponseOutputRefusal object { refusal, type }` - - `verbosity: optional "low" or "medium" or "high"` + A refusal from the model. - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. The default is - `medium`. + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - - `"low"` + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `"medium"` + - `ComputerScreenshot object { detail, file_id, image_url, 2 more }` - - `"high"` + A screenshot of a computer. -- `tool_choice: optional BetaToolChoiceOptions or BetaToolChoiceAllowed or BetaToolChoiceTypes or 6 more` + - `detail: "low" or "high" or "auto" or "original"` - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `BetaToolChoiceOptions = "none" or "auto" or "required"` + - `"low"` - Controls which (if any) tool is called by the model. + - `"high"` - `none` means the model will not call any tool and instead generates a message. + - `"auto"` - `auto` means the model can pick between generating a message or calling one or - more tools. + - `"original"` - `required` means the model must call one or more tools. + - `file_id: string` - - `"none"` + The identifier of an uploaded file that contains the screenshot. - - `"auto"` + - `image_url: string` - - `"required"` + The URL of the screenshot image. - - `BetaToolChoiceAllowed object { mode, tools, type }` + - `type: "computer_screenshot"` - Constrains the tools available to the model to a pre-defined set. + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - - `mode: "auto" or "required"` + - `"computer_screenshot"` - Constrains the tools available to the model to a pre-defined set. + - `prompt_cache_breakpoint: optional object { mode }` - `auto` allows the model to pick from among the allowed tools and generate a - message. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - `required` requires the model to call one or more of the allowed tools. + - `mode: "explicit"` - - `"auto"` + The breakpoint mode. Always `explicit`. - - `"required"` + - `"explicit"` - - `tools: array of map[unknown]` + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - A list of tool definitions that the model should be allowed to call. + A file input to the model. - For the Responses API, the list of tool definitions might look like: + - `EncryptedContent object { encrypted_content, type }` - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `type: "allowed_tools"` + - `encrypted_content: string` - Allowed tool configuration type. Always `allowed_tools`. + Opaque encrypted content. - - `"allowed_tools"` + - `type: "encrypted_content"` - - `BetaToolChoiceTypes object { type }` + The type of the input item. Always `encrypted_content`. - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](/docs/guides/tools). + - `"encrypted_content"` - - `type: "file_search" or "web_search_preview" or "computer" or 5 more` + - `recipient: string` - The type of hosted tool the model should to use. Learn more about - [built-in tools](/docs/guides/tools). + The destination agent identity. - Allowed values are: + - `type: "agent_message"` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + The type of the item. Always `agent_message`. - - `"file_search"` + - `"agent_message"` - - `"web_search_preview"` + - `agent: optional object { agent_name }` - - `"computer"` + The agent that produced this item. - - `"computer_use_preview"` + - `agent_name: string` - - `"computer_use"` + The canonical name of the agent that produced this item. - - `"web_search_preview_2025_03_11"` + - `MultiAgentCall object { id, action, arguments, 3 more }` - - `"image_generation"` + - `id: string` - - `"code_interpreter"` + The unique ID of the multi-agent call item. - - `BetaToolChoiceFunction object { name, type }` + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - Use this option to force the model to call a specific function. + The multi-agent action to execute. - - `name: string` + - `"spawn_agent"` - The name of the function to call. + - `"interrupt_agent"` - - `type: "function"` + - `"list_agents"` - For function calling, the type is always `function`. + - `"send_message"` - - `"function"` + - `"followup_task"` - - `BetaToolChoiceMcp object { server_label, type, name }` + - `"wait_agent"` - Use this option to force the model to call a specific tool on a remote MCP server. + - `arguments: string` - - `server_label: string` + The JSON string of arguments generated for the action. - The label of the MCP server to use. + - `call_id: string` - - `type: "mcp"` + The unique ID linking this call to its output. - For MCP tools, the type is always `mcp`. + - `type: "multi_agent_call"` - - `"mcp"` + The type of the multi-agent call. Always `multi_agent_call`. - - `name: optional string` + - `"multi_agent_call"` - The name of the tool to call on the server. + - `agent: optional object { agent_name }` - - `BetaToolChoiceCustom object { name, type }` + The agent that produced this item. - Use this option to force the model to call a specific custom tool. + - `agent_name: string` - - `name: string` + The canonical name of the agent that produced this item. - The name of the custom tool to call. + - `MultiAgentCallOutput object { id, action, call_id, 3 more }` - - `type: "custom"` + - `id: string` - For custom tool calling, the type is always `custom`. + The unique ID of the multi-agent call output item. - - `"custom"` + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - - `BetaSpecificProgrammaticToolCallingParam object { type }` + The multi-agent action that produced this result. - - `type: "programmatic_tool_calling"` + - `"spawn_agent"` - The tool to call. Always `programmatic_tool_calling`. + - `"interrupt_agent"` - - `"programmatic_tool_calling"` + - `"list_agents"` - - `BetaToolChoiceApplyPatch object { type }` + - `"send_message"` - Forces the model to call the apply_patch tool when executing a tool call. + - `"followup_task"` - - `type: "apply_patch"` + - `"wait_agent"` - The tool to call. Always `apply_patch`. + - `call_id: string` - - `"apply_patch"` + The unique ID of the multi-agent call. - - `BetaToolChoiceShell object { type }` + - `output: array of BetaResponseOutputText` - Forces the model to call the shell tool when a tool call is required. + Text output returned by the multi-agent action. - - `type: "shell"` + - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` - The tool to call. Always `shell`. + The annotations of the text output. - - `"shell"` + - `logprobs: array of object { token, bytes, logprob, top_logprobs }` -- `tools: optional array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` + - `text: string` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + The text output from the model. - We support the following categories of tools: + - `type: "output_text"` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](/docs/guides/tools-web-search) - or [file search](/docs/guides/tools-file-search). Learn more about - [built-in tools](/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](/docs/guides/function-calling). You can also use - custom tools to call your own code. + The type of the output text. Always `output_text`. - - `Function object { name, parameters, strict, 5 more }` + - `type: "multi_agent_call_output"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + The type of the multi-agent result. Always `multi_agent_call_output`. - - `name: string` + - `"multi_agent_call_output"` - The name of the function to call. + - `agent: optional object { agent_name }` - - `parameters: map[unknown]` + The agent that produced this item. - A JSON schema object describing the parameters of the function. + - `agent_name: string` - - `strict: boolean` + The canonical name of the agent that produced this item. - Whether strict parameter validation is enforced for this function tool. + - `WebSearchCall object { id, action, status, 2 more }` - - `type: "function"` + The results of a web search tool call. See the + [web search guide](/docs/guides/tools-web-search) for more information. - The type of the function tool. Always `function`. + - `id: string` - - `"function"` + The unique ID of the web search tool call. - - `allowed_callers: optional array of "direct" or "programmatic"` + - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` - The tool invocation context(s). + An object describing the specific action taken in this web search call. + Includes details on how the model used the web (search, open_page, find_in_page). - - `"direct"` + - `Search object { type, queries, query, sources }` - - `"programmatic"` + Action type "search" - Performs a web search query. - - `defer_loading: optional boolean` + - `type: "search"` - Whether this function is deferred and loaded via tool search. + The action type. - - `description: optional string` + - `"search"` - A description of the function. Used by the model to determine whether or not to call the function. + - `queries: optional array of string` - - `output_schema: optional map[unknown]` + The search queries. - A JSON schema object describing the JSON value encoded in string outputs for this function. + - `query: optional string` - - `FileSearch object { type, vector_store_ids, filters, 2 more }` + The search query. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `sources: optional array of object { type, url }` - - `type: "file_search"` + The sources used in the search. - The type of the file search tool. Always `file_search`. + - `type: "url"` - - `"file_search"` + The type of source. Always `url`. - - `vector_store_ids: array of string` + - `"url"` - The IDs of the vector stores to search. + - `url: string` - - `filters: optional object { key, type, value } or object { filters, type }` + The URL of the source. - A filter to apply. + - `OpenPage object { type, url }` - - `ComparisonFilter object { key, type, value }` + Action type "open_page" - Opens a specific URL from search results. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `type: "open_page"` - - `key: string` + The action type. - The key to compare against the value. + - `"open_page"` - - `type: "eq" or "ne" or "gt" or 5 more` + - `url: optional string` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + The URL opened by the model. - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in + - `FindInPage object { pattern, type, url }` - - `"eq"` + Action type "find_in_page": Searches for a pattern within a loaded page. - - `"ne"` + - `pattern: string` - - `"gt"` + The pattern or text to search for within the page. - - `"gte"` + - `type: "find_in_page"` - - `"lt"` + The action type. - - `"lte"` + - `"find_in_page"` - - `"in"` + - `url: string` - - `"nin"` + The URL of the page searched for the pattern. - - `value: string or number or boolean or array of string or number` + - `status: "in_progress" or "searching" or "completed" or "failed"` - The value to compare against the attribute key; supports string, number, or boolean types. + The status of the web search tool call. - - `string` + - `"in_progress"` - - `number` + - `"searching"` - - `boolean` + - `"completed"` - - `array of string or number` + - `"failed"` - - `string` + - `type: "web_search_call"` - - `number` + The type of the web search tool call. Always `web_search_call`. - - `CompoundFilter object { filters, type }` + - `"web_search_call"` - Combine multiple filters using `and` or `or`. + - `agent: optional object { agent_name }` - - `filters: array of object { key, type, value } or unknown` + The agent that produced this item. - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `agent_name: string` - - `ComparisonFilter object { key, type, value }` + The canonical name of the agent that produced this item. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` - - `key: string` + A tool call to a computer use tool. See the + [computer use guide](/docs/guides/tools-computer-use) for more information. - The key to compare against the value. + - `id: string` - - `type: "eq" or "ne" or "gt" or 5 more` + The unique ID of the computer call. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `call_id: string` - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in + An identifier used when responding to the tool call with output. - - `"eq"` + - `pending_safety_checks: array of object { id, code, message }` - - `"ne"` + The pending safety checks for the computer call. - - `"gt"` + - `id: string` - - `"gte"` + The ID of the pending safety check. - - `"lt"` + - `code: optional string` - - `"lte"` + The type of the pending safety check. - - `"in"` + - `message: optional string` - - `"nin"` + Details about the pending safety check. - - `value: string or number or boolean or array of string or number` + - `status: "in_progress" or "completed" or "incomplete"` - The value to compare against the attribute key; supports string, number, or boolean types. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `string` + - `"in_progress"` - - `number` + - `"completed"` - - `boolean` + - `"incomplete"` - - `array of string or number` + - `type: "computer_call"` - - `string` + The type of the computer call. Always `computer_call`. - - `number` + - `"computer_call"` - - `unknown` + - `action: optional BetaComputerAction` - - `type: "and" or "or"` + A click action. - Type of operation: `and` or `or`. + - `actions: optional BetaComputerActionList` - - `"and"` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `"or"` + - `agent: optional object { agent_name }` - - `max_num_results: optional number` + The agent that produced this item. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `agent_name: string` - - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` + The canonical name of the agent that produced this item. - Ranking options for search. + - `ComputerCallOutput object { id, call_id, output, 5 more }` - - `hybrid_search: optional object { embedding_weight, text_weight }` + - `id: string` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + The unique ID of the computer call tool output. - - `embedding_weight: number` + - `call_id: string` - The weight of the embedding in the reciprocal ranking fusion. + The ID of the computer tool call that produced the output. - - `text_weight: number` + - `output: BetaResponseComputerToolCallOutputScreenshot` - The weight of the text in the reciprocal ranking fusion. + A computer screenshot image used with the computer use tool. - - `ranker: optional "auto" or "default-2024-11-15"` + - `status: "completed" or "incomplete" or "failed" or "in_progress"` - The ranker to use for the file search. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `"auto"` + - `"completed"` - - `"default-2024-11-15"` + - `"incomplete"` - - `score_threshold: optional number` + - `"failed"` - The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. + - `"in_progress"` - - `Computer object { type }` + - `type: "computer_call_output"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The type of the computer tool call output. Always `computer_call_output`. - - `type: "computer"` + - `"computer_call_output"` - The type of the computer tool. Always `computer`. + - `acknowledged_safety_checks: optional array of object { id, code, message }` - - `"computer"` + The safety checks reported by the API that have been acknowledged by the + developer. - - `ComputerUsePreview object { display_height, display_width, environment, type }` + - `id: string` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The ID of the pending safety check. - - `display_height: number` + - `code: optional string` - The height of the computer display. + The type of the pending safety check. - - `display_width: number` + - `message: optional string` - The width of the computer display. + Details about the pending safety check. - - `environment: "windows" or "mac" or "linux" or 2 more` + - `agent: optional object { agent_name }` - The type of computer environment to control. + The agent that produced this item. - - `"windows"` + - `agent_name: string` - - `"mac"` + The canonical name of the agent that produced this item. - - `"linux"` + - `created_by: optional string` - - `"ubuntu"` + The identifier of the actor that created the item. - - `"browser"` + - `Reasoning object { id, summary, type, 4 more }` - - `type: "computer_use_preview"` + A description of the chain of thought used by a reasoning model while generating + a response. Be sure to include these items in your `input` to the Responses API + for subsequent turns of a conversation if you are manually + [managing context](/docs/guides/conversation-state). - The type of the computer use tool. Always `computer_use_preview`. + - `id: string` - - `"computer_use_preview"` + The unique identifier of the reasoning content. - - `WebSearch object { type, filters, search_context_size, user_location }` + - `summary: array of object { text, type }` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](/docs/guides/tools-web-search). + Reasoning summary content. - - `type: "web_search" or "web_search_2025_08_26"` + - `text: string` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + A summary of the reasoning output from the model so far. - - `"web_search"` + - `type: "summary_text"` - - `"web_search_2025_08_26"` + The type of the object. Always `summary_text`. - - `filters: optional object { allowed_domains }` + - `"summary_text"` - Filters for the search. + - `type: "reasoning"` - - `allowed_domains: optional array of string` + The type of the object. Always `reasoning`. - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `"reasoning"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `agent: optional object { agent_name }` - - `search_context_size: optional "low" or "medium" or "high"` + The agent that produced this item. - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + - `agent_name: string` - - `"low"` + The canonical name of the agent that produced this item. - - `"medium"` + - `content: optional array of object { text, type }` - - `"high"` + Reasoning text content. - - `user_location: optional object { city, country, region, 2 more }` + - `text: string` - The approximate location of the user. + The reasoning text from the model. - - `city: optional string` + - `type: "reasoning_text"` - Free text input for the city of the user, e.g. `San Francisco`. + The type of the reasoning text. Always `reasoning_text`. + + - `"reasoning_text"` + + - `encrypted_content: optional string` + + The encrypted content of the reasoning item. This is populated by default + for reasoning items returned by `POST /v1/responses` and WebSocket + `response.create` requests. + + - `status: optional "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `Program object { id, call_id, code, 3 more }` + + - `id: string` + + The unique ID of the program item. + + - `call_id: string` + + The stable call ID of the program item. + + - `code: string` + + The JavaScript source executed by programmatic tool calling. + + - `fingerprint: string` + + Opaque program replay fingerprint that must be round-tripped. + + - `type: "program"` + + The type of the item. Always `program`. + + - `"program"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `ProgramOutput object { id, call_id, result, 3 more }` + + - `id: string` + + The unique ID of the program output item. + + - `call_id: string` + + The call ID of the program item. + + - `result: string` + + The result produced by the program item. + + - `status: "completed" or "incomplete"` + + The terminal status of the program output item. + + - `"completed"` + + - `"incomplete"` + + - `type: "program_output"` + + The type of the item. Always `program_output`. + + - `"program_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `ToolSearchCall object { id, arguments, call_id, 5 more }` + + - `id: string` + + The unique ID of the tool search call item. + + - `arguments: unknown` + + Arguments used for the tool search call. + + - `call_id: string` + + The unique ID of the tool search call generated by the model. + + - `execution: "server" or "client"` + + Whether tool search was executed by the server or by the client. + + - `"server"` + + - `"client"` + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the tool search call item that was recorded. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "tool_search_call"` + + The type of the item. Always `tool_search_call`. + + - `"tool_search_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `created_by: optional string` + + The identifier of the actor that created the item. + + - `ToolSearchOutput object { id, call_id, execution, 5 more }` + + - `id: string` + + The unique ID of the tool search output item. + + - `call_id: string` + + The unique ID of the tool search call generated by the model. + + - `execution: "server" or "client"` + + Whether tool search was executed by the server or by the client. + + - `"server"` + + - `"client"` + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the tool search output item that was recorded. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` + + The loaded tool definitions returned by tool search. + + - `Function object { name, parameters, strict, 5 more }` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `name: string` + + The name of the function to call. + + - `parameters: map[unknown]` + + A JSON schema object describing the parameters of the function. + + - `strict: boolean` + + Whether strict parameter validation is enforced for this function tool. + + - `type: "function"` + + The type of the function tool. Always `function`. + + - `"function"` + + - `allowed_callers: optional array of "direct" or "programmatic"` + + The tool invocation context(s). + + - `"direct"` + + - `"programmatic"` + + - `defer_loading: optional boolean` + + Whether this function is deferred and loaded via tool search. + + - `description: optional string` + + A description of the function. Used by the model to determine whether or not to call the function. + + - `output_schema: optional map[unknown]` + + A JSON schema object describing the JSON value encoded in string outputs for this function. + + - `FileSearch object { type, vector_store_ids, filters, 2 more }` + + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + + - `type: "file_search"` + + The type of the file search tool. Always `file_search`. + + - `"file_search"` + + - `vector_store_ids: array of string` + + The IDs of the vector stores to search. + + - `filters: optional object { key, type, value } or object { filters, type }` + + A filter to apply. + + - `ComparisonFilter object { key, type, value }` + + A filter used to compare a specified attribute key to a given value using a defined comparison operation. + + - `key: string` + + The key to compare against the value. + + - `type: "eq" or "ne" or "gt" or 5 more` + + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in + + - `"eq"` + + - `"ne"` + + - `"gt"` + + - `"gte"` + + - `"lt"` + + - `"lte"` + + - `"in"` + + - `"nin"` + + - `value: string or number or boolean or array of string or number` + + The value to compare against the attribute key; supports string, number, or boolean types. + + - `string` + + - `number` + + - `boolean` + + - `array of string or number` + + - `string` + + - `number` + + - `CompoundFilter object { filters, type }` + + Combine multiple filters using `and` or `or`. + + - `filters: array of object { key, type, value } or unknown` + + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + + - `ComparisonFilter object { key, type, value }` + + A filter used to compare a specified attribute key to a given value using a defined comparison operation. + + - `key: string` + + The key to compare against the value. + + - `type: "eq" or "ne" or "gt" or 5 more` + + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in + + - `"eq"` + + - `"ne"` + + - `"gt"` + + - `"gte"` + + - `"lt"` + + - `"lte"` + + - `"in"` + + - `"nin"` + + - `value: string or number or boolean or array of string or number` + + The value to compare against the attribute key; supports string, number, or boolean types. + + - `string` + + - `number` + + - `boolean` + + - `array of string or number` + + - `string` + + - `number` + + - `unknown` + + - `type: "and" or "or"` + + Type of operation: `and` or `or`. + + - `"and"` + + - `"or"` + + - `max_num_results: optional number` + + The maximum number of results to return. This number should be between 1 and 50 inclusive. + + - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` + + Ranking options for search. + + - `hybrid_search: optional object { embedding_weight, text_weight }` + + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + + - `embedding_weight: number` + + The weight of the embedding in the reciprocal ranking fusion. + + - `text_weight: number` + + The weight of the text in the reciprocal ranking fusion. + + - `ranker: optional "auto" or "default-2024-11-15"` + + The ranker to use for the file search. + + - `"auto"` + + - `"default-2024-11-15"` + + - `score_threshold: optional number` + + The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. + + - `Computer object { type }` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type: "computer"` + + The type of the computer tool. Always `computer`. + + - `"computer"` + + - `ComputerUsePreview object { display_height, display_width, environment, type }` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `display_height: number` + + The height of the computer display. + + - `display_width: number` + + The width of the computer display. + + - `environment: "windows" or "mac" or "linux" or 2 more` + + The type of computer environment to control. + + - `"windows"` + + - `"mac"` + + - `"linux"` + + - `"ubuntu"` + + - `"browser"` + + - `type: "computer_use_preview"` + + The type of the computer use tool. Always `computer_use_preview`. + + - `"computer_use_preview"` + + - `WebSearch object { type, filters, search_context_size, user_location }` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). + + - `type: "web_search" or "web_search_2025_08_26"` + + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + + - `"web_search"` + + - `"web_search_2025_08_26"` + + - `filters: optional object { allowed_domains }` + + Filters for the search. + + - `allowed_domains: optional array of string` + + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. + + Example: `["pubmed.ncbi.nlm.nih.gov"]` + + - `search_context_size: optional "low" or "medium" or "high"` + + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + + - `"low"` + + - `"medium"` + + - `"high"` + + - `user_location: optional object { city, country, region, 2 more }` + + The approximate location of the user. + + - `city: optional string` + + Free text input for the city of the user, e.g. `San Francisco`. - `country: optional string` @@ -6659,1072 +7038,1074 @@ as input for the model's response. - `"programmatic"` -- `top_logprobs: optional number` + - `type: "tool_search_output"` - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + The type of the item. Always `tool_search_output`. -- `top_p: optional number` + - `"tool_search_output"` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + - `agent: optional object { agent_name }` - We generally recommend altering this or `temperature` but not both. + The agent that produced this item. -- `truncation: optional "auto" or "disabled"` + - `agent_name: string` - The truncation strategy to use for the model response. + The canonical name of the agent that produced this item. - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `created_by: optional string` - - `"auto"` + The identifier of the actor that created the item. - - `"disabled"` + - `AdditionalTools object { id, role, tools, 2 more }` -- `user: optional string` + - `id: string` - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). + The unique ID of the additional tools item. -### Returns + - `role: "unknown" or "user" or "assistant" or 5 more` -- `BetaResponse object { id, created_at, error, 32 more }` + The role that provided the additional tools. - - `id: string` + - `"unknown"` - Unique identifier for this Response. + - `"user"` - - `created_at: number` + - `"assistant"` - Unix timestamp (in seconds) of when this Response was created. + - `"system"` - - `error: BetaResponseError` + - `"critic"` - An error object returned when the model fails to generate a Response. + - `"discriminator"` - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 17 more` + - `"developer"` - The error code for the response. + - `"tool"` - - `"server_error"` + - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - - `"rate_limit_exceeded"` + The additional tool definitions made available at this item. - - `"invalid_prompt"` + - `Function object { name, parameters, strict, 5 more }` - - `"data_residency_mismatch"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `"bio_policy"` + - `name: string` - - `"vector_store_timeout"` + The name of the function to call. - - `"invalid_image"` + - `parameters: map[unknown]` - - `"invalid_image_format"` + A JSON schema object describing the parameters of the function. - - `"invalid_base64_image"` + - `strict: boolean` - - `"invalid_image_url"` + Whether strict parameter validation is enforced for this function tool. - - `"image_too_large"` + - `type: "function"` - - `"image_too_small"` + The type of the function tool. Always `function`. - - `"image_parse_error"` + - `"function"` - - `"image_content_policy_violation"` + - `allowed_callers: optional array of "direct" or "programmatic"` - - `"invalid_image_mode"` + The tool invocation context(s). - - `"image_file_too_large"` + - `"direct"` - - `"unsupported_image_media_type"` + - `"programmatic"` - - `"empty_image_file"` + - `defer_loading: optional boolean` - - `"failed_to_download_image"` + Whether this function is deferred and loaded via tool search. - - `"image_file_not_found"` + - `description: optional string` - - `message: string` + A description of the function. Used by the model to determine whether or not to call the function. - A human-readable description of the error. + - `output_schema: optional map[unknown]` - - `incomplete_details: object { reason }` + A JSON schema object describing the JSON value encoded in string outputs for this function. - Details about why the response is incomplete. + - `FileSearch object { type, vector_store_ids, filters, 2 more }` - - `reason: optional "max_output_tokens" or "content_filter"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The reason why the response is incomplete. + - `type: "file_search"` - - `"max_output_tokens"` + The type of the file search tool. Always `file_search`. - - `"content_filter"` + - `"file_search"` - - `instructions: string or array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` + - `vector_store_ids: array of string` - A system (or developer) message inserted into the model's context. + The IDs of the vector stores to search. - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + - `filters: optional object { key, type, value } or object { filters, type }` - - `string` + A filter to apply. - A text input to the model, equivalent to a text input with the - `developer` role. + - `ComparisonFilter object { key, type, value }` - - `InputItemList = array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - A list of one or many input items to the model, containing - different content types. + - `key: string` - - `BetaEasyInputMessage object { content, role, phase, type }` + The key to compare against the value. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + - `type: "eq" or "ne" or "gt" or 5 more` - - `content: string or BetaResponseInputMessageContentList` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in - - `TextInput = string` + - `"eq"` - A text input to the model. + - `"ne"` - - `BetaResponseInputMessageContentList = array of BetaResponseInputContent` + - `"gt"` - A list of one or many input items to the model, containing different content - types. + - `"gte"` - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + - `"lt"` - A text input to the model. + - `"lte"` - - `text: string` + - `"in"` - The text input to the model. + - `"nin"` - - `type: "input_text"` + - `value: string or number or boolean or array of string or number` - The type of the input item. Always `input_text`. + The value to compare against the attribute key; supports string, number, or boolean types. - - `"input_text"` + - `string` - - `prompt_cache_breakpoint: optional object { mode }` + - `number` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `boolean` - - `mode: "explicit"` + - `array of string or number` - The breakpoint mode. Always `explicit`. + - `string` - - `"explicit"` + - `number` - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + - `CompoundFilter object { filters, type }` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + Combine multiple filters using `and` or `or`. - - `detail: "low" or "high" or "auto" or "original"` + - `filters: array of object { key, type, value } or unknown` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `"low"` + - `ComparisonFilter object { key, type, value }` - - `"high"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `"auto"` + - `key: string` - - `"original"` + The key to compare against the value. - - `type: "input_image"` + - `type: "eq" or "ne" or "gt" or 5 more` - The type of the input item. Always `input_image`. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `"input_image"` + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in - - `file_id: optional string` + - `"eq"` - The ID of the file to be sent to the model. + - `"ne"` - - `image_url: optional string` + - `"gt"` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `"gte"` - - `prompt_cache_breakpoint: optional object { mode }` + - `"lt"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `"lte"` - - `mode: "explicit"` + - `"in"` - The breakpoint mode. Always `explicit`. + - `"nin"` - - `"explicit"` + - `value: string or number or boolean or array of string or number` - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + The value to compare against the attribute key; supports string, number, or boolean types. - A file input to the model. + - `string` - - `type: "input_file"` + - `number` - The type of the input item. Always `input_file`. + - `boolean` - - `"input_file"` + - `array of string or number` - - `detail: optional "auto" or "low" or "high"` + - `string` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `number` - - `"auto"` + - `unknown` - - `"low"` + - `type: "and" or "or"` - - `"high"` + Type of operation: `and` or `or`. - - `file_data: optional string` + - `"and"` - The content of the file to be sent to the model. + - `"or"` - - `file_id: optional string` + - `max_num_results: optional number` - The ID of the file to be sent to the model. + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `file_url: optional string` + - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` - The URL of the file to be sent to the model. + Ranking options for search. - - `filename: optional string` + - `hybrid_search: optional object { embedding_weight, text_weight }` - The name of the file to be sent to the model. + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `prompt_cache_breakpoint: optional object { mode }` + - `embedding_weight: number` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The weight of the embedding in the reciprocal ranking fusion. - - `mode: "explicit"` + - `text_weight: number` - The breakpoint mode. Always `explicit`. + The weight of the text in the reciprocal ranking fusion. - - `"explicit"` + - `ranker: optional "auto" or "default-2024-11-15"` - - `role: "user" or "assistant" or "system" or "developer"` + The ranker to use for the file search. - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + - `"auto"` - - `"user"` + - `"default-2024-11-15"` - - `"assistant"` + - `score_threshold: optional number` - - `"system"` + The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. - - `"developer"` + - `Computer object { type }` - - `phase: optional "commentary" or "final_answer"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). - For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend - phase on all assistant messages — dropping it can degrade performance. Not used for user messages. + - `type: "computer"` - - `"commentary"` + The type of the computer tool. Always `computer`. - - `"final_answer"` + - `"computer"` - - `type: optional "message"` + - `ComputerUsePreview object { display_height, display_width, environment, type }` - The type of the message input. Always `message`. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `"message"` + - `display_height: number` - - `Message object { content, role, agent, 2 more }` + The height of the computer display. - 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. + - `display_width: number` - - `content: BetaResponseInputMessageContentList` + The width of the computer display. - A list of one or many input items to the model, containing different content - types. + - `environment: "windows" or "mac" or "linux" or 2 more` - - `role: "user" or "system" or "developer"` + The type of computer environment to control. - The role of the message input. One of `user`, `system`, or `developer`. + - `"windows"` - - `"user"` + - `"mac"` - - `"system"` + - `"linux"` - - `"developer"` + - `"ubuntu"` - - `agent: optional object { agent_name }` + - `"browser"` - The agent that produced this item. + - `type: "computer_use_preview"` - - `agent_name: string` + The type of the computer use tool. Always `computer_use_preview`. - The canonical name of the agent that produced this item. + - `"computer_use_preview"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `WebSearch object { type, filters, search_context_size, user_location }` - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). - - `"in_progress"` + - `type: "web_search" or "web_search_2025_08_26"` - - `"completed"` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `"incomplete"` + - `"web_search"` - - `type: optional "message"` + - `"web_search_2025_08_26"` - The type of the message input. Always set to `message`. + - `filters: optional object { allowed_domains }` - - `"message"` + Filters for the search. - - `BetaResponseOutputMessage object { id, content, role, 4 more }` + - `allowed_domains: optional array of string` - An output message from the model. + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `id: string` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - The unique ID of the output message. + - `search_context_size: optional "low" or "medium" or "high"` - - `content: array of BetaResponseOutputText or BetaResponseOutputRefusal` + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - The content of the output message. + - `"low"` - - `BetaResponseOutputText object { annotations, logprobs, text, type }` + - `"medium"` - A text output from the model. + - `"high"` - - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` + - `user_location: optional object { city, country, region, 2 more }` - The annotations of the text output. + The approximate location of the user. - - `FileCitation object { file_id, filename, index, type }` + - `city: optional string` - A citation to a file. + Free text input for the city of the user, e.g. `San Francisco`. - - `file_id: string` + - `country: optional string` - The ID of the file. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `filename: string` + - `region: optional string` - The filename of the file cited. + Free text input for the region of the user, e.g. `California`. - - `index: number` + - `timezone: optional string` - The index of the file in the list of files. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `type: "file_citation"` + - `type: optional "approximate"` - The type of the file citation. Always `file_citation`. + The type of location approximation. Always `approximate`. - - `"file_citation"` + - `"approximate"` - - `URLCitation object { end_index, start_index, title, 2 more }` + - `Mcp object { server_label, type, allowed_callers, 9 more }` - A citation for a web resource used to generate a model response. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). - - `end_index: number` + - `server_label: string` - The index of the last character of the URL citation in the message. + A label for this MCP server, used to identify it in tool calls. - - `start_index: number` + - `type: "mcp"` - The index of the first character of the URL citation in the message. + The type of the MCP tool. Always `mcp`. - - `title: string` + - `"mcp"` - The title of the web resource. + - `allowed_callers: optional array of "direct" or "programmatic"` - - `type: "url_citation"` + The tool invocation context(s). - The type of the URL citation. Always `url_citation`. + - `"direct"` - - `"url_citation"` + - `"programmatic"` - - `url: string` + - `allowed_tools: optional array of string or object { read_only, tool_names }` - The URL of the web resource. + List of allowed tool names or a filter object. - - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` + - `McpAllowedTools = array of string` - A citation for a container file used to generate a model response. + A string array of allowed tool names - - `container_id: string` + - `McpToolFilter object { read_only, tool_names }` - The ID of the container file. + A filter object to specify which tools are allowed. - - `end_index: number` + - `read_only: optional boolean` - The index of the last character of the container file citation in the message. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `file_id: string` + - `tool_names: optional array of string` - The ID of the file. + List of allowed tool names. - - `filename: string` + - `authorization: optional string` - The filename of the container file cited. + An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application + must handle the OAuth authorization flow and provide the token here. - - `start_index: number` + - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` - The index of the first character of the container file citation in the message. + Identifier for service connectors, like those available in ChatGPT. One of + `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more + about service connectors [here](/docs/guides/tools-remote-mcp#connectors). - - `type: "container_file_citation"` + Currently supported `connector_id` values are: - The type of the container file citation. Always `container_file_citation`. + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` - - `"container_file_citation"` + - `"connector_dropbox"` - - `FilePath object { file_id, index, type }` + - `"connector_gmail"` - A path to a file. + - `"connector_googlecalendar"` - - `file_id: string` + - `"connector_googledrive"` - The ID of the file. + - `"connector_microsoftteams"` - - `index: number` + - `"connector_outlookcalendar"` - The index of the file in the list of files. + - `"connector_outlookemail"` - - `type: "file_path"` + - `"connector_sharepoint"` - The type of the file path. Always `file_path`. + - `defer_loading: optional boolean` - - `"file_path"` + Whether this MCP tool is deferred and discovered via tool search. - - `logprobs: array of object { token, bytes, logprob, top_logprobs }` + - `headers: optional map[string]` - - `token: string` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `bytes: array of number` + - `require_approval: optional object { always, never } or "always" or "never"` - - `logprob: number` + Specify which of the MCP server's tools require approval. - - `top_logprobs: array of object { token, bytes, logprob }` + - `McpToolApprovalFilter object { always, never }` - - `token: string` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `bytes: array of number` + - `always: optional object { read_only, tool_names }` - - `logprob: number` + A filter object to specify which tools are allowed. - - `text: string` + - `read_only: optional boolean` - The text output from the model. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `type: "output_text"` + - `tool_names: optional array of string` - The type of the output text. Always `output_text`. + List of allowed tool names. - - `"output_text"` + - `never: optional object { read_only, tool_names }` - - `BetaResponseOutputRefusal object { refusal, type }` + A filter object to specify which tools are allowed. - A refusal from the model. + - `read_only: optional boolean` - - `refusal: string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The refusal explanation from the model. + - `tool_names: optional array of string` - - `type: "refusal"` + List of allowed tool names. - The type of the refusal. Always `refusal`. + - `McpToolApprovalSetting = "always" or "never"` - - `"refusal"` + Specify a single approval policy for all tools. One of `always` or + `never`. When set to `always`, all tools will require approval. When + set to `never`, all tools will not require approval. - - `role: "assistant"` + - `"always"` - The role of the output message. Always `assistant`. + - `"never"` - - `"assistant"` + - `server_description: optional string` - - `status: "in_progress" or "completed" or "incomplete"` + Optional description of the MCP server, used to provide more context. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `server_url: optional string` - - `"in_progress"` + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `"completed"` + - `tunnel_id: optional string` - - `"incomplete"` + The Secure MCP Tunnel ID to use instead of a direct server URL. One of + `server_url`, `connector_id`, or `tunnel_id` must be provided. - - `type: "message"` + - `CodeInterpreter object { container, type, allowed_callers }` - The type of the output message. Always `message`. + A tool that runs Python code to help generate a response to a prompt. - - `"message"` + - `container: string or object { type, file_ids, memory_limit, network_policy }` - - `agent: optional object { agent_name }` + The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an + optional `memory_limit` setting. - The agent that produced this item. + - `string` - - `agent_name: string` + The container ID. - The canonical name of the agent that produced this item. + - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` - - `phase: optional "commentary" or "final_answer"` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). - For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend - phase on all assistant messages — dropping it can degrade performance. Not used for user messages. + - `type: "auto"` - - `"commentary"` + Always `auto`. - - `"final_answer"` + - `"auto"` - - `FileSearchCall object { id, queries, status, 3 more }` + - `file_ids: optional array of string` - The results of a file search tool call. See the - [file search guide](/docs/guides/tools-file-search) for more information. + An optional list of uploaded files to make available to your code. - - `id: string` + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - The unique ID of the file search tool call. + The memory limit for the code interpreter container. - - `queries: array of string` + - `"1g"` - The queries used to search for files. + - `"4g"` - - `status: "in_progress" or "searching" or "completed" or 2 more` + - `"16g"` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `"64g"` - - `"in_progress"` + - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` - - `"searching"` + Network access policy for the container. - - `"completed"` + - `BetaContainerNetworkPolicyDisabled object { type }` - - `"incomplete"` + - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `"failed"` + - `type: "code_interpreter"` - - `type: "file_search_call"` + The type of the code interpreter tool. Always `code_interpreter`. - The type of the file search tool call. Always `file_search_call`. + - `"code_interpreter"` - - `"file_search_call"` + - `allowed_callers: optional array of "direct" or "programmatic"` - - `agent: optional object { agent_name }` + The tool invocation context(s). - The agent that produced this item. + - `"direct"` - - `agent_name: string` + - `"programmatic"` - The canonical name of the agent that produced this item. + - `ProgrammaticToolCalling object { type }` - - `results: optional array of object { attributes, file_id, filename, 2 more }` + - `type: "programmatic_tool_calling"` - The results of the file search tool call. + The type of the tool. Always `programmatic_tool_calling`. - - `attributes: optional map[string or number or boolean]` + - `"programmatic_tool_calling"` - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. Keys are strings - with a maximum length of 64 characters. Values are strings with a maximum - length of 512 characters, booleans, or numbers. + - `ImageGeneration object { type, action, background, 9 more }` - - `string` + A tool that generates images using the GPT image models. - - `number` + - `type: "image_generation"` - - `boolean` + The type of the image generation tool. Always `image_generation`. - - `file_id: optional string` + - `"image_generation"` - The unique ID of the file. + - `action: optional "generate" or "edit" or "auto"` - - `filename: optional string` + Whether to generate a new image or edit an existing image. Default: `auto`. - The name of the file. + - `"generate"` - - `score: optional number` + - `"edit"` - The relevance score of the file - a value between 0 and 1. + - `"auto"` - - `text: optional string` + - `background: optional "transparent" or "opaque" or "auto"` - The text that was retrieved from the file. + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. - - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` + - `"transparent"` - A tool call to a computer use tool. See the - [computer use guide](/docs/guides/tools-computer-use) for more information. + - `"opaque"` - - `id: string` + - `"auto"` - The unique ID of the computer call. + - `input_fidelity: optional "high" or "low"` - - `call_id: string` + Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. - An identifier used when responding to the tool call with output. + - `"high"` - - `pending_safety_checks: array of object { id, code, message }` + - `"low"` - The pending safety checks for the computer call. + - `input_image_mask: optional object { file_id, image_url }` - - `id: string` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - The ID of the pending safety check. + - `file_id: optional string` - - `code: optional string` + File ID for the mask image. - The type of the pending safety check. + - `image_url: optional string` - - `message: optional string` + Base64-encoded mask image. - Details about the pending safety check. + - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `status: "in_progress" or "completed" or "incomplete"` + The image generation model to use. Default: `gpt-image-1`. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `string` - - `"in_progress"` + - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `"completed"` + The image generation model to use. Default: `gpt-image-1`. - - `"incomplete"` + - `"gpt-image-1"` - - `type: "computer_call"` + - `"gpt-image-1-mini"` - The type of the computer call. Always `computer_call`. + - `"gpt-image-1.5"` - - `"computer_call"` + - `moderation: optional "auto" or "low"` - - `action: optional BetaComputerAction` + Moderation level for the generated image. Default: `auto`. - A click action. + - `"auto"` - - `Click object { button, type, x, 2 more }` + - `"low"` - A click action. + - `output_compression: optional number` - - `button: "left" or "right" or "wheel" or 2 more` + Compression level for the output image. Default: 100. - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `output_format: optional "png" or "webp" or "jpeg"` - - `"left"` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `"right"` + - `"png"` - - `"wheel"` + - `"webp"` - - `"back"` + - `"jpeg"` - - `"forward"` + - `partial_images: optional number` - - `type: "click"` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - Specifies the event type. For a click action, this property is always `click`. + - `quality: optional "low" or "medium" or "high" or "auto"` - - `"click"` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `x: number` + - `"low"` - The x-coordinate where the click occurred. + - `"medium"` - - `y: number` + - `"high"` - The y-coordinate where the click occurred. + - `"auto"` - - `keys: optional array of string` + - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` - The keys being held while clicking. + The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. - - `DoubleClick object { keys, type, x, y }` + - `string` - A double click action. + - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - `keys: array of string` + The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. - The keys being held while double-clicking. + - `"1024x1024"` - - `type: "double_click"` + - `"1024x1536"` - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `"1536x1024"` - - `"double_click"` + - `"auto"` - - `x: number` + - `LocalShell object { type }` - The x-coordinate where the double click occurred. + A tool that allows the model to execute shell commands in a local environment. - - `y: number` + - `type: "local_shell"` - The y-coordinate where the double click occurred. + The type of the local shell tool. Always `local_shell`. - - `Drag object { path, type, keys }` + - `"local_shell"` - A drag action. + - `Shell object { type, allowed_callers, environment }` - - `path: array of object { x, y }` + A tool that allows the model to execute shell commands. - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `type: "shell"` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + The type of the shell tool. Always `shell`. - - `x: number` + - `"shell"` - The x-coordinate. + - `allowed_callers: optional array of "direct" or "programmatic"` - - `y: number` + The tool invocation context(s). - The y-coordinate. + - `"direct"` - - `type: "drag"` + - `"programmatic"` - Specifies the event type. For a drag action, this property is always set to `drag`. + - `environment: optional BetaContainerAuto or BetaLocalEnvironment or BetaContainerReference` - - `"drag"` + - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` - - `keys: optional array of string` + - `BetaLocalEnvironment object { type, skills }` - The keys being held while dragging the mouse. + - `BetaContainerReference object { container_id, type }` - - `Keypress object { keys, type }` + - `Custom object { name, type, allowed_callers, 3 more }` - A collection of keypresses the model would like to perform. + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - `keys: array of string` + - `name: string` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + The name of the custom tool, used to identify it in tool calls. - - `type: "keypress"` + - `type: "custom"` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + The type of the custom tool. Always `custom`. - - `"keypress"` + - `"custom"` - - `Move object { type, x, y, keys }` + - `allowed_callers: optional array of "direct" or "programmatic"` - A mouse move action. + The tool invocation context(s). - - `type: "move"` + - `"direct"` - Specifies the event type. For a move action, this property is always set to `move`. + - `"programmatic"` - - `"move"` + - `defer_loading: optional boolean` - - `x: number` + Whether this tool should be deferred and discovered via tool search. - The x-coordinate to move to. + - `description: optional string` - - `y: number` + Optional description of the custom tool, used to provide more context. - The y-coordinate to move to. + - `format: optional object { type } or object { definition, syntax, type }` - - `keys: optional array of string` + The input format for the custom tool. Default is unconstrained text. - The keys being held while moving the mouse. + - `Text object { type }` - - `Screenshot object { type }` + Unconstrained free-form text. - A screenshot action. + - `type: "text"` - - `type: "screenshot"` + Unconstrained text format. Always `text`. - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `"text"` - - `"screenshot"` + - `Grammar object { definition, syntax, type }` - - `Scroll object { scroll_x, scroll_y, type, 3 more }` + A grammar defined by the user. - A scroll action. + - `definition: string` - - `scroll_x: number` + The grammar definition. - The horizontal scroll distance. + - `syntax: "lark" or "regex"` - - `scroll_y: number` + The syntax of the grammar definition. One of `lark` or `regex`. - The vertical scroll distance. + - `"lark"` - - `type: "scroll"` + - `"regex"` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `type: "grammar"` - - `"scroll"` + Grammar format. Always `grammar`. - - `x: number` + - `"grammar"` - The x-coordinate where the scroll occurred. + - `Namespace object { description, name, tools, type }` - - `y: number` + Groups function/custom tools under a shared namespace. - The y-coordinate where the scroll occurred. + - `description: string` - - `keys: optional array of string` + A description of the namespace shown to the model. - The keys being held while scrolling. + - `name: string` - - `Type object { text, type }` + The namespace name used in tool calls (for example, `crm`). - An action to type in text. + - `tools: array of object { name, type, allowed_callers, 5 more } or object { name, type, allowed_callers, 3 more }` - - `text: string` + The function/custom tools available inside this namespace. - The text to type. + - `Function object { name, type, allowed_callers, 5 more }` - - `type: "type"` + - `name: string` - Specifies the event type. For a type action, this property is always set to `type`. + - `type: "function"` - - `"type"` + - `"function"` - - `Wait object { type }` + - `allowed_callers: optional array of "direct" or "programmatic"` - A wait action. + The tool invocation context(s). - - `type: "wait"` + - `"direct"` - Specifies the event type. For a wait action, this property is always set to `wait`. + - `"programmatic"` - - `"wait"` + - `defer_loading: optional boolean` - - `actions: optional BetaComputerActionList` + Whether this function should be deferred and discovered via tool search. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `description: optional string` - - `Click object { button, type, x, 2 more }` + - `output_schema: optional map[unknown]` - A click action. + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `DoubleClick object { keys, type, x, y }` + - `parameters: optional unknown` - A double click action. + - `strict: optional boolean` - - `Drag object { path, type, keys }` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - A drag action. + - `Custom object { name, type, allowed_callers, 3 more }` - - `Keypress object { keys, type }` + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - A collection of keypresses the model would like to perform. + - `name: string` - - `Move object { type, x, y, keys }` + The name of the custom tool, used to identify it in tool calls. - A mouse move action. + - `type: "custom"` - - `Screenshot object { type }` + The type of the custom tool. Always `custom`. - A screenshot action. + - `"custom"` - - `Scroll object { scroll_x, scroll_y, type, 3 more }` + - `allowed_callers: optional array of "direct" or "programmatic"` - A scroll action. + The tool invocation context(s). - - `Type object { text, type }` + - `"direct"` - An action to type in text. + - `"programmatic"` - - `Wait object { type }` + - `defer_loading: optional boolean` - A wait action. + Whether this tool should be deferred and discovered via tool search. - - `agent: optional object { agent_name }` + - `description: optional string` - The agent that produced this item. + Optional description of the custom tool, used to provide more context. - - `agent_name: string` + - `format: optional object { type } or object { definition, syntax, type }` - The canonical name of the agent that produced this item. + The input format for the custom tool. Default is unconstrained text. - - `ComputerCallOutput object { call_id, output, type, 4 more }` + - `Text object { type }` - The output of a computer tool call. + Unconstrained free-form text. - - `call_id: string` + - `type: "text"` - The ID of the computer tool call that produced the output. + Unconstrained text format. Always `text`. - - `output: BetaResponseComputerToolCallOutputScreenshot` + - `"text"` - A computer screenshot image used with the computer use tool. + - `Grammar object { definition, syntax, type }` - - `type: "computer_screenshot"` + A grammar defined by the user. - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `definition: string` - - `"computer_screenshot"` + The grammar definition. - - `file_id: optional string` + - `syntax: "lark" or "regex"` - The identifier of an uploaded file that contains the screenshot. + The syntax of the grammar definition. One of `lark` or `regex`. - - `image_url: optional string` + - `"lark"` - The URL of the screenshot image. + - `"regex"` - - `type: "computer_call_output"` + - `type: "grammar"` - The type of the computer tool call output. Always `computer_call_output`. + Grammar format. Always `grammar`. - - `"computer_call_output"` + - `"grammar"` - - `id: optional string` + - `type: "namespace"` - The ID of the computer tool call output. + The type of the tool. Always `namespace`. - - `acknowledged_safety_checks: optional array of object { id, code, message }` + - `"namespace"` - The safety checks reported by the API that have been acknowledged by the developer. + - `ToolSearch object { type, description, execution, parameters }` - - `id: string` + Hosted or BYOT tool search configuration for deferred tools. - The ID of the pending safety check. + - `type: "tool_search"` - - `code: optional string` + The type of the tool. Always `tool_search`. - The type of the pending safety check. + - `"tool_search"` - - `message: optional string` + - `description: optional string` - Details about the pending safety check. + Description shown to the model for a client-executed tool search tool. - - `agent: optional object { agent_name }` + - `execution: optional "server" or "client"` - The agent that produced this item. + Whether tool search is executed by the server or by the client. - - `agent_name: string` + - `"server"` - The canonical name of the agent that produced this item. + - `"client"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `parameters: optional unknown` - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + Parameter schema for a client-executed tool search tool. - - `"in_progress"` + - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` - - `"completed"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `"incomplete"` + - `type: "web_search_preview" or "web_search_preview_2025_03_11"` - - `WebSearchCall object { id, action, status, 2 more }` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The results of a web search tool call. See the - [web search guide](/docs/guides/tools-web-search) for more information. + - `"web_search_preview"` - - `id: string` + - `"web_search_preview_2025_03_11"` - The unique ID of the web search tool call. + - `search_content_types: optional array of "text" or "image"` - - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` + - `"text"` - An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find_in_page). + - `"image"` - - `Search object { type, queries, query, sources }` + - `search_context_size: optional "low" or "medium" or "high"` - Action type "search" - Performs a web search query. + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - - `type: "search"` + - `"low"` - The action type. + - `"medium"` - - `"search"` + - `"high"` - - `queries: optional array of string` + - `user_location: optional object { type, city, country, 2 more }` - The search queries. + The user's location. - - `query: optional string` + - `type: "approximate"` - The search query. + The type of location approximation. Always `approximate`. - - `sources: optional array of object { type, url }` + - `"approximate"` - The sources used in the search. + - `city: optional string` - - `type: "url"` + Free text input for the city of the user, e.g. `San Francisco`. - The type of source. Always `url`. + - `country: optional string` - - `"url"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `url: string` + - `region: optional string` - The URL of the source. + Free text input for the region of the user, e.g. `California`. - - `OpenPage object { type, url }` + - `timezone: optional string` - Action type "open_page" - Opens a specific URL from search results. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `type: "open_page"` + - `ApplyPatch object { type, allowed_callers }` - The action type. + Allows the assistant to create, delete, or update files using unified diffs. - - `"open_page"` + - `type: "apply_patch"` - - `url: optional string` + The type of the tool. Always `apply_patch`. - The URL opened by the model. + - `"apply_patch"` - - `FindInPage object { pattern, type, url }` + - `allowed_callers: optional array of "direct" or "programmatic"` - Action type "find_in_page": Searches for a pattern within a loaded page. + The tool invocation context(s). - - `pattern: string` + - `"direct"` - The pattern or text to search for within the page. + - `"programmatic"` - - `type: "find_in_page"` + - `type: "additional_tools"` - The action type. + The type of the item. Always `additional_tools`. - - `"find_in_page"` + - `"additional_tools"` - - `url: string` + - `agent: optional object { agent_name }` - The URL of the page searched for the pattern. + The agent that produced this item. - - `status: "in_progress" or "searching" or "completed" or "failed"` + - `agent_name: string` - The status of the web search tool call. + The canonical name of the agent that produced this item. - - `"in_progress"` + - `Compaction object { id, encrypted_content, type, 2 more }` - - `"searching"` + A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - - `"completed"` + - `id: string` - - `"failed"` + The unique ID of the compaction item. - - `type: "web_search_call"` + - `encrypted_content: string` - The type of the web search tool call. Always `web_search_call`. + The encrypted content that was produced by compaction. - - `"web_search_call"` + - `type: "compaction"` + + The type of the item. Always `compaction`. + + - `"compaction"` - `agent: optional object { agent_name }` @@ -7734,215 +8115,208 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `FunctionCall object { arguments, call_id, name, 6 more }` - - A tool call to run a function. See the - [function calling guide](/docs/guides/function-calling) for more information. - - - `arguments: string` - - A JSON string of the arguments to pass to the function. + - `created_by: optional string` - - `call_id: string` + The identifier of the actor that created the item. - The unique ID of the function tool call generated by the model. + - `ImageGenerationCall object { id, result, status, 2 more }` - - `name: string` + An image generation request made by the model. - The name of the function to run. + - `id: string` - - `type: "function_call"` + The unique ID of the image generation call. - The type of the function tool call. Always `function_call`. + - `result: string` - - `"function_call"` + The generated image encoded in base64. - - `id: optional string` + - `status: "in_progress" or "completed" or "generating" or "failed"` - The unique ID of the function tool call. + The status of the image generation call. - - `agent: optional object { agent_name }` + - `"in_progress"` - The agent that produced this item. + - `"completed"` - - `agent_name: string` + - `"generating"` - The canonical name of the agent that produced this item. + - `"failed"` - - `caller: optional object { type } or object { caller_id, type }` + - `type: "image_generation_call"` - The execution context that produced this tool call. + The type of the image generation call. Always `image_generation_call`. - - `Direct object { type }` + - `"image_generation_call"` - - `type: "direct"` + - `agent: optional object { agent_name }` - - `"direct"` + The agent that produced this item. - - `Program object { caller_id, type }` + - `agent_name: string` - - `caller_id: string` + The canonical name of the agent that produced this item. - The call ID of the program item that produced this tool call. + - `CodeInterpreterCall object { id, code, container_id, 4 more }` - - `type: "program"` + A tool call to run code. - - `"program"` + - `id: string` - - `namespace: optional string` + The unique ID of the code interpreter tool call. - The namespace of the function to run. + - `code: string` - - `status: optional "in_progress" or "completed" or "incomplete"` + The code to run, or null if not available. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `container_id: string` - - `"in_progress"` + The ID of the container used to run the code. - - `"completed"` + - `outputs: array of object { logs, type } or object { type, url }` - - `"incomplete"` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `FunctionCallOutput object { call_id, output, type, 4 more }` + - `Logs object { logs, type }` - The output of a function tool call. + The logs output from the code interpreter. - - `call_id: string` + - `logs: string` - The unique ID of the function tool call generated by the model. + The logs output from the code interpreter. - - `output: string or array of BetaResponseInputTextContent or BetaResponseInputImageContent or BetaResponseInputFileContent` + - `type: "logs"` - Text, image, or file output of the function tool call. + The type of the output. Always `logs`. - - `string` + - `"logs"` - A JSON string of the output of the function tool call. + - `Image object { type, url }` - - `array of BetaResponseInputTextContent or BetaResponseInputImageContent or BetaResponseInputFileContent` + The image output from the code interpreter. - An array of content outputs (text, image, file) for the function tool call. + - `type: "image"` - - `BetaResponseInputTextContent object { text, type, prompt_cache_breakpoint }` + The type of the output. Always `image`. - A text input to the model. + - `"image"` - - `text: string` + - `url: string` - The text input to the model. + The URL of the image output from the code interpreter. - - `type: "input_text"` + - `status: "in_progress" or "completed" or "incomplete" or 2 more` - The type of the input item. Always `input_text`. + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `"input_text"` + - `"in_progress"` - - `prompt_cache_breakpoint: optional object { mode }` + - `"completed"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `"incomplete"` - - `mode: "explicit"` + - `"interpreting"` - The breakpoint mode. Always `explicit`. + - `"failed"` - - `"explicit"` + - `type: "code_interpreter_call"` - - `BetaResponseInputImageContent object { type, detail, file_id, 2 more }` + The type of the code interpreter tool call. Always `code_interpreter_call`. - An image input to the model. Learn about [image inputs](/docs/guides/vision) + - `"code_interpreter_call"` - - `type: "input_image"` + - `agent: optional object { agent_name }` - The type of the input item. Always `input_image`. + The agent that produced this item. - - `"input_image"` + - `agent_name: string` - - `detail: optional "low" or "high" or "auto" or "original"` + The canonical name of the agent that produced this item. - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `LocalShellCall object { id, action, call_id, 3 more }` - - `"low"` + A tool call to run a command on the local shell. - - `"high"` + - `id: string` - - `"auto"` + The unique ID of the local shell call. - - `"original"` + - `action: object { command, env, type, 3 more }` - - `file_id: optional string` + Execute a shell command on the server. - The ID of the file to be sent to the model. + - `command: array of string` - - `image_url: optional string` + The command to run. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `env: map[string]` - - `prompt_cache_breakpoint: optional object { mode }` + Environment variables to set for the command. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type: "exec"` - - `mode: "explicit"` + The type of the local shell action. Always `exec`. - The breakpoint mode. Always `explicit`. + - `"exec"` - - `"explicit"` + - `timeout_ms: optional number` - - `BetaResponseInputFileContent object { type, detail, file_data, 4 more }` + Optional timeout in milliseconds for the command. - A file input to the model. + - `user: optional string` - - `type: "input_file"` + Optional user to run the command as. - The type of the input item. Always `input_file`. + - `working_directory: optional string` - - `"input_file"` + Optional working directory to run the command in. - - `detail: optional "auto" or "low" or "high"` + - `call_id: string` - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + The unique ID of the local shell tool call generated by the model. - - `"auto"` + - `status: "in_progress" or "completed" or "incomplete"` - - `"low"` + The status of the local shell call. - - `"high"` + - `"in_progress"` - - `file_data: optional string` + - `"completed"` - The base64-encoded data of the file to be sent to the model. + - `"incomplete"` - - `file_id: optional string` + - `type: "local_shell_call"` - The ID of the file to be sent to the model. + The type of the local shell call. Always `local_shell_call`. - - `file_url: optional string` + - `"local_shell_call"` - The URL of the file to be sent to the model. + - `agent: optional object { agent_name }` - - `filename: optional string` + The agent that produced this item. - The name of the file to be sent to the model. + - `agent_name: string` - - `prompt_cache_breakpoint: optional object { mode }` + The canonical name of the agent that produced this item. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `LocalShellCallOutput object { id, output, type, 2 more }` - - `mode: "explicit"` + The output of a local shell tool call. - The breakpoint mode. Always `explicit`. + - `id: string` - - `"explicit"` + The unique ID of the local shell tool call generated by the model. - - `type: "function_call_output"` + - `output: string` - The type of the function tool call output. Always `function_call_output`. + A JSON string of the output of the local shell tool call. - - `"function_call_output"` + - `type: "local_shell_call_output"` - - `id: optional string` + The type of the local shell tool call output. Always `local_shell_call_output`. - The unique ID of the function tool call output. Populated when this item is returned via API. + - `"local_shell_call_output"` - `agent: optional object { agent_name }` @@ -7952,87 +8326,83 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `caller: optional object { type } or object { caller_id, type }` - - The execution context that produced this tool call. - - - `Direct object { type }` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `type: "direct"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - The caller type. Always `direct`. + - `"in_progress"` - - `"direct"` + - `"completed"` - - `Program object { caller_id, type }` + - `"incomplete"` - - `caller_id: string` + - `ShellCall object { id, action, call_id, 6 more }` - The call ID of the program item that produced this tool call. + A tool call that executes one or more shell commands in a managed environment. - - `type: "program"` + - `id: string` - The caller type. Always `program`. + The unique ID of the shell tool call. Populated when this item is returned via API. - - `"program"` + - `action: object { commands, max_output_length, timeout_ms }` - - `status: optional "in_progress" or "completed" or "incomplete"` + The shell commands and limits that describe how to run the tool call. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + - `commands: array of string` - - `"in_progress"` + - `max_output_length: number` - - `"completed"` + Optional maximum number of characters to return from each command. - - `"incomplete"` + - `timeout_ms: number` - - `AgentMessage object { author, content, recipient, 3 more }` + Optional timeout in milliseconds for the commands. - A message routed between agents. + - `call_id: string` - - `author: string` + The unique ID of the shell tool call generated by the model. - The sending agent identity. + - `environment: BetaResponseLocalEnvironment or BetaResponseContainerReference` - - `content: array of BetaResponseInputTextContent or BetaResponseInputImageContent or object { encrypted_content, type }` + Represents the use of a local environment to perform shell actions. - Plaintext, image, or encrypted content sent between agents. + - `BetaResponseLocalEnvironment object { type }` - - `BetaResponseInputTextContent object { text, type, prompt_cache_breakpoint }` + Represents the use of a local environment to perform shell actions. - A text input to the model. + - `type: "local"` - - `BetaResponseInputImageContent object { type, detail, file_id, 2 more }` + The environment type. Always `local`. - An image input to the model. Learn about [image inputs](/docs/guides/vision) + - `"local"` - - `EncryptedContent object { encrypted_content, type }` + - `BetaResponseContainerReference object { container_id, type }` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + Represents a container created with /v1/containers. - - `encrypted_content: string` + - `container_id: string` - Opaque encrypted content. + - `type: "container_reference"` - - `type: "encrypted_content"` + The environment type. Always `container_reference`. - The type of the input item. Always `encrypted_content`. + - `"container_reference"` - - `"encrypted_content"` + - `status: "in_progress" or "completed" or "incomplete"` - - `recipient: string` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - The destination agent identity. + - `"in_progress"` - - `type: "agent_message"` + - `"completed"` - The item type. Always `agent_message`. + - `"incomplete"` - - `"agent_message"` + - `type: "shell_call"` - - `id: optional string` + The type of the item. Always `shell_call`. - The unique ID of this agent message item. + - `"shell_call"` - `agent: optional object { agent_name }` @@ -8042,173 +8412,219 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `MultiAgentCall object { action, arguments, call_id, 3 more }` + - `caller: optional object { type } or object { caller_id, type }` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + The execution context that produced this tool call. - The multi-agent action that was executed. + - `Direct object { type }` - - `"spawn_agent"` + - `type: "direct"` - - `"interrupt_agent"` + - `"direct"` - - `"list_agents"` + - `Program object { caller_id, type }` - - `"send_message"` + - `caller_id: string` - - `"followup_task"` + The call ID of the program item that produced this tool call. - - `"wait_agent"` + - `type: "program"` - - `arguments: string` + - `"program"` - The action arguments as a JSON string. + - `created_by: optional string` - - `call_id: string` + The ID of the entity that created this tool call. - The unique ID linking this call to its output. + - `ShellCallOutput object { id, call_id, max_output_length, 6 more }` - - `type: "multi_agent_call"` + The output of a shell tool call that was emitted. - The item type. Always `multi_agent_call`. + - `id: string` - - `"multi_agent_call"` + The unique ID of the shell call output. Populated when this item is returned via API. - - `id: optional string` + - `call_id: string` - The unique ID of this multi-agent call. + The unique ID of the shell tool call generated by the model. - - `agent: optional object { agent_name }` + - `max_output_length: number` - The agent that produced this item. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - `agent_name: string` + - `output: array of object { outcome, stderr, stdout, created_by }` - The canonical name of the agent that produced this item. + An array of shell call output contents - - `MultiAgentCallOutput object { action, call_id, output, 3 more }` + - `outcome: object { type } or object { exit_code, type }` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - The multi-agent action that produced this result. + - `Timeout object { type }` - - `"spawn_agent"` + Indicates that the shell call exceeded its configured time limit. - - `"interrupt_agent"` + - `type: "timeout"` - - `"list_agents"` + The outcome type. Always `timeout`. - - `"send_message"` + - `"timeout"` - - `"followup_task"` + - `Exit object { exit_code, type }` - - `"wait_agent"` + Indicates that the shell commands finished and returned an exit code. - - `call_id: string` + - `exit_code: number` - The unique ID of the multi-agent call. + Exit code from the shell process. - - `output: array of object { text, type, annotations }` + - `type: "exit"` - Text output returned by the multi-agent action. + The outcome type. Always `exit`. - - `text: string` + - `"exit"` - The text content. + - `stderr: string` - - `type: "output_text"` + The standard error output that was captured. - The content type. Always `output_text`. + - `stdout: string` - - `"output_text"` + The standard output that was captured. - - `annotations: optional array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more }` + - `created_by: optional string` - Citations associated with the text content. + The identifier of the actor that created the item. - - `FileCitation object { file_id, filename, index, type }` + - `status: "in_progress" or "completed" or "incomplete"` - - `file_id: string` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - The ID of the file. + - `"in_progress"` - - `filename: string` + - `"completed"` - The filename of the file cited. + - `"incomplete"` - - `index: number` + - `type: "shell_call_output"` - The index of the file in the list of files. + The type of the shell call output. Always `shell_call_output`. - - `type: "file_citation"` + - `"shell_call_output"` - The citation type. Always `file_citation`. + - `agent: optional object { agent_name }` - - `"file_citation"` + The agent that produced this item. - - `URLCitation object { end_index, start_index, title, 2 more }` + - `agent_name: string` - - `end_index: number` + The canonical name of the agent that produced this item. - The index of the last character of the citation in the message. + - `caller: optional object { type } or object { caller_id, type }` - - `start_index: number` + The execution context that produced this tool call. - The index of the first character of the citation in the message. + - `Direct object { type }` - - `title: string` + - `type: "direct"` - The title of the cited resource. + - `"direct"` - - `type: "url_citation"` + - `Program object { caller_id, type }` - The citation type. Always `url_citation`. + - `caller_id: string` - - `"url_citation"` + The call ID of the program item that produced this tool call. - - `url: string` + - `type: "program"` - The URL of the cited resource. + - `"program"` - - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` + - `created_by: optional string` - - `container_id: string` + The identifier of the actor that created the item. - The ID of the container. + - `ApplyPatchCall object { id, call_id, operation, 5 more }` - - `end_index: number` + A tool call that applies file diffs by creating, deleting, or updating files. - The index of the last character of the citation in the message. + - `id: string` - - `file_id: string` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - The ID of the container file. + - `call_id: string` - - `filename: string` + The unique ID of the apply patch tool call generated by the model. - The filename of the container file cited. + - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` - - `start_index: number` + One of the create_file, delete_file, or update_file operations applied via apply_patch. - The index of the first character of the citation in the message. + - `CreateFile object { diff, path, type }` - - `type: "container_file_citation"` + Instruction describing how to create a file via the apply_patch tool. - The citation type. Always `container_file_citation`. + - `diff: string` - - `"container_file_citation"` + Diff to apply. - - `type: "multi_agent_call_output"` + - `path: string` - The item type. Always `multi_agent_call_output`. + Path of the file to create. - - `"multi_agent_call_output"` + - `type: "create_file"` - - `id: optional string` + Create a new file with the provided diff. - The unique ID of this multi-agent call output. + - `"create_file"` - - `agent: optional object { agent_name }` + - `DeleteFile object { path, type }` + + Instruction describing how to delete a file via the apply_patch tool. + + - `path: string` + + Path of the file to delete. + + - `type: "delete_file"` + + Delete the specified file. + + - `"delete_file"` + + - `UpdateFile object { diff, path, type }` + + Instruction describing how to update a file via the apply_patch tool. + + - `diff: string` + + Diff to apply. + + - `path: string` + + Path of the file to update. + + - `type: "update_file"` + + Update an existing file with the provided diff. + + - `"update_file"` + + - `status: "in_progress" or "completed"` + + The status of the apply patch tool call. One of `in_progress` or `completed`. + + - `"in_progress"` + + - `"completed"` + + - `type: "apply_patch_call"` + + The type of the item. Always `apply_patch_call`. + + - `"apply_patch_call"` + + - `agent: optional object { agent_name }` The agent that produced this item. @@ -8216,21 +8632,296 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `ToolSearchCall object { arguments, type, id, 4 more }` + - `caller: optional object { type } or object { caller_id, type }` - - `arguments: unknown` + The execution context that produced this tool call. - The arguments supplied to the tool search call. + - `Direct object { type }` - - `type: "tool_search_call"` + - `type: "direct"` - The item type. Always `tool_search_call`. + - `"direct"` - - `"tool_search_call"` + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `created_by: optional string` + + The ID of the entity that created this tool call. + + - `ApplyPatchCallOutput object { id, call_id, status, 5 more }` + + The output emitted by an apply patch tool call. + + - `id: string` + + The unique ID of the apply patch tool call output. Populated when this item is returned via API. + + - `call_id: string` + + The unique ID of the apply patch tool call generated by the model. + + - `status: "completed" or "failed"` + + The status of the apply patch tool call output. One of `completed` or `failed`. + + - `"completed"` + + - `"failed"` + + - `type: "apply_patch_call_output"` + + The type of the item. Always `apply_patch_call_output`. + + - `"apply_patch_call_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `created_by: optional string` + + The ID of the entity that created this tool call output. + + - `output: optional string` + + Optional textual output returned by the apply patch tool. + + - `McpCall object { id, arguments, name, 7 more }` + + An invocation of a tool on an MCP server. + + - `id: string` + + The unique ID of the tool call. + + - `arguments: string` + + A JSON string of the arguments passed to the tool. + + - `name: string` + + The name of the tool that was run. + + - `server_label: string` + + The label of the MCP server running the tool. + + - `type: "mcp_call"` + + The type of the item. Always `mcp_call`. + + - `"mcp_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `approval_request_id: optional string` + + Unique identifier for the MCP tool call approval request. + Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call. + + - `error: optional string` + + The error from the tool call, if any. + + - `output: optional string` + + The output from the tool call. + + - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` + + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `"calling"` + + - `"failed"` + + - `McpListTools object { id, server_label, tools, 3 more }` + + A list of tools available on an MCP server. + + - `id: string` + + The unique ID of the list. + + - `server_label: string` + + The label of the MCP server. + + - `tools: array of object { input_schema, name, annotations, description }` + + The tools available on the server. + + - `input_schema: unknown` + + The JSON schema describing the tool's input. + + - `name: string` + + The name of the tool. + + - `annotations: optional unknown` + + Additional annotations about the tool. + + - `description: optional string` + + The description of the tool. + + - `type: "mcp_list_tools"` + + The type of the item. Always `mcp_list_tools`. + + - `"mcp_list_tools"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `error: optional string` + + Error message if the server could not list tools. + + - `McpApprovalRequest object { id, arguments, name, 3 more }` + + A request for human approval of a tool invocation. + + - `id: string` + + The unique ID of the approval request. + + - `arguments: string` + + A JSON string of arguments for the tool. + + - `name: string` + + The name of the tool to run. + + - `server_label: string` + + The label of the MCP server making the request. + + - `type: "mcp_approval_request"` + + The type of the item. Always `mcp_approval_request`. + + - `"mcp_approval_request"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `McpApprovalResponse object { id, approval_request_id, approve, 3 more }` + + A response to an MCP approval request. + + - `id: string` + + The unique ID of the approval response + + - `approval_request_id: string` + + The ID of the approval request being answered. + + - `approve: boolean` + + Whether the request was approved. + + - `type: "mcp_approval_response"` + + The type of the item. Always `mcp_approval_response`. + + - `"mcp_approval_response"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `reason: optional string` + + Optional reason for the decision. + + - `CustomToolCall object { call_id, input, name, 5 more }` + + A call to a custom tool created by the model. + + - `call_id: string` + + An identifier used to map this custom tool call to a tool call output. + + - `input: string` + + The input for the custom tool call generated by the model. + + - `name: string` + + The name of the custom tool being called. + + - `type: "custom_tool_call"` + + The type of the custom tool call. Always `custom_tool_call`. + + - `"custom_tool_call"` - `id: optional string` - The unique ID of this tool search call. + The unique ID of the custom tool call in the OpenAI platform. - `agent: optional object { agent_name }` @@ -8240,21 +8931,69 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `call_id: optional string` + - `caller: optional object { type } or object { caller_id, type }` - The unique ID of the tool search call generated by the model. + The execution context that produced this tool call. - - `execution: optional "server" or "client"` + - `Direct object { type }` - Whether tool search was executed by the server or by the client. + - `type: "direct"` - - `"server"` + - `"direct"` - - `"client"` + - `Program object { caller_id, type }` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `caller_id: string` - The status of the tool search call. + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `namespace: optional string` + + The namespace of the custom tool being called. + + - `CustomToolCallOutput object { id, call_id, output, 5 more }` + + - `id: string` + + The unique ID of the custom tool call output item. + + - `call_id: string` + + The call ID, used to map this custom tool call output to a custom tool call. + + - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + + The output from the custom tool call generated by your code. + Can be a string or an list of output content. + + - `StringOutput = string` + + A string of the output of the custom tool call. + + - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + + Text, image, or file output of the custom tool call. + + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + + A text input to the model. + + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + + An image input to the model. Learn about [image inputs](/docs/guides/vision). + + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + + A file input to the model. + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - `"in_progress"` @@ -8262,11 +9001,246 @@ as input for the model's response. - `"incomplete"` - - `ToolSearchOutput object { tools, type, id, 4 more }` + - `type: "custom_tool_call_output"` + + The type of the custom tool call output. Always `custom_tool_call_output`. + + - `"custom_tool_call_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + The caller type. Always `direct`. + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + The caller type. Always `program`. + + - `"program"` + + - `created_by: optional string` + + The identifier of the actor that created the item. + + - `parallel_tool_calls: boolean` + + Whether to allow the model to run tool calls in parallel. + + - `temperature: number` + + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. + + - `tool_choice: BetaToolChoiceOptions or BetaToolChoiceAllowed or BetaToolChoiceTypes or 6 more` + + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. + + - `BetaToolChoiceOptions = "none" or "auto" or "required"` + + Controls which (if any) tool is called by the model. + + `none` means the model will not call any tool and instead generates a message. + + `auto` means the model can pick between generating a message or calling one or + more tools. + + `required` means the model must call one or more tools. + + - `"none"` + + - `"auto"` + + - `"required"` + + - `BetaToolChoiceAllowed object { mode, tools, type }` + + Constrains the tools available to the model to a pre-defined set. + + - `mode: "auto" or "required"` + + Constrains the tools available to the model to a pre-defined set. + + `auto` allows the model to pick from among the allowed tools and generate a + message. + + `required` requires the model to call one or more of the allowed tools. + + - `"auto"` + + - `"required"` + + - `tools: array of map[unknown]` + + A list of tool definitions that the model should be allowed to call. + + For the Responses API, the list of tool definitions might look like: + + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` + + - `type: "allowed_tools"` + + Allowed tool configuration type. Always `allowed_tools`. + + - `"allowed_tools"` + + - `BetaToolChoiceTypes object { type }` + + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](/docs/guides/tools). + + - `type: "file_search" or "web_search_preview" or "computer" or 5 more` + + The type of hosted tool the model should to use. Learn more about + [built-in tools](/docs/guides/tools). + + Allowed values are: + + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` + + - `"file_search"` + + - `"web_search_preview"` + + - `"computer"` + + - `"computer_use_preview"` + + - `"computer_use"` + + - `"web_search_preview_2025_03_11"` + + - `"image_generation"` + + - `"code_interpreter"` + + - `BetaToolChoiceFunction object { name, type }` + + Use this option to force the model to call a specific function. + + - `name: string` + + The name of the function to call. + + - `type: "function"` + + For function calling, the type is always `function`. + + - `"function"` + + - `BetaToolChoiceMcp object { server_label, type, name }` + + Use this option to force the model to call a specific tool on a remote MCP server. + + - `server_label: string` + + The label of the MCP server to use. + + - `type: "mcp"` + + For MCP tools, the type is always `mcp`. + + - `"mcp"` + + - `name: optional string` + + The name of the tool to call on the server. + + - `BetaToolChoiceCustom object { name, type }` + + Use this option to force the model to call a specific custom tool. + + - `name: string` + + The name of the custom tool to call. + + - `type: "custom"` + + For custom tool calling, the type is always `custom`. + + - `"custom"` + + - `BetaSpecificProgrammaticToolCallingParam object { type }` + + - `type: "programmatic_tool_calling"` + + The tool to call. Always `programmatic_tool_calling`. + + - `"programmatic_tool_calling"` + + - `BetaToolChoiceApplyPatch object { type }` + + Forces the model to call the apply_patch tool when executing a tool call. + + - `type: "apply_patch"` + + The tool to call. Always `apply_patch`. + + - `"apply_patch"` + + - `BetaToolChoiceShell object { type }` + + Forces the model to call the shell tool when a tool call is required. + + - `type: "shell"` + + The tool to call. Always `shell`. + + - `"shell"` - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - The loaded tool definitions returned by the tool search output. + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](/docs/guides/tools-web-search) + or [file search](/docs/guides/tools-file-search). Learn more about + [built-in tools](/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](/docs/guides/function-calling). You can also use + custom tools to call your own code. - `Function object { name, parameters, strict, 5 more }` @@ -8787,40 +9761,8 @@ as input for the model's response. - `BetaContainerNetworkPolicyDisabled object { type }` - - `type: "disabled"` - - Disable outbound network access. Always `disabled`. - - - `"disabled"` - - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `allowed_domains: array of string` - - A list of allowed domains when type is `allowlist`. - - - `type: "allowlist"` - - Allow outbound network access only to specified domains. Always `allowlist`. - - - `"allowlist"` - - - `domain_secrets: optional array of BetaContainerNetworkPolicyDomainSecret` - - Optional domain-scoped secrets for allowlisted domains. - - - `domain: string` - - The domain associated with the secret. - - - `name: string` - - The name of the secret to inject for the domain. - - - `value: string` - - The secret value to inject for the domain. - - `type: "code_interpreter"` The type of the code interpreter tool. Always `code_interpreter`. @@ -9001,128 +9943,10 @@ as input for the model's response. - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` - - `type: "container_auto"` - - Automatically creates a container for this request - - - `"container_auto"` - - - `file_ids: optional array of string` - - An optional list of uploaded files to make available to your code. - - - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - The memory limit for the container. - - - `"1g"` - - - `"4g"` - - - `"16g"` - - - `"64g"` - - - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` - - Network access policy for the container. - - - `BetaContainerNetworkPolicyDisabled object { type }` - - - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - - `skills: optional array of BetaSkillReference or BetaInlineSkill` - - An optional list of skills referenced by id or inline data. - - - `BetaSkillReference object { skill_id, type, version }` - - - `skill_id: string` - - The ID of the referenced skill. - - - `type: "skill_reference"` - - References a skill created with the /v1/skills endpoint. - - - `"skill_reference"` - - - `version: optional string` - - Optional skill version. Use a positive integer or 'latest'. Omit for default. - - - `BetaInlineSkill object { description, name, source, type }` - - - `description: string` - - The description of the skill. - - - `name: string` - - The name of the skill. - - - `source: BetaInlineSkillSource` - - Inline skill payload - - - `data: string` - - Base64-encoded skill zip bundle. - - - `media_type: "application/zip"` - - The media type of the inline skill payload. Must be `application/zip`. - - - `"application/zip"` - - - `type: "base64"` - - The type of the inline skill source. Must be `base64`. - - - `"base64"` - - - `type: "inline"` - - Defines an inline skill for this request. - - - `"inline"` - - `BetaLocalEnvironment object { type, skills }` - - `type: "local"` - - Use a local computer environment. - - - `"local"` - - - `skills: optional array of BetaLocalSkill` - - An optional list of skills. - - - `description: string` - - The description of the skill. - - - `name: string` - - The name of the skill. - - - `path: string` - - The path to the directory containing the skill. - - `BetaContainerReference object { container_id, type }` - - `container_id: string` - - The ID of the referenced container. - - - `type: "container_reference"` - - References a container created with the /v1/containers endpoint - - - `"container_reference"` - - `Custom object { name, type, allowed_callers, 3 more }` A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) @@ -9407,1128 +10231,1383 @@ as input for the model's response. - `"programmatic"` - - `type: "tool_search_output"` + - `top_p: number` - The item type. Always `tool_search_output`. + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - - `"tool_search_output"` + We generally recommend altering this or `temperature` but not both. - - `id: optional string` + - `background: optional boolean` - The unique ID of this tool search output. + Whether to run the model response in the background. + [Learn more](/docs/guides/background). - - `agent: optional object { agent_name }` + - `completed_at: optional number` - The agent that produced this item. + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - - `agent_name: string` + - `conversation: optional object { id }` - The canonical name of the agent that produced this item. + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - - `call_id: optional string` + - `id: string` - The unique ID of the tool search call generated by the model. + The unique ID of the conversation that this response was associated with. - - `execution: optional "server" or "client"` + - `max_output_tokens: optional number` - Whether tool search was executed by the server or by the client. + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning). - - `"server"` + - `max_tool_calls: optional number` - - `"client"` + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `moderation: optional object { input, output }` - The status of the tool search output. + Moderation results for the response input and output, if moderated completions were requested. - - `"in_progress"` + - `input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }` - - `"completed"` + Moderation for the response input. - - `"incomplete"` + - `ModerationResult object { categories, category_applied_input_types, category_scores, 3 more }` - - `AdditionalTools object { role, tools, type, 2 more }` + A moderation result produced for the response input or output. - - `role: "developer"` + - `categories: map[boolean]` - The role that provided the additional tools. Only `developer` is supported. + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `"developer"` + - `category_applied_input_types: map[array of "text" or "image"]` - - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` + Which modalities of input are reflected by the score for each category. - A list of additional tools made available at this item. + - `"text"` - - `Function object { name, parameters, strict, 5 more }` + - `"image"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `category_scores: map[number]` - - `name: string` + A dictionary of moderation categories to scores. - The name of the function to call. + - `flagged: boolean` - - `parameters: map[unknown]` + A boolean indicating whether the content was flagged by any category. - A JSON schema object describing the parameters of the function. + - `model: string` - - `strict: boolean` + The moderation model that produced this result. - Whether strict parameter validation is enforced for this function tool. + - `type: "moderation_result"` - - `type: "function"` + The object type, which was always `moderation_result` for successful moderation results. - The type of the function tool. Always `function`. + - `"moderation_result"` - - `"function"` + - `Error object { code, message, type }` - - `allowed_callers: optional array of "direct" or "programmatic"` + An error produced while attempting moderation for the response input or output. - The tool invocation context(s). + - `code: string` - - `"direct"` + The error code. - - `"programmatic"` + - `message: string` - - `defer_loading: optional boolean` + The error message. - Whether this function is deferred and loaded via tool search. + - `type: "error"` - - `description: optional string` + The object type, which was always `error` for moderation failures. - A description of the function. Used by the model to determine whether or not to call the function. + - `"error"` - - `output_schema: optional map[unknown]` + - `output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }` - A JSON schema object describing the JSON value encoded in string outputs for this function. + Moderation for the response output. - - `FileSearch object { type, vector_store_ids, filters, 2 more }` + - `ModerationResult object { categories, category_applied_input_types, category_scores, 3 more }` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + A moderation result produced for the response input or output. - - `type: "file_search"` + - `categories: map[boolean]` - The type of the file search tool. Always `file_search`. + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `"file_search"` + - `category_applied_input_types: map[array of "text" or "image"]` - - `vector_store_ids: array of string` + Which modalities of input are reflected by the score for each category. - The IDs of the vector stores to search. + - `"text"` - - `filters: optional object { key, type, value } or object { filters, type }` + - `"image"` - A filter to apply. + - `category_scores: map[number]` - - `ComparisonFilter object { key, type, value }` + A dictionary of moderation categories to scores. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `flagged: boolean` - - `key: string` + A boolean indicating whether the content was flagged by any category. - The key to compare against the value. + - `model: string` - - `type: "eq" or "ne" or "gt" or 5 more` + The moderation model that produced this result. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `type: "moderation_result"` - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in + The object type, which was always `moderation_result` for successful moderation results. - - `"eq"` + - `"moderation_result"` - - `"ne"` + - `Error object { code, message, type }` - - `"gt"` + An error produced while attempting moderation for the response input or output. - - `"gte"` + - `code: string` - - `"lt"` + The error code. - - `"lte"` + - `message: string` - - `"in"` + The error message. - - `"nin"` + - `type: "error"` - - `value: string or number or boolean or array of string or number` + The object type, which was always `error` for moderation failures. - The value to compare against the attribute key; supports string, number, or boolean types. + - `"error"` - - `string` + - `output_text: optional string` - - `number` + SDK-only convenience property that contains the aggregated text output + from all `output_text` items in the `output` array, if any are present. + Supported in the Python and JavaScript SDKs. - - `boolean` + - `previous_response_id: optional string` - - `array of string or number` + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - - `string` + - `prompt: optional BetaResponsePrompt` - - `number` + Reference to a prompt template and its variables. + [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts). - - `CompoundFilter object { filters, type }` + - `id: string` - Combine multiple filters using `and` or `or`. + The unique identifier of the prompt template to use. - - `filters: array of object { key, type, value } or unknown` + - `variables: optional map[string or BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile]` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - - `ComparisonFilter object { key, type, value }` + - `string` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - `key: string` + A text input to the model. - The key to compare against the value. + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - - `type: "eq" or "ne" or "gt" or 5 more` + An image input to the model. Learn about [image inputs](/docs/guides/vision). - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in + A file input to the model. - - `"eq"` + - `version: optional string` - - `"ne"` + Optional version of the prompt template. - - `"gt"` + - `prompt_cache_key: optional string` - - `"gte"` + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching). - - `"lt"` + - `prompt_cache_options: optional object { mode, ttl }` - - `"lte"` + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - `"in"` + - `mode: "implicit" or "explicit"` - - `"nin"` + Whether implicit prompt-cache breakpoints were enabled. - - `value: string or number or boolean or array of string or number` + - `"implicit"` - The value to compare against the attribute key; supports string, number, or boolean types. + - `"explicit"` - - `string` + - `ttl: "30m"` - - `number` + The minimum lifetime applied to each cache breakpoint. - - `boolean` + - `"30m"` - - `array of string or number` + - `prompt_cache_retention: optional "in_memory" or "24h"` - - `string` + Deprecated. Use `prompt_cache_options.ttl` instead. - - `number` + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - `unknown` + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - - `type: "and" or "or"` + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - Type of operation: `and` or `or`. + - `"in_memory"` - - `"and"` + - `"24h"` - - `"or"` + - `reasoning: optional object { context, effort, generate_summary, 2 more }` - - `max_num_results: optional number` + **gpt-5 and o-series models only** - The maximum number of results to return. This number should be between 1 and 50 inclusive. + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` + - `context: optional "auto" or "current_turn" or "all_turns"` - Ranking options for search. + Controls which reasoning items are rendered back to the model on later turns. + If omitted or set to `auto`, the model determines the context mode. The + `gpt-5.6` model family defaults to `all_turns`; earlier models default to + `current_turn`. - - `hybrid_search: optional object { embedding_weight, text_weight }` + When returned on a response, this is the effective reasoning context mode + used for the response. - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + - `"auto"` - - `embedding_weight: number` + - `"current_turn"` - The weight of the embedding in the reciprocal ranking fusion. + - `"all_turns"` - - `text_weight: number` + - `effort: optional "none" or "minimal" or "low" or 4 more` - The weight of the text in the reciprocal ranking fusion. + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - - `ranker: optional "auto" or "default-2024-11-15"` + - `"none"` - The ranker to use for the file search. + - `"minimal"` - - `"auto"` + - `"low"` - - `"default-2024-11-15"` + - `"medium"` - - `score_threshold: optional number` + - `"high"` - The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. + - `"xhigh"` - - `Computer object { type }` + - `"max"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `generate_summary: optional "auto" or "concise" or "detailed"` - - `type: "computer"` + **Deprecated:** use `summary` instead. - The type of the computer tool. Always `computer`. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `"computer"` + - `"auto"` - - `ComputerUsePreview object { display_height, display_width, environment, type }` + - `"concise"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `"detailed"` - - `display_height: number` + - `mode: optional string or "standard" or "pro"` - The height of the computer display. + Controls the reasoning execution mode for the request. - - `display_width: number` + When returned on a response, this is the effective execution mode. - The width of the computer display. + - `string` - - `environment: "windows" or "mac" or "linux" or 2 more` + - `"standard" or "pro"` - The type of computer environment to control. + Controls the reasoning execution mode for the request. - - `"windows"` + When returned on a response, this is the effective execution mode. - - `"mac"` + - `"standard"` - - `"linux"` + - `"pro"` - - `"ubuntu"` + - `summary: optional "auto" or "concise" or "detailed"` - - `"browser"` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `type: "computer_use_preview"` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - The type of the computer use tool. Always `computer_use_preview`. + - `"auto"` - - `"computer_use_preview"` + - `"concise"` - - `WebSearch object { type, filters, search_context_size, user_location }` + - `"detailed"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](/docs/guides/tools-web-search). + - `safety_identifier: optional string` - - `type: "web_search" or "web_search_2025_08_26"` + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `service_tier: optional "auto" or "default" or "flex" or 2 more` - - `"web_search"` + Specifies the processing type used for serving the request. - - `"web_search_2025_08_26"` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - - `filters: optional object { allowed_domains }` + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - Filters for the search. + - `"auto"` - - `allowed_domains: optional array of string` + - `"default"` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `"flex"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `"scale"` - - `search_context_size: optional "low" or "medium" or "high"` + - `"priority"` - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + - `status: optional BetaResponseStatus` - - `"low"` + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. - - `"medium"` + - `"completed"` - - `"high"` + - `"failed"` - - `user_location: optional object { city, country, region, 2 more }` + - `"in_progress"` - The approximate location of the user. + - `"cancelled"` - - `city: optional string` + - `"queued"` - Free text input for the city of the user, e.g. `San Francisco`. + - `"incomplete"` - - `country: optional string` + - `text: optional BetaResponseTextConfig` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - - `region: optional string` + - [Text inputs and outputs](/docs/guides/text) + - [Structured Outputs](/docs/guides/structured-outputs) - Free text input for the region of the user, e.g. `California`. + - `format: optional BetaResponseFormatTextConfig` - - `timezone: optional string` + An object specifying the format that the model must output. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](/docs/guides/structured-outputs). - - `type: optional "approximate"` + The default format is `{ "type": "text" }` with no additional options. - The type of location approximation. Always `approximate`. + **Not recommended for gpt-4o and newer models:** - - `"approximate"` + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - - `Mcp object { server_label, type, allowed_callers, 9 more }` + - `Text object { type }` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). + Default response format. Used to generate text responses. - - `server_label: string` + - `type: "text"` - A label for this MCP server, used to identify it in tool calls. + The type of response format being defined. Always `text`. - - `type: "mcp"` + - `"text"` - The type of the MCP tool. Always `mcp`. + - `BetaResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }` - - `"mcp"` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - `allowed_callers: optional array of "direct" or "programmatic"` + - `name: string` - The tool invocation context(s). + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - - `"direct"` + - `schema: map[unknown]` - - `"programmatic"` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - - `allowed_tools: optional array of string or object { read_only, tool_names }` + - `type: "json_schema"` - List of allowed tool names or a filter object. + The type of response format being defined. Always `json_schema`. - - `McpAllowedTools = array of string` + - `"json_schema"` - A string array of allowed tool names + - `description: optional string` - - `McpToolFilter object { read_only, tool_names }` + A description of what the response format is for, used by the model to + determine how to respond in the format. - A filter object to specify which tools are allowed. + - `strict: optional boolean` - - `read_only: optional boolean` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](/docs/guides/structured-outputs). - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `JSONObject object { type }` - - `tool_names: optional array of string` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - List of allowed tool names. + - `type: "json_object"` - - `authorization: optional string` + The type of response format being defined. Always `json_object`. - An OAuth access token that can be used with a remote MCP server, either - with a custom MCP server URL or a service connector. Your application - must handle the OAuth authorization flow and provide the token here. + - `"json_object"` - - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` + - `verbosity: optional "low" or "medium" or "high"` - Identifier for service connectors, like those available in ChatGPT. One of - `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more - about service connectors [here](/docs/guides/tools-remote-mcp#connectors). + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. The default is + `medium`. - Currently supported `connector_id` values are: + - `"low"` - - Dropbox: `connector_dropbox` - - Gmail: `connector_gmail` - - Google Calendar: `connector_googlecalendar` - - Google Drive: `connector_googledrive` - - Microsoft Teams: `connector_microsoftteams` - - Outlook Calendar: `connector_outlookcalendar` - - Outlook Email: `connector_outlookemail` - - SharePoint: `connector_sharepoint` + - `"medium"` - - `"connector_dropbox"` + - `"high"` - - `"connector_gmail"` + - `top_logprobs: optional number` - - `"connector_googlecalendar"` + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - - `"connector_googledrive"` + - `truncation: optional "auto" or "disabled"` - - `"connector_microsoftteams"` + The truncation strategy to use for the model response. - - `"connector_outlookcalendar"` + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - - `"connector_outlookemail"` + - `"auto"` - - `"connector_sharepoint"` + - `"disabled"` - - `defer_loading: optional boolean` + - `usage: optional BetaResponseUsage` - Whether this MCP tool is deferred and discovered via tool search. + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - - `headers: optional map[string]` + - `input_tokens: number` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + The number of input tokens. - - `require_approval: optional object { always, never } or "always" or "never"` + - `input_tokens_details: object { cache_write_tokens, cached_tokens }` - Specify which of the MCP server's tools require approval. + A detailed breakdown of the input tokens. - - `McpToolApprovalFilter object { always, never }` + - `cache_write_tokens: number` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + The number of input tokens that were written to the cache. - - `always: optional object { read_only, tool_names }` + - `cached_tokens: number` - A filter object to specify which tools are allowed. + The number of tokens that were retrieved from the cache. + [More on prompt caching](/docs/guides/prompt-caching). - - `read_only: optional boolean` + - `output_tokens: number` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The number of output tokens. - - `tool_names: optional array of string` + - `output_tokens_details: object { reasoning_tokens }` - List of allowed tool names. + A detailed breakdown of the output tokens. - - `never: optional object { read_only, tool_names }` + - `reasoning_tokens: number` - A filter object to specify which tools are allowed. + The number of reasoning tokens. - - `read_only: optional boolean` + - `total_tokens: number` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + The total number of tokens used. - - `tool_names: optional array of string` + - `user: optional string` - List of allowed tool names. + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). - - `McpToolApprovalSetting = "always" or "never"` +### Example - Specify a single approval policy for all tools. One of `always` or - `never`. When set to `always`, all tools will require approval. When - set to `never`, all tools will not require approval. +```http +curl https://api.openai.com/v1/responses/$RESPONSE_ID/cancel \ + -X POST \ + -H "Authorization: Bearer $OPENAI_API_KEY" +``` - - `"always"` +#### Response - - `"never"` +```json +{ + "id": "id", + "created_at": 0, + "error": { + "code": "server_error", + "message": "message" + }, + "incomplete_details": { + "reason": "max_output_tokens" + }, + "instructions": "string", + "metadata": { + "foo": "string" + }, + "model": "gpt-5.1", + "object": "response", + "output": [ + { + "id": "id", + "content": [ + { + "annotations": [ + { + "file_id": "file_id", + "filename": "filename", + "index": 0, + "type": "file_citation" + } + ], + "logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0, + "top_logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0 + } + ] + } + ], + "text": "text", + "type": "output_text" + } + ], + "role": "assistant", + "status": "in_progress", + "type": "message", + "agent": { + "agent_name": "agent_name" + }, + "phase": "commentary" + } + ], + "parallel_tool_calls": true, + "temperature": 1, + "tool_choice": "none", + "tools": [ + { + "name": "name", + "parameters": { + "foo": "bar" + }, + "strict": true, + "type": "function", + "allowed_callers": [ + "direct" + ], + "defer_loading": true, + "description": "description", + "output_schema": { + "foo": "bar" + } + } + ], + "top_p": 1, + "background": true, + "completed_at": 0, + "conversation": { + "id": "id" + }, + "max_output_tokens": 0, + "max_tool_calls": 0, + "moderation": { + "input": { + "categories": { + "foo": true + }, + "category_applied_input_types": { + "foo": [ + "text" + ] + }, + "category_scores": { + "foo": 0 + }, + "flagged": true, + "model": "model", + "type": "moderation_result" + }, + "output": { + "categories": { + "foo": true + }, + "category_applied_input_types": { + "foo": [ + "text" + ] + }, + "category_scores": { + "foo": 0 + }, + "flagged": true, + "model": "model", + "type": "moderation_result" + } + }, + "output_text": "output_text", + "previous_response_id": "previous_response_id", + "prompt": { + "id": "id", + "variables": { + "foo": "string" + }, + "version": "version" + }, + "prompt_cache_key": "prompt-cache-key-1234", + "prompt_cache_options": { + "mode": "implicit", + "ttl": "30m" + }, + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": "auto", + "effort": "none", + "generate_summary": "auto", + "mode": "standard", + "summary": "auto" + }, + "safety_identifier": "safety-identifier-1234", + "service_tier": "auto", + "status": "completed", + "text": { + "format": { + "type": "text" + }, + "verbosity": "low" + }, + "top_logprobs": 0, + "truncation": "auto", + "usage": { + "input_tokens": 0, + "input_tokens_details": { + "cache_write_tokens": 0, + "cached_tokens": 0 + }, + "output_tokens": 0, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 0 + }, + "user": "user-1234" +} +``` - - `server_description: optional string` +### Example - Optional description of the MCP server, used to provide more context. +```http +curl -X POST https://api.openai.com/v1/responses/resp_123/cancel \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" +``` - - `server_url: optional string` +#### Response - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. +```json +{ + "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44", + "object": "response", + "created_at": 1741386163, + "status": "cancelled", + "background": true, + "completed_at": null, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-2024-08-06", + "output": [ + { + "type": "message", + "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44", + "status": "in_progress", + "role": "assistant", + "content": [ + { + "type": "output_text", + "text": "Silent circuits hum, \nThoughts emerge in data streams— \nDigital dawn breaks.", + "annotations": [] + } + ] + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1.0, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} +} +``` - - `tunnel_id: optional string` +## Compact a response - The Secure MCP Tunnel ID to use instead of a direct server URL. One of - `server_url`, `connector_id`, or `tunnel_id` must be provided. +**post** `/responses/compact?beta=true` - - `CodeInterpreter object { container, type, allowed_callers }` +Compact a conversation. Returns a compacted response object. - A tool that runs Python code to help generate a response to a prompt. +Learn when and how to compact long-running conversations in the [conversation state guide](/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](/docs/guides/conversation-state#compaction-advanced). - - `container: string or object { type, file_ids, memory_limit, network_policy }` +### Header Parameters - The code interpreter container. Can be a container ID or an object that - specifies uploaded file IDs to make available to your code, along with an - optional `memory_limit` setting. +- `"openai-beta": optional array of "responses_multi_agent=v1"` - - `string` + - `"responses_multi_agent=v1"` - The container ID. +### Body Parameters - - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` +- `model: "gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more or string` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/docs/models) to browse and compare available models. - - `type: "auto"` + - `"gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more` - Always `auto`. + Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/docs/models) to browse and compare available models. - - `"auto"` + - `"gpt-5.6-sol"` - - `file_ids: optional array of string` + - `"gpt-5.6-terra"` - An optional list of uploaded files to make available to your code. + - `"gpt-5.6-luna"` - - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` + - `"gpt-5.4"` - The memory limit for the code interpreter container. + - `"gpt-5.4-mini"` - - `"1g"` + - `"gpt-5.4-nano"` - - `"4g"` + - `"gpt-5.4-mini-2026-03-17"` - - `"16g"` + - `"gpt-5.4-nano-2026-03-17"` - - `"64g"` + - `"gpt-5.3-chat-latest"` - - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` + - `"gpt-5.2"` - Network access policy for the container. + - `"gpt-5.2-2025-12-11"` - - `BetaContainerNetworkPolicyDisabled object { type }` + - `"gpt-5.2-chat-latest"` - - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` + - `"gpt-5.2-pro"` - - `type: "code_interpreter"` + - `"gpt-5.2-pro-2025-12-11"` - The type of the code interpreter tool. Always `code_interpreter`. + - `"gpt-5.1"` - - `"code_interpreter"` + - `"gpt-5.1-2025-11-13"` - - `allowed_callers: optional array of "direct" or "programmatic"` + - `"gpt-5.1-codex"` - The tool invocation context(s). + - `"gpt-5.1-mini"` - - `"direct"` + - `"gpt-5.1-chat-latest"` - - `"programmatic"` + - `"gpt-5"` - - `ProgrammaticToolCalling object { type }` + - `"gpt-5-mini"` - - `type: "programmatic_tool_calling"` + - `"gpt-5-nano"` - The type of the tool. Always `programmatic_tool_calling`. + - `"gpt-5-2025-08-07"` - - `"programmatic_tool_calling"` + - `"gpt-5-mini-2025-08-07"` - - `ImageGeneration object { type, action, background, 9 more }` + - `"gpt-5-nano-2025-08-07"` - A tool that generates images using the GPT image models. + - `"gpt-5-chat-latest"` - - `type: "image_generation"` + - `"gpt-4.1"` - The type of the image generation tool. Always `image_generation`. + - `"gpt-4.1-mini"` - - `"image_generation"` + - `"gpt-4.1-nano"` - - `action: optional "generate" or "edit" or "auto"` + - `"gpt-4.1-2025-04-14"` - Whether to generate a new image or edit an existing image. Default: `auto`. + - `"gpt-4.1-mini-2025-04-14"` - - `"generate"` + - `"gpt-4.1-nano-2025-04-14"` - - `"edit"` + - `"o4-mini"` - - `"auto"` + - `"o4-mini-2025-04-16"` - - `background: optional "transparent" or "opaque" or "auto"` + - `"o3"` - Background type for the generated image. One of `transparent`, - `opaque`, or `auto`. Default: `auto`. + - `"o3-2025-04-16"` - - `"transparent"` + - `"o3-mini"` - - `"opaque"` + - `"o3-mini-2025-01-31"` - - `"auto"` + - `"o1"` - - `input_fidelity: optional "high" or "low"` + - `"o1-2024-12-17"` - Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. + - `"o1-preview"` - - `"high"` + - `"o1-preview-2024-09-12"` - - `"low"` + - `"o1-mini"` - - `input_image_mask: optional object { file_id, image_url }` + - `"o1-mini-2024-09-12"` - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + - `"gpt-4o"` - - `file_id: optional string` + - `"gpt-4o-2024-11-20"` - File ID for the mask image. + - `"gpt-4o-2024-08-06"` - - `image_url: optional string` + - `"gpt-4o-2024-05-13"` - Base64-encoded mask image. + - `"gpt-4o-audio-preview"` - - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + - `"gpt-4o-audio-preview-2024-10-01"` - The image generation model to use. Default: `gpt-image-1`. + - `"gpt-4o-audio-preview-2024-12-17"` - - `string` + - `"gpt-4o-audio-preview-2025-06-03"` - - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + - `"gpt-4o-mini-audio-preview"` - The image generation model to use. Default: `gpt-image-1`. + - `"gpt-4o-mini-audio-preview-2024-12-17"` - - `"gpt-image-1"` + - `"gpt-4o-search-preview"` - - `"gpt-image-1-mini"` + - `"gpt-4o-mini-search-preview"` - - `"gpt-image-1.5"` + - `"gpt-4o-search-preview-2025-03-11"` - - `moderation: optional "auto" or "low"` + - `"gpt-4o-mini-search-preview-2025-03-11"` - Moderation level for the generated image. Default: `auto`. + - `"chatgpt-4o-latest"` - - `"auto"` + - `"codex-mini-latest"` - - `"low"` + - `"gpt-4o-mini"` - - `output_compression: optional number` + - `"gpt-4o-mini-2024-07-18"` - Compression level for the output image. Default: 100. + - `"gpt-4-turbo"` - - `output_format: optional "png" or "webp" or "jpeg"` + - `"gpt-4-turbo-2024-04-09"` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `"gpt-4-0125-preview"` - - `"png"` + - `"gpt-4-turbo-preview"` - - `"webp"` + - `"gpt-4-1106-preview"` - - `"jpeg"` + - `"gpt-4-vision-preview"` - - `partial_images: optional number` + - `"gpt-4"` - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `"gpt-4-0314"` - - `quality: optional "low" or "medium" or "high" or "auto"` + - `"gpt-4-0613"` - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `"gpt-4-32k"` - - `"low"` + - `"gpt-4-32k-0314"` - - `"medium"` + - `"gpt-4-32k-0613"` - - `"high"` + - `"gpt-3.5-turbo"` - - `"auto"` + - `"gpt-3.5-turbo-16k"` - - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` + - `"gpt-3.5-turbo-0301"` - The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + - `"gpt-3.5-turbo-0613"` - - `string` + - `"gpt-3.5-turbo-1106"` - - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` + - `"gpt-3.5-turbo-0125"` - The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + - `"gpt-3.5-turbo-16k-0613"` - - `"1024x1024"` + - `"o1-pro"` - - `"1024x1536"` + - `"o1-pro-2025-03-19"` - - `"1536x1024"` + - `"o3-pro"` - - `"auto"` + - `"o3-pro-2025-06-10"` - - `LocalShell object { type }` + - `"o3-deep-research"` - A tool that allows the model to execute shell commands in a local environment. + - `"o3-deep-research-2025-06-26"` - - `type: "local_shell"` + - `"o4-mini-deep-research"` - The type of the local shell tool. Always `local_shell`. + - `"o4-mini-deep-research-2025-06-26"` - - `"local_shell"` + - `"computer-use-preview"` - - `Shell object { type, allowed_callers, environment }` + - `"computer-use-preview-2025-03-11"` - A tool that allows the model to execute shell commands. + - `"gpt-5-codex"` - - `type: "shell"` + - `"gpt-5-pro"` - The type of the shell tool. Always `shell`. + - `"gpt-5-pro-2025-10-06"` - - `"shell"` + - `"gpt-5.1-codex-max"` - - `allowed_callers: optional array of "direct" or "programmatic"` + - `string` - The tool invocation context(s). +- `input: optional string or array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` - - `"direct"` + Text, image, or file inputs to the model, used to generate a response - - `"programmatic"` + - `string` - - `environment: optional BetaContainerAuto or BetaLocalEnvironment or BetaContainerReference` + A text input to the model, equivalent to a text input with the `user` role. - - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` + - `array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` - - `BetaLocalEnvironment object { type, skills }` + A list of one or many input items to the model, containing different content types. - - `BetaContainerReference object { container_id, type }` + - `BetaEasyInputMessage object { content, role, phase, type }` - - `Custom object { name, type, allowed_callers, 3 more }` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) + - `content: string or BetaResponseInputMessageContentList` - - `name: string` + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - The name of the custom tool, used to identify it in tool calls. + - `TextInput = string` - - `type: "custom"` + A text input to the model. - The type of the custom tool. Always `custom`. + - `BetaResponseInputMessageContentList = array of BetaResponseInputContent` - - `"custom"` + A list of one or many input items to the model, containing different content + types. - - `allowed_callers: optional array of "direct" or "programmatic"` + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - The tool invocation context(s). + A text input to the model. - - `"direct"` + - `text: string` - - `"programmatic"` + The text input to the model. - - `defer_loading: optional boolean` + - `type: "input_text"` - Whether this tool should be deferred and discovered via tool search. + The type of the input item. Always `input_text`. - - `description: optional string` + - `"input_text"` - Optional description of the custom tool, used to provide more context. + - `prompt_cache_breakpoint: optional object { mode }` - - `format: optional object { type } or object { definition, syntax, type }` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The input format for the custom tool. Default is unconstrained text. + - `mode: "explicit"` - - `Text object { type }` + The breakpoint mode. Always `explicit`. - Unconstrained free-form text. + - `"explicit"` - - `type: "text"` + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - Unconstrained text format. Always `text`. + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `"text"` + - `detail: "low" or "high" or "auto" or "original"` - - `Grammar object { definition, syntax, type }` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - A grammar defined by the user. + - `"low"` - - `definition: string` + - `"high"` - The grammar definition. + - `"auto"` - - `syntax: "lark" or "regex"` + - `"original"` - The syntax of the grammar definition. One of `lark` or `regex`. + - `type: "input_image"` - - `"lark"` + The type of the input item. Always `input_image`. - - `"regex"` + - `"input_image"` - - `type: "grammar"` + - `file_id: optional string` - Grammar format. Always `grammar`. + The ID of the file to be sent to the model. - - `"grammar"` + - `image_url: optional string` - - `Namespace object { description, name, tools, type }` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - Groups function/custom tools under a shared namespace. + - `prompt_cache_breakpoint: optional object { mode }` - - `description: string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - A description of the namespace shown to the model. + - `mode: "explicit"` - - `name: string` + The breakpoint mode. Always `explicit`. - The namespace name used in tool calls (for example, `crm`). + - `"explicit"` - - `tools: array of object { name, type, allowed_callers, 5 more } or object { name, type, allowed_callers, 3 more }` + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - The function/custom tools available inside this namespace. + A file input to the model. - - `Function object { name, type, allowed_callers, 5 more }` + - `type: "input_file"` - - `name: string` + The type of the input item. Always `input_file`. - - `type: "function"` + - `"input_file"` - - `"function"` + - `detail: optional "auto" or "low" or "high"` - - `allowed_callers: optional array of "direct" or "programmatic"` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - The tool invocation context(s). + - `"auto"` - - `"direct"` + - `"low"` - - `"programmatic"` + - `"high"` - - `defer_loading: optional boolean` + - `file_data: optional string` - Whether this function should be deferred and discovered via tool search. + The content of the file to be sent to the model. - - `description: optional string` + - `file_id: optional string` - - `output_schema: optional map[unknown]` + The ID of the file to be sent to the model. - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + - `file_url: optional string` - - `parameters: optional unknown` + The URL of the file to be sent to the model. - - `strict: optional boolean` + - `filename: optional string` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + The name of the file to be sent to the model. - - `Custom object { name, type, allowed_callers, 3 more }` + - `prompt_cache_breakpoint: optional object { mode }` - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `name: string` + - `mode: "explicit"` - The name of the custom tool, used to identify it in tool calls. + The breakpoint mode. Always `explicit`. - - `type: "custom"` + - `"explicit"` - The type of the custom tool. Always `custom`. + - `role: "user" or "assistant" or "system" or "developer"` - - `"custom"` + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. - - `allowed_callers: optional array of "direct" or "programmatic"` + - `"user"` - The tool invocation context(s). + - `"assistant"` - - `"direct"` + - `"system"` - - `"programmatic"` + - `"developer"` - - `defer_loading: optional boolean` + - `phase: optional "commentary" or "final_answer"` - Whether this tool should be deferred and discovered via tool search. + Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). + For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend + phase on all assistant messages — dropping it can degrade performance. Not used for user messages. - - `description: optional string` + - `"commentary"` - Optional description of the custom tool, used to provide more context. + - `"final_answer"` - - `format: optional object { type } or object { definition, syntax, type }` + - `type: optional "message"` - The input format for the custom tool. Default is unconstrained text. + The type of the message input. Always `message`. - - `Text object { type }` + - `"message"` - Unconstrained free-form text. + - `Message object { content, role, agent, 2 more }` - - `type: "text"` + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. - Unconstrained text format. Always `text`. + - `content: BetaResponseInputMessageContentList` - - `"text"` + A list of one or many input items to the model, containing different content + types. - - `Grammar object { definition, syntax, type }` + - `role: "user" or "system" or "developer"` - A grammar defined by the user. + The role of the message input. One of `user`, `system`, or `developer`. - - `definition: string` + - `"user"` - The grammar definition. + - `"system"` - - `syntax: "lark" or "regex"` + - `"developer"` - The syntax of the grammar definition. One of `lark` or `regex`. + - `agent: optional object { agent_name }` - - `"lark"` + The agent that produced this item. - - `"regex"` + - `agent_name: string` - - `type: "grammar"` + The canonical name of the agent that produced this item. - Grammar format. Always `grammar`. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"grammar"` + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `type: "namespace"` + - `"in_progress"` - The type of the tool. Always `namespace`. + - `"completed"` - - `"namespace"` + - `"incomplete"` - - `ToolSearch object { type, description, execution, parameters }` + - `type: optional "message"` - Hosted or BYOT tool search configuration for deferred tools. + The type of the message input. Always set to `message`. - - `type: "tool_search"` + - `"message"` - The type of the tool. Always `tool_search`. + - `BetaResponseOutputMessage object { id, content, role, 4 more }` - - `"tool_search"` - - - `description: optional string` + An output message from the model. - Description shown to the model for a client-executed tool search tool. + - `id: string` - - `execution: optional "server" or "client"` + The unique ID of the output message. - Whether tool search is executed by the server or by the client. + - `content: array of BetaResponseOutputText or BetaResponseOutputRefusal` - - `"server"` + The content of the output message. - - `"client"` + - `BetaResponseOutputText object { annotations, logprobs, text, type }` - - `parameters: optional unknown` + A text output from the model. - Parameter schema for a client-executed tool search tool. + - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` - - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` + The annotations of the text output. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `FileCitation object { file_id, filename, index, type }` - - `type: "web_search_preview" or "web_search_preview_2025_03_11"` + A citation to a file. - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `file_id: string` - - `"web_search_preview"` + The ID of the file. - - `"web_search_preview_2025_03_11"` + - `filename: string` - - `search_content_types: optional array of "text" or "image"` + The filename of the file cited. - - `"text"` + - `index: number` - - `"image"` + The index of the file in the list of files. - - `search_context_size: optional "low" or "medium" or "high"` + - `type: "file_citation"` - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + The type of the file citation. Always `file_citation`. - - `"low"` + - `"file_citation"` - - `"medium"` + - `URLCitation object { end_index, start_index, title, 2 more }` - - `"high"` + A citation for a web resource used to generate a model response. - - `user_location: optional object { type, city, country, 2 more }` + - `end_index: number` - The user's location. + The index of the last character of the URL citation in the message. - - `type: "approximate"` + - `start_index: number` - The type of location approximation. Always `approximate`. + The index of the first character of the URL citation in the message. - - `"approximate"` + - `title: string` - - `city: optional string` + The title of the web resource. - Free text input for the city of the user, e.g. `San Francisco`. + - `type: "url_citation"` - - `country: optional string` + The type of the URL citation. Always `url_citation`. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `"url_citation"` - - `region: optional string` + - `url: string` - Free text input for the region of the user, e.g. `California`. + The URL of the web resource. - - `timezone: optional string` + - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + A citation for a container file used to generate a model response. - - `ApplyPatch object { type, allowed_callers }` + - `container_id: string` - Allows the assistant to create, delete, or update files using unified diffs. + The ID of the container file. - - `type: "apply_patch"` + - `end_index: number` - The type of the tool. Always `apply_patch`. + The index of the last character of the container file citation in the message. - - `"apply_patch"` + - `file_id: string` - - `allowed_callers: optional array of "direct" or "programmatic"` + The ID of the file. - The tool invocation context(s). + - `filename: string` - - `"direct"` + The filename of the container file cited. - - `"programmatic"` + - `start_index: number` - - `type: "additional_tools"` + The index of the first character of the container file citation in the message. - The item type. Always `additional_tools`. + - `type: "container_file_citation"` - - `"additional_tools"` + The type of the container file citation. Always `container_file_citation`. - - `id: optional string` + - `"container_file_citation"` - The unique ID of this additional tools item. + - `FilePath object { file_id, index, type }` - - `agent: optional object { agent_name }` + A path to a file. - The agent that produced this item. + - `file_id: string` - - `agent_name: string` + The ID of the file. - The canonical name of the agent that produced this item. + - `index: number` - - `Reasoning object { id, summary, type, 4 more }` + The index of the file in the list of files. - 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](/docs/guides/conversation-state). + - `type: "file_path"` - - `id: string` + The type of the file path. Always `file_path`. - The unique identifier of the reasoning content. + - `"file_path"` - - `summary: array of object { text, type }` + - `logprobs: array of object { token, bytes, logprob, top_logprobs }` - Reasoning summary content. + - `token: string` - - `text: string` + - `bytes: array of number` - A summary of the reasoning output from the model so far. + - `logprob: number` - - `type: "summary_text"` + - `top_logprobs: array of object { token, bytes, logprob }` - The type of the object. Always `summary_text`. + - `token: string` - - `"summary_text"` + - `bytes: array of number` - - `type: "reasoning"` + - `logprob: number` - The type of the object. Always `reasoning`. + - `text: string` - - `"reasoning"` + The text output from the model. - - `agent: optional object { agent_name }` + - `type: "output_text"` - The agent that produced this item. + The type of the output text. Always `output_text`. - - `agent_name: string` + - `"output_text"` - The canonical name of the agent that produced this item. + - `BetaResponseOutputRefusal object { refusal, type }` - - `content: optional array of object { text, type }` + A refusal from the model. - Reasoning text content. + - `refusal: string` - - `text: string` + The refusal explanation from the model. - The reasoning text from the model. + - `type: "refusal"` - - `type: "reasoning_text"` + The type of the refusal. Always `refusal`. - The type of the reasoning text. Always `reasoning_text`. + - `"refusal"` - - `"reasoning_text"` + - `role: "assistant"` - - `encrypted_content: optional string` + The role of the output message. Always `assistant`. - The encrypted content of the reasoning item. This is populated by default - for reasoning items returned by `POST /v1/responses` and WebSocket - `response.create` requests. + - `"assistant"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `status: "in_progress" or "completed" or "incomplete"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - `"in_progress"` @@ -10536,23 +11615,11 @@ as input for the model's response. - `"incomplete"` - - `Compaction object { encrypted_content, type, id, agent }` - - A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - - - `encrypted_content: string` - - The encrypted content of the compaction summary. - - - `type: "compaction"` - - The type of the item. Always `compaction`. - - - `"compaction"` + - `type: "message"` - - `id: optional string` + The type of the output message. Always `message`. - The ID of the compaction item. + - `"message"` - `agent: optional object { agent_name }` @@ -10562,35 +11629,49 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `ImageGenerationCall object { id, result, status, 2 more }` + - `phase: optional "commentary" or "final_answer"` - An image generation request made by the model. + Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). + For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend + phase on all assistant messages — dropping it can degrade performance. Not used for user messages. + + - `"commentary"` + + - `"final_answer"` + + - `FileSearchCall object { id, queries, status, 3 more }` + + The results of a file search tool call. See the + [file search guide](/docs/guides/tools-file-search) for more information. - `id: string` - The unique ID of the image generation call. + The unique ID of the file search tool call. - - `result: string` + - `queries: array of string` - The generated image encoded in base64. + The queries used to search for files. - - `status: "in_progress" or "completed" or "generating" or "failed"` + - `status: "in_progress" or "searching" or "completed" or 2 more` - The status of the image generation call. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - `"in_progress"` + - `"searching"` + - `"completed"` - - `"generating"` + - `"incomplete"` - `"failed"` - - `type: "image_generation_call"` + - `type: "file_search_call"` - The type of the image generation call. Always `image_generation_call`. + The type of the file search tool call. Always `file_search_call`. - - `"image_generation_call"` + - `"file_search_call"` - `agent: optional object { agent_name }` @@ -10600,58 +11681,73 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `CodeInterpreterCall object { id, code, container_id, 4 more }` + - `results: optional array of object { attributes, file_id, filename, 2 more }` - A tool call to run code. + The results of the file search tool call. - - `id: string` + - `attributes: optional map[string or number or boolean]` - The unique ID of the code interpreter tool call. + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. Keys are strings + with a maximum length of 64 characters. Values are strings with a maximum + length of 512 characters, booleans, or numbers. - - `code: string` + - `string` - The code to run, or null if not available. + - `number` - - `container_id: string` + - `boolean` - The ID of the container used to run the code. + - `file_id: optional string` - - `outputs: array of object { logs, type } or object { type, url }` + The unique ID of the file. - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - `filename: optional string` - - `Logs object { logs, type }` + The name of the file. - The logs output from the code interpreter. + - `score: optional number` - - `logs: string` + The relevance score of the file - a value between 0 and 1. - The logs output from the code interpreter. + - `text: optional string` - - `type: "logs"` + The text that was retrieved from the file. - The type of the output. Always `logs`. + - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` - - `"logs"` + A tool call to a computer use tool. See the + [computer use guide](/docs/guides/tools-computer-use) for more information. - - `Image object { type, url }` + - `id: string` - The image output from the code interpreter. + The unique ID of the computer call. - - `type: "image"` + - `call_id: string` - The type of the output. Always `image`. + An identifier used when responding to the tool call with output. - - `"image"` + - `pending_safety_checks: array of object { id, code, message }` - - `url: string` + The pending safety checks for the computer call. - The URL of the image output from the code interpreter. + - `id: string` - - `status: "in_progress" or "completed" or "incomplete" or 2 more` + The ID of the pending safety check. - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `code: optional string` + + The type of the pending safety check. + + - `message: optional string` + + Details about the pending safety check. + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - `"in_progress"` @@ -10659,307 +11755,320 @@ as input for the model's response. - `"incomplete"` - - `"interpreting"` + - `type: "computer_call"` - - `"failed"` + The type of the computer call. Always `computer_call`. - - `type: "code_interpreter_call"` + - `"computer_call"` - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `action: optional BetaComputerAction` - - `"code_interpreter_call"` + A click action. - - `agent: optional object { agent_name }` + - `Click object { button, type, x, 2 more }` - The agent that produced this item. + A click action. - - `agent_name: string` + - `button: "left" or "right" or "wheel" or 2 more` - The canonical name of the agent that produced this item. + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `LocalShellCall object { id, action, call_id, 3 more }` + - `"left"` - A tool call to run a command on the local shell. + - `"right"` - - `id: string` + - `"wheel"` - The unique ID of the local shell call. + - `"back"` - - `action: object { command, env, type, 3 more }` + - `"forward"` - Execute a shell command on the server. + - `type: "click"` - - `command: array of string` + Specifies the event type. For a click action, this property is always `click`. - The command to run. + - `"click"` - - `env: map[string]` + - `x: number` - Environment variables to set for the command. + The x-coordinate where the click occurred. - - `type: "exec"` + - `y: number` - The type of the local shell action. Always `exec`. + The y-coordinate where the click occurred. - - `"exec"` + - `keys: optional array of string` - - `timeout_ms: optional number` + The keys being held while clicking. - Optional timeout in milliseconds for the command. + - `DoubleClick object { keys, type, x, y }` - - `user: optional string` + A double click action. - Optional user to run the command as. + - `keys: array of string` - - `working_directory: optional string` + The keys being held while double-clicking. - Optional working directory to run the command in. + - `type: "double_click"` - - `call_id: string` + Specifies the event type. For a double click action, this property is always set to `double_click`. - The unique ID of the local shell tool call generated by the model. + - `"double_click"` - - `status: "in_progress" or "completed" or "incomplete"` + - `x: number` - The status of the local shell call. + The x-coordinate where the double click occurred. - - `"in_progress"` + - `y: number` - - `"completed"` + The y-coordinate where the double click occurred. - - `"incomplete"` + - `Drag object { path, type, keys }` - - `type: "local_shell_call"` + A drag action. - The type of the local shell call. Always `local_shell_call`. + - `path: array of object { x, y }` - - `"local_shell_call"` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `agent: optional object { agent_name }` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - The agent that produced this item. + - `x: number` - - `agent_name: string` + The x-coordinate. - The canonical name of the agent that produced this item. + - `y: number` - - `LocalShellCallOutput object { id, output, type, 2 more }` + The y-coordinate. - The output of a local shell tool call. + - `type: "drag"` - - `id: string` + Specifies the event type. For a drag action, this property is always set to `drag`. - The unique ID of the local shell tool call generated by the model. + - `"drag"` - - `output: string` + - `keys: optional array of string` - A JSON string of the output of the local shell tool call. + The keys being held while dragging the mouse. - - `type: "local_shell_call_output"` + - `Keypress object { keys, type }` - The type of the local shell tool call output. Always `local_shell_call_output`. + A collection of keypresses the model would like to perform. - - `"local_shell_call_output"` + - `keys: array of string` - - `agent: optional object { agent_name }` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - The agent that produced this item. + - `type: "keypress"` - - `agent_name: string` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - The canonical name of the agent that produced this item. + - `"keypress"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `Move object { type, x, y, keys }` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + A mouse move action. - - `"in_progress"` + - `type: "move"` - - `"completed"` + Specifies the event type. For a move action, this property is always set to `move`. - - `"incomplete"` + - `"move"` - - `ShellCall object { action, call_id, type, 5 more }` + - `x: number` - A tool representing a request to execute one or more shell commands. + The x-coordinate to move to. - - `action: object { commands, max_output_length, timeout_ms }` + - `y: number` - The shell commands and limits that describe how to run the tool call. + The y-coordinate to move to. - - `commands: array of string` + - `keys: optional array of string` - Ordered shell commands for the execution environment to run. + The keys being held while moving the mouse. - - `max_output_length: optional number` + - `Screenshot object { type }` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + A screenshot action. - - `timeout_ms: optional number` + - `type: "screenshot"` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `call_id: string` + - `"screenshot"` - The unique ID of the shell tool call generated by the model. + - `Scroll object { scroll_x, scroll_y, type, 3 more }` - - `type: "shell_call"` + A scroll action. - The type of the item. Always `shell_call`. + - `scroll_x: number` - - `"shell_call"` + The horizontal scroll distance. - - `id: optional string` + - `scroll_y: number` - The unique ID of the shell tool call. Populated when this item is returned via API. + The vertical scroll distance. - - `agent: optional object { agent_name }` + - `type: "scroll"` - The agent that produced this item. + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `agent_name: string` + - `"scroll"` - The canonical name of the agent that produced this item. + - `x: number` - - `caller: optional object { type } or object { caller_id, type }` + The x-coordinate where the scroll occurred. - The execution context that produced this tool call. + - `y: number` - - `Direct object { type }` + The y-coordinate where the scroll occurred. - - `type: "direct"` + - `keys: optional array of string` - The caller type. Always `direct`. + The keys being held while scrolling. - - `"direct"` + - `Type object { text, type }` - - `Program object { caller_id, type }` + An action to type in text. - - `caller_id: string` + - `text: string` - The call ID of the program item that produced this tool call. + The text to type. - - `type: "program"` + - `type: "type"` - The caller type. Always `program`. + Specifies the event type. For a type action, this property is always set to `type`. - - `"program"` + - `"type"` - - `environment: optional BetaLocalEnvironment or BetaContainerReference` + - `Wait object { type }` - The environment to execute the shell commands in. + A wait action. - - `BetaLocalEnvironment object { type, skills }` + - `type: "wait"` - - `BetaContainerReference object { container_id, type }` + Specifies the event type. For a wait action, this property is always set to `wait`. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"wait"` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `actions: optional BetaComputerActionList` - - `"in_progress"` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `"completed"` + - `Click object { button, type, x, 2 more }` - - `"incomplete"` + A click action. - - `ShellCallOutput object { call_id, output, type, 5 more }` + - `DoubleClick object { keys, type, x, y }` - The streamed output items emitted by a shell tool call. + A double click action. - - `call_id: string` + - `Drag object { path, type, keys }` - The unique ID of the shell tool call generated by the model. + A drag action. - - `output: array of BetaResponseFunctionShellCallOutputContent` + - `Keypress object { keys, type }` - Captured chunks of stdout and stderr output, along with their associated outcomes. + A collection of keypresses the model would like to perform. - - `outcome: object { type } or object { exit_code, type }` + - `Move object { type, x, y, keys }` - The exit or timeout outcome associated with this shell call. + A mouse move action. - - `Timeout object { type }` + - `Screenshot object { type }` - Indicates that the shell call exceeded its configured time limit. + A screenshot action. - - `type: "timeout"` + - `Scroll object { scroll_x, scroll_y, type, 3 more }` - The outcome type. Always `timeout`. + A scroll action. - - `"timeout"` + - `Type object { text, type }` - - `Exit object { exit_code, type }` + An action to type in text. - Indicates that the shell commands finished and returned an exit code. + - `Wait object { type }` - - `exit_code: number` + A wait action. - The exit code returned by the shell process. + - `agent: optional object { agent_name }` - - `type: "exit"` + The agent that produced this item. - The outcome type. Always `exit`. + - `agent_name: string` - - `"exit"` + The canonical name of the agent that produced this item. - - `stderr: string` + - `ComputerCallOutput object { call_id, output, type, 4 more }` - Captured stderr output for the shell call. + The output of a computer tool call. - - `stdout: string` + - `call_id: string` - Captured stdout output for the shell call. + The ID of the computer tool call that produced the output. - - `type: "shell_call_output"` + - `output: BetaResponseComputerToolCallOutputScreenshot` - The type of the item. Always `shell_call_output`. + A computer screenshot image used with the computer use tool. - - `"shell_call_output"` + - `type: "computer_screenshot"` - - `id: optional string` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `"computer_screenshot"` - - `agent: optional object { agent_name }` + - `file_id: optional string` - The agent that produced this item. + The identifier of an uploaded file that contains the screenshot. - - `agent_name: string` + - `image_url: optional string` - The canonical name of the agent that produced this item. + The URL of the screenshot image. - - `caller: optional object { type } or object { caller_id, type }` + - `type: "computer_call_output"` - The execution context that produced this tool call. + The type of the computer tool call output. Always `computer_call_output`. - - `Direct object { type }` + - `"computer_call_output"` - - `type: "direct"` + - `id: optional string` - The caller type. Always `direct`. + The ID of the computer tool call output. - - `"direct"` + - `acknowledged_safety_checks: optional array of object { id, code, message }` - - `Program object { caller_id, type }` + The safety checks reported by the API that have been acknowledged by the developer. - - `caller_id: string` + - `id: string` - The call ID of the program item that produced this tool call. + The ID of the pending safety check. - - `type: "program"` + - `code: optional string` - The caller type. Always `program`. + The type of the pending safety check. - - `"program"` + - `message: optional string` - - `max_output_length: optional number` + Details about the pending safety check. - The maximum number of UTF-8 characters captured for this shell call's combined output. + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. - `status: optional "in_progress" or "completed" or "incomplete"` - The status of the shell call output. + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - `"in_progress"` @@ -10967,143 +12076,136 @@ as input for the model's response. - `"incomplete"` - - `ApplyPatchCall object { call_id, operation, status, 4 more }` - - A tool call representing a request to create, delete, or update files using diff patches. - - - `call_id: string` - - The unique ID of the apply patch tool call generated by the model. + - `WebSearchCall object { id, action, status, 2 more }` - - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` + The results of a web search tool call. See the + [web search guide](/docs/guides/tools-web-search) for more information. - The specific create, delete, or update instruction for the apply_patch tool call. + - `id: string` - - `CreateFile object { diff, path, type }` + The unique ID of the web search tool call. - Instruction for creating a new file via the apply_patch tool. + - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` - - `diff: string` + An object describing the specific action taken in this web search call. + Includes details on how the model used the web (search, open_page, find_in_page). - Unified diff content to apply when creating the file. + - `Search object { type, queries, query, sources }` - - `path: string` + Action type "search" - Performs a web search query. - Path of the file to create relative to the workspace root. + - `type: "search"` - - `type: "create_file"` + The action type. - The operation type. Always `create_file`. + - `"search"` - - `"create_file"` + - `queries: optional array of string` - - `DeleteFile object { path, type }` + The search queries. - Instruction for deleting an existing file via the apply_patch tool. + - `query: optional string` - - `path: string` + The search query. - Path of the file to delete relative to the workspace root. + - `sources: optional array of object { type, url }` - - `type: "delete_file"` + The sources used in the search. - The operation type. Always `delete_file`. + - `type: "url"` - - `"delete_file"` + The type of source. Always `url`. - - `UpdateFile object { diff, path, type }` + - `"url"` - Instruction for updating an existing file via the apply_patch tool. + - `url: string` - - `diff: string` + The URL of the source. - Unified diff content to apply to the existing file. + - `OpenPage object { type, url }` - - `path: string` + Action type "open_page" - Opens a specific URL from search results. - Path of the file to update relative to the workspace root. + - `type: "open_page"` - - `type: "update_file"` + The action type. - The operation type. Always `update_file`. + - `"open_page"` - - `"update_file"` + - `url: optional string` - - `status: "in_progress" or "completed"` + The URL opened by the model. - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `FindInPage object { pattern, type, url }` - - `"in_progress"` + Action type "find_in_page": Searches for a pattern within a loaded page. - - `"completed"` + - `pattern: string` - - `type: "apply_patch_call"` + The pattern or text to search for within the page. - The type of the item. Always `apply_patch_call`. + - `type: "find_in_page"` - - `"apply_patch_call"` + The action type. - - `id: optional string` + - `"find_in_page"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `url: string` - - `agent: optional object { agent_name }` + The URL of the page searched for the pattern. - The agent that produced this item. + - `status: "in_progress" or "searching" or "completed" or "failed"` - - `agent_name: string` + The status of the web search tool call. - The canonical name of the agent that produced this item. + - `"in_progress"` - - `caller: optional object { type } or object { caller_id, type }` + - `"searching"` - The execution context that produced this tool call. + - `"completed"` - - `Direct object { type }` + - `"failed"` - - `type: "direct"` + - `type: "web_search_call"` - The caller type. Always `direct`. + The type of the web search tool call. Always `web_search_call`. - - `"direct"` + - `"web_search_call"` - - `Program object { caller_id, type }` + - `agent: optional object { agent_name }` - - `caller_id: string` + The agent that produced this item. - The call ID of the program item that produced this tool call. + - `agent_name: string` - - `type: "program"` + The canonical name of the agent that produced this item. - The caller type. Always `program`. + - `FunctionCall object { arguments, call_id, name, 6 more }` - - `"program"` + A tool call to run a function. See the + [function calling guide](/docs/guides/function-calling) for more information. - - `ApplyPatchCallOutput object { call_id, status, type, 4 more }` + - `arguments: string` - The streamed output emitted by an apply patch tool call. + A JSON string of the arguments to pass to the function. - `call_id: string` - The unique ID of the apply patch tool call generated by the model. - - - `status: "completed" or "failed"` - - The status of the apply patch tool call output. One of `completed` or `failed`. + The unique ID of the function tool call generated by the model. - - `"completed"` + - `name: string` - - `"failed"` + The name of the function to run. - - `type: "apply_patch_call_output"` + - `type: "function_call"` - The type of the item. Always `apply_patch_call_output`. + The type of the function tool call. Always `function_call`. - - `"apply_patch_call_output"` + - `"function_call"` - `id: optional string` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The unique ID of the function tool call. - `agent: optional object { agent_name }` @@ -11121,8 +12223,6 @@ as input for the model's response. - `type: "direct"` - The caller type. Always `direct`. - - `"direct"` - `Program object { caller_id, type }` @@ -11133,157 +12233,162 @@ as input for the model's response. - `type: "program"` - The caller type. Always `program`. - - `"program"` - - `output: optional string` + - `namespace: optional string` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + The namespace of the function to run. - - `McpListTools object { id, server_label, tools, 3 more }` + - `status: optional "in_progress" or "completed" or "incomplete"` - A list of tools available on an MCP server. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `id: string` + - `"in_progress"` - The unique ID of the list. + - `"completed"` - - `server_label: string` + - `"incomplete"` - The label of the MCP server. + - `FunctionCallOutput object { call_id, output, type, 4 more }` - - `tools: array of object { input_schema, name, annotations, description }` + The output of a function tool call. - The tools available on the server. + - `call_id: string` - - `input_schema: unknown` + The unique ID of the function tool call generated by the model. - The JSON schema describing the tool's input. + - `output: string or array of BetaResponseInputTextContent or BetaResponseInputImageContent or BetaResponseInputFileContent` - - `name: string` + Text, image, or file output of the function tool call. - The name of the tool. + - `string` - - `annotations: optional unknown` + A JSON string of the output of the function tool call. - Additional annotations about the tool. + - `array of BetaResponseInputTextContent or BetaResponseInputImageContent or BetaResponseInputFileContent` - - `description: optional string` + An array of content outputs (text, image, file) for the function tool call. - The description of the tool. + - `BetaResponseInputTextContent object { text, type, prompt_cache_breakpoint }` - - `type: "mcp_list_tools"` + A text input to the model. - The type of the item. Always `mcp_list_tools`. + - `text: string` - - `"mcp_list_tools"` + The text input to the model. - - `agent: optional object { agent_name }` + - `type: "input_text"` - The agent that produced this item. + The type of the input item. Always `input_text`. - - `agent_name: string` + - `"input_text"` - The canonical name of the agent that produced this item. + - `prompt_cache_breakpoint: optional object { mode }` - - `error: optional string` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - Error message if the server could not list tools. + - `mode: "explicit"` - - `McpApprovalRequest object { id, arguments, name, 3 more }` + The breakpoint mode. Always `explicit`. - A request for human approval of a tool invocation. + - `"explicit"` - - `id: string` + - `BetaResponseInputImageContent object { type, detail, file_id, 2 more }` - The unique ID of the approval request. + An image input to the model. Learn about [image inputs](/docs/guides/vision) - - `arguments: string` + - `type: "input_image"` - A JSON string of arguments for the tool. + The type of the input item. Always `input_image`. - - `name: string` + - `"input_image"` - The name of the tool to run. + - `detail: optional "low" or "high" or "auto" or "original"` - - `server_label: string` + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - The label of the MCP server making the request. + - `"low"` - - `type: "mcp_approval_request"` + - `"high"` - The type of the item. Always `mcp_approval_request`. + - `"auto"` - - `"mcp_approval_request"` + - `"original"` - - `agent: optional object { agent_name }` + - `file_id: optional string` - The agent that produced this item. + The ID of the file to be sent to the model. - - `agent_name: string` + - `image_url: optional string` - The canonical name of the agent that produced this item. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `McpApprovalResponse object { approval_request_id, approve, type, 3 more }` + - `prompt_cache_breakpoint: optional object { mode }` - A response to an MCP approval request. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `approval_request_id: string` + - `mode: "explicit"` - The ID of the approval request being answered. + The breakpoint mode. Always `explicit`. - - `approve: boolean` + - `"explicit"` - Whether the request was approved. + - `BetaResponseInputFileContent object { type, detail, file_data, 4 more }` - - `type: "mcp_approval_response"` + A file input to the model. - The type of the item. Always `mcp_approval_response`. + - `type: "input_file"` - - `"mcp_approval_response"` + The type of the input item. Always `input_file`. - - `id: optional string` + - `"input_file"` - The unique ID of the approval response + - `detail: optional "auto" or "low" or "high"` - - `agent: optional object { agent_name }` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - The agent that produced this item. + - `"auto"` - - `agent_name: string` + - `"low"` - The canonical name of the agent that produced this item. + - `"high"` - - `reason: optional string` + - `file_data: optional string` - Optional reason for the decision. + The base64-encoded data of the file to be sent to the model. - - `McpCall object { id, arguments, name, 7 more }` + - `file_id: optional string` - An invocation of a tool on an MCP server. + The ID of the file to be sent to the model. - - `id: string` + - `file_url: optional string` - The unique ID of the tool call. + The URL of the file to be sent to the model. - - `arguments: string` + - `filename: optional string` - A JSON string of the arguments passed to the tool. + The name of the file to be sent to the model. - - `name: string` + - `prompt_cache_breakpoint: optional object { mode }` - The name of the tool that was run. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `server_label: string` + - `mode: "explicit"` - The label of the MCP server running the tool. + The breakpoint mode. Always `explicit`. - - `type: "mcp_call"` + - `"explicit"` - The type of the item. Always `mcp_call`. + - `type: "function_call_output"` - - `"mcp_call"` + The type of the function tool call output. Always `function_call_output`. + + - `"function_call_output"` + + - `id: optional string` + + The unique ID of the function tool call output. Populated when this item is returned via API. - `agent: optional object { agent_name }` @@ -11293,22 +12398,33 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `approval_request_id: optional string` + - `caller: optional object { type } or object { caller_id, type }` - Unique identifier for the MCP tool call approval request. - Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call. + The execution context that produced this tool call. - - `error: optional string` + - `Direct object { type }` - The error from the tool call, if any. + - `type: "direct"` - - `output: optional string` + The caller type. Always `direct`. - The output from the tool call. + - `"direct"` - - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` + - `Program object { caller_id, type }` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + The caller type. Always `program`. + + - `"program"` + + - `status: optional "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - `"in_progress"` @@ -11316,52 +12432,53 @@ as input for the model's response. - `"incomplete"` - - `"calling"` + - `AgentMessage object { author, content, recipient, 3 more }` - - `"failed"` + A message routed between agents. - - `CustomToolCallOutput object { call_id, output, type, 3 more }` + - `author: string` - The output of a custom tool call from your code, being sent back to the model. + The sending agent identity. - - `call_id: string` + - `content: array of BetaResponseInputTextContent or BetaResponseInputImageContent or object { encrypted_content, type }` - The call ID, used to map this custom tool call output to a custom tool call. + Plaintext, image, or encrypted content sent between agents. - - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + - `BetaResponseInputTextContent object { text, type, prompt_cache_breakpoint }` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + A text input to the model. - - `StringOutput = string` + - `BetaResponseInputImageContent object { type, detail, file_id, 2 more }` - A string of the output of the custom tool call. + An image input to the model. Learn about [image inputs](/docs/guides/vision) - - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + - `EncryptedContent object { encrypted_content, type }` - Text, image, or file output of the custom tool call. + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + - `encrypted_content: string` - A text input to the model. + Opaque encrypted content. - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + - `type: "encrypted_content"` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + The type of the input item. Always `encrypted_content`. - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + - `"encrypted_content"` - A file input to the model. + - `recipient: string` - - `type: "custom_tool_call_output"` + The destination agent identity. - The type of the custom tool call output. Always `custom_tool_call_output`. + - `type: "agent_message"` - - `"custom_tool_call_output"` + The item type. Always `agent_message`. + + - `"agent_message"` - `id: optional string` - The unique ID of the custom tool call output in the OpenAI platform. + The unique ID of this agent message item. - `agent: optional object { agent_name }` @@ -11371,187 +12488,195 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `caller: optional object { type } or object { caller_id, type }` + - `MultiAgentCall object { action, arguments, call_id, 3 more }` - The execution context that produced this tool call. + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - - `Direct object { type }` + The multi-agent action that was executed. - - `type: "direct"` + - `"spawn_agent"` - The caller type. Always `direct`. + - `"interrupt_agent"` - - `"direct"` + - `"list_agents"` - - `Program object { caller_id, type }` + - `"send_message"` - - `caller_id: string` + - `"followup_task"` - The call ID of the program item that produced this tool call. + - `"wait_agent"` - - `type: "program"` + - `arguments: string` - The caller type. Always `program`. + The action arguments as a JSON string. - - `"program"` + - `call_id: string` - - `CustomToolCall object { call_id, input, name, 5 more }` + The unique ID linking this call to its output. - A call to a custom tool created by the model. + - `type: "multi_agent_call"` - - `call_id: string` + The item type. Always `multi_agent_call`. - An identifier used to map this custom tool call to a tool call output. + - `"multi_agent_call"` - - `input: string` + - `id: optional string` - The input for the custom tool call generated by the model. + The unique ID of this multi-agent call. - - `name: string` + - `agent: optional object { agent_name }` - The name of the custom tool being called. + The agent that produced this item. - - `type: "custom_tool_call"` + - `agent_name: string` - The type of the custom tool call. Always `custom_tool_call`. + The canonical name of the agent that produced this item. - - `"custom_tool_call"` + - `MultiAgentCallOutput object { action, call_id, output, 3 more }` - - `id: optional string` + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - The unique ID of the custom tool call in the OpenAI platform. + The multi-agent action that produced this result. - - `agent: optional object { agent_name }` + - `"spawn_agent"` - The agent that produced this item. + - `"interrupt_agent"` - - `agent_name: string` + - `"list_agents"` - The canonical name of the agent that produced this item. + - `"send_message"` - - `caller: optional object { type } or object { caller_id, type }` + - `"followup_task"` - The execution context that produced this tool call. + - `"wait_agent"` - - `Direct object { type }` + - `call_id: string` - - `type: "direct"` + The unique ID of the multi-agent call. - - `"direct"` + - `output: array of object { text, type, annotations }` - - `Program object { caller_id, type }` + Text output returned by the multi-agent action. - - `caller_id: string` + - `text: string` - The call ID of the program item that produced this tool call. + The text content. - - `type: "program"` + - `type: "output_text"` - - `"program"` + The content type. Always `output_text`. - - `namespace: optional string` + - `"output_text"` - The namespace of the custom tool being called. + - `annotations: optional array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more }` - - `CompactionTrigger object { type, agent }` + Citations associated with the text content. - Compacts the current context. Must be the final input item. + - `FileCitation object { file_id, filename, index, type }` - - `type: "compaction_trigger"` + - `file_id: string` - The type of the item. Always `compaction_trigger`. + The ID of the file. - - `"compaction_trigger"` + - `filename: string` - - `agent: optional object { agent_name }` + The filename of the file cited. - The agent that produced this item. + - `index: number` - - `agent_name: string` + The index of the file in the list of files. - The canonical name of the agent that produced this item. + - `type: "file_citation"` - - `ItemReference object { id, agent, type }` + The citation type. Always `file_citation`. - An internal identifier for an item to reference. + - `"file_citation"` - - `id: string` + - `URLCitation object { end_index, start_index, title, 2 more }` - The ID of the item to reference. + - `end_index: number` - - `agent: optional object { agent_name }` + The index of the last character of the citation in the message. - The agent that produced this item. + - `start_index: number` - - `agent_name: string` + The index of the first character of the citation in the message. - The canonical name of the agent that produced this item. + - `title: string` - - `type: optional "item_reference"` + The title of the cited resource. - The type of item to reference. Always `item_reference`. + - `type: "url_citation"` - - `"item_reference"` + The citation type. Always `url_citation`. - - `Program object { id, call_id, code, 3 more }` + - `"url_citation"` - - `id: string` + - `url: string` - The unique ID of this program item. + The URL of the cited resource. - - `call_id: string` + - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` - The stable call ID of the program item. + - `container_id: string` - - `code: string` + The ID of the container. - The JavaScript source executed by programmatic tool calling. + - `end_index: number` - - `fingerprint: string` + The index of the last character of the citation in the message. - Opaque program replay fingerprint that must be round-tripped. + - `file_id: string` - - `type: "program"` + The ID of the container file. - The item type. Always `program`. + - `filename: string` - - `"program"` + The filename of the container file cited. - - `agent: optional object { agent_name }` + - `start_index: number` - The agent that produced this item. + The index of the first character of the citation in the message. - - `agent_name: string` + - `type: "container_file_citation"` - The canonical name of the agent that produced this item. + The citation type. Always `container_file_citation`. - - `ProgramOutput object { id, call_id, result, 3 more }` + - `"container_file_citation"` - - `id: string` + - `type: "multi_agent_call_output"` - The unique ID of this program output item. + The item type. Always `multi_agent_call_output`. - - `call_id: string` + - `"multi_agent_call_output"` - The call ID of the program item. + - `id: optional string` - - `result: string` + The unique ID of this multi-agent call output. - The result produced by the program item. + - `agent: optional object { agent_name }` - - `status: "completed" or "incomplete"` + The agent that produced this item. - The terminal status of the program output. + - `agent_name: string` - - `"completed"` + The canonical name of the agent that produced this item. - - `"incomplete"` + - `ToolSearchCall object { arguments, type, id, 4 more }` - - `type: "program_output"` + - `arguments: unknown` - The item type. Always `program_output`. + The arguments supplied to the tool search call. - - `"program_output"` + - `type: "tool_search_call"` + + The item type. Always `tool_search_call`. + + - `"tool_search_call"` + + - `id: optional string` + + The unique ID of this tool search call. - `agent: optional object { agent_name }` @@ -11561,1150 +12686,1196 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `metadata: map[string]` + - `call_id: optional string` - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. + The unique ID of the tool search call generated by the model. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `execution: optional "server" or "client"` - - `model: "gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more or string` + Whether tool search was executed by the server or by the client. - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](/docs/models) - to browse and compare available models. + - `"server"` - - `"gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more` + - `"client"` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](/docs/models) - to browse and compare available models. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"gpt-5.6-sol"` + The status of the tool search call. - - `"gpt-5.6-terra"` + - `"in_progress"` - - `"gpt-5.6-luna"` + - `"completed"` - - `"gpt-5.4"` + - `"incomplete"` - - `"gpt-5.4-mini"` + - `ToolSearchOutput object { tools, type, id, 4 more }` - - `"gpt-5.4-nano"` + - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - - `"gpt-5.4-mini-2026-03-17"` + The loaded tool definitions returned by the tool search output. - - `"gpt-5.4-nano-2026-03-17"` + - `Function object { name, parameters, strict, 5 more }` - - `"gpt-5.3-chat-latest"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `"gpt-5.2"` + - `name: string` - - `"gpt-5.2-2025-12-11"` + The name of the function to call. - - `"gpt-5.2-chat-latest"` + - `parameters: map[unknown]` - - `"gpt-5.2-pro"` + A JSON schema object describing the parameters of the function. - - `"gpt-5.2-pro-2025-12-11"` + - `strict: boolean` - - `"gpt-5.1"` + Whether strict parameter validation is enforced for this function tool. - - `"gpt-5.1-2025-11-13"` + - `type: "function"` - - `"gpt-5.1-codex"` + The type of the function tool. Always `function`. - - `"gpt-5.1-mini"` + - `"function"` - - `"gpt-5.1-chat-latest"` + - `allowed_callers: optional array of "direct" or "programmatic"` - - `"gpt-5"` + The tool invocation context(s). - - `"gpt-5-mini"` + - `"direct"` - - `"gpt-5-nano"` + - `"programmatic"` - - `"gpt-5-2025-08-07"` + - `defer_loading: optional boolean` - - `"gpt-5-mini-2025-08-07"` + Whether this function is deferred and loaded via tool search. - - `"gpt-5-nano-2025-08-07"` + - `description: optional string` - - `"gpt-5-chat-latest"` + A description of the function. Used by the model to determine whether or not to call the function. - - `"gpt-4.1"` + - `output_schema: optional map[unknown]` - - `"gpt-4.1-mini"` + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `"gpt-4.1-nano"` + - `FileSearch object { type, vector_store_ids, filters, 2 more }` - - `"gpt-4.1-2025-04-14"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `"gpt-4.1-mini-2025-04-14"` + - `type: "file_search"` - - `"gpt-4.1-nano-2025-04-14"` + The type of the file search tool. Always `file_search`. - - `"o4-mini"` + - `"file_search"` - - `"o4-mini-2025-04-16"` + - `vector_store_ids: array of string` - - `"o3"` + The IDs of the vector stores to search. - - `"o3-2025-04-16"` + - `filters: optional object { key, type, value } or object { filters, type }` - - `"o3-mini"` + A filter to apply. - - `"o3-mini-2025-01-31"` + - `ComparisonFilter object { key, type, value }` - - `"o1"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `"o1-2024-12-17"` + - `key: string` - - `"o1-preview"` + The key to compare against the value. - - `"o1-preview-2024-09-12"` + - `type: "eq" or "ne" or "gt" or 5 more` - - `"o1-mini"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `"o1-mini-2024-09-12"` + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in - - `"gpt-4o"` + - `"eq"` - - `"gpt-4o-2024-11-20"` + - `"ne"` - - `"gpt-4o-2024-08-06"` + - `"gt"` - - `"gpt-4o-2024-05-13"` + - `"gte"` - - `"gpt-4o-audio-preview"` + - `"lt"` - - `"gpt-4o-audio-preview-2024-10-01"` + - `"lte"` - - `"gpt-4o-audio-preview-2024-12-17"` + - `"in"` - - `"gpt-4o-audio-preview-2025-06-03"` + - `"nin"` - - `"gpt-4o-mini-audio-preview"` + - `value: string or number or boolean or array of string or number` - - `"gpt-4o-mini-audio-preview-2024-12-17"` + The value to compare against the attribute key; supports string, number, or boolean types. - - `"gpt-4o-search-preview"` + - `string` - - `"gpt-4o-mini-search-preview"` + - `number` - - `"gpt-4o-search-preview-2025-03-11"` + - `boolean` - - `"gpt-4o-mini-search-preview-2025-03-11"` + - `array of string or number` - - `"chatgpt-4o-latest"` + - `string` - - `"codex-mini-latest"` + - `number` - - `"gpt-4o-mini"` + - `CompoundFilter object { filters, type }` - - `"gpt-4o-mini-2024-07-18"` + Combine multiple filters using `and` or `or`. - - `"gpt-4-turbo"` + - `filters: array of object { key, type, value } or unknown` - - `"gpt-4-turbo-2024-04-09"` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `"gpt-4-0125-preview"` + - `ComparisonFilter object { key, type, value }` - - `"gpt-4-turbo-preview"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `"gpt-4-1106-preview"` + - `key: string` - - `"gpt-4-vision-preview"` + The key to compare against the value. - - `"gpt-4"` + - `type: "eq" or "ne" or "gt" or 5 more` - - `"gpt-4-0314"` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `"gpt-4-0613"` + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in - - `"gpt-4-32k"` + - `"eq"` - - `"gpt-4-32k-0314"` + - `"ne"` - - `"gpt-4-32k-0613"` + - `"gt"` - - `"gpt-3.5-turbo"` + - `"gte"` - - `"gpt-3.5-turbo-16k"` + - `"lt"` - - `"gpt-3.5-turbo-0301"` + - `"lte"` - - `"gpt-3.5-turbo-0613"` + - `"in"` - - `"gpt-3.5-turbo-1106"` + - `"nin"` - - `"gpt-3.5-turbo-0125"` + - `value: string or number or boolean or array of string or number` - - `"gpt-3.5-turbo-16k-0613"` + The value to compare against the attribute key; supports string, number, or boolean types. - - `"o1-pro"` + - `string` - - `"o1-pro-2025-03-19"` + - `number` - - `"o3-pro"` + - `boolean` - - `"o3-pro-2025-06-10"` + - `array of string or number` - - `"o3-deep-research"` + - `string` - - `"o3-deep-research-2025-06-26"` + - `number` - - `"o4-mini-deep-research"` + - `unknown` - - `"o4-mini-deep-research-2025-06-26"` + - `type: "and" or "or"` - - `"computer-use-preview"` + Type of operation: `and` or `or`. - - `"computer-use-preview-2025-03-11"` + - `"and"` - - `"gpt-5-codex"` + - `"or"` - - `"gpt-5-pro"` + - `max_num_results: optional number` - - `"gpt-5-pro-2025-10-06"` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `"gpt-5.1-codex-max"` + - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` - - `string` + Ranking options for search. - - `object: "response"` + - `hybrid_search: optional object { embedding_weight, text_weight }` - The object type of this resource - always set to `response`. + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `"response"` + - `embedding_weight: number` - - `output: array of BetaResponseOutputItem` + The weight of the embedding in the reciprocal ranking fusion. - An array of content items generated by the model. + - `text_weight: number` - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + The weight of the text in the reciprocal ranking fusion. - - `BetaResponseOutputMessage object { id, content, role, 4 more }` + - `ranker: optional "auto" or "default-2024-11-15"` - An output message from the model. + The ranker to use for the file search. - - `FileSearchCall object { id, queries, status, 3 more }` + - `"auto"` - The results of a file search tool call. See the - [file search guide](/docs/guides/tools-file-search) for more information. + - `"default-2024-11-15"` - - `id: string` + - `score_threshold: optional number` - The unique ID of the file search tool call. + The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. - - `queries: array of string` + - `Computer object { type }` - The queries used to search for files. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `status: "in_progress" or "searching" or "completed" or 2 more` + - `type: "computer"` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + The type of the computer tool. Always `computer`. - - `"in_progress"` + - `"computer"` - - `"searching"` + - `ComputerUsePreview object { display_height, display_width, environment, type }` - - `"completed"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `"incomplete"` + - `display_height: number` - - `"failed"` + The height of the computer display. - - `type: "file_search_call"` + - `display_width: number` - The type of the file search tool call. Always `file_search_call`. + The width of the computer display. - - `"file_search_call"` + - `environment: "windows" or "mac" or "linux" or 2 more` - - `agent: optional object { agent_name }` + The type of computer environment to control. - The agent that produced this item. + - `"windows"` - - `agent_name: string` + - `"mac"` - The canonical name of the agent that produced this item. + - `"linux"` - - `results: optional array of object { attributes, file_id, filename, 2 more }` + - `"ubuntu"` - The results of the file search tool call. + - `"browser"` - - `attributes: optional map[string or number or boolean]` + - `type: "computer_use_preview"` - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. Keys are strings - with a maximum length of 64 characters. Values are strings with a maximum - length of 512 characters, booleans, or numbers. + The type of the computer use tool. Always `computer_use_preview`. - - `string` + - `"computer_use_preview"` - - `number` + - `WebSearch object { type, filters, search_context_size, user_location }` - - `boolean` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). - - `file_id: optional string` + - `type: "web_search" or "web_search_2025_08_26"` - The unique ID of the file. + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `filename: optional string` + - `"web_search"` - The name of the file. + - `"web_search_2025_08_26"` - - `score: optional number` + - `filters: optional object { allowed_domains }` - The relevance score of the file - a value between 0 and 1. + Filters for the search. - - `text: optional string` + - `allowed_domains: optional array of string` - The text that was retrieved from the file. + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `FunctionCall object { arguments, call_id, name, 6 more }` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - A tool call to run a function. See the - [function calling guide](/docs/guides/function-calling) for more information. + - `search_context_size: optional "low" or "medium" or "high"` - - `arguments: string` + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - A JSON string of the arguments to pass to the function. + - `"low"` - - `call_id: string` + - `"medium"` - The unique ID of the function tool call generated by the model. + - `"high"` - - `name: string` + - `user_location: optional object { city, country, region, 2 more }` - The name of the function to run. + The approximate location of the user. - - `type: "function_call"` + - `city: optional string` - The type of the function tool call. Always `function_call`. + Free text input for the city of the user, e.g. `San Francisco`. - - `"function_call"` + - `country: optional string` - - `id: optional string` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The unique ID of the function tool call. + - `region: optional string` - - `agent: optional object { agent_name }` + Free text input for the region of the user, e.g. `California`. - The agent that produced this item. + - `timezone: optional string` - - `agent_name: string` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The canonical name of the agent that produced this item. + - `type: optional "approximate"` - - `caller: optional object { type } or object { caller_id, type }` + The type of location approximation. Always `approximate`. - The execution context that produced this tool call. + - `"approximate"` - - `Direct object { type }` + - `Mcp object { server_label, type, allowed_callers, 9 more }` - - `type: "direct"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). - - `"direct"` + - `server_label: string` - - `Program object { caller_id, type }` + A label for this MCP server, used to identify it in tool calls. - - `caller_id: string` + - `type: "mcp"` - The call ID of the program item that produced this tool call. + The type of the MCP tool. Always `mcp`. - - `type: "program"` + - `"mcp"` - - `"program"` + - `allowed_callers: optional array of "direct" or "programmatic"` - - `namespace: optional string` + The tool invocation context(s). - The namespace of the function to run. + - `"direct"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"programmatic"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `allowed_tools: optional array of string or object { read_only, tool_names }` - - `"in_progress"` + List of allowed tool names or a filter object. - - `"completed"` + - `McpAllowedTools = array of string` - - `"incomplete"` + A string array of allowed tool names - - `FunctionCallOutput object { id, call_id, output, 5 more }` + - `McpToolFilter object { read_only, tool_names }` - - `id: string` + A filter object to specify which tools are allowed. - The unique ID of the function call tool output. + - `read_only: optional boolean` - - `call_id: string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The unique ID of the function tool call generated by the model. + - `tool_names: optional array of string` - - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + List of allowed tool names. - The output from the function call generated by your code. - Can be a string or an list of output content. + - `authorization: optional string` - - `StringOutput = string` + An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application + must handle the OAuth authorization flow and provide the token here. - A string of the output of the function call. + - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` - - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + Identifier for service connectors, like those available in ChatGPT. One of + `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more + about service connectors [here](/docs/guides/tools-remote-mcp#connectors). - Text, image, or file output of the function call. + Currently supported `connector_id` values are: - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` - A text input to the model. + - `"connector_dropbox"` - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + - `"connector_gmail"` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + - `"connector_googlecalendar"` - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + - `"connector_googledrive"` - A file input to the model. + - `"connector_microsoftteams"` - - `status: "in_progress" or "completed" or "incomplete"` + - `"connector_outlookcalendar"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `"connector_outlookemail"` - - `"in_progress"` + - `"connector_sharepoint"` - - `"completed"` + - `defer_loading: optional boolean` - - `"incomplete"` + Whether this MCP tool is deferred and discovered via tool search. - - `type: "function_call_output"` + - `headers: optional map[string]` - The type of the function tool call output. Always `function_call_output`. + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `"function_call_output"` + - `require_approval: optional object { always, never } or "always" or "never"` - - `agent: optional object { agent_name }` + Specify which of the MCP server's tools require approval. - The agent that produced this item. + - `McpToolApprovalFilter object { always, never }` - - `agent_name: string` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - The canonical name of the agent that produced this item. + - `always: optional object { read_only, tool_names }` - - `caller: optional object { type } or object { caller_id, type }` + A filter object to specify which tools are allowed. - The execution context that produced this tool call. + - `read_only: optional boolean` - - `Direct object { type }` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `type: "direct"` + - `tool_names: optional array of string` - The caller type. Always `direct`. + List of allowed tool names. - - `"direct"` + - `never: optional object { read_only, tool_names }` - - `Program object { caller_id, type }` + A filter object to specify which tools are allowed. - - `caller_id: string` + - `read_only: optional boolean` - The call ID of the program item that produced this tool call. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `type: "program"` + - `tool_names: optional array of string` - The caller type. Always `program`. + List of allowed tool names. - - `"program"` + - `McpToolApprovalSetting = "always" or "never"` - - `created_by: optional string` + Specify a single approval policy for all tools. One of `always` or + `never`. When set to `always`, all tools will require approval. When + set to `never`, all tools will not require approval. - The identifier of the actor that created the item. + - `"always"` - - `AgentMessage object { id, author, content, 3 more }` + - `"never"` - - `id: string` + - `server_description: optional string` - The unique ID of the agent message. + Optional description of the MCP server, used to provide more context. - - `author: string` + - `server_url: optional string` - The sending agent identity. + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `content: array of BetaResponseInputText or BetaResponseOutputText or object { text, type } or 7 more` + - `tunnel_id: optional string` - Encrypted content sent between agents. + The Secure MCP Tunnel ID to use instead of a direct server URL. One of + `server_url`, `connector_id`, or `tunnel_id` must be provided. - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + - `CodeInterpreter object { container, type, allowed_callers }` - A text input to the model. + A tool that runs Python code to help generate a response to a prompt. - - `BetaResponseOutputText object { annotations, logprobs, text, type }` + - `container: string or object { type, file_ids, memory_limit, network_policy }` - A text output from the model. + The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an + optional `memory_limit` setting. - - `Text object { text, type }` + - `string` - A text content. + The container ID. - - `text: string` + - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` - - `type: "text"` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `"text"` + - `type: "auto"` - - `SummaryText object { text, type }` + Always `auto`. - A summary text from the model. + - `"auto"` - - `text: string` + - `file_ids: optional array of string` - A summary of the reasoning output from the model so far. + An optional list of uploaded files to make available to your code. - - `type: "summary_text"` + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - The type of the object. Always `summary_text`. + The memory limit for the code interpreter container. - - `"summary_text"` + - `"1g"` - - `ReasoningText object { text, type }` + - `"4g"` - Reasoning text from the model. + - `"16g"` - - `text: string` + - `"64g"` - The reasoning text from the model. + - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` - - `type: "reasoning_text"` + Network access policy for the container. - The type of the reasoning text. Always `reasoning_text`. + - `BetaContainerNetworkPolicyDisabled object { type }` - - `"reasoning_text"` + - `type: "disabled"` - - `BetaResponseOutputRefusal object { refusal, type }` + Disable outbound network access. Always `disabled`. - A refusal from the model. + - `"disabled"` - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + - `allowed_domains: array of string` - - `ComputerScreenshot object { detail, file_id, image_url, 2 more }` + A list of allowed domains when type is `allowlist`. - A screenshot of a computer. + - `type: "allowlist"` - - `detail: "low" or "high" or "auto" or "original"` + Allow outbound network access only to specified domains. Always `allowlist`. - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `"allowlist"` - - `"low"` + - `domain_secrets: optional array of BetaContainerNetworkPolicyDomainSecret` - - `"high"` + Optional domain-scoped secrets for allowlisted domains. - - `"auto"` + - `domain: string` - - `"original"` + The domain associated with the secret. - - `file_id: string` + - `name: string` - The identifier of an uploaded file that contains the screenshot. + The name of the secret to inject for the domain. - - `image_url: string` + - `value: string` - The URL of the screenshot image. + The secret value to inject for the domain. - - `type: "computer_screenshot"` + - `type: "code_interpreter"` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + The type of the code interpreter tool. Always `code_interpreter`. - - `"computer_screenshot"` + - `"code_interpreter"` - - `prompt_cache_breakpoint: optional object { mode }` + - `allowed_callers: optional array of "direct" or "programmatic"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The tool invocation context(s). - - `mode: "explicit"` + - `"direct"` - The breakpoint mode. Always `explicit`. + - `"programmatic"` - - `"explicit"` + - `ProgrammaticToolCalling object { type }` - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + - `type: "programmatic_tool_calling"` - A file input to the model. + The type of the tool. Always `programmatic_tool_calling`. - - `EncryptedContent object { encrypted_content, type }` + - `"programmatic_tool_calling"` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `ImageGeneration object { type, action, background, 9 more }` - - `encrypted_content: string` + A tool that generates images using the GPT image models. - Opaque encrypted content. + - `type: "image_generation"` - - `type: "encrypted_content"` + The type of the image generation tool. Always `image_generation`. - The type of the input item. Always `encrypted_content`. + - `"image_generation"` - - `"encrypted_content"` + - `action: optional "generate" or "edit" or "auto"` - - `recipient: string` + Whether to generate a new image or edit an existing image. Default: `auto`. - The destination agent identity. + - `"generate"` - - `type: "agent_message"` + - `"edit"` - The type of the item. Always `agent_message`. + - `"auto"` - - `"agent_message"` + - `background: optional "transparent" or "opaque" or "auto"` - - `agent: optional object { agent_name }` + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. - The agent that produced this item. + - `"transparent"` - - `agent_name: string` + - `"opaque"` - The canonical name of the agent that produced this item. + - `"auto"` - - `MultiAgentCall object { id, action, arguments, 3 more }` + - `input_fidelity: optional "high" or "low"` - - `id: string` + Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. - The unique ID of the multi-agent call item. + - `"high"` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + - `"low"` - The multi-agent action to execute. + - `input_image_mask: optional object { file_id, image_url }` - - `"spawn_agent"` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `"interrupt_agent"` + - `file_id: optional string` - - `"list_agents"` + File ID for the mask image. - - `"send_message"` + - `image_url: optional string` - - `"followup_task"` + Base64-encoded mask image. - - `"wait_agent"` + - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `arguments: string` + The image generation model to use. Default: `gpt-image-1`. - The JSON string of arguments generated for the action. + - `string` - - `call_id: string` + - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - The unique ID linking this call to its output. + The image generation model to use. Default: `gpt-image-1`. - - `type: "multi_agent_call"` + - `"gpt-image-1"` - The type of the multi-agent call. Always `multi_agent_call`. + - `"gpt-image-1-mini"` - - `"multi_agent_call"` + - `"gpt-image-1.5"` - - `agent: optional object { agent_name }` + - `moderation: optional "auto" or "low"` - The agent that produced this item. + Moderation level for the generated image. Default: `auto`. - - `agent_name: string` + - `"auto"` - The canonical name of the agent that produced this item. + - `"low"` - - `MultiAgentCallOutput object { id, action, call_id, 3 more }` + - `output_compression: optional number` - - `id: string` + Compression level for the output image. Default: 100. - The unique ID of the multi-agent call output item. + - `output_format: optional "png" or "webp" or "jpeg"` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - The multi-agent action that produced this result. + - `"png"` - - `"spawn_agent"` + - `"webp"` - - `"interrupt_agent"` + - `"jpeg"` - - `"list_agents"` + - `partial_images: optional number` - - `"send_message"` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `"followup_task"` + - `quality: optional "low" or "medium" or "high" or "auto"` - - `"wait_agent"` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `call_id: string` + - `"low"` - The unique ID of the multi-agent call. + - `"medium"` - - `output: array of BetaResponseOutputText` + - `"high"` - Text output returned by the multi-agent action. + - `"auto"` - - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` + - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` - The annotations of the text output. + The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. - - `logprobs: array of object { token, bytes, logprob, top_logprobs }` + - `string` - - `text: string` + - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` - The text output from the model. + The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. - - `type: "output_text"` + - `"1024x1024"` - The type of the output text. Always `output_text`. + - `"1024x1536"` - - `type: "multi_agent_call_output"` + - `"1536x1024"` - The type of the multi-agent result. Always `multi_agent_call_output`. + - `"auto"` - - `"multi_agent_call_output"` + - `LocalShell object { type }` - - `agent: optional object { agent_name }` + A tool that allows the model to execute shell commands in a local environment. - The agent that produced this item. + - `type: "local_shell"` - - `agent_name: string` + The type of the local shell tool. Always `local_shell`. - The canonical name of the agent that produced this item. + - `"local_shell"` - - `WebSearchCall object { id, action, status, 2 more }` + - `Shell object { type, allowed_callers, environment }` - The results of a web search tool call. See the - [web search guide](/docs/guides/tools-web-search) for more information. + A tool that allows the model to execute shell commands. - - `id: string` + - `type: "shell"` - The unique ID of the web search tool call. + The type of the shell tool. Always `shell`. - - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` + - `"shell"` - An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find_in_page). + - `allowed_callers: optional array of "direct" or "programmatic"` - - `Search object { type, queries, query, sources }` + The tool invocation context(s). - Action type "search" - Performs a web search query. + - `"direct"` - - `type: "search"` + - `"programmatic"` - The action type. + - `environment: optional BetaContainerAuto or BetaLocalEnvironment or BetaContainerReference` - - `"search"` + - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` - - `queries: optional array of string` + - `type: "container_auto"` - The search queries. + Automatically creates a container for this request - - `query: optional string` + - `"container_auto"` - The search query. + - `file_ids: optional array of string` - - `sources: optional array of object { type, url }` + An optional list of uploaded files to make available to your code. - The sources used in the search. + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - `type: "url"` + The memory limit for the container. - The type of source. Always `url`. + - `"1g"` - - `"url"` + - `"4g"` - - `url: string` + - `"16g"` - The URL of the source. + - `"64g"` - - `OpenPage object { type, url }` + - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` - Action type "open_page" - Opens a specific URL from search results. + Network access policy for the container. - - `type: "open_page"` + - `BetaContainerNetworkPolicyDisabled object { type }` - The action type. + - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `"open_page"` + - `skills: optional array of BetaSkillReference or BetaInlineSkill` - - `url: optional string` + An optional list of skills referenced by id or inline data. - The URL opened by the model. + - `BetaSkillReference object { skill_id, type, version }` - - `FindInPage object { pattern, type, url }` + - `skill_id: string` - Action type "find_in_page": Searches for a pattern within a loaded page. + The ID of the referenced skill. - - `pattern: string` + - `type: "skill_reference"` - The pattern or text to search for within the page. + References a skill created with the /v1/skills endpoint. - - `type: "find_in_page"` + - `"skill_reference"` - The action type. + - `version: optional string` - - `"find_in_page"` + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `url: string` + - `BetaInlineSkill object { description, name, source, type }` - The URL of the page searched for the pattern. + - `description: string` - - `status: "in_progress" or "searching" or "completed" or "failed"` + The description of the skill. - The status of the web search tool call. + - `name: string` - - `"in_progress"` + The name of the skill. - - `"searching"` + - `source: BetaInlineSkillSource` - - `"completed"` + Inline skill payload - - `"failed"` + - `data: string` - - `type: "web_search_call"` + Base64-encoded skill zip bundle. - The type of the web search tool call. Always `web_search_call`. + - `media_type: "application/zip"` - - `"web_search_call"` + The media type of the inline skill payload. Must be `application/zip`. - - `agent: optional object { agent_name }` + - `"application/zip"` - The agent that produced this item. + - `type: "base64"` - - `agent_name: string` + The type of the inline skill source. Must be `base64`. - The canonical name of the agent that produced this item. + - `"base64"` - - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` + - `type: "inline"` - A tool call to a computer use tool. See the - [computer use guide](/docs/guides/tools-computer-use) for more information. + Defines an inline skill for this request. - - `id: string` + - `"inline"` - The unique ID of the computer call. + - `BetaLocalEnvironment object { type, skills }` - - `call_id: string` + - `type: "local"` - An identifier used when responding to the tool call with output. + Use a local computer environment. - - `pending_safety_checks: array of object { id, code, message }` + - `"local"` - The pending safety checks for the computer call. + - `skills: optional array of BetaLocalSkill` - - `id: string` + An optional list of skills. - The ID of the pending safety check. + - `description: string` - - `code: optional string` + The description of the skill. - The type of the pending safety check. + - `name: string` - - `message: optional string` + The name of the skill. - Details about the pending safety check. + - `path: string` - - `status: "in_progress" or "completed" or "incomplete"` + The path to the directory containing the skill. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `BetaContainerReference object { container_id, type }` - - `"in_progress"` + - `container_id: string` - - `"completed"` + The ID of the referenced container. - - `"incomplete"` + - `type: "container_reference"` - - `type: "computer_call"` + References a container created with the /v1/containers endpoint - The type of the computer call. Always `computer_call`. + - `"container_reference"` - - `"computer_call"` + - `Custom object { name, type, allowed_callers, 3 more }` - - `action: optional BetaComputerAction` + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - A click action. + - `name: string` - - `actions: optional BetaComputerActionList` + The name of the custom tool, used to identify it in tool calls. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `type: "custom"` - - `agent: optional object { agent_name }` + The type of the custom tool. Always `custom`. - The agent that produced this item. + - `"custom"` - - `agent_name: string` + - `allowed_callers: optional array of "direct" or "programmatic"` - The canonical name of the agent that produced this item. + The tool invocation context(s). - - `ComputerCallOutput object { id, call_id, output, 5 more }` + - `"direct"` - - `id: string` + - `"programmatic"` - The unique ID of the computer call tool output. + - `defer_loading: optional boolean` - - `call_id: string` + Whether this tool should be deferred and discovered via tool search. - The ID of the computer tool call that produced the output. + - `description: optional string` - - `output: BetaResponseComputerToolCallOutputScreenshot` + Optional description of the custom tool, used to provide more context. - A computer screenshot image used with the computer use tool. + - `format: optional object { type } or object { definition, syntax, type }` - - `status: "completed" or "incomplete" or "failed" or "in_progress"` + The input format for the custom tool. Default is unconstrained text. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `Text object { type }` - - `"completed"` + Unconstrained free-form text. - - `"incomplete"` + - `type: "text"` - - `"failed"` + Unconstrained text format. Always `text`. - - `"in_progress"` + - `"text"` - - `type: "computer_call_output"` + - `Grammar object { definition, syntax, type }` - The type of the computer tool call output. Always `computer_call_output`. + A grammar defined by the user. - - `"computer_call_output"` + - `definition: string` - - `acknowledged_safety_checks: optional array of object { id, code, message }` + The grammar definition. - The safety checks reported by the API that have been acknowledged by the - developer. + - `syntax: "lark" or "regex"` - - `id: string` + The syntax of the grammar definition. One of `lark` or `regex`. - The ID of the pending safety check. + - `"lark"` - - `code: optional string` + - `"regex"` - The type of the pending safety check. + - `type: "grammar"` - - `message: optional string` + Grammar format. Always `grammar`. - Details about the pending safety check. + - `"grammar"` - - `agent: optional object { agent_name }` + - `Namespace object { description, name, tools, type }` - The agent that produced this item. + Groups function/custom tools under a shared namespace. - - `agent_name: string` + - `description: string` - The canonical name of the agent that produced this item. + A description of the namespace shown to the model. - - `created_by: optional string` + - `name: string` - The identifier of the actor that created the item. + The namespace name used in tool calls (for example, `crm`). - - `Reasoning object { id, summary, type, 4 more }` + - `tools: array of object { name, type, allowed_callers, 5 more } or object { name, type, allowed_callers, 3 more }` - 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](/docs/guides/conversation-state). + The function/custom tools available inside this namespace. - - `id: string` + - `Function object { name, type, allowed_callers, 5 more }` - The unique identifier of the reasoning content. + - `name: string` - - `summary: array of object { text, type }` + - `type: "function"` - Reasoning summary content. + - `"function"` - - `text: string` + - `allowed_callers: optional array of "direct" or "programmatic"` - A summary of the reasoning output from the model so far. + The tool invocation context(s). - - `type: "summary_text"` + - `"direct"` - The type of the object. Always `summary_text`. + - `"programmatic"` - - `"summary_text"` + - `defer_loading: optional boolean` - - `type: "reasoning"` + Whether this function should be deferred and discovered via tool search. - The type of the object. Always `reasoning`. + - `description: optional string` - - `"reasoning"` + - `output_schema: optional map[unknown]` - - `agent: optional object { agent_name }` + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - The agent that produced this item. + - `parameters: optional unknown` - - `agent_name: string` + - `strict: optional boolean` - The canonical name of the agent that produced this item. + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - `content: optional array of object { text, type }` + - `Custom object { name, type, allowed_callers, 3 more }` - Reasoning text content. + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - `text: string` + - `name: string` - The reasoning text from the model. + The name of the custom tool, used to identify it in tool calls. - - `type: "reasoning_text"` + - `type: "custom"` - The type of the reasoning text. Always `reasoning_text`. + The type of the custom tool. Always `custom`. - - `"reasoning_text"` + - `"custom"` - - `encrypted_content: optional string` + - `allowed_callers: optional array of "direct" or "programmatic"` - The encrypted content of the reasoning item. This is populated by default - for reasoning items returned by `POST /v1/responses` and WebSocket - `response.create` requests. + The tool invocation context(s). - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"direct"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `"programmatic"` - - `"in_progress"` + - `defer_loading: optional boolean` - - `"completed"` + Whether this tool should be deferred and discovered via tool search. - - `"incomplete"` + - `description: optional string` - - `Program object { id, call_id, code, 3 more }` + Optional description of the custom tool, used to provide more context. - - `id: string` + - `format: optional object { type } or object { definition, syntax, type }` - The unique ID of the program item. + The input format for the custom tool. Default is unconstrained text. - - `call_id: string` + - `Text object { type }` - The stable call ID of the program item. + Unconstrained free-form text. - - `code: string` + - `type: "text"` - The JavaScript source executed by programmatic tool calling. + Unconstrained text format. Always `text`. - - `fingerprint: string` + - `"text"` - Opaque program replay fingerprint that must be round-tripped. + - `Grammar object { definition, syntax, type }` - - `type: "program"` + A grammar defined by the user. - The type of the item. Always `program`. + - `definition: string` - - `"program"` + The grammar definition. - - `agent: optional object { agent_name }` + - `syntax: "lark" or "regex"` - The agent that produced this item. + The syntax of the grammar definition. One of `lark` or `regex`. - - `agent_name: string` + - `"lark"` - The canonical name of the agent that produced this item. + - `"regex"` - - `ProgramOutput object { id, call_id, result, 3 more }` + - `type: "grammar"` - - `id: string` + Grammar format. Always `grammar`. - The unique ID of the program output item. + - `"grammar"` - - `call_id: string` + - `type: "namespace"` - The call ID of the program item. + The type of the tool. Always `namespace`. - - `result: string` + - `"namespace"` - The result produced by the program item. + - `ToolSearch object { type, description, execution, parameters }` - - `status: "completed" or "incomplete"` + Hosted or BYOT tool search configuration for deferred tools. - The terminal status of the program output item. + - `type: "tool_search"` - - `"completed"` + The type of the tool. Always `tool_search`. - - `"incomplete"` + - `"tool_search"` - - `type: "program_output"` + - `description: optional string` - The type of the item. Always `program_output`. + Description shown to the model for a client-executed tool search tool. - - `"program_output"` + - `execution: optional "server" or "client"` - - `agent: optional object { agent_name }` + Whether tool search is executed by the server or by the client. - The agent that produced this item. + - `"server"` - - `agent_name: string` + - `"client"` - The canonical name of the agent that produced this item. + - `parameters: optional unknown` - - `ToolSearchCall object { id, arguments, call_id, 5 more }` + Parameter schema for a client-executed tool search tool. - - `id: string` + - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` - The unique ID of the tool search call item. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `arguments: unknown` + - `type: "web_search_preview" or "web_search_preview_2025_03_11"` - Arguments used for the tool search call. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `call_id: string` + - `"web_search_preview"` - The unique ID of the tool search call generated by the model. + - `"web_search_preview_2025_03_11"` - - `execution: "server" or "client"` + - `search_content_types: optional array of "text" or "image"` - Whether tool search was executed by the server or by the client. + - `"text"` - - `"server"` + - `"image"` - - `"client"` + - `search_context_size: optional "low" or "medium" or "high"` - - `status: "in_progress" or "completed" or "incomplete"` + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - The status of the tool search call item that was recorded. + - `"low"` - - `"in_progress"` + - `"medium"` - - `"completed"` + - `"high"` - - `"incomplete"` + - `user_location: optional object { type, city, country, 2 more }` - - `type: "tool_search_call"` + The user's location. - The type of the item. Always `tool_search_call`. + - `type: "approximate"` - - `"tool_search_call"` + The type of location approximation. Always `approximate`. - - `agent: optional object { agent_name }` + - `"approximate"` - The agent that produced this item. + - `city: optional string` - - `agent_name: string` + Free text input for the city of the user, e.g. `San Francisco`. - The canonical name of the agent that produced this item. + - `country: optional string` - - `created_by: optional string` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - The identifier of the actor that created the item. + - `region: optional string` - - `ToolSearchOutput object { id, call_id, execution, 5 more }` + Free text input for the region of the user, e.g. `California`. - - `id: string` + - `timezone: optional string` - The unique ID of the tool search output item. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `call_id: string` + - `ApplyPatch object { type, allowed_callers }` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `type: "apply_patch"` + + The type of the tool. Always `apply_patch`. + + - `"apply_patch"` + + - `allowed_callers: optional array of "direct" or "programmatic"` + + The tool invocation context(s). + + - `"direct"` + + - `"programmatic"` + + - `type: "tool_search_output"` + + The item type. Always `tool_search_output`. + + - `"tool_search_output"` + + - `id: optional string` + + The unique ID of this tool search output. + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `call_id: optional string` The unique ID of the tool search call generated by the model. - - `execution: "server" or "client"` + - `execution: optional "server" or "client"` Whether tool search was executed by the server or by the client. @@ -12712,9 +13883,9 @@ as input for the model's response. - `"client"` - - `status: "in_progress" or "completed" or "incomplete"` + - `status: optional "in_progress" or "completed" or "incomplete"` - The status of the tool search output item that was recorded. + The status of the tool search output. - `"in_progress"` @@ -12722,9 +13893,17 @@ as input for the model's response. - `"incomplete"` + - `AdditionalTools object { role, tools, type, 2 more }` + + - `role: "developer"` + + The role that provided the additional tools. Only `developer` is supported. + + - `"developer"` + - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - The loaded tool definitions returned by tool search. + A list of additional tools made available at this item. - `Function object { name, parameters, strict, 5 more }` @@ -13715,11 +14894,15 @@ as input for the model's response. - `"programmatic"` - - `type: "tool_search_output"` + - `type: "additional_tools"` - The type of the item. Always `tool_search_output`. + The item type. Always `additional_tools`. - - `"tool_search_output"` + - `"additional_tools"` + + - `id: optional string` + + The unique ID of this additional tools item. - `agent: optional object { agent_name }` @@ -13729,5209 +14912,786 @@ as input for the model's response. The canonical name of the agent that produced this item. - - `created_by: optional string` - - The identifier of the actor that created the item. + - `Reasoning object { id, summary, type, 4 more }` - - `AdditionalTools object { id, role, tools, 2 more }` + 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](/docs/guides/conversation-state). - `id: string` - The unique ID of the additional tools item. - - - `role: "unknown" or "user" or "assistant" or 5 more` - - The role that provided the additional tools. - - - `"unknown"` - - - `"user"` - - - `"assistant"` - - - `"system"` - - - `"critic"` - - - `"discriminator"` - - - `"developer"` - - - `"tool"` - - - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - - The additional tool definitions made available at this item. - - - `Function object { name, parameters, strict, 5 more }` - - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - - `name: string` - - The name of the function to call. - - - `parameters: map[unknown]` - - A JSON schema object describing the parameters of the function. - - - `strict: boolean` - - Whether strict parameter validation is enforced for this function tool. - - - `type: "function"` - - The type of the function tool. Always `function`. - - - `"function"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` + The unique identifier of the reasoning content. - - `defer_loading: optional boolean` + - `summary: array of object { text, type }` - Whether this function is deferred and loaded via tool search. + Reasoning summary content. - - `description: optional string` + - `text: string` - A description of the function. Used by the model to determine whether or not to call the function. + A summary of the reasoning output from the model so far. - - `output_schema: optional map[unknown]` + - `type: "summary_text"` - A JSON schema object describing the JSON value encoded in string outputs for this function. + The type of the object. Always `summary_text`. - - `FileSearch object { type, vector_store_ids, filters, 2 more }` + - `"summary_text"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `type: "reasoning"` - - `type: "file_search"` + The type of the object. Always `reasoning`. - The type of the file search tool. Always `file_search`. + - `"reasoning"` - - `"file_search"` + - `agent: optional object { agent_name }` - - `vector_store_ids: array of string` + The agent that produced this item. - The IDs of the vector stores to search. + - `agent_name: string` - - `filters: optional object { key, type, value } or object { filters, type }` + The canonical name of the agent that produced this item. - A filter to apply. + - `content: optional array of object { text, type }` - - `ComparisonFilter object { key, type, value }` + Reasoning text content. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `text: string` - - `key: string` + The reasoning text from the model. - The key to compare against the value. + - `type: "reasoning_text"` - - `type: "eq" or "ne" or "gt" or 5 more` + The type of the reasoning text. Always `reasoning_text`. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `"reasoning_text"` - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in + - `encrypted_content: optional string` - - `"eq"` + The encrypted content of the reasoning item. This is populated by default + for reasoning items returned by `POST /v1/responses` and WebSocket + `response.create` requests. - - `"ne"` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"gt"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `"gte"` + - `"in_progress"` - - `"lt"` + - `"completed"` - - `"lte"` + - `"incomplete"` - - `"in"` + - `Compaction object { encrypted_content, type, id, agent }` - - `"nin"` + A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - - `value: string or number or boolean or array of string or number` + - `encrypted_content: string` - The value to compare against the attribute key; supports string, number, or boolean types. + The encrypted content of the compaction summary. - - `string` + - `type: "compaction"` - - `number` + The type of the item. Always `compaction`. - - `boolean` + - `"compaction"` - - `array of string or number` + - `id: optional string` - - `string` + The ID of the compaction item. - - `number` + - `agent: optional object { agent_name }` - - `CompoundFilter object { filters, type }` + The agent that produced this item. - Combine multiple filters using `and` or `or`. + - `agent_name: string` - - `filters: array of object { key, type, value } or unknown` + The canonical name of the agent that produced this item. - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + - `ImageGenerationCall object { id, result, status, 2 more }` - - `ComparisonFilter object { key, type, value }` + An image generation request made by the model. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `id: string` - - `key: string` + The unique ID of the image generation call. - The key to compare against the value. + - `result: string` - - `type: "eq" or "ne" or "gt" or 5 more` + The generated image encoded in base64. - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `status: "in_progress" or "completed" or "generating" or "failed"` - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in + The status of the image generation call. - - `"eq"` + - `"in_progress"` - - `"ne"` + - `"completed"` - - `"gt"` + - `"generating"` - - `"gte"` + - `"failed"` - - `"lt"` + - `type: "image_generation_call"` - - `"lte"` + The type of the image generation call. Always `image_generation_call`. - - `"in"` + - `"image_generation_call"` - - `"nin"` + - `agent: optional object { agent_name }` - - `value: string or number or boolean or array of string or number` + The agent that produced this item. - The value to compare against the attribute key; supports string, number, or boolean types. + - `agent_name: string` - - `string` + The canonical name of the agent that produced this item. - - `number` + - `CodeInterpreterCall object { id, code, container_id, 4 more }` - - `boolean` + A tool call to run code. - - `array of string or number` + - `id: string` - - `string` + The unique ID of the code interpreter tool call. - - `number` + - `code: string` - - `unknown` + The code to run, or null if not available. - - `type: "and" or "or"` + - `container_id: string` - Type of operation: `and` or `or`. + The ID of the container used to run the code. - - `"and"` + - `outputs: array of object { logs, type } or object { type, url }` - - `"or"` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `max_num_results: optional number` + - `Logs object { logs, type }` - The maximum number of results to return. This number should be between 1 and 50 inclusive. + The logs output from the code interpreter. - - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` + - `logs: string` - Ranking options for search. + The logs output from the code interpreter. - - `hybrid_search: optional object { embedding_weight, text_weight }` + - `type: "logs"` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + The type of the output. Always `logs`. - - `embedding_weight: number` + - `"logs"` - The weight of the embedding in the reciprocal ranking fusion. + - `Image object { type, url }` - - `text_weight: number` + The image output from the code interpreter. - The weight of the text in the reciprocal ranking fusion. + - `type: "image"` - - `ranker: optional "auto" or "default-2024-11-15"` + The type of the output. Always `image`. - The ranker to use for the file search. + - `"image"` - - `"auto"` + - `url: string` - - `"default-2024-11-15"` + The URL of the image output from the code interpreter. - - `score_threshold: optional number` + - `status: "in_progress" or "completed" or "incomplete" or 2 more` - The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `Computer object { type }` + - `"in_progress"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `"completed"` - - `type: "computer"` + - `"incomplete"` - The type of the computer tool. Always `computer`. + - `"interpreting"` - - `"computer"` + - `"failed"` - - `ComputerUsePreview object { display_height, display_width, environment, type }` + - `type: "code_interpreter_call"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `display_height: number` + - `"code_interpreter_call"` - The height of the computer display. + - `agent: optional object { agent_name }` - - `display_width: number` + The agent that produced this item. - The width of the computer display. + - `agent_name: string` - - `environment: "windows" or "mac" or "linux" or 2 more` + The canonical name of the agent that produced this item. - The type of computer environment to control. + - `LocalShellCall object { id, action, call_id, 3 more }` - - `"windows"` + A tool call to run a command on the local shell. - - `"mac"` + - `id: string` - - `"linux"` + The unique ID of the local shell call. - - `"ubuntu"` + - `action: object { command, env, type, 3 more }` - - `"browser"` + Execute a shell command on the server. - - `type: "computer_use_preview"` + - `command: array of string` - The type of the computer use tool. Always `computer_use_preview`. + The command to run. - - `"computer_use_preview"` + - `env: map[string]` - - `WebSearch object { type, filters, search_context_size, user_location }` + Environment variables to set for the command. - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](/docs/guides/tools-web-search). + - `type: "exec"` - - `type: "web_search" or "web_search_2025_08_26"` + The type of the local shell action. Always `exec`. - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `"exec"` - - `"web_search"` + - `timeout_ms: optional number` - - `"web_search_2025_08_26"` + Optional timeout in milliseconds for the command. - - `filters: optional object { allowed_domains }` + - `user: optional string` - Filters for the search. + Optional user to run the command as. - - `allowed_domains: optional array of string` + - `working_directory: optional string` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + Optional working directory to run the command in. - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `call_id: string` - - `search_context_size: optional "low" or "medium" or "high"` + The unique ID of the local shell tool call generated by the model. - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + - `status: "in_progress" or "completed" or "incomplete"` - - `"low"` + The status of the local shell call. - - `"medium"` + - `"in_progress"` - - `"high"` + - `"completed"` - - `user_location: optional object { city, country, region, 2 more }` + - `"incomplete"` - The approximate location of the user. + - `type: "local_shell_call"` - - `city: optional string` + The type of the local shell call. Always `local_shell_call`. - Free text input for the city of the user, e.g. `San Francisco`. + - `"local_shell_call"` - - `country: optional string` + - `agent: optional object { agent_name }` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + The agent that produced this item. - - `region: optional string` + - `agent_name: string` - Free text input for the region of the user, e.g. `California`. + The canonical name of the agent that produced this item. - - `timezone: optional string` + - `LocalShellCallOutput object { id, output, type, 2 more }` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + The output of a local shell tool call. - - `type: optional "approximate"` + - `id: string` - The type of location approximation. Always `approximate`. + The unique ID of the local shell tool call generated by the model. - - `"approximate"` + - `output: string` - - `Mcp object { server_label, type, allowed_callers, 9 more }` + A JSON string of the output of the local shell tool call. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). + - `type: "local_shell_call_output"` - - `server_label: string` + The type of the local shell tool call output. Always `local_shell_call_output`. - A label for this MCP server, used to identify it in tool calls. + - `"local_shell_call_output"` - - `type: "mcp"` + - `agent: optional object { agent_name }` - The type of the MCP tool. Always `mcp`. + The agent that produced this item. - - `"mcp"` + - `agent_name: string` - - `allowed_callers: optional array of "direct" or "programmatic"` + The canonical name of the agent that produced this item. - The tool invocation context(s). + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"direct"` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `"programmatic"` + - `"in_progress"` - - `allowed_tools: optional array of string or object { read_only, tool_names }` + - `"completed"` - List of allowed tool names or a filter object. + - `"incomplete"` - - `McpAllowedTools = array of string` + - `ShellCall object { action, call_id, type, 5 more }` - A string array of allowed tool names + A tool representing a request to execute one or more shell commands. - - `McpToolFilter object { read_only, tool_names }` + - `action: object { commands, max_output_length, timeout_ms }` - A filter object to specify which tools are allowed. + The shell commands and limits that describe how to run the tool call. - - `read_only: optional boolean` + - `commands: array of string` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + Ordered shell commands for the execution environment to run. - - `tool_names: optional array of string` + - `max_output_length: optional number` - List of allowed tool names. + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - `authorization: optional string` + - `timeout_ms: optional number` - An OAuth access token that can be used with a remote MCP server, either - with a custom MCP server URL or a service connector. Your application - must handle the OAuth authorization flow and provide the token here. + Maximum wall-clock time in milliseconds to allow the shell commands to run. - - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` + - `call_id: string` - Identifier for service connectors, like those available in ChatGPT. One of - `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more - about service connectors [here](/docs/guides/tools-remote-mcp#connectors). + The unique ID of the shell tool call generated by the model. - Currently supported `connector_id` values are: + - `type: "shell_call"` - - Dropbox: `connector_dropbox` - - Gmail: `connector_gmail` - - Google Calendar: `connector_googlecalendar` - - Google Drive: `connector_googledrive` - - Microsoft Teams: `connector_microsoftteams` - - Outlook Calendar: `connector_outlookcalendar` - - Outlook Email: `connector_outlookemail` - - SharePoint: `connector_sharepoint` + The type of the item. Always `shell_call`. - - `"connector_dropbox"` + - `"shell_call"` - - `"connector_gmail"` + - `id: optional string` - - `"connector_googlecalendar"` + The unique ID of the shell tool call. Populated when this item is returned via API. - - `"connector_googledrive"` + - `agent: optional object { agent_name }` - - `"connector_microsoftteams"` + The agent that produced this item. - - `"connector_outlookcalendar"` + - `agent_name: string` - - `"connector_outlookemail"` + The canonical name of the agent that produced this item. - - `"connector_sharepoint"` + - `caller: optional object { type } or object { caller_id, type }` - - `defer_loading: optional boolean` + The execution context that produced this tool call. - Whether this MCP tool is deferred and discovered via tool search. + - `Direct object { type }` - - `headers: optional map[string]` + - `type: "direct"` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + The caller type. Always `direct`. - - `require_approval: optional object { always, never } or "always" or "never"` + - `"direct"` - Specify which of the MCP server's tools require approval. + - `Program object { caller_id, type }` - - `McpToolApprovalFilter object { always, never }` + - `caller_id: string` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + The call ID of the program item that produced this tool call. - - `always: optional object { read_only, tool_names }` + - `type: "program"` - A filter object to specify which tools are allowed. + The caller type. Always `program`. - - `read_only: optional boolean` + - `"program"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `environment: optional BetaLocalEnvironment or BetaContainerReference` - - `tool_names: optional array of string` + The environment to execute the shell commands in. - List of allowed tool names. + - `BetaLocalEnvironment object { type, skills }` - - `never: optional object { read_only, tool_names }` + - `BetaContainerReference object { container_id, type }` - A filter object to specify which tools are allowed. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `read_only: optional boolean` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `"in_progress"` - - `tool_names: optional array of string` + - `"completed"` - List of allowed tool names. + - `"incomplete"` - - `McpToolApprovalSetting = "always" or "never"` + - `ShellCallOutput object { call_id, output, type, 5 more }` - Specify a single approval policy for all tools. One of `always` or - `never`. When set to `always`, all tools will require approval. When - set to `never`, all tools will not require approval. + The streamed output items emitted by a shell tool call. - - `"always"` + - `call_id: string` - - `"never"` + The unique ID of the shell tool call generated by the model. - - `server_description: optional string` + - `output: array of BetaResponseFunctionShellCallOutputContent` - Optional description of the MCP server, used to provide more context. + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `server_url: optional string` + - `outcome: object { type } or object { exit_code, type }` - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. + The exit or timeout outcome associated with this shell call. - - `tunnel_id: optional string` + - `Timeout object { type }` - The Secure MCP Tunnel ID to use instead of a direct server URL. One of - `server_url`, `connector_id`, or `tunnel_id` must be provided. + Indicates that the shell call exceeded its configured time limit. - - `CodeInterpreter object { container, type, allowed_callers }` + - `type: "timeout"` - A tool that runs Python code to help generate a response to a prompt. + The outcome type. Always `timeout`. - - `container: string or object { type, file_ids, memory_limit, network_policy }` + - `"timeout"` - The code interpreter container. Can be a container ID or an object that - specifies uploaded file IDs to make available to your code, along with an - optional `memory_limit` setting. + - `Exit object { exit_code, type }` - - `string` + Indicates that the shell commands finished and returned an exit code. - The container ID. + - `exit_code: number` - - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` + The exit code returned by the shell process. - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + - `type: "exit"` - - `type: "auto"` + The outcome type. Always `exit`. - Always `auto`. + - `"exit"` - - `"auto"` + - `stderr: string` - - `file_ids: optional array of string` + Captured stderr output for the shell call. - An optional list of uploaded files to make available to your code. + - `stdout: string` - - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` + Captured stdout output for the shell call. - The memory limit for the code interpreter container. + - `type: "shell_call_output"` - - `"1g"` + The type of the item. Always `shell_call_output`. - - `"4g"` + - `"shell_call_output"` - - `"16g"` + - `id: optional string` - - `"64g"` + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` + - `agent: optional object { agent_name }` - Network access policy for the container. + The agent that produced this item. - - `BetaContainerNetworkPolicyDisabled object { type }` + - `agent_name: string` - - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` + The canonical name of the agent that produced this item. - - `type: "code_interpreter"` + - `caller: optional object { type } or object { caller_id, type }` - The type of the code interpreter tool. Always `code_interpreter`. + The execution context that produced this tool call. - - `"code_interpreter"` + - `Direct object { type }` - - `allowed_callers: optional array of "direct" or "programmatic"` + - `type: "direct"` - The tool invocation context(s). + The caller type. Always `direct`. - `"direct"` - - `"programmatic"` - - - `ProgrammaticToolCalling object { type }` - - - `type: "programmatic_tool_calling"` - - The type of the tool. Always `programmatic_tool_calling`. - - - `"programmatic_tool_calling"` - - - `ImageGeneration object { type, action, background, 9 more }` - - A tool that generates images using the GPT image models. - - - `type: "image_generation"` - - The type of the image generation tool. Always `image_generation`. - - - `"image_generation"` - - - `action: optional "generate" or "edit" or "auto"` - - Whether to generate a new image or edit an existing image. Default: `auto`. - - - `"generate"` - - - `"edit"` - - - `"auto"` - - - `background: optional "transparent" or "opaque" or "auto"` - - Background type for the generated image. One of `transparent`, - `opaque`, or `auto`. Default: `auto`. - - - `"transparent"` - - - `"opaque"` - - - `"auto"` - - - `input_fidelity: optional "high" or "low"` - - Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. - - - `"high"` - - - `"low"` - - - `input_image_mask: optional object { file_id, image_url }` - - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). - - - `file_id: optional string` - - File ID for the mask image. - - - `image_url: optional string` - - Base64-encoded mask image. - - - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - The image generation model to use. Default: `gpt-image-1`. + - `Program object { caller_id, type }` - - `string` + - `caller_id: string` - - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + The call ID of the program item that produced this tool call. - The image generation model to use. Default: `gpt-image-1`. + - `type: "program"` - - `"gpt-image-1"` + The caller type. Always `program`. - - `"gpt-image-1-mini"` + - `"program"` - - `"gpt-image-1.5"` + - `max_output_length: optional number` - - `moderation: optional "auto" or "low"` + The maximum number of UTF-8 characters captured for this shell call's combined output. - Moderation level for the generated image. Default: `auto`. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"auto"` + The status of the shell call output. - - `"low"` + - `"in_progress"` - - `output_compression: optional number` + - `"completed"` - Compression level for the output image. Default: 100. + - `"incomplete"` - - `output_format: optional "png" or "webp" or "jpeg"` + - `ApplyPatchCall object { call_id, operation, status, 4 more }` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + A tool call representing a request to create, delete, or update files using diff patches. - - `"png"` + - `call_id: string` - - `"webp"` + The unique ID of the apply patch tool call generated by the model. - - `"jpeg"` + - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` - - `partial_images: optional number` + The specific create, delete, or update instruction for the apply_patch tool call. - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `CreateFile object { diff, path, type }` - - `quality: optional "low" or "medium" or "high" or "auto"` + Instruction for creating a new file via the apply_patch tool. - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `diff: string` - - `"low"` + Unified diff content to apply when creating the file. - - `"medium"` + - `path: string` - - `"high"` + Path of the file to create relative to the workspace root. - - `"auto"` + - `type: "create_file"` - - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` + The operation type. Always `create_file`. - The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + - `"create_file"` - - `string` + - `DeleteFile object { path, type }` - - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` + Instruction for deleting an existing file via the apply_patch tool. - The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + - `path: string` - - `"1024x1024"` + Path of the file to delete relative to the workspace root. - - `"1024x1536"` + - `type: "delete_file"` - - `"1536x1024"` + The operation type. Always `delete_file`. - - `"auto"` + - `"delete_file"` - - `LocalShell object { type }` + - `UpdateFile object { diff, path, type }` - A tool that allows the model to execute shell commands in a local environment. + Instruction for updating an existing file via the apply_patch tool. - - `type: "local_shell"` + - `diff: string` - The type of the local shell tool. Always `local_shell`. + Unified diff content to apply to the existing file. - - `"local_shell"` + - `path: string` - - `Shell object { type, allowed_callers, environment }` + Path of the file to update relative to the workspace root. - A tool that allows the model to execute shell commands. + - `type: "update_file"` - - `type: "shell"` + The operation type. Always `update_file`. - The type of the shell tool. Always `shell`. + - `"update_file"` - - `"shell"` + - `status: "in_progress" or "completed"` - - `allowed_callers: optional array of "direct" or "programmatic"` + The status of the apply patch tool call. One of `in_progress` or `completed`. - The tool invocation context(s). + - `"in_progress"` - - `"direct"` + - `"completed"` - - `"programmatic"` + - `type: "apply_patch_call"` - - `environment: optional BetaContainerAuto or BetaLocalEnvironment or BetaContainerReference` + The type of the item. Always `apply_patch_call`. - - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` + - `"apply_patch_call"` - - `BetaLocalEnvironment object { type, skills }` + - `id: optional string` - - `BetaContainerReference object { container_id, type }` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `Custom object { name, type, allowed_callers, 3 more }` + - `agent: optional object { agent_name }` - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) + The agent that produced this item. - - `name: string` + - `agent_name: string` - The name of the custom tool, used to identify it in tool calls. + The canonical name of the agent that produced this item. - - `type: "custom"` + - `caller: optional object { type } or object { caller_id, type }` - The type of the custom tool. Always `custom`. + The execution context that produced this tool call. - - `"custom"` + - `Direct object { type }` - - `allowed_callers: optional array of "direct" or "programmatic"` + - `type: "direct"` - The tool invocation context(s). + The caller type. Always `direct`. - `"direct"` - - `"programmatic"` - - - `defer_loading: optional boolean` - - Whether this tool should be deferred and discovered via tool search. - - - `description: optional string` - - Optional description of the custom tool, used to provide more context. - - - `format: optional object { type } or object { definition, syntax, type }` - - The input format for the custom tool. Default is unconstrained text. - - - `Text object { type }` - - Unconstrained free-form text. - - - `type: "text"` - - Unconstrained text format. Always `text`. - - - `"text"` - - - `Grammar object { definition, syntax, type }` - - A grammar defined by the user. - - - `definition: string` - - The grammar definition. - - - `syntax: "lark" or "regex"` - - The syntax of the grammar definition. One of `lark` or `regex`. - - - `"lark"` - - - `"regex"` - - - `type: "grammar"` - - Grammar format. Always `grammar`. - - - `"grammar"` - - - `Namespace object { description, name, tools, type }` - - Groups function/custom tools under a shared namespace. - - - `description: string` - - A description of the namespace shown to the model. - - - `name: string` - - The namespace name used in tool calls (for example, `crm`). + - `Program object { caller_id, type }` - - `tools: array of object { name, type, allowed_callers, 5 more } or object { name, type, allowed_callers, 3 more }` + - `caller_id: string` - The function/custom tools available inside this namespace. + The call ID of the program item that produced this tool call. - - `Function object { name, type, allowed_callers, 5 more }` + - `type: "program"` - - `name: string` + The caller type. Always `program`. - - `type: "function"` + - `"program"` - - `"function"` + - `ApplyPatchCallOutput object { call_id, status, type, 4 more }` - - `allowed_callers: optional array of "direct" or "programmatic"` + The streamed output emitted by an apply patch tool call. - The tool invocation context(s). + - `call_id: string` - - `"direct"` + The unique ID of the apply patch tool call generated by the model. - - `"programmatic"` + - `status: "completed" or "failed"` - - `defer_loading: optional boolean` + The status of the apply patch tool call output. One of `completed` or `failed`. - Whether this function should be deferred and discovered via tool search. + - `"completed"` - - `description: optional string` + - `"failed"` - - `output_schema: optional map[unknown]` + - `type: "apply_patch_call_output"` - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. + The type of the item. Always `apply_patch_call_output`. - - `parameters: optional unknown` + - `"apply_patch_call_output"` - - `strict: optional boolean` + - `id: optional string` - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `Custom object { name, type, allowed_callers, 3 more }` + - `agent: optional object { agent_name }` - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) + The agent that produced this item. - - `name: string` + - `agent_name: string` - The name of the custom tool, used to identify it in tool calls. + The canonical name of the agent that produced this item. - - `type: "custom"` + - `caller: optional object { type } or object { caller_id, type }` - The type of the custom tool. Always `custom`. + The execution context that produced this tool call. - - `"custom"` + - `Direct object { type }` - - `allowed_callers: optional array of "direct" or "programmatic"` + - `type: "direct"` - The tool invocation context(s). + The caller type. Always `direct`. - `"direct"` - - `"programmatic"` - - - `defer_loading: optional boolean` - - Whether this tool should be deferred and discovered via tool search. - - - `description: optional string` - - Optional description of the custom tool, used to provide more context. - - - `format: optional object { type } or object { definition, syntax, type }` - - The input format for the custom tool. Default is unconstrained text. - - - `Text object { type }` - - Unconstrained free-form text. - - - `type: "text"` + - `Program object { caller_id, type }` - Unconstrained text format. Always `text`. + - `caller_id: string` - - `"text"` + The call ID of the program item that produced this tool call. - - `Grammar object { definition, syntax, type }` + - `type: "program"` - A grammar defined by the user. + The caller type. Always `program`. - - `definition: string` + - `"program"` - The grammar definition. + - `output: optional string` - - `syntax: "lark" or "regex"` + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - The syntax of the grammar definition. One of `lark` or `regex`. + - `McpListTools object { id, server_label, tools, 3 more }` - - `"lark"` + A list of tools available on an MCP server. - - `"regex"` + - `id: string` - - `type: "grammar"` + The unique ID of the list. - Grammar format. Always `grammar`. + - `server_label: string` - - `"grammar"` + The label of the MCP server. - - `type: "namespace"` + - `tools: array of object { input_schema, name, annotations, description }` - The type of the tool. Always `namespace`. + The tools available on the server. - - `"namespace"` + - `input_schema: unknown` - - `ToolSearch object { type, description, execution, parameters }` + The JSON schema describing the tool's input. - Hosted or BYOT tool search configuration for deferred tools. + - `name: string` - - `type: "tool_search"` + The name of the tool. - The type of the tool. Always `tool_search`. + - `annotations: optional unknown` - - `"tool_search"` + Additional annotations about the tool. - `description: optional string` - Description shown to the model for a client-executed tool search tool. - - - `execution: optional "server" or "client"` - - Whether tool search is executed by the server or by the client. - - - `"server"` - - - `"client"` - - - `parameters: optional unknown` - - Parameter schema for a client-executed tool search tool. + The description of the tool. - - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` + - `type: "mcp_list_tools"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The type of the item. Always `mcp_list_tools`. - - `type: "web_search_preview" or "web_search_preview_2025_03_11"` + - `"mcp_list_tools"` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `agent: optional object { agent_name }` - - `"web_search_preview"` + The agent that produced this item. - - `"web_search_preview_2025_03_11"` + - `agent_name: string` - - `search_content_types: optional array of "text" or "image"` + The canonical name of the agent that produced this item. - - `"text"` + - `error: optional string` - - `"image"` + Error message if the server could not list tools. - - `search_context_size: optional "low" or "medium" or "high"` + - `McpApprovalRequest object { id, arguments, name, 3 more }` - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + A request for human approval of a tool invocation. - - `"low"` + - `id: string` - - `"medium"` + The unique ID of the approval request. - - `"high"` + - `arguments: string` - - `user_location: optional object { type, city, country, 2 more }` + A JSON string of arguments for the tool. - The user's location. + - `name: string` - - `type: "approximate"` + The name of the tool to run. - The type of location approximation. Always `approximate`. + - `server_label: string` - - `"approximate"` + The label of the MCP server making the request. - - `city: optional string` + - `type: "mcp_approval_request"` - Free text input for the city of the user, e.g. `San Francisco`. + The type of the item. Always `mcp_approval_request`. - - `country: optional string` + - `"mcp_approval_request"` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `agent: optional object { agent_name }` - - `region: optional string` + The agent that produced this item. - Free text input for the region of the user, e.g. `California`. + - `agent_name: string` - - `timezone: optional string` + The canonical name of the agent that produced this item. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `McpApprovalResponse object { approval_request_id, approve, type, 3 more }` - - `ApplyPatch object { type, allowed_callers }` + A response to an MCP approval request. - Allows the assistant to create, delete, or update files using unified diffs. + - `approval_request_id: string` - - `type: "apply_patch"` + The ID of the approval request being answered. - The type of the tool. Always `apply_patch`. + - `approve: boolean` - - `"apply_patch"` + Whether the request was approved. - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `type: "additional_tools"` - - The type of the item. Always `additional_tools`. - - - `"additional_tools"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `Compaction object { id, encrypted_content, type, 2 more }` - - A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - - - `id: string` - - The unique ID of the compaction item. - - - `encrypted_content: string` - - The encrypted content that was produced by compaction. - - - `type: "compaction"` - - The type of the item. Always `compaction`. - - - `"compaction"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `created_by: optional string` - - The identifier of the actor that created the item. - - - `ImageGenerationCall object { id, result, status, 2 more }` - - An image generation request made by the model. - - - `id: string` - - The unique ID of the image generation call. - - - `result: string` - - The generated image encoded in base64. - - - `status: "in_progress" or "completed" or "generating" or "failed"` - - The status of the image generation call. - - - `"in_progress"` - - - `"completed"` - - - `"generating"` - - - `"failed"` - - - `type: "image_generation_call"` - - The type of the image generation call. Always `image_generation_call`. - - - `"image_generation_call"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `CodeInterpreterCall object { id, code, container_id, 4 more }` - - A tool call to run code. - - - `id: string` - - The unique ID of the code interpreter tool call. - - - `code: string` - - The code to run, or null if not available. - - - `container_id: string` - - The ID of the container used to run the code. - - - `outputs: array of object { logs, type } or object { type, url }` - - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. - - - `Logs object { logs, type }` - - The logs output from the code interpreter. - - - `logs: string` - - The logs output from the code interpreter. - - - `type: "logs"` - - The type of the output. Always `logs`. - - - `"logs"` - - - `Image object { type, url }` - - The image output from the code interpreter. - - - `type: "image"` - - The type of the output. Always `image`. - - - `"image"` - - - `url: string` - - The URL of the image output from the code interpreter. - - - `status: "in_progress" or "completed" or "incomplete" or 2 more` - - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `"interpreting"` - - - `"failed"` - - - `type: "code_interpreter_call"` - - The type of the code interpreter tool call. Always `code_interpreter_call`. - - - `"code_interpreter_call"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `LocalShellCall object { id, action, call_id, 3 more }` - - A tool call to run a command on the local shell. - - - `id: string` - - The unique ID of the local shell call. - - - `action: object { command, env, type, 3 more }` - - Execute a shell command on the server. - - - `command: array of string` - - The command to run. - - - `env: map[string]` - - Environment variables to set for the command. - - - `type: "exec"` - - The type of the local shell action. Always `exec`. - - - `"exec"` - - - `timeout_ms: optional number` - - Optional timeout in milliseconds for the command. - - - `user: optional string` - - Optional user to run the command as. - - - `working_directory: optional string` - - Optional working directory to run the command in. - - - `call_id: string` - - The unique ID of the local shell tool call generated by the model. - - - `status: "in_progress" or "completed" or "incomplete"` - - The status of the local shell call. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `type: "local_shell_call"` - - The type of the local shell call. Always `local_shell_call`. - - - `"local_shell_call"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `LocalShellCallOutput object { id, output, type, 2 more }` - - The output of a local shell tool call. - - - `id: string` - - The unique ID of the local shell tool call generated by the model. - - - `output: string` - - A JSON string of the output of the local shell tool call. - - - `type: "local_shell_call_output"` - - The type of the local shell tool call output. Always `local_shell_call_output`. - - - `"local_shell_call_output"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `status: optional "in_progress" or "completed" or "incomplete"` - - The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `ShellCall object { id, action, call_id, 6 more }` - - A tool call that executes one or more shell commands in a managed environment. - - - `id: string` - - The unique ID of the shell tool call. Populated when this item is returned via API. - - - `action: object { commands, max_output_length, timeout_ms }` - - The shell commands and limits that describe how to run the tool call. - - - `commands: array of string` - - - `max_output_length: number` - - Optional maximum number of characters to return from each command. - - - `timeout_ms: number` - - Optional timeout in milliseconds for the commands. - - - `call_id: string` - - The unique ID of the shell tool call generated by the model. - - - `environment: BetaResponseLocalEnvironment or BetaResponseContainerReference` - - Represents the use of a local environment to perform shell actions. - - - `BetaResponseLocalEnvironment object { type }` - - Represents the use of a local environment to perform shell actions. - - - `type: "local"` - - The environment type. Always `local`. - - - `"local"` - - - `BetaResponseContainerReference object { container_id, type }` - - Represents a container created with /v1/containers. - - - `container_id: string` - - - `type: "container_reference"` - - The environment type. Always `container_reference`. - - - `"container_reference"` - - - `status: "in_progress" or "completed" or "incomplete"` - - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `type: "shell_call"` - - The type of the item. Always `shell_call`. - - - `"shell_call"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `caller: optional object { type } or object { caller_id, type }` - - The execution context that produced this tool call. - - - `Direct object { type }` - - - `type: "direct"` - - - `"direct"` - - - `Program object { caller_id, type }` - - - `caller_id: string` - - The call ID of the program item that produced this tool call. - - - `type: "program"` - - - `"program"` - - - `created_by: optional string` - - The ID of the entity that created this tool call. - - - `ShellCallOutput object { id, call_id, max_output_length, 6 more }` - - The output of a shell tool call that was emitted. - - - `id: string` - - The unique ID of the shell call output. Populated when this item is returned via API. - - - `call_id: string` - - The unique ID of the shell tool call generated by the model. - - - `max_output_length: number` - - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. - - - `output: array of object { outcome, stderr, stdout, created_by }` - - An array of shell call output contents - - - `outcome: object { type } or object { exit_code, type }` - - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - - - `Timeout object { type }` - - Indicates that the shell call exceeded its configured time limit. - - - `type: "timeout"` - - The outcome type. Always `timeout`. - - - `"timeout"` - - - `Exit object { exit_code, type }` - - Indicates that the shell commands finished and returned an exit code. - - - `exit_code: number` - - Exit code from the shell process. - - - `type: "exit"` - - The outcome type. Always `exit`. - - - `"exit"` - - - `stderr: string` - - The standard error output that was captured. - - - `stdout: string` - - The standard output that was captured. - - - `created_by: optional string` - - The identifier of the actor that created the item. - - - `status: "in_progress" or "completed" or "incomplete"` - - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `type: "shell_call_output"` - - The type of the shell call output. Always `shell_call_output`. - - - `"shell_call_output"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `caller: optional object { type } or object { caller_id, type }` - - The execution context that produced this tool call. - - - `Direct object { type }` - - - `type: "direct"` - - - `"direct"` - - - `Program object { caller_id, type }` - - - `caller_id: string` - - The call ID of the program item that produced this tool call. - - - `type: "program"` - - - `"program"` - - - `created_by: optional string` - - The identifier of the actor that created the item. - - - `ApplyPatchCall object { id, call_id, operation, 5 more }` - - A tool call that applies file diffs by creating, deleting, or updating files. - - - `id: string` - - The unique ID of the apply patch tool call. Populated when this item is returned via API. - - - `call_id: string` - - The unique ID of the apply patch tool call generated by the model. - - - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` - - One of the create_file, delete_file, or update_file operations applied via apply_patch. - - - `CreateFile object { diff, path, type }` - - Instruction describing how to create a file via the apply_patch tool. - - - `diff: string` - - Diff to apply. - - - `path: string` - - Path of the file to create. - - - `type: "create_file"` - - Create a new file with the provided diff. - - - `"create_file"` - - - `DeleteFile object { path, type }` - - Instruction describing how to delete a file via the apply_patch tool. - - - `path: string` - - Path of the file to delete. - - - `type: "delete_file"` - - Delete the specified file. - - - `"delete_file"` - - - `UpdateFile object { diff, path, type }` - - Instruction describing how to update a file via the apply_patch tool. - - - `diff: string` - - Diff to apply. - - - `path: string` - - Path of the file to update. - - - `type: "update_file"` - - Update an existing file with the provided diff. - - - `"update_file"` - - - `status: "in_progress" or "completed"` - - The status of the apply patch tool call. One of `in_progress` or `completed`. - - - `"in_progress"` - - - `"completed"` - - - `type: "apply_patch_call"` - - The type of the item. Always `apply_patch_call`. - - - `"apply_patch_call"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `caller: optional object { type } or object { caller_id, type }` - - The execution context that produced this tool call. - - - `Direct object { type }` - - - `type: "direct"` - - - `"direct"` - - - `Program object { caller_id, type }` - - - `caller_id: string` - - The call ID of the program item that produced this tool call. - - - `type: "program"` - - - `"program"` - - - `created_by: optional string` - - The ID of the entity that created this tool call. - - - `ApplyPatchCallOutput object { id, call_id, status, 5 more }` - - The output emitted by an apply patch tool call. - - - `id: string` - - The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - - `call_id: string` - - The unique ID of the apply patch tool call generated by the model. - - - `status: "completed" or "failed"` - - The status of the apply patch tool call output. One of `completed` or `failed`. - - - `"completed"` - - - `"failed"` - - - `type: "apply_patch_call_output"` - - The type of the item. Always `apply_patch_call_output`. - - - `"apply_patch_call_output"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `caller: optional object { type } or object { caller_id, type }` - - The execution context that produced this tool call. - - - `Direct object { type }` - - - `type: "direct"` - - - `"direct"` - - - `Program object { caller_id, type }` - - - `caller_id: string` - - The call ID of the program item that produced this tool call. - - - `type: "program"` - - - `"program"` - - - `created_by: optional string` - - The ID of the entity that created this tool call output. - - - `output: optional string` - - Optional textual output returned by the apply patch tool. - - - `McpCall object { id, arguments, name, 7 more }` - - An invocation of a tool on an MCP server. - - - `id: string` - - The unique ID of the tool call. - - - `arguments: string` - - A JSON string of the arguments passed to the tool. - - - `name: string` - - The name of the tool that was run. - - - `server_label: string` - - The label of the MCP server running the tool. - - - `type: "mcp_call"` - - The type of the item. Always `mcp_call`. - - - `"mcp_call"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `approval_request_id: optional string` - - Unique identifier for the MCP tool call approval request. - Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call. - - - `error: optional string` - - The error from the tool call, if any. - - - `output: optional string` - - The output from the tool call. - - - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` - - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `"calling"` - - - `"failed"` - - - `McpListTools object { id, server_label, tools, 3 more }` - - A list of tools available on an MCP server. - - - `id: string` - - The unique ID of the list. - - - `server_label: string` - - The label of the MCP server. - - - `tools: array of object { input_schema, name, annotations, description }` - - The tools available on the server. - - - `input_schema: unknown` - - The JSON schema describing the tool's input. - - - `name: string` - - The name of the tool. - - - `annotations: optional unknown` - - Additional annotations about the tool. - - - `description: optional string` - - The description of the tool. - - - `type: "mcp_list_tools"` - - The type of the item. Always `mcp_list_tools`. - - - `"mcp_list_tools"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `error: optional string` - - Error message if the server could not list tools. - - - `McpApprovalRequest object { id, arguments, name, 3 more }` - - A request for human approval of a tool invocation. - - - `id: string` - - The unique ID of the approval request. - - - `arguments: string` - - A JSON string of arguments for the tool. - - - `name: string` - - The name of the tool to run. - - - `server_label: string` - - The label of the MCP server making the request. - - - `type: "mcp_approval_request"` - - The type of the item. Always `mcp_approval_request`. - - - `"mcp_approval_request"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `McpApprovalResponse object { id, approval_request_id, approve, 3 more }` - - A response to an MCP approval request. - - - `id: string` - - The unique ID of the approval response - - - `approval_request_id: string` - - The ID of the approval request being answered. - - - `approve: boolean` - - Whether the request was approved. - - - `type: "mcp_approval_response"` + - `type: "mcp_approval_response"` The type of the item. Always `mcp_approval_response`. - - `"mcp_approval_response"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `reason: optional string` - - Optional reason for the decision. - - - `CustomToolCall object { call_id, input, name, 5 more }` - - A call to a custom tool created by the model. - - - `call_id: string` - - An identifier used to map this custom tool call to a tool call output. - - - `input: string` - - The input for the custom tool call generated by the model. - - - `name: string` - - The name of the custom tool being called. - - - `type: "custom_tool_call"` - - The type of the custom tool call. Always `custom_tool_call`. - - - `"custom_tool_call"` - - - `id: optional string` - - The unique ID of the custom tool call in the OpenAI platform. - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `caller: optional object { type } or object { caller_id, type }` - - The execution context that produced this tool call. - - - `Direct object { type }` - - - `type: "direct"` - - - `"direct"` - - - `Program object { caller_id, type }` - - - `caller_id: string` - - The call ID of the program item that produced this tool call. - - - `type: "program"` - - - `"program"` - - - `namespace: optional string` - - The namespace of the custom tool being called. - - - `CustomToolCallOutput object { id, call_id, output, 5 more }` - - - `id: string` - - The unique ID of the custom tool call output item. - - - `call_id: string` - - The call ID, used to map this custom tool call output to a custom tool call. - - - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - - The output from the custom tool call generated by your code. - Can be a string or an list of output content. - - - `StringOutput = string` - - A string of the output of the custom tool call. - - - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - - Text, image, or file output of the custom tool call. - - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - A text input to the model. - - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - - An image input to the model. Learn about [image inputs](/docs/guides/vision). - - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - - A file input to the model. - - - `status: "in_progress" or "completed" or "incomplete"` - - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `type: "custom_tool_call_output"` - - The type of the custom tool call output. Always `custom_tool_call_output`. - - - `"custom_tool_call_output"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `caller: optional object { type } or object { caller_id, type }` - - The execution context that produced this tool call. - - - `Direct object { type }` - - - `type: "direct"` - - The caller type. Always `direct`. - - - `"direct"` - - - `Program object { caller_id, type }` - - - `caller_id: string` - - The call ID of the program item that produced this tool call. - - - `type: "program"` - - The caller type. Always `program`. - - - `"program"` - - - `created_by: optional string` - - The identifier of the actor that created the item. - - - `parallel_tool_calls: boolean` - - Whether to allow the model to run tool calls in parallel. - - - `temperature: number` - - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. - - - `tool_choice: BetaToolChoiceOptions or BetaToolChoiceAllowed or BetaToolChoiceTypes or 6 more` - - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. - - - `BetaToolChoiceOptions = "none" or "auto" or "required"` - - Controls which (if any) tool is called by the model. - - `none` means the model will not call any tool and instead generates a message. - - `auto` means the model can pick between generating a message or calling one or - more tools. - - `required` means the model must call one or more tools. - - - `"none"` - - - `"auto"` - - - `"required"` - - - `BetaToolChoiceAllowed object { mode, tools, type }` - - Constrains the tools available to the model to a pre-defined set. - - - `mode: "auto" or "required"` - - Constrains the tools available to the model to a pre-defined set. - - `auto` allows the model to pick from among the allowed tools and generate a - message. - - `required` requires the model to call one or more of the allowed tools. - - - `"auto"` - - - `"required"` - - - `tools: array of map[unknown]` - - A list of tool definitions that the model should be allowed to call. - - For the Responses API, the list of tool definitions might look like: - - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` - - - `type: "allowed_tools"` - - Allowed tool configuration type. Always `allowed_tools`. - - - `"allowed_tools"` - - - `BetaToolChoiceTypes object { type }` - - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](/docs/guides/tools). - - - `type: "file_search" or "web_search_preview" or "computer" or 5 more` - - The type of hosted tool the model should to use. Learn more about - [built-in tools](/docs/guides/tools). - - Allowed values are: - - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` - - - `"file_search"` - - - `"web_search_preview"` - - - `"computer"` - - - `"computer_use_preview"` - - - `"computer_use"` - - - `"web_search_preview_2025_03_11"` - - - `"image_generation"` - - - `"code_interpreter"` - - - `BetaToolChoiceFunction object { name, type }` - - Use this option to force the model to call a specific function. - - - `name: string` - - The name of the function to call. - - - `type: "function"` - - For function calling, the type is always `function`. - - - `"function"` - - - `BetaToolChoiceMcp object { server_label, type, name }` - - Use this option to force the model to call a specific tool on a remote MCP server. - - - `server_label: string` - - The label of the MCP server to use. - - - `type: "mcp"` - - For MCP tools, the type is always `mcp`. - - - `"mcp"` - - - `name: optional string` - - The name of the tool to call on the server. - - - `BetaToolChoiceCustom object { name, type }` - - Use this option to force the model to call a specific custom tool. - - - `name: string` - - The name of the custom tool to call. - - - `type: "custom"` - - For custom tool calling, the type is always `custom`. - - - `"custom"` - - - `BetaSpecificProgrammaticToolCallingParam object { type }` - - - `type: "programmatic_tool_calling"` - - The tool to call. Always `programmatic_tool_calling`. - - - `"programmatic_tool_calling"` - - - `BetaToolChoiceApplyPatch object { type }` - - Forces the model to call the apply_patch tool when executing a tool call. - - - `type: "apply_patch"` - - The tool to call. Always `apply_patch`. - - - `"apply_patch"` - - - `BetaToolChoiceShell object { type }` - - Forces the model to call the shell tool when a tool call is required. - - - `type: "shell"` - - The tool to call. Always `shell`. - - - `"shell"` - - - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. - - We support the following categories of tools: - - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](/docs/guides/tools-web-search) - or [file search](/docs/guides/tools-file-search). Learn more about - [built-in tools](/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](/docs/guides/function-calling). You can also use - custom tools to call your own code. - - - `Function object { name, parameters, strict, 5 more }` - - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - - `name: string` - - The name of the function to call. - - - `parameters: map[unknown]` - - A JSON schema object describing the parameters of the function. - - - `strict: boolean` - - Whether strict parameter validation is enforced for this function tool. - - - `type: "function"` - - The type of the function tool. Always `function`. - - - `"function"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `defer_loading: optional boolean` - - Whether this function is deferred and loaded via tool search. - - - `description: optional string` - - A description of the function. Used by the model to determine whether or not to call the function. - - - `output_schema: optional map[unknown]` - - A JSON schema object describing the JSON value encoded in string outputs for this function. - - - `FileSearch object { type, vector_store_ids, filters, 2 more }` - - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - - `type: "file_search"` - - The type of the file search tool. Always `file_search`. - - - `"file_search"` - - - `vector_store_ids: array of string` - - The IDs of the vector stores to search. - - - `filters: optional object { key, type, value } or object { filters, type }` - - A filter to apply. - - - `ComparisonFilter object { key, type, value }` - - A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - - `key: string` - - The key to compare against the value. - - - `type: "eq" or "ne" or "gt" or 5 more` - - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in - - - `"eq"` - - - `"ne"` - - - `"gt"` - - - `"gte"` - - - `"lt"` - - - `"lte"` - - - `"in"` - - - `"nin"` - - - `value: string or number or boolean or array of string or number` - - The value to compare against the attribute key; supports string, number, or boolean types. - - - `string` - - - `number` - - - `boolean` - - - `array of string or number` - - - `string` - - - `number` - - - `CompoundFilter object { filters, type }` - - Combine multiple filters using `and` or `or`. - - - `filters: array of object { key, type, value } or unknown` - - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - - `ComparisonFilter object { key, type, value }` - - A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - - `key: string` - - The key to compare against the value. - - - `type: "eq" or "ne" or "gt" or 5 more` - - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in - - - `"eq"` - - - `"ne"` - - - `"gt"` - - - `"gte"` - - - `"lt"` - - - `"lte"` - - - `"in"` - - - `"nin"` - - - `value: string or number or boolean or array of string or number` - - The value to compare against the attribute key; supports string, number, or boolean types. - - - `string` - - - `number` - - - `boolean` - - - `array of string or number` - - - `string` - - - `number` - - - `unknown` - - - `type: "and" or "or"` - - Type of operation: `and` or `or`. - - - `"and"` - - - `"or"` - - - `max_num_results: optional number` - - The maximum number of results to return. This number should be between 1 and 50 inclusive. - - - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` - - Ranking options for search. - - - `hybrid_search: optional object { embedding_weight, text_weight }` - - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - - `embedding_weight: number` - - The weight of the embedding in the reciprocal ranking fusion. - - - `text_weight: number` - - The weight of the text in the reciprocal ranking fusion. - - - `ranker: optional "auto" or "default-2024-11-15"` - - The ranker to use for the file search. - - - `"auto"` - - - `"default-2024-11-15"` - - - `score_threshold: optional number` - - The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. - - - `Computer object { type }` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `type: "computer"` - - The type of the computer tool. Always `computer`. - - - `"computer"` - - - `ComputerUsePreview object { display_height, display_width, environment, type }` - - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - - `display_height: number` - - The height of the computer display. - - - `display_width: number` - - The width of the computer display. - - - `environment: "windows" or "mac" or "linux" or 2 more` - - The type of computer environment to control. - - - `"windows"` - - - `"mac"` - - - `"linux"` - - - `"ubuntu"` - - - `"browser"` - - - `type: "computer_use_preview"` - - The type of the computer use tool. Always `computer_use_preview`. - - - `"computer_use_preview"` - - - `WebSearch object { type, filters, search_context_size, user_location }` - - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](/docs/guides/tools-web-search). - - - `type: "web_search" or "web_search_2025_08_26"` - - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - - `"web_search"` - - - `"web_search_2025_08_26"` - - - `filters: optional object { allowed_domains }` - - Filters for the search. - - - `allowed_domains: optional array of string` - - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. - - Example: `["pubmed.ncbi.nlm.nih.gov"]` - - - `search_context_size: optional "low" or "medium" or "high"` - - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - - - `"low"` - - - `"medium"` - - - `"high"` - - - `user_location: optional object { city, country, region, 2 more }` - - The approximate location of the user. - - - `city: optional string` - - Free text input for the city of the user, e.g. `San Francisco`. - - - `country: optional string` - - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - - `region: optional string` - - Free text input for the region of the user, e.g. `California`. - - - `timezone: optional string` - - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - - `type: optional "approximate"` - - The type of location approximation. Always `approximate`. - - - `"approximate"` - - - `Mcp object { server_label, type, allowed_callers, 9 more }` - - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). - - - `server_label: string` - - A label for this MCP server, used to identify it in tool calls. - - - `type: "mcp"` - - The type of the MCP tool. Always `mcp`. - - - `"mcp"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `allowed_tools: optional array of string or object { read_only, tool_names }` - - List of allowed tool names or a filter object. - - - `McpAllowedTools = array of string` - - A string array of allowed tool names - - - `McpToolFilter object { read_only, tool_names }` - - A filter object to specify which tools are allowed. - - - `read_only: optional boolean` - - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. - - - `tool_names: optional array of string` - - List of allowed tool names. - - - `authorization: optional string` - - An OAuth access token that can be used with a remote MCP server, either - with a custom MCP server URL or a service connector. Your application - must handle the OAuth authorization flow and provide the token here. - - - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` - - Identifier for service connectors, like those available in ChatGPT. One of - `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more - about service connectors [here](/docs/guides/tools-remote-mcp#connectors). - - Currently supported `connector_id` values are: - - - Dropbox: `connector_dropbox` - - Gmail: `connector_gmail` - - Google Calendar: `connector_googlecalendar` - - Google Drive: `connector_googledrive` - - Microsoft Teams: `connector_microsoftteams` - - Outlook Calendar: `connector_outlookcalendar` - - Outlook Email: `connector_outlookemail` - - SharePoint: `connector_sharepoint` - - - `"connector_dropbox"` - - - `"connector_gmail"` - - - `"connector_googlecalendar"` - - - `"connector_googledrive"` - - - `"connector_microsoftteams"` - - - `"connector_outlookcalendar"` - - - `"connector_outlookemail"` - - - `"connector_sharepoint"` - - - `defer_loading: optional boolean` - - Whether this MCP tool is deferred and discovered via tool search. - - - `headers: optional map[string]` - - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. - - - `require_approval: optional object { always, never } or "always" or "never"` - - Specify which of the MCP server's tools require approval. - - - `McpToolApprovalFilter object { always, never }` - - 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 object { read_only, tool_names }` - - A filter object to specify which tools are allowed. - - - `read_only: optional boolean` - - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. - - - `tool_names: optional array of string` - - List of allowed tool names. - - - `never: optional object { read_only, tool_names }` - - A filter object to specify which tools are allowed. - - - `read_only: optional boolean` - - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. - - - `tool_names: optional array of string` - - List of allowed tool names. - - - `McpToolApprovalSetting = "always" or "never"` - - Specify a single approval policy for all tools. One of `always` or - `never`. When set to `always`, all tools will require approval. When - set to `never`, all tools will not require approval. - - - `"always"` - - - `"never"` - - - `server_description: optional string` - - Optional description of the MCP server, used to provide more context. - - - `server_url: optional string` - - The URL for the MCP server. One of `server_url`, `connector_id`, or - `tunnel_id` must be provided. - - - `tunnel_id: optional string` - - The Secure MCP Tunnel ID to use instead of a direct server URL. One of - `server_url`, `connector_id`, or `tunnel_id` must be provided. - - - `CodeInterpreter object { container, type, allowed_callers }` - - A tool that runs Python code to help generate a response to a prompt. - - - `container: string or object { type, file_ids, memory_limit, network_policy }` - - The code interpreter container. Can be a container ID or an object that - specifies uploaded file IDs to make available to your code, along with an - optional `memory_limit` setting. - - - `string` - - The container ID. - - - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` - - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - - `type: "auto"` - - Always `auto`. - - - `"auto"` - - - `file_ids: optional array of string` - - An optional list of uploaded files to make available to your code. - - - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - The memory limit for the code interpreter container. - - - `"1g"` - - - `"4g"` - - - `"16g"` - - - `"64g"` - - - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` - - Network access policy for the container. - - - `BetaContainerNetworkPolicyDisabled object { type }` - - - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - - `type: "code_interpreter"` - - The type of the code interpreter tool. Always `code_interpreter`. - - - `"code_interpreter"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `ProgrammaticToolCalling object { type }` - - - `type: "programmatic_tool_calling"` - - The type of the tool. Always `programmatic_tool_calling`. - - - `"programmatic_tool_calling"` - - - `ImageGeneration object { type, action, background, 9 more }` - - A tool that generates images using the GPT image models. - - - `type: "image_generation"` - - The type of the image generation tool. Always `image_generation`. - - - `"image_generation"` - - - `action: optional "generate" or "edit" or "auto"` - - Whether to generate a new image or edit an existing image. Default: `auto`. - - - `"generate"` - - - `"edit"` - - - `"auto"` - - - `background: optional "transparent" or "opaque" or "auto"` - - Background type for the generated image. One of `transparent`, - `opaque`, or `auto`. Default: `auto`. - - - `"transparent"` - - - `"opaque"` - - - `"auto"` - - - `input_fidelity: optional "high" or "low"` - - Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. - - - `"high"` - - - `"low"` - - - `input_image_mask: optional object { file_id, image_url }` - - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). - - - `file_id: optional string` - - File ID for the mask image. - - - `image_url: optional string` - - Base64-encoded mask image. - - - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - The image generation model to use. Default: `gpt-image-1`. - - - `string` - - - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - The image generation model to use. Default: `gpt-image-1`. - - - `"gpt-image-1"` - - - `"gpt-image-1-mini"` - - - `"gpt-image-1.5"` - - - `moderation: optional "auto" or "low"` - - Moderation level for the generated image. Default: `auto`. - - - `"auto"` - - - `"low"` - - - `output_compression: optional number` - - Compression level for the output image. Default: 100. - - - `output_format: optional "png" or "webp" or "jpeg"` - - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. - - - `"png"` - - - `"webp"` - - - `"jpeg"` - - - `partial_images: optional number` - - Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - - `quality: optional "low" or "medium" or "high" or "auto"` - - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"auto"` - - - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. - - - `string` - - - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. - - - `"1024x1024"` - - - `"1024x1536"` - - - `"1536x1024"` - - - `"auto"` - - - `LocalShell object { type }` - - A tool that allows the model to execute shell commands in a local environment. - - - `type: "local_shell"` - - The type of the local shell tool. Always `local_shell`. - - - `"local_shell"` - - - `Shell object { type, allowed_callers, environment }` - - A tool that allows the model to execute shell commands. - - - `type: "shell"` - - The type of the shell tool. Always `shell`. - - - `"shell"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `environment: optional BetaContainerAuto or BetaLocalEnvironment or BetaContainerReference` - - - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` - - - `BetaLocalEnvironment object { type, skills }` - - - `BetaContainerReference object { container_id, type }` - - - `Custom object { name, type, allowed_callers, 3 more }` - - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - - `name: string` - - The name of the custom tool, used to identify it in tool calls. - - - `type: "custom"` - - The type of the custom tool. Always `custom`. - - - `"custom"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `defer_loading: optional boolean` - - Whether this tool should be deferred and discovered via tool search. - - - `description: optional string` - - Optional description of the custom tool, used to provide more context. - - - `format: optional object { type } or object { definition, syntax, type }` - - The input format for the custom tool. Default is unconstrained text. - - - `Text object { type }` - - Unconstrained free-form text. - - - `type: "text"` - - Unconstrained text format. Always `text`. - - - `"text"` - - - `Grammar object { definition, syntax, type }` - - A grammar defined by the user. - - - `definition: string` - - The grammar definition. - - - `syntax: "lark" or "regex"` - - The syntax of the grammar definition. One of `lark` or `regex`. - - - `"lark"` - - - `"regex"` - - - `type: "grammar"` - - Grammar format. Always `grammar`. - - - `"grammar"` - - - `Namespace object { description, name, tools, type }` - - Groups function/custom tools under a shared namespace. - - - `description: string` - - A description of the namespace shown to the model. - - - `name: string` - - The namespace name used in tool calls (for example, `crm`). - - - `tools: array of object { name, type, allowed_callers, 5 more } or object { name, type, allowed_callers, 3 more }` - - The function/custom tools available inside this namespace. - - - `Function object { name, type, allowed_callers, 5 more }` - - - `name: string` - - - `type: "function"` - - - `"function"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `defer_loading: optional boolean` - - Whether this function should be deferred and discovered via tool search. - - - `description: optional string` - - - `output_schema: optional map[unknown]` - - A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - - `parameters: optional unknown` - - - `strict: optional boolean` - - Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - - - `Custom object { name, type, allowed_callers, 3 more }` - - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - - `name: string` - - The name of the custom tool, used to identify it in tool calls. - - - `type: "custom"` - - The type of the custom tool. Always `custom`. - - - `"custom"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `defer_loading: optional boolean` - - Whether this tool should be deferred and discovered via tool search. - - - `description: optional string` - - Optional description of the custom tool, used to provide more context. - - - `format: optional object { type } or object { definition, syntax, type }` - - The input format for the custom tool. Default is unconstrained text. - - - `Text object { type }` - - Unconstrained free-form text. - - - `type: "text"` - - Unconstrained text format. Always `text`. - - - `"text"` - - - `Grammar object { definition, syntax, type }` - - A grammar defined by the user. - - - `definition: string` - - The grammar definition. - - - `syntax: "lark" or "regex"` - - The syntax of the grammar definition. One of `lark` or `regex`. - - - `"lark"` - - - `"regex"` - - - `type: "grammar"` - - Grammar format. Always `grammar`. - - - `"grammar"` - - - `type: "namespace"` - - The type of the tool. Always `namespace`. - - - `"namespace"` - - - `ToolSearch object { type, description, execution, parameters }` - - Hosted or BYOT tool search configuration for deferred tools. - - - `type: "tool_search"` - - The type of the tool. Always `tool_search`. - - - `"tool_search"` - - - `description: optional string` - - Description shown to the model for a client-executed tool search tool. - - - `execution: optional "server" or "client"` - - Whether tool search is executed by the server or by the client. - - - `"server"` - - - `"client"` - - - `parameters: optional unknown` - - Parameter schema for a client-executed tool search tool. - - - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` - - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - - `type: "web_search_preview" or "web_search_preview_2025_03_11"` - - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - - `"web_search_preview"` - - - `"web_search_preview_2025_03_11"` - - - `search_content_types: optional array of "text" or "image"` - - - `"text"` - - - `"image"` - - - `search_context_size: optional "low" or "medium" or "high"` - - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - - - `"low"` - - - `"medium"` - - - `"high"` - - - `user_location: optional object { type, city, country, 2 more }` - - The user's location. - - - `type: "approximate"` - - The type of location approximation. Always `approximate`. - - - `"approximate"` - - - `city: optional string` - - Free text input for the city of the user, e.g. `San Francisco`. - - - `country: optional string` - - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - - `region: optional string` - - Free text input for the region of the user, e.g. `California`. - - - `timezone: optional string` - - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - - `ApplyPatch object { type, allowed_callers }` - - Allows the assistant to create, delete, or update files using unified diffs. - - - `type: "apply_patch"` - - The type of the tool. Always `apply_patch`. - - - `"apply_patch"` - - - `allowed_callers: optional array of "direct" or "programmatic"` - - The tool invocation context(s). - - - `"direct"` - - - `"programmatic"` - - - `top_p: number` - - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. - - We generally recommend altering this or `temperature` but not both. - - - `background: optional boolean` - - Whether to run the model response in the background. - [Learn more](/docs/guides/background). - - - `completed_at: optional number` - - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. - - - `conversation: optional object { id }` - - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - - - `id: string` - - The unique ID of the conversation that this response was associated with. - - - `max_output_tokens: optional number` - - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning). - - - `max_tool_calls: optional number` - - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - - `moderation: optional object { input, output }` - - Moderation results for the response input and output, if moderated completions were requested. - - - `input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }` - - Moderation for the response input. - - - `ModerationResult object { categories, category_applied_input_types, category_scores, 3 more }` - - A moderation result produced for the response input or output. - - - `categories: map[boolean]` - - A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - - `category_applied_input_types: map[array of "text" or "image"]` - - Which modalities of input are reflected by the score for each category. - - - `"text"` - - - `"image"` - - - `category_scores: map[number]` - - A dictionary of moderation categories to scores. - - - `flagged: boolean` - - A boolean indicating whether the content was flagged by any category. - - - `model: string` - - The moderation model that produced this result. - - - `type: "moderation_result"` - - The object type, which was always `moderation_result` for successful moderation results. - - - `"moderation_result"` - - - `Error object { code, message, type }` - - An error produced while attempting moderation for the response input or output. - - - `code: string` - - The error code. - - - `message: string` - - The error message. - - - `type: "error"` - - The object type, which was always `error` for moderation failures. - - - `"error"` - - - `output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }` - - Moderation for the response output. - - - `ModerationResult object { categories, category_applied_input_types, category_scores, 3 more }` - - A moderation result produced for the response input or output. - - - `categories: map[boolean]` - - A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - - `category_applied_input_types: map[array of "text" or "image"]` - - Which modalities of input are reflected by the score for each category. - - - `"text"` - - - `"image"` - - - `category_scores: map[number]` - - A dictionary of moderation categories to scores. - - - `flagged: boolean` - - A boolean indicating whether the content was flagged by any category. - - - `model: string` - - The moderation model that produced this result. - - - `type: "moderation_result"` - - The object type, which was always `moderation_result` for successful moderation results. - - - `"moderation_result"` - - - `Error object { code, message, type }` - - An error produced while attempting moderation for the response input or output. - - - `code: string` - - The error code. - - - `message: string` - - The error message. - - - `type: "error"` - - The object type, which was always `error` for moderation failures. - - - `"error"` - - - `output_text: optional string` - - SDK-only convenience property that contains the aggregated text output - from all `output_text` items in the `output` array, if any are present. - Supported in the Python and JavaScript SDKs. - - - `previous_response_id: optional string` - - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - - - `prompt: optional BetaResponsePrompt` - - Reference to a prompt template and its variables. - [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts). - - - `id: string` - - The unique identifier of the prompt template to use. - - - `variables: optional map[string or BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile]` - - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. - - - `string` - - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - A text input to the model. - - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - - An image input to the model. Learn about [image inputs](/docs/guides/vision). - - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - - A file input to the model. - - - `version: optional string` - - Optional version of the prompt template. - - - `prompt_cache_key: optional string` - - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching). - - - `prompt_cache_options: optional object { mode, ttl }` - - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - - `mode: "implicit" or "explicit"` - - Whether implicit prompt-cache breakpoints were enabled. - - - `"implicit"` - - - `"explicit"` - - - `ttl: "30m"` - - The minimum lifetime applied to each cache breakpoint. - - - `"30m"` - - - `prompt_cache_retention: optional "in_memory" or "24h"` - - Deprecated. Use `prompt_cache_options.ttl` instead. - - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - - `"in_memory"` - - - `"24h"` - - - `reasoning: optional object { context, effort, generate_summary, 2 more }` - - **gpt-5 and o-series models only** - - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). - - - `context: optional "auto" or "current_turn" or "all_turns"` - - Controls which reasoning items are rendered back to the model on later turns. - If omitted or set to `auto`, the model determines the context mode. The - `gpt-5.6` model family defaults to `all_turns`; earlier models default to - `current_turn`. - - When returned on a response, this is the effective reasoning context mode - used for the response. - - - `"auto"` - - - `"current_turn"` - - - `"all_turns"` - - - `effort: optional "none" or "minimal" or "low" or 4 more` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - - - `generate_summary: optional "auto" or "concise" or "detailed"` - - **Deprecated:** use `summary` instead. - - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. - - - `"auto"` - - - `"concise"` - - - `"detailed"` - - - `mode: optional string or "standard" or "pro"` - - Controls the reasoning execution mode for the request. - - When returned on a response, this is the effective execution mode. - - - `string` - - - `"standard" or "pro"` - - Controls the reasoning execution mode for the request. - - When returned on a response, this is the effective execution mode. - - - `"standard"` - - - `"pro"` - - - `summary: optional "auto" or "concise" or "detailed"` - - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. - - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - - - `"auto"` - - - `"concise"` - - - `"detailed"` - - - `safety_identifier: optional string` - - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). - - - `service_tier: optional "auto" or "default" or "flex" or 2 more` - - Specifies the processing type used for serving the request. - - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. - - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - - `"auto"` - - - `"default"` - - - `"flex"` - - - `"scale"` - - - `"priority"` - - - `status: optional BetaResponseStatus` - - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - - - `"completed"` - - - `"failed"` - - - `"in_progress"` - - - `"cancelled"` - - - `"queued"` - - - `"incomplete"` - - - `text: optional BetaResponseTextConfig` - - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: - - - [Text inputs and outputs](/docs/guides/text) - - [Structured Outputs](/docs/guides/structured-outputs) - - - `format: optional BetaResponseFormatTextConfig` - - An object specifying the format that the model must output. - - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](/docs/guides/structured-outputs). - - The default format is `{ "type": "text" }` with no additional options. - - **Not recommended for gpt-4o and newer models:** - - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. - - - `Text object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `BetaResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `schema: map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `strict: optional boolean` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `JSONObject object { type }` - - 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: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `verbosity: optional "low" or "medium" or "high"` - - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. The default is - `medium`. - - - `"low"` - - - `"medium"` - - - `"high"` - - - `top_logprobs: optional number` - - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. - - - `truncation: optional "auto" or "disabled"` - - The truncation strategy to use for the model response. - - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. - - - `"auto"` - - - `"disabled"` - - - `usage: optional BetaResponseUsage` - - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. - - - `input_tokens: number` - - The number of input tokens. - - - `input_tokens_details: object { cache_write_tokens, cached_tokens }` - - A detailed breakdown of the input tokens. - - - `cache_write_tokens: number` - - The number of input tokens that were written to the cache. - - - `cached_tokens: number` - - The number of tokens that were retrieved from the cache. - [More on prompt caching](/docs/guides/prompt-caching). - - - `output_tokens: number` - - The number of output tokens. - - - `output_tokens_details: object { reasoning_tokens }` - - A detailed breakdown of the output tokens. - - - `reasoning_tokens: number` - - The number of reasoning tokens. - - - `total_tokens: number` - - The total number of tokens used. - - - `user: optional string` - - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). - -### Example - -```http -curl https://api.openai.com/v1/responses \ - -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.1", - "prompt_cache_key": "prompt-cache-key-1234", - "safety_identifier": "safety-identifier-1234", - "temperature": 1, - "top_p": 1, - "user": "user-1234" - }' -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "error": { - "code": "server_error", - "message": "message" - }, - "incomplete_details": { - "reason": "max_output_tokens" - }, - "instructions": "string", - "metadata": { - "foo": "string" - }, - "model": "gpt-5.1", - "object": "response", - "output": [ - { - "id": "id", - "content": [ - { - "annotations": [ - { - "file_id": "file_id", - "filename": "filename", - "index": 0, - "type": "file_citation" - } - ], - "logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0, - "top_logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0 - } - ] - } - ], - "text": "text", - "type": "output_text" - } - ], - "role": "assistant", - "status": "in_progress", - "type": "message", - "agent": { - "agent_name": "agent_name" - }, - "phase": "commentary" - } - ], - "parallel_tool_calls": true, - "temperature": 1, - "tool_choice": "none", - "tools": [ - { - "name": "name", - "parameters": { - "foo": "bar" - }, - "strict": true, - "type": "function", - "allowed_callers": [ - "direct" - ], - "defer_loading": true, - "description": "description", - "output_schema": { - "foo": "bar" - } - } - ], - "top_p": 1, - "background": true, - "completed_at": 0, - "conversation": { - "id": "id" - }, - "max_output_tokens": 0, - "max_tool_calls": 0, - "moderation": { - "input": { - "categories": { - "foo": true - }, - "category_applied_input_types": { - "foo": [ - "text" - ] - }, - "category_scores": { - "foo": 0 - }, - "flagged": true, - "model": "model", - "type": "moderation_result" - }, - "output": { - "categories": { - "foo": true - }, - "category_applied_input_types": { - "foo": [ - "text" - ] - }, - "category_scores": { - "foo": 0 - }, - "flagged": true, - "model": "model", - "type": "moderation_result" - } - }, - "output_text": "output_text", - "previous_response_id": "previous_response_id", - "prompt": { - "id": "id", - "variables": { - "foo": "string" - }, - "version": "version" - }, - "prompt_cache_key": "prompt-cache-key-1234", - "prompt_cache_options": { - "mode": "implicit", - "ttl": "30m" - }, - "prompt_cache_retention": "in_memory", - "reasoning": { - "context": "auto", - "effort": "none", - "generate_summary": "auto", - "mode": "standard", - "summary": "auto" - }, - "safety_identifier": "safety-identifier-1234", - "service_tier": "auto", - "status": "completed", - "text": { - "format": { - "type": "text" - }, - "verbosity": "low" - }, - "top_logprobs": 0, - "truncation": "auto", - "usage": { - "input_tokens": 0, - "input_tokens_details": { - "cache_write_tokens": 0, - "cached_tokens": 0 - }, - "output_tokens": 0, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 0 - }, - "user": "user-1234" -} -``` - -### Text input - -```http -curl https://api.openai.com/v1/responses \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.4", - "input": "Tell me a three sentence bedtime story about a unicorn." - }' -``` - -#### Response - -```json -{ - "id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b", - "object": "response", - "created_at": 1741476542, - "status": "completed", - "completed_at": 1741476543, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-5.4", - "output": [ - { - "type": "message", - "id": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b", - "status": "completed", - "role": "assistant", - "content": [ - { - "type": "output_text", - "text": "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.", - "annotations": [] - } - ] - } - ], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1.0, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1.0, - "truncation": "disabled", - "usage": { - "input_tokens": 36, - "input_tokens_details": { - "cached_tokens": 0, - "cache_write_tokens": 0 - }, - "output_tokens": 87, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 123 - }, - "user": null, - "metadata": {} -} -``` - -### Image input - -```http -curl https://api.openai.com/v1/responses \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.4", - "input": [ - { - "role": "user", - "content": [ - {"type": "input_text", "text": "what is in this image?"}, - { - "type": "input_image", - "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" - } - ] - } - ] - }' -``` - -#### Response - -```json -{ - "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41", - "object": "response", - "created_at": 1741476777, - "status": "completed", - "completed_at": 1741476778, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-5.4", - "output": [ - { - "type": "message", - "id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41", - "status": "completed", - "role": "assistant", - "content": [ - { - "type": "output_text", - "text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.", - "annotations": [] - } - ] - } - ], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1.0, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1.0, - "truncation": "disabled", - "usage": { - "input_tokens": 328, - "input_tokens_details": { - "cached_tokens": 0, - "cache_write_tokens": 0 - }, - "output_tokens": 52, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 380 - }, - "user": null, - "metadata": {} -} -``` - -### File input - -```http -curl https://api.openai.com/v1/responses \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.4", - "input": [ - { - "role": "user", - "content": [ - {"type": "input_text", "text": "what is in this file?"}, - { - "type": "input_file", - "file_url": "https://www.berkshirehathaway.com/letters/2024ltr.pdf", - "detail": "auto" - } - ] - } - ] - }' -``` - -#### Response - -```json -{ - "id": "resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86", - "object": "response", - "created_at": 1752100704, - "status": "completed", - "completed_at": 1752100705, - "background": false, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "max_tool_calls": null, - "model": "gpt-5.4", - "output": [ - { - "id": "msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86", - "type": "message", - "status": "completed", - "content": [ - { - "type": "output_text", - "annotations": [], - "logprobs": [], - "text": "The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:\n\n1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.\n\n2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.\n\n3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.\n\n4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.\n\n5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.\n\n6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.\n\n7. **Investment Strategy**: A breakdown of Berkshire\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.\n\n8. **American Capitalism**: Reflections on America\u2019s economic development and Berkshire\u2019s role within it.\n\n9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.\n\n10. **Japanese Investments**: Information about Berkshire\u2019s investments in Japanese companies and future plans.\n\n11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.\n\n12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.\n\n13. **Financial Performance Data**: Tables comparing Berkshire\u2019s annual performance to the S&P 500, showing impressive long-term gains.\n\nOverall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management." - } - ], - "role": "assistant" - } - ], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "service_tier": "default", - "store": true, - "temperature": 1.0, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_logprobs": 0, - "top_p": 1.0, - "truncation": "disabled", - "usage": { - "input_tokens": 8438, - "input_tokens_details": { - "cached_tokens": 0, - "cache_write_tokens": 0 - }, - "output_tokens": 398, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 8836 - }, - "user": null, - "metadata": {} -} -``` - -### Web search - -```http -curl https://api.openai.com/v1/responses \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.4", - "tools": [{ "type": "web_search_preview" }], - "input": "What was a positive news story from today?" - }' -``` - -#### Response - -```json -{ - "id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c", - "object": "response", - "created_at": 1741484430, - "status": "completed", - "completed_at": 1741484431, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-5.4", - "output": [ - { - "type": "web_search_call", - "id": "ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c", - "status": "completed" - }, - { - "type": "message", - "id": "msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c", - "status": "completed", - "role": "assistant", - "content": [ - { - "type": "output_text", - "text": "As of today, March 9, 2025, one notable positive news story...", - "annotations": [ - { - "type": "url_citation", - "start_index": 442, - "end_index": 557, - "url": "https://.../?utm_source=chatgpt.com", - "title": "..." - }, - { - "type": "url_citation", - "start_index": 962, - "end_index": 1077, - "url": "https://.../?utm_source=chatgpt.com", - "title": "..." - }, - { - "type": "url_citation", - "start_index": 1336, - "end_index": 1451, - "url": "https://.../?utm_source=chatgpt.com", - "title": "..." - } - ] - } - ] - } - ], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1.0, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [ - { - "type": "web_search_preview", - "domains": [], - "search_context_size": "medium", - "user_location": { - "type": "approximate", - "city": null, - "country": "US", - "region": null, - "timezone": null - } - } - ], - "top_p": 1.0, - "truncation": "disabled", - "usage": { - "input_tokens": 328, - "input_tokens_details": { - "cached_tokens": 0, - "cache_write_tokens": 0 - }, - "output_tokens": 356, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 684 - }, - "user": null, - "metadata": {} -} -``` - -### File search - -```http -curl https://api.openai.com/v1/responses \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.4", - "tools": [{ - "type": "file_search", - "vector_store_ids": ["vs_1234567890"], - "max_num_results": 20 - }], - "input": "What are the attributes of an ancient brown dragon?" - }' -``` - -#### Response - -```json -{ - "id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7", - "object": "response", - "created_at": 1741485253, - "status": "completed", - "completed_at": 1741485254, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-5.4", - "output": [ - { - "type": "file_search_call", - "id": "fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7", - "status": "completed", - "queries": [ - "attributes of an ancient brown dragon" - ], - "results": null - }, - { - "type": "message", - "id": "msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7", - "status": "completed", - "role": "assistant", - "content": [ - { - "type": "output_text", - "text": "The attributes of an ancient brown dragon include...", - "annotations": [ - { - "type": "file_citation", - "index": 320, - "file_id": "file-4wDz5b167pAf72nx1h9eiN", - "filename": "dragons.pdf" - }, - { - "type": "file_citation", - "index": 576, - "file_id": "file-4wDz5b167pAf72nx1h9eiN", - "filename": "dragons.pdf" - }, - { - "type": "file_citation", - "index": 815, - "file_id": "file-4wDz5b167pAf72nx1h9eiN", - "filename": "dragons.pdf" - }, - { - "type": "file_citation", - "index": 815, - "file_id": "file-4wDz5b167pAf72nx1h9eiN", - "filename": "dragons.pdf" - }, - { - "type": "file_citation", - "index": 1030, - "file_id": "file-4wDz5b167pAf72nx1h9eiN", - "filename": "dragons.pdf" - }, - { - "type": "file_citation", - "index": 1030, - "file_id": "file-4wDz5b167pAf72nx1h9eiN", - "filename": "dragons.pdf" - }, - { - "type": "file_citation", - "index": 1156, - "file_id": "file-4wDz5b167pAf72nx1h9eiN", - "filename": "dragons.pdf" - }, - { - "type": "file_citation", - "index": 1225, - "file_id": "file-4wDz5b167pAf72nx1h9eiN", - "filename": "dragons.pdf" - } - ] - } - ] - } - ], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1.0, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [ - { - "type": "file_search", - "filters": null, - "max_num_results": 20, - "ranking_options": { - "ranker": "auto", - "score_threshold": 0.0 - }, - "vector_store_ids": [ - "vs_1234567890" - ] - } - ], - "top_p": 1.0, - "truncation": "disabled", - "usage": { - "input_tokens": 18307, - "input_tokens_details": { - "cached_tokens": 0, - "cache_write_tokens": 0 - }, - "output_tokens": 348, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 18655 - }, - "user": null, - "metadata": {} -} -``` - -### Streaming - -```http -curl https://api.openai.com/v1/responses \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.4", - "instructions": "You are a helpful assistant.", - "input": "Hello!", - "stream": true - }' -``` - -#### Response - -```json -event: response.created -data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} - -event: response.in_progress -data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} - -event: response.output_item.added -data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}} - -event: response.content_part.added -data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} - -event: response.output_text.delta -data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi"} - -... - -event: response.output_text.done -data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?"} - -event: response.content_part.done -data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}} - -event: response.output_item.done -data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}} - -event: response.completed -data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}} -``` - -### Functions - -```http -curl https://api.openai.com/v1/responses \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.4", - "input": "What is the weather like in Boston today?", - "tools": [ - { - "type": "function", - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": ["celsius", "fahrenheit"] - } - }, - "required": ["location", "unit"] - } - } - ], - "tool_choice": "auto" - }' -``` - -#### Response - -```json -{ - "id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0", - "object": "response", - "created_at": 1741294021, - "status": "completed", - "completed_at": 1741294022, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-5.4", - "output": [ - { - "type": "function_call", - "id": "fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0", - "call_id": "call_unLAR8MvFNptuiZK6K6HCy5k", - "name": "get_current_weather", - "arguments": "{\"location\":\"Boston, MA\",\"unit\":\"celsius\"}", - "status": "completed" - } - ], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1.0, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [ - { - "type": "function", - "description": "Get the current weather in a given location", - "name": "get_current_weather", - "parameters": { - "type": "object", - "properties": { - "location": { - "type": "string", - "description": "The city and state, e.g. San Francisco, CA" - }, - "unit": { - "type": "string", - "enum": [ - "celsius", - "fahrenheit" - ] - } - }, - "required": [ - "location", - "unit" - ] - }, - "strict": true - } - ], - "top_p": 1.0, - "truncation": "disabled", - "usage": { - "input_tokens": 291, - "output_tokens": 23, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 314 - }, - "user": null, - "metadata": {} -} -``` - -### Reasoning - -```http -curl https://api.openai.com/v1/responses \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "o3-mini", - "input": "How much wood would a woodchuck chuck?", - "reasoning": { - "effort": "high" - } - }' -``` - -#### Response - -```json -{ - "id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808", - "object": "response", - "created_at": 1741477868, - "status": "completed", - "completed_at": 1741477869, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "o1-2024-12-17", - "output": [ - { - "type": "message", - "id": "msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808", - "status": "completed", - "role": "assistant", - "content": [ - { - "type": "output_text", - "text": "The classic tongue twister...", - "annotations": [] - } - ] - } - ], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": "high", - "summary": null - }, - "store": true, - "temperature": 1.0, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1.0, - "truncation": "disabled", - "usage": { - "input_tokens": 81, - "input_tokens_details": { - "cached_tokens": 0, - "cache_write_tokens": 0 - }, - "output_tokens": 1035, - "output_tokens_details": { - "reasoning_tokens": 832 - }, - "total_tokens": 1116 - }, - "user": null, - "metadata": {} -} -``` - -## Get a model response - -**get** `/responses/{response_id}?beta=true` - -Retrieves a model response with the given ID. - -### Path Parameters - -- `response_id: string` - -### Query Parameters - -- `include: optional array of BetaResponseIncludable` - - Additional fields to include in the response. See the `include` - parameter for Response creation above for more information. - - - `"file_search_call.results"` - - - `"web_search_call.results"` - - - `"web_search_call.action.sources"` - - - `"message.input_image.image_url"` - - - `"computer_call_output.output.image_url"` - - - `"code_interpreter_call.outputs"` - - - `"reasoning.encrypted_content"` - - - `"message.output_text.logprobs"` - -- `include_obfuscation: optional boolean` - - When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events - to normalize payload sizes as a mitigation to certain side-channel - attacks. These obfuscation fields are included by default, but add a - small amount of overhead to the data stream. You can set - `include_obfuscation` to false to optimize for bandwidth if you trust - the network links between your application and the OpenAI API. - -- `starting_after: optional number` - - The sequence number of the event after which to start streaming. - -- `stream: optional false` - - If set to true, the model response data will be streamed to the client - as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). - See the [Streaming section below](/docs/api-reference/responses-streaming) - for more information. - - - `false` - -### Header Parameters - -- `"openai-beta": optional array of "responses_multi_agent=v1"` - - - `"responses_multi_agent=v1"` - -### Returns - -- `BetaResponse object { id, created_at, error, 32 more }` - - - `id: string` - - Unique identifier for this Response. - - - `created_at: number` - - Unix timestamp (in seconds) of when this Response was created. - - - `error: BetaResponseError` - - An error object returned when the model fails to generate a Response. - - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 17 more` - - The error code for the response. - - - `"server_error"` - - - `"rate_limit_exceeded"` - - - `"invalid_prompt"` - - - `"data_residency_mismatch"` - - - `"bio_policy"` - - - `"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: string` - - A human-readable description of the error. - - - `incomplete_details: object { reason }` - - Details about why the response is incomplete. - - - `reason: optional "max_output_tokens" or "content_filter"` - - The reason why the response is incomplete. - - - `"max_output_tokens"` - - - `"content_filter"` - - - `instructions: string or array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` - - A system (or developer) message inserted into the model's context. - - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. - - - `string` - - A text input to the model, equivalent to a text input with the - `developer` role. - - - `InputItemList = array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` - - A list of one or many input items to the model, containing - different content types. - - - `BetaEasyInputMessage object { content, role, phase, type }` - - 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: string or BetaResponseInputMessageContentList` - - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. - - - `TextInput = string` - - A text input to the model. - - - `BetaResponseInputMessageContentList = array of BetaResponseInputContent` - - A list of one or many input items to the model, containing different content - types. - - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - A text input to the model. - - - `text: string` - - The text input to the model. - - - `type: "input_text"` - - The type of the input item. Always `input_text`. - - - `"input_text"` - - - `prompt_cache_breakpoint: optional object { mode }` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `mode: "explicit"` - - The breakpoint mode. Always `explicit`. - - - `"explicit"` - - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - - An image input to the model. Learn about [image inputs](/docs/guides/vision). - - - `detail: "low" or "high" or "auto" or "original"` - - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - - `"low"` - - - `"high"` - - - `"auto"` - - - `"original"` - - - `type: "input_image"` - - The type of the input item. Always `input_image`. - - - `"input_image"` - - - `file_id: optional string` - - The ID of the file to be sent to the model. - - - `image_url: optional string` - - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - - `prompt_cache_breakpoint: optional object { mode }` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `mode: "explicit"` - - The breakpoint mode. Always `explicit`. - - - `"explicit"` - - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - - A file input to the model. - - - `type: "input_file"` - - The type of the input item. Always `input_file`. - - - `"input_file"` - - - `detail: optional "auto" or "low" or "high"` - - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - - `"auto"` - - - `"low"` - - - `"high"` - - - `file_data: optional string` - - The content of the file to be sent to the model. - - - `file_id: optional string` - - The ID of the file to be sent to the model. - - - `file_url: optional string` - - The URL of the file to be sent to the model. - - - `filename: optional string` - - The name of the file to be sent to the model. - - - `prompt_cache_breakpoint: optional object { mode }` - - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - - `mode: "explicit"` - - The breakpoint mode. Always `explicit`. - - - `"explicit"` - - - `role: "user" or "assistant" or "system" or "developer"` - - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. - - - `"user"` - - - `"assistant"` - - - `"system"` - - - `"developer"` - - - `phase: optional "commentary" or "final_answer"` - - Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). - For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend - phase on all assistant messages — dropping it can degrade performance. Not used for user messages. - - - `"commentary"` - - - `"final_answer"` - - - `type: optional "message"` - - The type of the message input. Always `message`. - - - `"message"` - - - `Message object { content, role, agent, 2 more }` - - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. - - - `content: BetaResponseInputMessageContentList` - - A list of one or many input items to the model, containing different content - types. - - - `role: "user" or "system" or "developer"` - - The role of the message input. One of `user`, `system`, or `developer`. - - - `"user"` - - - `"system"` - - - `"developer"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `status: optional "in_progress" or "completed" or "incomplete"` - - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `type: optional "message"` - - The type of the message input. Always set to `message`. - - - `"message"` - - - `BetaResponseOutputMessage object { id, content, role, 4 more }` - - An output message from the model. - - - `id: string` - - The unique ID of the output message. - - - `content: array of BetaResponseOutputText or BetaResponseOutputRefusal` - - The content of the output message. - - - `BetaResponseOutputText object { annotations, logprobs, text, type }` - - A text output from the model. - - - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` - - The annotations of the text output. - - - `FileCitation object { file_id, filename, index, type }` - - A citation to a file. - - - `file_id: string` - - The ID of the file. - - - `filename: string` - - The filename of the file cited. - - - `index: number` - - The index of the file in the list of files. - - - `type: "file_citation"` - - The type of the file citation. Always `file_citation`. - - - `"file_citation"` - - - `URLCitation object { end_index, start_index, title, 2 more }` - - A citation for a web resource used to generate a model response. - - - `end_index: number` - - The index of the last character of the URL citation in the message. - - - `start_index: number` - - The index of the first character of the URL citation in the message. - - - `title: string` - - The title of the web resource. - - - `type: "url_citation"` - - The type of the URL citation. Always `url_citation`. - - - `"url_citation"` - - - `url: string` - - The URL of the web resource. - - - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` - - A citation for a container file used to generate a model response. - - - `container_id: string` - - The ID of the container file. - - - `end_index: number` - - The index of the last character of the container file citation in the message. - - - `file_id: string` - - The ID of the file. - - - `filename: string` - - The filename of the container file cited. - - - `start_index: number` - - The index of the first character of the container file citation in the message. - - - `type: "container_file_citation"` - - The type of the container file citation. Always `container_file_citation`. - - - `"container_file_citation"` - - - `FilePath object { file_id, index, type }` - - A path to a file. - - - `file_id: string` - - The ID of the file. - - - `index: number` - - The index of the file in the list of files. - - - `type: "file_path"` - - The type of the file path. Always `file_path`. - - - `"file_path"` - - - `logprobs: array of object { token, bytes, logprob, top_logprobs }` - - - `token: string` - - - `bytes: array of number` - - - `logprob: number` - - - `top_logprobs: array of object { token, bytes, logprob }` - - - `token: string` - - - `bytes: array of number` - - - `logprob: number` - - - `text: string` - - The text output from the model. - - - `type: "output_text"` - - The type of the output text. Always `output_text`. - - - `"output_text"` - - - `BetaResponseOutputRefusal object { refusal, type }` - - A refusal from the model. - - - `refusal: string` - - The refusal explanation from the model. - - - `type: "refusal"` - - The type of the refusal. Always `refusal`. - - - `"refusal"` - - - `role: "assistant"` - - The role of the output message. Always `assistant`. - - - `"assistant"` - - - `status: "in_progress" or "completed" or "incomplete"` - - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - - `type: "message"` + - `"mcp_approval_response"` - The type of the output message. Always `message`. + - `id: optional string` - - `"message"` + The unique ID of the approval response - `agent: optional object { agent_name }` @@ -18941,49 +15701,35 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `phase: optional "commentary" or "final_answer"` - - Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). - For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend - phase on all assistant messages — dropping it can degrade performance. Not used for user messages. - - - `"commentary"` + - `reason: optional string` - - `"final_answer"` + Optional reason for the decision. - - `FileSearchCall object { id, queries, status, 3 more }` + - `McpCall object { id, arguments, name, 7 more }` - The results of a file search tool call. See the - [file search guide](/docs/guides/tools-file-search) for more information. + An invocation of a tool on an MCP server. - `id: string` - The unique ID of the file search tool call. - - - `queries: array of string` - - The queries used to search for files. - - - `status: "in_progress" or "searching" or "completed" or 2 more` + The unique ID of the tool call. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + - `arguments: string` - - `"in_progress"` + A JSON string of the arguments passed to the tool. - - `"searching"` + - `name: string` - - `"completed"` + The name of the tool that was run. - - `"incomplete"` + - `server_label: string` - - `"failed"` + The label of the MCP server running the tool. - - `type: "file_search_call"` + - `type: "mcp_call"` - The type of the file search tool call. Always `file_search_call`. + The type of the item. Always `mcp_call`. - - `"file_search_call"` + - `"mcp_call"` - `agent: optional object { agent_name }` @@ -18993,608 +15739,594 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `results: optional array of object { attributes, file_id, filename, 2 more }` + - `approval_request_id: optional string` - The results of the file search tool call. + Unique identifier for the MCP tool call approval request. + Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call. - - `attributes: optional map[string or number or boolean]` + - `error: optional string` - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. Keys are strings - with a maximum length of 64 characters. Values are strings with a maximum - length of 512 characters, booleans, or numbers. + The error from the tool call, if any. - - `string` + - `output: optional string` - - `number` + The output from the tool call. - - `boolean` + - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` - - `file_id: optional string` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - The unique ID of the file. + - `"in_progress"` - - `filename: optional string` + - `"completed"` - The name of the file. + - `"incomplete"` - - `score: optional number` + - `"calling"` - The relevance score of the file - a value between 0 and 1. + - `"failed"` - - `text: optional string` + - `CustomToolCallOutput object { call_id, output, type, 3 more }` - The text that was retrieved from the file. + The output of a custom tool call from your code, being sent back to the model. - - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` + - `call_id: string` - A tool call to a computer use tool. See the - [computer use guide](/docs/guides/tools-computer-use) for more information. + The call ID, used to map this custom tool call output to a custom tool call. - - `id: string` + - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - The unique ID of the computer call. + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `call_id: string` + - `StringOutput = string` - An identifier used when responding to the tool call with output. + A string of the output of the custom tool call. - - `pending_safety_checks: array of object { id, code, message }` + - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - The pending safety checks for the computer call. + Text, image, or file output of the custom tool call. - - `id: string` + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - The ID of the pending safety check. + A text input to the model. - - `code: optional string` + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - The type of the pending safety check. + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `message: optional string` + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - Details about the pending safety check. + A file input to the model. - - `status: "in_progress" or "completed" or "incomplete"` + - `type: "custom_tool_call_output"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The type of the custom tool call output. Always `custom_tool_call_output`. - - `"in_progress"` + - `"custom_tool_call_output"` - - `"completed"` + - `id: optional string` - - `"incomplete"` + The unique ID of the custom tool call output in the OpenAI platform. - - `type: "computer_call"` + - `agent: optional object { agent_name }` - The type of the computer call. Always `computer_call`. + The agent that produced this item. - - `"computer_call"` + - `agent_name: string` - - `action: optional BetaComputerAction` + The canonical name of the agent that produced this item. - A click action. + - `caller: optional object { type } or object { caller_id, type }` - - `Click object { button, type, x, 2 more }` + The execution context that produced this tool call. - A click action. + - `Direct object { type }` - - `button: "left" or "right" or "wheel" or 2 more` + - `type: "direct"` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + The caller type. Always `direct`. - - `"left"` + - `"direct"` - - `"right"` + - `Program object { caller_id, type }` - - `"wheel"` + - `caller_id: string` - - `"back"` + The call ID of the program item that produced this tool call. - - `"forward"` + - `type: "program"` - - `type: "click"` + The caller type. Always `program`. - Specifies the event type. For a click action, this property is always `click`. + - `"program"` - - `"click"` + - `CustomToolCall object { call_id, input, name, 5 more }` - - `x: number` + A call to a custom tool created by the model. - The x-coordinate where the click occurred. + - `call_id: string` - - `y: number` + An identifier used to map this custom tool call to a tool call output. - The y-coordinate where the click occurred. + - `input: string` - - `keys: optional array of string` + The input for the custom tool call generated by the model. - The keys being held while clicking. + - `name: string` - - `DoubleClick object { keys, type, x, y }` + The name of the custom tool being called. - A double click action. + - `type: "custom_tool_call"` - - `keys: array of string` + The type of the custom tool call. Always `custom_tool_call`. - The keys being held while double-clicking. + - `"custom_tool_call"` - - `type: "double_click"` + - `id: optional string` - Specifies the event type. For a double click action, this property is always set to `double_click`. + The unique ID of the custom tool call in the OpenAI platform. - - `"double_click"` + - `agent: optional object { agent_name }` - - `x: number` + The agent that produced this item. - The x-coordinate where the double click occurred. + - `agent_name: string` - - `y: number` + The canonical name of the agent that produced this item. - The y-coordinate where the double click occurred. + - `caller: optional object { type } or object { caller_id, type }` - - `Drag object { path, type, keys }` + The execution context that produced this tool call. - A drag action. + - `Direct object { type }` - - `path: array of object { x, y }` + - `type: "direct"` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `"direct"` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `Program object { caller_id, type }` - - `x: number` + - `caller_id: string` - The x-coordinate. + The call ID of the program item that produced this tool call. - - `y: number` + - `type: "program"` - The y-coordinate. + - `"program"` - - `type: "drag"` + - `namespace: optional string` - Specifies the event type. For a drag action, this property is always set to `drag`. + The namespace of the custom tool being called. - - `"drag"` + - `CompactionTrigger object { type, agent }` - - `keys: optional array of string` + Compacts the current context. Must be the final input item. - The keys being held while dragging the mouse. + - `type: "compaction_trigger"` - - `Keypress object { keys, type }` + The type of the item. Always `compaction_trigger`. - A collection of keypresses the model would like to perform. + - `"compaction_trigger"` - - `keys: array of string` + - `agent: optional object { agent_name }` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + The agent that produced this item. - - `type: "keypress"` + - `agent_name: string` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + The canonical name of the agent that produced this item. - - `"keypress"` + - `ItemReference object { id, agent, type }` - - `Move object { type, x, y, keys }` + An internal identifier for an item to reference. - A mouse move action. + - `id: string` - - `type: "move"` + The ID of the item to reference. - Specifies the event type. For a move action, this property is always set to `move`. + - `agent: optional object { agent_name }` - - `"move"` + The agent that produced this item. - - `x: number` + - `agent_name: string` - The x-coordinate to move to. + The canonical name of the agent that produced this item. - - `y: number` + - `type: optional "item_reference"` - The y-coordinate to move to. + The type of item to reference. Always `item_reference`. - - `keys: optional array of string` + - `"item_reference"` - The keys being held while moving the mouse. + - `Program object { id, call_id, code, 3 more }` - - `Screenshot object { type }` + - `id: string` - A screenshot action. + The unique ID of this program item. - - `type: "screenshot"` + - `call_id: string` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + The stable call ID of the program item. - - `"screenshot"` + - `code: string` - - `Scroll object { scroll_x, scroll_y, type, 3 more }` + The JavaScript source executed by programmatic tool calling. - A scroll action. + - `fingerprint: string` - - `scroll_x: number` + Opaque program replay fingerprint that must be round-tripped. - The horizontal scroll distance. + - `type: "program"` - - `scroll_y: number` + The item type. Always `program`. - The vertical scroll distance. + - `"program"` - - `type: "scroll"` + - `agent: optional object { agent_name }` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + The agent that produced this item. - - `"scroll"` + - `agent_name: string` - - `x: number` + The canonical name of the agent that produced this item. - The x-coordinate where the scroll occurred. + - `ProgramOutput object { id, call_id, result, 3 more }` - - `y: number` + - `id: string` - The y-coordinate where the scroll occurred. + The unique ID of this program output item. - - `keys: optional array of string` + - `call_id: string` - The keys being held while scrolling. + The call ID of the program item. - - `Type object { text, type }` + - `result: string` - An action to type in text. + The result produced by the program item. - - `text: string` + - `status: "completed" or "incomplete"` - The text to type. + The terminal status of the program output. - - `type: "type"` + - `"completed"` - Specifies the event type. For a type action, this property is always set to `type`. + - `"incomplete"` - - `"type"` + - `type: "program_output"` - - `Wait object { type }` + The item type. Always `program_output`. - A wait action. + - `"program_output"` - - `type: "wait"` + - `agent: optional object { agent_name }` - Specifies the event type. For a wait action, this property is always set to `wait`. + The agent that produced this item. - - `"wait"` + - `agent_name: string` - - `actions: optional BetaComputerActionList` + The canonical name of the agent that produced this item. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. +- `instructions: optional string` - - `Click object { button, type, x, 2 more }` + A system (or developer) message inserted into the model's context. + When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. - A click action. +- `previous_response_id: optional string` - - `DoubleClick object { keys, type, x, y }` + The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - A double click action. +- `prompt_cache_key: optional string` - - `Drag object { path, type, keys }` + A key to use when reading from or writing to the prompt cache. - A drag action. +- `prompt_cache_options: optional object { mode, ttl }` - - `Keypress object { keys, type }` + Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](/docs/guides/prompt-caching) for current details. - A collection of keypresses the model would like to perform. + - `mode: optional "implicit" or "explicit"` - - `Move object { type, x, y, keys }` + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. - A mouse move action. + - `"implicit"` - - `Screenshot object { type }` + - `"explicit"` - A screenshot action. + - `ttl: optional "30m"` - - `Scroll object { scroll_x, scroll_y, type, 3 more }` + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. - A scroll action. + - `"30m"` - - `Type object { text, type }` +- `prompt_cache_retention: optional "in_memory" or "24h"` - An action to type in text. + How long to retain a prompt cache entry created by this request. - - `Wait object { type }` + - `"in_memory"` - A wait action. + - `"24h"` - - `agent: optional object { agent_name }` +- `service_tier: optional "auto" or "default" or "flex" or "priority"` - The agent that produced this item. + The service tier to use for this request. - - `agent_name: string` + - `"auto"` - The canonical name of the agent that produced this item. + - `"default"` - - `ComputerCallOutput object { call_id, output, type, 4 more }` + - `"flex"` - The output of a computer tool call. + - `"priority"` - - `call_id: string` +### Returns - The ID of the computer tool call that produced the output. +- `BetaCompactedResponse object { id, created_at, object, 2 more }` - - `output: BetaResponseComputerToolCallOutputScreenshot` + - `id: string` - A computer screenshot image used with the computer use tool. + The unique identifier for the compacted response. - - `type: "computer_screenshot"` + - `created_at: number` - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + Unix timestamp (in seconds) when the compacted conversation was created. - - `"computer_screenshot"` + - `object: "response.compaction"` - - `file_id: optional string` + The object type. Always `response.compaction`. - The identifier of an uploaded file that contains the screenshot. + - `"response.compaction"` - - `image_url: optional string` + - `output: array of object { id, content, role, 4 more } or object { id, call_id, code, 3 more } or object { id, call_id, result, 3 more } or 28 more` - The URL of the screenshot image. + The compacted list of output items. - - `type: "computer_call_output"` + - `Message object { id, content, role, 4 more }` - The type of the computer tool call output. Always `computer_call_output`. + A message to or from the model. - - `"computer_call_output"` + - `id: string` - - `id: optional string` + The unique ID of the message. - The ID of the computer tool call output. + - `content: array of BetaResponseInputText or BetaResponseOutputText or object { text, type } or 7 more` - - `acknowledged_safety_checks: optional array of object { id, code, message }` + The content of the message - The safety checks reported by the API that have been acknowledged by the developer. + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - `id: string` + A text input to the model. - The ID of the pending safety check. + - `text: string` - - `code: optional string` + The text input to the model. - The type of the pending safety check. + - `type: "input_text"` - - `message: optional string` + The type of the input item. Always `input_text`. - Details about the pending safety check. + - `"input_text"` - - `agent: optional object { agent_name }` + - `prompt_cache_breakpoint: optional object { mode }` - The agent that produced this item. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `agent_name: string` + - `mode: "explicit"` - The canonical name of the agent that produced this item. + The breakpoint mode. Always `explicit`. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"explicit"` - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + - `BetaResponseOutputText object { annotations, logprobs, text, type }` - - `"in_progress"` + A text output from the model. - - `"completed"` + - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` - - `"incomplete"` + The annotations of the text output. - - `WebSearchCall object { id, action, status, 2 more }` + - `FileCitation object { file_id, filename, index, type }` - The results of a web search tool call. See the - [web search guide](/docs/guides/tools-web-search) for more information. + A citation to a file. - - `id: string` + - `file_id: string` - The unique ID of the web search tool call. + The ID of the file. - - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` + - `filename: string` - An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find_in_page). + The filename of the file cited. - - `Search object { type, queries, query, sources }` + - `index: number` - Action type "search" - Performs a web search query. + The index of the file in the list of files. - - `type: "search"` + - `type: "file_citation"` - The action type. + The type of the file citation. Always `file_citation`. - - `"search"` + - `"file_citation"` - - `queries: optional array of string` + - `URLCitation object { end_index, start_index, title, 2 more }` - The search queries. + A citation for a web resource used to generate a model response. - - `query: optional string` + - `end_index: number` - The search query. + The index of the last character of the URL citation in the message. - - `sources: optional array of object { type, url }` + - `start_index: number` - The sources used in the search. + The index of the first character of the URL citation in the message. - - `type: "url"` + - `title: string` - The type of source. Always `url`. + The title of the web resource. - - `"url"` + - `type: "url_citation"` - - `url: string` + The type of the URL citation. Always `url_citation`. - The URL of the source. + - `"url_citation"` - - `OpenPage object { type, url }` + - `url: string` - Action type "open_page" - Opens a specific URL from search results. + The URL of the web resource. - - `type: "open_page"` + - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` - The action type. + A citation for a container file used to generate a model response. - - `"open_page"` + - `container_id: string` - - `url: optional string` + The ID of the container file. - The URL opened by the model. + - `end_index: number` - - `FindInPage object { pattern, type, url }` + The index of the last character of the container file citation in the message. - Action type "find_in_page": Searches for a pattern within a loaded page. + - `file_id: string` - - `pattern: string` + The ID of the file. - The pattern or text to search for within the page. + - `filename: string` - - `type: "find_in_page"` + The filename of the container file cited. - The action type. + - `start_index: number` - - `"find_in_page"` + The index of the first character of the container file citation in the message. - - `url: string` + - `type: "container_file_citation"` - The URL of the page searched for the pattern. + The type of the container file citation. Always `container_file_citation`. - - `status: "in_progress" or "searching" or "completed" or "failed"` + - `"container_file_citation"` - The status of the web search tool call. + - `FilePath object { file_id, index, type }` - - `"in_progress"` + A path to a file. - - `"searching"` + - `file_id: string` - - `"completed"` + The ID of the file. - - `"failed"` + - `index: number` - - `type: "web_search_call"` + The index of the file in the list of files. - The type of the web search tool call. Always `web_search_call`. + - `type: "file_path"` - - `"web_search_call"` + The type of the file path. Always `file_path`. - - `agent: optional object { agent_name }` + - `"file_path"` - The agent that produced this item. + - `logprobs: array of object { token, bytes, logprob, top_logprobs }` - - `agent_name: string` + - `token: string` - The canonical name of the agent that produced this item. + - `bytes: array of number` - - `FunctionCall object { arguments, call_id, name, 6 more }` + - `logprob: number` - A tool call to run a function. See the - [function calling guide](/docs/guides/function-calling) for more information. + - `top_logprobs: array of object { token, bytes, logprob }` - - `arguments: string` + - `token: string` - A JSON string of the arguments to pass to the function. + - `bytes: array of number` - - `call_id: string` + - `logprob: number` - The unique ID of the function tool call generated by the model. + - `text: string` - - `name: string` + The text output from the model. - The name of the function to run. + - `type: "output_text"` - - `type: "function_call"` + The type of the output text. Always `output_text`. - The type of the function tool call. Always `function_call`. + - `"output_text"` - - `"function_call"` + - `Text object { text, type }` - - `id: optional string` + A text content. - The unique ID of the function tool call. + - `text: string` - - `agent: optional object { agent_name }` + - `type: "text"` - The agent that produced this item. + - `"text"` - - `agent_name: string` + - `SummaryText object { text, type }` - The canonical name of the agent that produced this item. + A summary text from the model. - - `caller: optional object { type } or object { caller_id, type }` + - `text: string` - The execution context that produced this tool call. + A summary of the reasoning output from the model so far. - - `Direct object { type }` + - `type: "summary_text"` - - `type: "direct"` + The type of the object. Always `summary_text`. - - `"direct"` + - `"summary_text"` - - `Program object { caller_id, type }` + - `ReasoningText object { text, type }` - - `caller_id: string` + Reasoning text from the model. - The call ID of the program item that produced this tool call. + - `text: string` - - `type: "program"` + The reasoning text from the model. - - `"program"` + - `type: "reasoning_text"` - - `namespace: optional string` + The type of the reasoning text. Always `reasoning_text`. - The namespace of the function to run. + - `"reasoning_text"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `BetaResponseOutputRefusal object { refusal, type }` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + A refusal from the model. - - `"in_progress"` + - `refusal: string` - - `"completed"` + The refusal explanation from the model. - - `"incomplete"` + - `type: "refusal"` - - `FunctionCallOutput object { call_id, output, type, 4 more }` + The type of the refusal. Always `refusal`. - The output of a function tool call. + - `"refusal"` - - `call_id: string` + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - The unique ID of the function tool call generated by the model. + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `output: string or array of BetaResponseInputTextContent or BetaResponseInputImageContent or BetaResponseInputFileContent` + - `detail: "low" or "high" or "auto" or "original"` - Text, image, or file output of the function tool call. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `string` + - `"low"` - A JSON string of the output of the function tool call. + - `"high"` - - `array of BetaResponseInputTextContent or BetaResponseInputImageContent or BetaResponseInputFileContent` + - `"auto"` - An array of content outputs (text, image, file) for the function tool call. + - `"original"` - - `BetaResponseInputTextContent object { text, type, prompt_cache_breakpoint }` + - `type: "input_image"` - A text input to the model. + The type of the input item. Always `input_image`. - - `text: string` + - `"input_image"` - The text input to the model. + - `file_id: optional string` - - `type: "input_text"` + The ID of the file to be sent to the model. - The type of the input item. Always `input_text`. + - `image_url: optional string` - - `"input_text"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - `prompt_cache_breakpoint: optional object { mode }` @@ -19606,19 +16338,13 @@ Retrieves a model response with the given ID. - `"explicit"` - - `BetaResponseInputImageContent object { type, detail, file_id, 2 more }` - - An image input to the model. Learn about [image inputs](/docs/guides/vision) - - - `type: "input_image"` - - The type of the input item. Always `input_image`. + - `ComputerScreenshot object { detail, file_id, image_url, 2 more }` - - `"input_image"` + A screenshot of a computer. - - `detail: optional "low" or "high" or "auto" or "original"` + - `detail: "low" or "high" or "auto" or "original"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - `"low"` @@ -19628,13 +16354,19 @@ Retrieves a model response with the given ID. - `"original"` - - `file_id: optional string` + - `file_id: string` - The ID of the file to be sent to the model. + The identifier of an uploaded file that contains the screenshot. - - `image_url: optional string` + - `image_url: string` - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + The URL of the screenshot image. + + - `type: "computer_screenshot"` + + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + + - `"computer_screenshot"` - `prompt_cache_breakpoint: optional object { mode }` @@ -19646,7 +16378,7 @@ Retrieves a model response with the given ID. - `"explicit"` - - `BetaResponseInputFileContent object { type, detail, file_data, 4 more }` + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` A file input to the model. @@ -19668,7 +16400,7 @@ Retrieves a model response with the given ID. - `file_data: optional string` - The base64-encoded data of the file to be sent to the model. + The content of the file to be sent to the model. - `file_id: optional string` @@ -19692,51 +16424,43 @@ Retrieves a model response with the given ID. - `"explicit"` - - `type: "function_call_output"` - - The type of the function tool call output. Always `function_call_output`. - - - `"function_call_output"` - - - `id: optional string` - - The unique ID of the function tool call output. Populated when this item is returned via API. + - `EncryptedContent object { encrypted_content, type }` - - `agent: optional object { agent_name }` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - The agent that produced this item. + - `encrypted_content: string` - - `agent_name: string` + Opaque encrypted content. - The canonical name of the agent that produced this item. + - `type: "encrypted_content"` - - `caller: optional object { type } or object { caller_id, type }` + The type of the input item. Always `encrypted_content`. - The execution context that produced this tool call. + - `"encrypted_content"` - - `Direct object { type }` + - `role: "unknown" or "user" or "assistant" or 5 more` - - `type: "direct"` + The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`. - The caller type. Always `direct`. + - `"unknown"` - - `"direct"` + - `"user"` - - `Program object { caller_id, type }` + - `"assistant"` - - `caller_id: string` + - `"system"` - The call ID of the program item that produced this tool call. + - `"critic"` - - `type: "program"` + - `"discriminator"` - The caller type. Always `program`. + - `"developer"` - - `"program"` + - `"tool"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `status: "in_progress" or "completed" or "incomplete"` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - `"in_progress"` @@ -19744,53 +16468,51 @@ Retrieves a model response with the given ID. - `"incomplete"` - - `AgentMessage object { author, content, recipient, 3 more }` - - A message routed between agents. + - `type: "message"` - - `author: string` + The type of the message. Always set to `message`. - The sending agent identity. + - `"message"` - - `content: array of BetaResponseInputTextContent or BetaResponseInputImageContent or object { encrypted_content, type }` + - `agent: optional object { agent_name }` - Plaintext, image, or encrypted content sent between agents. + The agent that produced this item. - - `BetaResponseInputTextContent object { text, type, prompt_cache_breakpoint }` + - `agent_name: string` - A text input to the model. + The canonical name of the agent that produced this item. - - `BetaResponseInputImageContent object { type, detail, file_id, 2 more }` + - `phase: optional "commentary" or "final_answer"` - An image input to the model. Learn about [image inputs](/docs/guides/vision) + Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages. - - `EncryptedContent object { encrypted_content, type }` + - `"commentary"` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `"final_answer"` - - `encrypted_content: string` + - `Program object { id, call_id, code, 3 more }` - Opaque encrypted content. + - `id: string` - - `type: "encrypted_content"` + The unique ID of the program item. - The type of the input item. Always `encrypted_content`. + - `call_id: string` - - `"encrypted_content"` + The stable call ID of the program item. - - `recipient: string` + - `code: string` - The destination agent identity. + The JavaScript source executed by programmatic tool calling. - - `type: "agent_message"` + - `fingerprint: string` - The item type. Always `agent_message`. + Opaque program replay fingerprint that must be round-tripped. - - `"agent_message"` + - `type: "program"` - - `id: optional string` + The type of the item. Always `program`. - The unique ID of this agent message item. + - `"program"` - `agent: optional object { agent_name }` @@ -19800,41 +16522,68 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `MultiAgentCall object { action, arguments, call_id, 3 more }` + - `ProgramOutput object { id, call_id, result, 3 more }` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + - `id: string` - The multi-agent action that was executed. + The unique ID of the program output item. - - `"spawn_agent"` + - `call_id: string` - - `"interrupt_agent"` + The call ID of the program item. - - `"list_agents"` + - `result: string` - - `"send_message"` + The result produced by the program item. - - `"followup_task"` + - `status: "completed" or "incomplete"` - - `"wait_agent"` + The terminal status of the program output item. + + - `"completed"` + + - `"incomplete"` + + - `type: "program_output"` + + The type of the item. Always `program_output`. + + - `"program_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `FunctionCall object { arguments, call_id, name, 6 more }` + + A tool call to run a function. See the + [function calling guide](/docs/guides/function-calling) for more information. - `arguments: string` - The action arguments as a JSON string. + A JSON string of the arguments to pass to the function. - `call_id: string` - The unique ID linking this call to its output. + The unique ID of the function tool call generated by the model. - - `type: "multi_agent_call"` + - `name: string` - The item type. Always `multi_agent_call`. + The name of the function to run. - - `"multi_agent_call"` + - `type: "function_call"` + + The type of the function tool call. Always `function_call`. + + - `"function_call"` - `id: optional string` - The unique ID of this multi-agent call. + The unique ID of the function tool call. - `agent: optional object { agent_name }` @@ -19844,127 +16593,134 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `MultiAgentCallOutput object { action, call_id, output, 3 more }` + - `caller: optional object { type } or object { caller_id, type }` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + The execution context that produced this tool call. - The multi-agent action that produced this result. + - `Direct object { type }` - - `"spawn_agent"` + - `type: "direct"` - - `"interrupt_agent"` + - `"direct"` - - `"list_agents"` + - `Program object { caller_id, type }` - - `"send_message"` + - `caller_id: string` - - `"followup_task"` + The call ID of the program item that produced this tool call. - - `"wait_agent"` + - `type: "program"` - - `call_id: string` + - `"program"` - The unique ID of the multi-agent call. + - `namespace: optional string` - - `output: array of object { text, type, annotations }` + The namespace of the function to run. - Text output returned by the multi-agent action. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `text: string` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The text content. + - `"in_progress"` - - `type: "output_text"` + - `"completed"` - The content type. Always `output_text`. + - `"incomplete"` - - `"output_text"` + - `MultiAgentCall object { id, action, arguments, 3 more }` - - `annotations: optional array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more }` + - `id: string` - Citations associated with the text content. + The unique ID of the multi-agent call item. - - `FileCitation object { file_id, filename, index, type }` + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - - `file_id: string` + The multi-agent action to execute. - The ID of the file. + - `"spawn_agent"` - - `filename: string` + - `"interrupt_agent"` - The filename of the file cited. + - `"list_agents"` - - `index: number` + - `"send_message"` - The index of the file in the list of files. + - `"followup_task"` - - `type: "file_citation"` + - `"wait_agent"` - The citation type. Always `file_citation`. + - `arguments: string` - - `"file_citation"` + The JSON string of arguments generated for the action. - - `URLCitation object { end_index, start_index, title, 2 more }` + - `call_id: string` - - `end_index: number` + The unique ID linking this call to its output. - The index of the last character of the citation in the message. + - `type: "multi_agent_call"` - - `start_index: number` + The type of the multi-agent call. Always `multi_agent_call`. - The index of the first character of the citation in the message. + - `"multi_agent_call"` - - `title: string` + - `agent: optional object { agent_name }` - The title of the cited resource. + The agent that produced this item. - - `type: "url_citation"` + - `agent_name: string` - The citation type. Always `url_citation`. + The canonical name of the agent that produced this item. - - `"url_citation"` + - `MultiAgentCallOutput object { id, action, call_id, 3 more }` - - `url: string` + - `id: string` - The URL of the cited resource. + The unique ID of the multi-agent call output item. - - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - - `container_id: string` + The multi-agent action that produced this result. - The ID of the container. + - `"spawn_agent"` - - `end_index: number` + - `"interrupt_agent"` - The index of the last character of the citation in the message. + - `"list_agents"` - - `file_id: string` + - `"send_message"` - The ID of the container file. + - `"followup_task"` - - `filename: string` + - `"wait_agent"` - The filename of the container file cited. + - `call_id: string` - - `start_index: number` + The unique ID of the multi-agent call. - The index of the first character of the citation in the message. + - `output: array of BetaResponseOutputText` - - `type: "container_file_citation"` + Text output returned by the multi-agent action. - The citation type. Always `container_file_citation`. + - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` - - `"container_file_citation"` + The annotations of the text output. - - `type: "multi_agent_call_output"` + - `logprobs: array of object { token, bytes, logprob, top_logprobs }` - The item type. Always `multi_agent_call_output`. + - `text: string` - - `"multi_agent_call_output"` + The text output from the model. - - `id: optional string` + - `type: "output_text"` - The unique ID of this multi-agent call output. + The type of the output text. Always `output_text`. + + - `type: "multi_agent_call_output"` + + The type of the multi-agent result. Always `multi_agent_call_output`. + + - `"multi_agent_call_output"` - `agent: optional object { agent_name }` @@ -19974,21 +16730,43 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `ToolSearchCall object { arguments, type, id, 4 more }` + - `ToolSearchCall object { id, arguments, call_id, 5 more }` + + - `id: string` + + The unique ID of the tool search call item. - `arguments: unknown` - The arguments supplied to the tool search call. + Arguments used for the tool search call. - - `type: "tool_search_call"` + - `call_id: string` - The item type. Always `tool_search_call`. + The unique ID of the tool search call generated by the model. - - `"tool_search_call"` + - `execution: "server" or "client"` - - `id: optional string` + Whether tool search was executed by the server or by the client. - The unique ID of this tool search call. + - `"server"` + + - `"client"` + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the tool search call item that was recorded. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "tool_search_call"` + + The type of the item. Always `tool_search_call`. + + - `"tool_search_call"` - `agent: optional object { agent_name }` @@ -19998,11 +16776,21 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `call_id: optional string` + - `created_by: optional string` + + The identifier of the actor that created the item. + + - `ToolSearchOutput object { id, call_id, execution, 5 more }` + + - `id: string` + + The unique ID of the tool search output item. + + - `call_id: string` The unique ID of the tool search call generated by the model. - - `execution: optional "server" or "client"` + - `execution: "server" or "client"` Whether tool search was executed by the server or by the client. @@ -20010,9 +16798,9 @@ Retrieves a model response with the given ID. - `"client"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `status: "in_progress" or "completed" or "incomplete"` - The status of the tool search call. + The status of the tool search output item that was recorded. - `"in_progress"` @@ -20020,11 +16808,9 @@ Retrieves a model response with the given ID. - `"incomplete"` - - `ToolSearchOutput object { tools, type, id, 4 more }` - - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - The loaded tool definitions returned by the tool search output. + The loaded tool definitions returned by tool search. - `Function object { name, parameters, strict, 5 more }` @@ -21167,14 +17953,10 @@ Retrieves a model response with the given ID. - `type: "tool_search_output"` - The item type. Always `tool_search_output`. + The type of the item. Always `tool_search_output`. - `"tool_search_output"` - - `id: optional string` - - The unique ID of this tool search output. - - `agent: optional object { agent_name }` The agent that produced this item. @@ -21183,39 +17965,39 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `call_id: optional string` - - The unique ID of the tool search call generated by the model. + - `created_by: optional string` - - `execution: optional "server" or "client"` + The identifier of the actor that created the item. - Whether tool search was executed by the server or by the client. + - `AdditionalTools object { id, role, tools, 2 more }` - - `"server"` + - `id: string` - - `"client"` + The unique ID of the additional tools item. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `role: "unknown" or "user" or "assistant" or 5 more` - The status of the tool search output. + The role that provided the additional tools. - - `"in_progress"` + - `"unknown"` - - `"completed"` + - `"user"` - - `"incomplete"` + - `"assistant"` - - `AdditionalTools object { role, tools, type, 2 more }` + - `"system"` - - `role: "developer"` + - `"critic"` - The role that provided the additional tools. Only `developer` is supported. + - `"discriminator"` - `"developer"` + - `"tool"` + - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - A list of additional tools made available at this item. + The additional tool definitions made available at this item. - `Function object { name, parameters, strict, 5 more }` @@ -22050,171 +18832,979 @@ Retrieves a model response with the given ID. - `"custom"` - - `allowed_callers: optional array of "direct" or "programmatic"` + - `allowed_callers: optional array of "direct" or "programmatic"` + + The tool invocation context(s). + + - `"direct"` + + - `"programmatic"` + + - `defer_loading: optional boolean` + + Whether this tool should be deferred and discovered via tool search. + + - `description: optional string` + + Optional description of the custom tool, used to provide more context. + + - `format: optional object { type } or object { definition, syntax, type }` + + The input format for the custom tool. Default is unconstrained text. + + - `Text object { type }` + + Unconstrained free-form text. + + - `type: "text"` + + Unconstrained text format. Always `text`. + + - `"text"` + + - `Grammar object { definition, syntax, type }` + + A grammar defined by the user. + + - `definition: string` + + The grammar definition. + + - `syntax: "lark" or "regex"` + + The syntax of the grammar definition. One of `lark` or `regex`. + + - `"lark"` + + - `"regex"` + + - `type: "grammar"` + + Grammar format. Always `grammar`. + + - `"grammar"` + + - `type: "namespace"` + + The type of the tool. Always `namespace`. + + - `"namespace"` + + - `ToolSearch object { type, description, execution, parameters }` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type: "tool_search"` + + The type of the tool. Always `tool_search`. + + - `"tool_search"` + + - `description: optional string` + + Description shown to the model for a client-executed tool search tool. + + - `execution: optional "server" or "client"` + + Whether tool search is executed by the server or by the client. + + - `"server"` + + - `"client"` + + - `parameters: optional unknown` + + Parameter schema for a client-executed tool search tool. + + - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` + + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + + - `type: "web_search_preview" or "web_search_preview_2025_03_11"` + + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + + - `"web_search_preview"` + + - `"web_search_preview_2025_03_11"` + + - `search_content_types: optional array of "text" or "image"` + + - `"text"` + + - `"image"` + + - `search_context_size: optional "low" or "medium" or "high"` + + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + + - `"low"` + + - `"medium"` + + - `"high"` + + - `user_location: optional object { type, city, country, 2 more }` + + The user's location. + + - `type: "approximate"` + + The type of location approximation. Always `approximate`. + + - `"approximate"` + + - `city: optional string` + + Free text input for the city of the user, e.g. `San Francisco`. + + - `country: optional string` + + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + + - `region: optional string` + + Free text input for the region of the user, e.g. `California`. + + - `timezone: optional string` + + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + + - `ApplyPatch object { type, allowed_callers }` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `type: "apply_patch"` + + The type of the tool. Always `apply_patch`. + + - `"apply_patch"` + + - `allowed_callers: optional array of "direct" or "programmatic"` + + The tool invocation context(s). + + - `"direct"` + + - `"programmatic"` + + - `type: "additional_tools"` + + The type of the item. Always `additional_tools`. + + - `"additional_tools"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `AgentMessage object { id, author, content, 3 more }` + + - `id: string` + + The unique ID of the agent message. + + - `author: string` + + The sending agent identity. + + - `content: array of BetaResponseInputText or BetaResponseOutputText or object { text, type } or 7 more` + + Encrypted content sent between agents. + + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + + A text input to the model. + + - `BetaResponseOutputText object { annotations, logprobs, text, type }` + + A text output from the model. + + - `Text object { text, type }` + + A text content. + + - `text: string` + + - `type: "text"` + + - `"text"` + + - `SummaryText object { text, type }` + + A summary text from the model. + + - `text: string` + + A summary of the reasoning output from the model so far. + + - `type: "summary_text"` + + The type of the object. Always `summary_text`. + + - `"summary_text"` + + - `ReasoningText object { text, type }` + + Reasoning text from the model. + + - `text: string` + + The reasoning text from the model. + + - `type: "reasoning_text"` + + The type of the reasoning text. Always `reasoning_text`. + + - `"reasoning_text"` + + - `BetaResponseOutputRefusal object { refusal, type }` + + A refusal from the model. + + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + + An image input to the model. Learn about [image inputs](/docs/guides/vision). + + - `ComputerScreenshot object { detail, file_id, image_url, 2 more }` + + A screenshot of a computer. + + - `detail: "low" or "high" or "auto" or "original"` + + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `"low"` + + - `"high"` + + - `"auto"` + + - `"original"` + + - `file_id: string` + + The identifier of an uploaded file that contains the screenshot. + + - `image_url: string` + + The URL of the screenshot image. + + - `type: "computer_screenshot"` + + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + + - `"computer_screenshot"` + + - `prompt_cache_breakpoint: optional object { mode }` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `mode: "explicit"` + + The breakpoint mode. Always `explicit`. + + - `"explicit"` + + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + + A file input to the model. + + - `EncryptedContent object { encrypted_content, type }` + + Opaque encrypted content that Responses API decrypts inside trusted model execution. + + - `encrypted_content: string` + + Opaque encrypted content. + + - `type: "encrypted_content"` + + The type of the input item. Always `encrypted_content`. + + - `"encrypted_content"` + + - `recipient: string` + + The destination agent identity. + + - `type: "agent_message"` + + The type of the item. Always `agent_message`. + + - `"agent_message"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `FunctionCallOutput object { call_id, output, type, 4 more }` + + The output of a function tool call. + + - `call_id: string` + + The unique ID of the function tool call generated by the model. + + - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + + The output from the function call generated by your code. + Can be a string or an list of output content. + + - `StringOutput = string` + + A string of the output of the function call. + + - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + + Text, image, or file output of the function call. + + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + + A text input to the model. + + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + + An image input to the model. Learn about [image inputs](/docs/guides/vision). + + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + + A file input to the model. + + - `type: "function_call_output"` + + The type of the function tool call output. Always `function_call_output`. + + - `"function_call_output"` + + - `id: optional string` + + The unique ID of the function tool call output. Populated when this item + is returned via API. + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + The caller type. Always `direct`. + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + The caller type. Always `program`. + + - `"program"` + + - `status: optional "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `FileSearchCall object { id, queries, status, 3 more }` + + The results of a file search tool call. See the + [file search guide](/docs/guides/tools-file-search) for more information. + + - `id: string` + + The unique ID of the file search tool call. + + - `queries: array of string` + + The queries used to search for files. + + - `status: "in_progress" or "searching" or "completed" or 2 more` + + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + + - `"in_progress"` + + - `"searching"` + + - `"completed"` + + - `"incomplete"` + + - `"failed"` + + - `type: "file_search_call"` + + The type of the file search tool call. Always `file_search_call`. + + - `"file_search_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `results: optional array of object { attributes, file_id, filename, 2 more }` + + The results of the file search tool call. + + - `attributes: optional map[string or number or boolean]` + + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. Keys are strings + with a maximum length of 64 characters. Values are strings with a maximum + length of 512 characters, booleans, or numbers. + + - `string` + + - `number` + + - `boolean` + + - `file_id: optional string` + + The unique ID of the file. + + - `filename: optional string` + + The name of the file. + + - `score: optional number` + + The relevance score of the file - a value between 0 and 1. + + - `text: optional string` + + The text that was retrieved from the file. + + - `WebSearchCall object { id, action, status, 2 more }` + + The results of a web search tool call. See the + [web search guide](/docs/guides/tools-web-search) for more information. + + - `id: string` + + The unique ID of the web search tool call. + + - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` + + An object describing the specific action taken in this web search call. + Includes details on how the model used the web (search, open_page, find_in_page). + + - `Search object { type, queries, query, sources }` + + Action type "search" - Performs a web search query. + + - `type: "search"` + + The action type. + + - `"search"` + + - `queries: optional array of string` + + The search queries. + + - `query: optional string` + + The search query. + + - `sources: optional array of object { type, url }` + + The sources used in the search. + + - `type: "url"` + + The type of source. Always `url`. + + - `"url"` + + - `url: string` + + The URL of the source. + + - `OpenPage object { type, url }` + + Action type "open_page" - Opens a specific URL from search results. + + - `type: "open_page"` + + The action type. + + - `"open_page"` + + - `url: optional string` + + The URL opened by the model. + + - `FindInPage object { pattern, type, url }` + + Action type "find_in_page": Searches for a pattern within a loaded page. + + - `pattern: string` + + The pattern or text to search for within the page. + + - `type: "find_in_page"` + + The action type. + + - `"find_in_page"` + + - `url: string` + + The URL of the page searched for the pattern. + + - `status: "in_progress" or "searching" or "completed" or "failed"` + + The status of the web search tool call. + + - `"in_progress"` + + - `"searching"` + + - `"completed"` + + - `"failed"` + + - `type: "web_search_call"` + + The type of the web search tool call. Always `web_search_call`. + + - `"web_search_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `ImageGenerationCall object { id, result, status, 2 more }` + + An image generation request made by the model. + + - `id: string` + + The unique ID of the image generation call. + + - `result: string` + + The generated image encoded in base64. + + - `status: "in_progress" or "completed" or "generating" or "failed"` + + The status of the image generation call. + + - `"in_progress"` + + - `"completed"` + + - `"generating"` + + - `"failed"` + + - `type: "image_generation_call"` + + The type of the image generation call. Always `image_generation_call`. + + - `"image_generation_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` + + A tool call to a computer use tool. See the + [computer use guide](/docs/guides/tools-computer-use) for more information. + + - `id: string` + + The unique ID of the computer call. + + - `call_id: string` + + An identifier used when responding to the tool call with output. + + - `pending_safety_checks: array of object { id, code, message }` + + The pending safety checks for the computer call. + + - `id: string` + + The ID of the pending safety check. + + - `code: optional string` + + The type of the pending safety check. + + - `message: optional string` + + Details about the pending safety check. + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "computer_call"` + + The type of the computer call. Always `computer_call`. + + - `"computer_call"` + + - `action: optional BetaComputerAction` + + A click action. + + - `Click object { button, type, x, 2 more }` + + A click action. + + - `button: "left" or "right" or "wheel" or 2 more` + + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + + - `"left"` + + - `"right"` + + - `"wheel"` + + - `"back"` + + - `"forward"` + + - `type: "click"` + + Specifies the event type. For a click action, this property is always `click`. + + - `"click"` + + - `x: number` + + The x-coordinate where the click occurred. + + - `y: number` + + The y-coordinate where the click occurred. + + - `keys: optional array of string` + + The keys being held while clicking. + + - `DoubleClick object { keys, type, x, y }` + + A double click action. + + - `keys: array of string` + + The keys being held while double-clicking. + + - `type: "double_click"` + + Specifies the event type. For a double click action, this property is always set to `double_click`. + + - `"double_click"` + + - `x: number` + + The x-coordinate where the double click occurred. + + - `y: number` + + The y-coordinate where the double click occurred. + + - `Drag object { path, type, keys }` + + A drag action. + + - `path: array of object { x, y }` + + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` + + - `x: number` + + The x-coordinate. + + - `y: number` + + The y-coordinate. + + - `type: "drag"` + + Specifies the event type. For a drag action, this property is always set to `drag`. + + - `"drag"` + + - `keys: optional array of string` + + The keys being held while dragging the mouse. + + - `Keypress object { keys, type }` + + A collection of keypresses the model would like to perform. + + - `keys: array of string` + + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + + - `type: "keypress"` + + Specifies the event type. For a keypress action, this property is always set to `keypress`. + + - `"keypress"` + + - `Move object { type, x, y, keys }` + + A mouse move action. + + - `type: "move"` + + Specifies the event type. For a move action, this property is always set to `move`. + + - `"move"` + + - `x: number` + + The x-coordinate to move to. + + - `y: number` + + The y-coordinate to move to. + + - `keys: optional array of string` + + The keys being held while moving the mouse. + + - `Screenshot object { type }` + + A screenshot action. + + - `type: "screenshot"` + + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + + - `"screenshot"` - The tool invocation context(s). + - `Scroll object { scroll_x, scroll_y, type, 3 more }` - - `"direct"` + A scroll action. - - `"programmatic"` + - `scroll_x: number` - - `defer_loading: optional boolean` + The horizontal scroll distance. - Whether this tool should be deferred and discovered via tool search. + - `scroll_y: number` - - `description: optional string` + The vertical scroll distance. - Optional description of the custom tool, used to provide more context. + - `type: "scroll"` - - `format: optional object { type } or object { definition, syntax, type }` + Specifies the event type. For a scroll action, this property is always set to `scroll`. - The input format for the custom tool. Default is unconstrained text. + - `"scroll"` - - `Text object { type }` + - `x: number` - Unconstrained free-form text. + The x-coordinate where the scroll occurred. - - `type: "text"` + - `y: number` - Unconstrained text format. Always `text`. + The y-coordinate where the scroll occurred. - - `"text"` + - `keys: optional array of string` - - `Grammar object { definition, syntax, type }` + The keys being held while scrolling. - A grammar defined by the user. + - `Type object { text, type }` - - `definition: string` + An action to type in text. - The grammar definition. + - `text: string` - - `syntax: "lark" or "regex"` + The text to type. - The syntax of the grammar definition. One of `lark` or `regex`. + - `type: "type"` - - `"lark"` + Specifies the event type. For a type action, this property is always set to `type`. - - `"regex"` + - `"type"` - - `type: "grammar"` + - `Wait object { type }` - Grammar format. Always `grammar`. + A wait action. - - `"grammar"` + - `type: "wait"` - - `type: "namespace"` + Specifies the event type. For a wait action, this property is always set to `wait`. - The type of the tool. Always `namespace`. + - `"wait"` - - `"namespace"` + - `actions: optional BetaComputerActionList` - - `ToolSearch object { type, description, execution, parameters }` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - Hosted or BYOT tool search configuration for deferred tools. + - `Click object { button, type, x, 2 more }` - - `type: "tool_search"` + A click action. - The type of the tool. Always `tool_search`. + - `DoubleClick object { keys, type, x, y }` - - `"tool_search"` + A double click action. - - `description: optional string` + - `Drag object { path, type, keys }` - Description shown to the model for a client-executed tool search tool. + A drag action. - - `execution: optional "server" or "client"` + - `Keypress object { keys, type }` - Whether tool search is executed by the server or by the client. + A collection of keypresses the model would like to perform. - - `"server"` + - `Move object { type, x, y, keys }` - - `"client"` + A mouse move action. - - `parameters: optional unknown` + - `Screenshot object { type }` - Parameter schema for a client-executed tool search tool. + A screenshot action. - - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` + - `Scroll object { scroll_x, scroll_y, type, 3 more }` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + A scroll action. - - `type: "web_search_preview" or "web_search_preview_2025_03_11"` + - `Type object { text, type }` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + An action to type in text. - - `"web_search_preview"` + - `Wait object { type }` - - `"web_search_preview_2025_03_11"` + A wait action. - - `search_content_types: optional array of "text" or "image"` + - `agent: optional object { agent_name }` - - `"text"` + The agent that produced this item. - - `"image"` + - `agent_name: string` - - `search_context_size: optional "low" or "medium" or "high"` + The canonical name of the agent that produced this item. - High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + - `ComputerCallOutput object { id, call_id, output, 5 more }` - - `"low"` + - `id: string` - - `"medium"` + The unique ID of the computer call tool output. - - `"high"` + - `call_id: string` - - `user_location: optional object { type, city, country, 2 more }` + The ID of the computer tool call that produced the output. - The user's location. + - `output: BetaResponseComputerToolCallOutputScreenshot` - - `type: "approximate"` + A computer screenshot image used with the computer use tool. - The type of location approximation. Always `approximate`. + - `type: "computer_screenshot"` - - `"approximate"` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `city: optional string` + - `"computer_screenshot"` - Free text input for the city of the user, e.g. `San Francisco`. + - `file_id: optional string` - - `country: optional string` + The identifier of an uploaded file that contains the screenshot. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `image_url: optional string` - - `region: optional string` + The URL of the screenshot image. - Free text input for the region of the user, e.g. `California`. + - `status: "completed" or "incomplete" or "failed" or "in_progress"` - - `timezone: optional string` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `"completed"` - - `ApplyPatch object { type, allowed_callers }` + - `"incomplete"` - Allows the assistant to create, delete, or update files using unified diffs. + - `"failed"` - - `type: "apply_patch"` + - `"in_progress"` - The type of the tool. Always `apply_patch`. + - `type: "computer_call_output"` - - `"apply_patch"` + The type of the computer tool call output. Always `computer_call_output`. - - `allowed_callers: optional array of "direct" or "programmatic"` + - `"computer_call_output"` - The tool invocation context(s). + - `acknowledged_safety_checks: optional array of object { id, code, message }` - - `"direct"` + The safety checks reported by the API that have been acknowledged by the + developer. - - `"programmatic"` + - `id: string` - - `type: "additional_tools"` + The ID of the pending safety check. - The item type. Always `additional_tools`. + - `code: optional string` - - `"additional_tools"` + The type of the pending safety check. - - `id: optional string` + - `message: optional string` - The unique ID of this additional tools item. + Details about the pending safety check. - `agent: optional object { agent_name }` @@ -22224,6 +19814,10 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. + - `created_by: optional string` + + The identifier of the actor that created the item. + - `Reasoning object { id, summary, type, 4 more }` A description of the chain of thought used by a reasoning model while generating @@ -22294,13 +19888,17 @@ Retrieves a model response with the given ID. - `"incomplete"` - - `Compaction object { encrypted_content, type, id, agent }` + - `Compaction object { id, encrypted_content, type, 2 more }` A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). + - `id: string` + + The unique ID of the compaction item. + - `encrypted_content: string` - The encrypted content of the compaction summary. + The encrypted content that was produced by compaction. - `type: "compaction"` @@ -22308,10 +19906,6 @@ Retrieves a model response with the given ID. - `"compaction"` - - `id: optional string` - - The ID of the compaction item. - - `agent: optional object { agent_name }` The agent that produced this item. @@ -22320,43 +19914,9 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `ImageGenerationCall object { id, result, status, 2 more }` - - An image generation request made by the model. - - - `id: string` - - The unique ID of the image generation call. - - - `result: string` - - The generated image encoded in base64. - - - `status: "in_progress" or "completed" or "generating" or "failed"` - - The status of the image generation call. - - - `"in_progress"` - - - `"completed"` - - - `"generating"` - - - `"failed"` - - - `type: "image_generation_call"` - - The type of the image generation call. Always `image_generation_call`. - - - `"image_generation_call"` - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` + - `created_by: optional string` - The canonical name of the agent that produced this item. + The identifier of the actor that created the item. - `CodeInterpreterCall object { id, code, container_id, 4 more }` @@ -22537,9 +20097,13 @@ Retrieves a model response with the given ID. - `"incomplete"` - - `ShellCall object { action, call_id, type, 5 more }` + - `ShellCall object { id, action, call_id, 6 more }` - A tool representing a request to execute one or more shell commands. + A tool call that executes one or more shell commands in a managed environment. + + - `id: string` + + The unique ID of the shell tool call. Populated when this item is returned via API. - `action: object { commands, max_output_length, timeout_ms }` @@ -22547,30 +20111,60 @@ Retrieves a model response with the given ID. - `commands: array of string` - Ordered shell commands for the execution environment to run. - - - `max_output_length: optional number` + - `max_output_length: number` - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + Optional maximum number of characters to return from each command. - - `timeout_ms: optional number` + - `timeout_ms: number` - Maximum wall-clock time in milliseconds to allow the shell commands to run. + Optional timeout in milliseconds for the commands. - `call_id: string` The unique ID of the shell tool call generated by the model. + - `environment: BetaResponseLocalEnvironment or BetaResponseContainerReference` + + Represents the use of a local environment to perform shell actions. + + - `BetaResponseLocalEnvironment object { type }` + + Represents the use of a local environment to perform shell actions. + + - `type: "local"` + + The environment type. Always `local`. + + - `"local"` + + - `BetaResponseContainerReference object { container_id, type }` + + Represents a container created with /v1/containers. + + - `container_id: string` + + - `type: "container_reference"` + + The environment type. Always `container_reference`. + + - `"container_reference"` + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + - `type: "shell_call"` The type of the item. Always `shell_call`. - `"shell_call"` - - `id: optional string` - - The unique ID of the shell tool call. Populated when this item is returned via API. - - `agent: optional object { agent_name }` The agent that produced this item. @@ -22587,8 +20181,6 @@ Retrieves a model response with the given ID. - `type: "direct"` - The caller type. Always `direct`. - - `"direct"` - `Program object { caller_id, type }` @@ -22599,43 +20191,35 @@ Retrieves a model response with the given ID. - `type: "program"` - The caller type. Always `program`. - - `"program"` - - `environment: optional BetaLocalEnvironment or BetaContainerReference` - - The environment to execute the shell commands in. - - - `BetaLocalEnvironment object { type, skills }` - - - `BetaContainerReference object { container_id, type }` - - - `status: optional "in_progress" or "completed" or "incomplete"` - - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `created_by: optional string` - - `"in_progress"` + The ID of the entity that created this tool call. - - `"completed"` + - `ShellCallOutput object { id, call_id, max_output_length, 6 more }` - - `"incomplete"` + The output of a shell tool call that was emitted. - - `ShellCallOutput object { call_id, output, type, 5 more }` + - `id: string` - The streamed output items emitted by a shell tool call. + The unique ID of the shell call output. Populated when this item is returned via API. - `call_id: string` The unique ID of the shell tool call generated by the model. - - `output: array of BetaResponseFunctionShellCallOutputContent` + - `max_output_length: number` - Captured chunks of stdout and stderr output, along with their associated outcomes. + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + + - `output: array of object { outcome, stderr, stdout, created_by }` + + An array of shell call output contents - `outcome: object { type } or object { exit_code, type }` - The exit or timeout outcome associated with this shell call. + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - `Timeout object { type }` @@ -22653,7 +20237,7 @@ Retrieves a model response with the given ID. - `exit_code: number` - The exit code returned by the shell process. + Exit code from the shell process. - `type: "exit"` @@ -22663,21 +20247,31 @@ Retrieves a model response with the given ID. - `stderr: string` - Captured stderr output for the shell call. + The standard error output that was captured. - `stdout: string` - Captured stdout output for the shell call. + The standard output that was captured. - - `type: "shell_call_output"` + - `created_by: optional string` - The type of the item. Always `shell_call_output`. + The identifier of the actor that created the item. - - `"shell_call_output"` + - `status: "in_progress" or "completed" or "incomplete"` - - `id: optional string` + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "shell_call_output"` + + The type of the shell call output. Always `shell_call_output`. + + - `"shell_call_output"` - `agent: optional object { agent_name }` @@ -22695,8 +20289,6 @@ Retrieves a model response with the given ID. - `type: "direct"` - The caller type. Always `direct`. - - `"direct"` - `Program object { caller_id, type }` @@ -22707,27 +20299,19 @@ Retrieves a model response with the given ID. - `type: "program"` - The caller type. Always `program`. - - `"program"` - - `max_output_length: optional number` - - The maximum number of UTF-8 characters captured for this shell call's combined output. - - - `status: optional "in_progress" or "completed" or "incomplete"` - - The status of the shell call output. + - `created_by: optional string` - - `"in_progress"` + The identifier of the actor that created the item. - - `"completed"` + - `ApplyPatchCall object { id, call_id, operation, 5 more }` - - `"incomplete"` + A tool call that applies file diffs by creating, deleting, or updating files. - - `ApplyPatchCall object { call_id, operation, status, 4 more }` + - `id: string` - A tool call representing a request to create, delete, or update files using diff patches. + The unique ID of the apply patch tool call. Populated when this item is returned via API. - `call_id: string` @@ -22735,55 +20319,55 @@ Retrieves a model response with the given ID. - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` - The specific create, delete, or update instruction for the apply_patch tool call. + One of the create_file, delete_file, or update_file operations applied via apply_patch. - `CreateFile object { diff, path, type }` - Instruction for creating a new file via the apply_patch tool. + Instruction describing how to create a file via the apply_patch tool. - `diff: string` - Unified diff content to apply when creating the file. + Diff to apply. - `path: string` - Path of the file to create relative to the workspace root. + Path of the file to create. - `type: "create_file"` - The operation type. Always `create_file`. + Create a new file with the provided diff. - `"create_file"` - `DeleteFile object { path, type }` - Instruction for deleting an existing file via the apply_patch tool. + Instruction describing how to delete a file via the apply_patch tool. - `path: string` - Path of the file to delete relative to the workspace root. + Path of the file to delete. - `type: "delete_file"` - The operation type. Always `delete_file`. + Delete the specified file. - `"delete_file"` - `UpdateFile object { diff, path, type }` - Instruction for updating an existing file via the apply_patch tool. + Instruction describing how to update a file via the apply_patch tool. - `diff: string` - Unified diff content to apply to the existing file. + Diff to apply. - `path: string` - Path of the file to update relative to the workspace root. + Path of the file to update. - `type: "update_file"` - The operation type. Always `update_file`. + Update an existing file with the provided diff. - `"update_file"` @@ -22801,10 +20385,6 @@ Retrieves a model response with the given ID. - `"apply_patch_call"` - - `id: optional string` - - The unique ID of the apply patch tool call. Populated when this item is returned via API. - - `agent: optional object { agent_name }` The agent that produced this item. @@ -22821,8 +20401,6 @@ Retrieves a model response with the given ID. - `type: "direct"` - The caller type. Always `direct`. - - `"direct"` - `Program object { caller_id, type }` @@ -22833,13 +20411,19 @@ Retrieves a model response with the given ID. - `type: "program"` - The caller type. Always `program`. - - `"program"` - - `ApplyPatchCallOutput object { call_id, status, type, 4 more }` + - `created_by: optional string` - The streamed output emitted by an apply patch tool call. + The ID of the entity that created this tool call. + + - `ApplyPatchCallOutput object { id, call_id, status, 5 more }` + + The output emitted by an apply patch tool call. + + - `id: string` + + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - `call_id: string` @@ -22859,10 +20443,6 @@ Retrieves a model response with the given ID. - `"apply_patch_call_output"` - - `id: optional string` - - The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `agent: optional object { agent_name }` The agent that produced this item. @@ -22879,8 +20459,6 @@ Retrieves a model response with the given ID. - `type: "direct"` - The caller type. Always `direct`. - - `"direct"` - `Program object { caller_id, type }` @@ -22891,13 +20469,15 @@ Retrieves a model response with the given ID. - `type: "program"` - The caller type. Always `program`. - - `"program"` + - `created_by: optional string` + + The ID of the entity that created this tool call output. + - `output: optional string` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + Optional textual output returned by the apply patch tool. - `McpListTools object { id, server_label, tools, 3 more }` @@ -22983,10 +20563,14 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `McpApprovalResponse object { approval_request_id, approve, type, 3 more }` + - `McpApprovalResponse object { id, approval_request_id, approve, 3 more }` A response to an MCP approval request. + - `id: string` + + The unique ID of the approval response + - `approval_request_id: string` The ID of the approval request being answered. @@ -23001,10 +20585,6 @@ Retrieves a model response with the given ID. - `"mcp_approval_response"` - - `id: optional string` - - The unique ID of the approval response - - `agent: optional object { agent_name }` The agent that produced this item. @@ -23078,6 +20658,64 @@ Retrieves a model response with the given ID. - `"failed"` + - `CustomToolCall object { call_id, input, name, 5 more }` + + A call to a custom tool created by the model. + + - `call_id: string` + + An identifier used to map this custom tool call to a tool call output. + + - `input: string` + + The input for the custom tool call generated by the model. + + - `name: string` + + The name of the custom tool being called. + + - `type: "custom_tool_call"` + + The type of the custom tool call. Always `custom_tool_call`. + + - `"custom_tool_call"` + + - `id: optional string` + + The unique ID of the custom tool call in the OpenAI platform. + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `namespace: optional string` + + The namespace of the custom tool being called. + - `CustomToolCallOutput object { call_id, output, type, 3 more }` The output of a custom tool call from your code, being sent back to the model. @@ -23153,407 +20791,677 @@ Retrieves a model response with the given ID. - `"program"` - - `CustomToolCall object { call_id, input, name, 5 more }` + - `usage: BetaResponseUsage` - A call to a custom tool created by the model. + Token accounting for the compaction pass, including cached, reasoning, and total tokens. - - `call_id: string` + - `input_tokens: number` - An identifier used to map this custom tool call to a tool call output. + The number of input tokens. - - `input: string` + - `input_tokens_details: object { cache_write_tokens, cached_tokens }` - The input for the custom tool call generated by the model. + A detailed breakdown of the input tokens. - - `name: string` + - `cache_write_tokens: number` - The name of the custom tool being called. + The number of input tokens that were written to the cache. - - `type: "custom_tool_call"` + - `cached_tokens: number` - The type of the custom tool call. Always `custom_tool_call`. + The number of tokens that were retrieved from the cache. + [More on prompt caching](/docs/guides/prompt-caching). - - `"custom_tool_call"` + - `output_tokens: number` - - `id: optional string` + The number of output tokens. - The unique ID of the custom tool call in the OpenAI platform. + - `output_tokens_details: object { reasoning_tokens }` - - `agent: optional object { agent_name }` + A detailed breakdown of the output tokens. - The agent that produced this item. + - `reasoning_tokens: number` - - `agent_name: string` + The number of reasoning tokens. - The canonical name of the agent that produced this item. + - `total_tokens: number` - - `caller: optional object { type } or object { caller_id, type }` + The total number of tokens used. - The execution context that produced this tool call. +### Example - - `Direct object { type }` +```http +curl https://api.openai.com/v1/responses/compact \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.6-sol", + "previous_response_id": "resp_123" + }' +``` - - `type: "direct"` +#### Response - - `"direct"` +```json +{ + "id": "id", + "created_at": 0, + "object": "response.compaction", + "output": [ + { + "id": "id", + "content": [ + { + "text": "text", + "type": "input_text", + "prompt_cache_breakpoint": { + "mode": "explicit" + } + } + ], + "role": "unknown", + "status": "in_progress", + "type": "message", + "agent": { + "agent_name": "agent_name" + }, + "phase": "commentary" + } + ], + "usage": { + "input_tokens": 0, + "input_tokens_details": { + "cache_write_tokens": 0, + "cached_tokens": 0 + }, + "output_tokens": 0, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 0 + } +} +``` - - `Program object { caller_id, type }` +### Example - - `caller_id: string` +```http +curl -X POST https://api.openai.com/v1/responses/compact \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.1-codex-max", + "input": [ + { + "role": "user", + "content": "Create a simple landing page for a dog petting café." + }, + { + "id": "msg_001", + "type": "message", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "Below is a single file, ready-to-use landing page for a dog petting café:..." + } + ], + "role": "assistant" + } + ] + }' +``` - The call ID of the program item that produced this tool call. +#### Response - - `type: "program"` +```json +{ + "id": "resp_001", + "object": "response.compaction", + "created_at": 1764967971, + "output": [ + { + "id": "msg_000", + "type": "message", + "status": "completed", + "content": [ + { + "type": "input_text", + "text": "Create a simple landing page for a dog petting cafe." + } + ], + "role": "user" + }, + { + "id": "cmp_001", + "type": "compaction", + "encrypted_content": "gAAAAABpM0Yj-...=" + } + ], + "usage": { + "input_tokens": 139, + "input_tokens_details": { + "cached_tokens": 0, + "cache_write_tokens": 0 + }, + "output_tokens": 438, + "output_tokens_details": { + "reasoning_tokens": 64 + }, + "total_tokens": 577 + } +} +``` - - `"program"` +## Create a model response - - `namespace: optional string` +**post** `/responses?beta=true` - The namespace of the custom tool being called. +Creates a model response. Provide [text](/docs/guides/text) or +[image](/docs/guides/images) inputs to generate [text](/docs/guides/text) +or [JSON](/docs/guides/structured-outputs) outputs. Have the model call +your own [custom code](/docs/guides/function-calling) or use built-in +[tools](/docs/guides/tools) like [web search](/docs/guides/tools-web-search) +or [file search](/docs/guides/tools-file-search) to use your own data +as input for the model's response. - - `CompactionTrigger object { type, agent }` +### Header Parameters - Compacts the current context. Must be the final input item. +- `"openai-beta": optional array of "responses_multi_agent=v1"` - - `type: "compaction_trigger"` + - `"responses_multi_agent=v1"` - The type of the item. Always `compaction_trigger`. +### Body Parameters - - `"compaction_trigger"` +- `background: optional boolean` - - `agent: optional object { agent_name }` + Whether to run the model response in the background. + [Learn more](/docs/guides/background). - The agent that produced this item. +- `context_management: optional array of object { type, compact_threshold }` - - `agent_name: string` + Context management configuration for this request. - The canonical name of the agent that produced this item. + - `type: string` - - `ItemReference object { id, agent, type }` + The context management entry type. Currently only 'compaction' is supported. - An internal identifier for an item to reference. + - `compact_threshold: optional number` + + Token threshold at which compaction should be triggered for this entry. + +- `conversation: optional string or BetaResponseConversationParam` + + The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. + Input items and output items from this response are automatically added to this conversation after this response completes. + + - `ConversationID = string` + + The unique ID of the conversation. + + - `BetaResponseConversationParam object { id }` + + The conversation that this response belongs to. - `id: string` - The ID of the item to reference. + The unique ID of the conversation. - - `agent: optional object { agent_name }` +- `include: optional array of BetaResponseIncludable` - The agent that produced this item. + Specify additional output data to include in the model response. Currently supported values are: - - `agent_name: string` + - `web_search_call.action.sources`: Include the sources of the web search tool call. + - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. + - `computer_call_output.output.image_url`: Include image urls from the computer call output. + - `file_search_call.results`: Include the search results of the file search tool call. + - `message.input_image.image_url`: Include image urls from the input message. + - `message.output_text.logprobs`: Include logprobs with assistant messages. + - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). - The canonical name of the agent that produced this item. + - `"file_search_call.results"` - - `type: optional "item_reference"` + - `"web_search_call.results"` - The type of item to reference. Always `item_reference`. + - `"web_search_call.action.sources"` - - `"item_reference"` + - `"message.input_image.image_url"` - - `Program object { id, call_id, code, 3 more }` + - `"computer_call_output.output.image_url"` - - `id: string` + - `"code_interpreter_call.outputs"` - The unique ID of this program item. + - `"reasoning.encrypted_content"` - - `call_id: string` + - `"message.output_text.logprobs"` - The stable call ID of the program item. +- `input: optional string or array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` - - `code: string` + Text, image, or file inputs to the model, used to generate a response. - The JavaScript source executed by programmatic tool calling. + Learn more: - - `fingerprint: string` + - [Text inputs and outputs](/docs/guides/text) + - [Image inputs](/docs/guides/images) + - [File inputs](/docs/guides/pdf-files) + - [Conversation state](/docs/guides/conversation-state) + - [Function calling](/docs/guides/function-calling) - Opaque program replay fingerprint that must be round-tripped. + - `TextInput = string` - - `type: "program"` + A text input to the model, equivalent to a text input with the + `user` role. - The item type. Always `program`. + - `InputItemList = array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` - - `"program"` + A list of one or many input items to the model, containing + different content types. - - `agent: optional object { agent_name }` + - `BetaEasyInputMessage object { content, role, phase, type }` - The agent that produced this item. + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. - - `agent_name: string` + - `content: string or BetaResponseInputMessageContentList` - The canonical name of the agent that produced this item. + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. - - `ProgramOutput object { id, call_id, result, 3 more }` + - `TextInput = string` - - `id: string` + A text input to the model. - The unique ID of this program output item. + - `BetaResponseInputMessageContentList = array of BetaResponseInputContent` - - `call_id: string` + A list of one or many input items to the model, containing different content + types. - The call ID of the program item. + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - `result: string` + A text input to the model. - The result produced by the program item. + - `text: string` - - `status: "completed" or "incomplete"` + The text input to the model. - The terminal status of the program output. + - `type: "input_text"` - - `"completed"` + The type of the input item. Always `input_text`. - - `"incomplete"` + - `"input_text"` - - `type: "program_output"` + - `prompt_cache_breakpoint: optional object { mode }` - The item type. Always `program_output`. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `"program_output"` + - `mode: "explicit"` - - `agent: optional object { agent_name }` + The breakpoint mode. Always `explicit`. - The agent that produced this item. + - `"explicit"` - - `agent_name: string` + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - The canonical name of the agent that produced this item. + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `metadata: map[string]` + - `detail: "low" or "high" or "auto" or "original"` - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `"low"` - - `model: "gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more or string` + - `"high"` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](/docs/models) - to browse and compare available models. + - `"auto"` - - `"gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more` + - `"original"` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](/docs/models) - to browse and compare available models. + - `type: "input_image"` - - `"gpt-5.6-sol"` + The type of the input item. Always `input_image`. - - `"gpt-5.6-terra"` + - `"input_image"` - - `"gpt-5.6-luna"` + - `file_id: optional string` - - `"gpt-5.4"` + The ID of the file to be sent to the model. - - `"gpt-5.4-mini"` + - `image_url: optional string` - - `"gpt-5.4-nano"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `"gpt-5.4-mini-2026-03-17"` + - `prompt_cache_breakpoint: optional object { mode }` - - `"gpt-5.4-nano-2026-03-17"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `"gpt-5.3-chat-latest"` + - `mode: "explicit"` - - `"gpt-5.2"` + The breakpoint mode. Always `explicit`. - - `"gpt-5.2-2025-12-11"` + - `"explicit"` - - `"gpt-5.2-chat-latest"` + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - - `"gpt-5.2-pro"` + A file input to the model. - - `"gpt-5.2-pro-2025-12-11"` + - `type: "input_file"` - - `"gpt-5.1"` + The type of the input item. Always `input_file`. - - `"gpt-5.1-2025-11-13"` + - `"input_file"` - - `"gpt-5.1-codex"` + - `detail: optional "auto" or "low" or "high"` - - `"gpt-5.1-mini"` + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `"gpt-5.1-chat-latest"` + - `"auto"` - - `"gpt-5"` + - `"low"` - - `"gpt-5-mini"` + - `"high"` - - `"gpt-5-nano"` + - `file_data: optional string` - - `"gpt-5-2025-08-07"` + The content of the file to be sent to the model. - - `"gpt-5-mini-2025-08-07"` + - `file_id: optional string` - - `"gpt-5-nano-2025-08-07"` + The ID of the file to be sent to the model. - - `"gpt-5-chat-latest"` + - `file_url: optional string` - - `"gpt-4.1"` + The URL of the file to be sent to the model. - - `"gpt-4.1-mini"` + - `filename: optional string` - - `"gpt-4.1-nano"` + The name of the file to be sent to the model. - - `"gpt-4.1-2025-04-14"` + - `prompt_cache_breakpoint: optional object { mode }` - - `"gpt-4.1-mini-2025-04-14"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `"gpt-4.1-nano-2025-04-14"` + - `mode: "explicit"` + + The breakpoint mode. Always `explicit`. + + - `"explicit"` + + - `role: "user" or "assistant" or "system" or "developer"` + + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. + + - `"user"` + + - `"assistant"` + + - `"system"` + + - `"developer"` + + - `phase: optional "commentary" or "final_answer"` + + Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). + For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend + phase on all assistant messages — dropping it can degrade performance. Not used for user messages. + + - `"commentary"` + + - `"final_answer"` + + - `type: optional "message"` + + The type of the message input. Always `message`. + + - `"message"` + + - `Message object { content, role, agent, 2 more }` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + + - `content: BetaResponseInputMessageContentList` + + A list of one or many input items to the model, containing different content + types. + + - `role: "user" or "system" or "developer"` + + The role of the message input. One of `user`, `system`, or `developer`. + + - `"user"` + + - `"system"` + + - `"developer"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `status: optional "in_progress" or "completed" or "incomplete"` + + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: optional "message"` + + The type of the message input. Always set to `message`. + + - `"message"` + + - `BetaResponseOutputMessage object { id, content, role, 4 more }` + + An output message from the model. + + - `id: string` + + The unique ID of the output message. + + - `content: array of BetaResponseOutputText or BetaResponseOutputRefusal` + + The content of the output message. + + - `BetaResponseOutputText object { annotations, logprobs, text, type }` + + A text output from the model. + + - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` + + The annotations of the text output. + + - `FileCitation object { file_id, filename, index, type }` + + A citation to a file. + + - `file_id: string` + + The ID of the file. + + - `filename: string` + + The filename of the file cited. + + - `index: number` + + The index of the file in the list of files. + + - `type: "file_citation"` + + The type of the file citation. Always `file_citation`. + + - `"file_citation"` + + - `URLCitation object { end_index, start_index, title, 2 more }` + + A citation for a web resource used to generate a model response. + + - `end_index: number` + + The index of the last character of the URL citation in the message. - - `"o4-mini"` + - `start_index: number` - - `"o4-mini-2025-04-16"` + The index of the first character of the URL citation in the message. - - `"o3"` + - `title: string` - - `"o3-2025-04-16"` + The title of the web resource. - - `"o3-mini"` + - `type: "url_citation"` - - `"o3-mini-2025-01-31"` + The type of the URL citation. Always `url_citation`. - - `"o1"` + - `"url_citation"` - - `"o1-2024-12-17"` + - `url: string` - - `"o1-preview"` + The URL of the web resource. - - `"o1-preview-2024-09-12"` + - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` - - `"o1-mini"` + A citation for a container file used to generate a model response. - - `"o1-mini-2024-09-12"` + - `container_id: string` - - `"gpt-4o"` + The ID of the container file. - - `"gpt-4o-2024-11-20"` + - `end_index: number` - - `"gpt-4o-2024-08-06"` + The index of the last character of the container file citation in the message. - - `"gpt-4o-2024-05-13"` + - `file_id: string` - - `"gpt-4o-audio-preview"` + The ID of the file. - - `"gpt-4o-audio-preview-2024-10-01"` + - `filename: string` - - `"gpt-4o-audio-preview-2024-12-17"` + The filename of the container file cited. - - `"gpt-4o-audio-preview-2025-06-03"` + - `start_index: number` - - `"gpt-4o-mini-audio-preview"` + The index of the first character of the container file citation in the message. - - `"gpt-4o-mini-audio-preview-2024-12-17"` + - `type: "container_file_citation"` - - `"gpt-4o-search-preview"` + The type of the container file citation. Always `container_file_citation`. - - `"gpt-4o-mini-search-preview"` + - `"container_file_citation"` - - `"gpt-4o-search-preview-2025-03-11"` + - `FilePath object { file_id, index, type }` - - `"gpt-4o-mini-search-preview-2025-03-11"` + A path to a file. - - `"chatgpt-4o-latest"` + - `file_id: string` - - `"codex-mini-latest"` + The ID of the file. - - `"gpt-4o-mini"` + - `index: number` - - `"gpt-4o-mini-2024-07-18"` + The index of the file in the list of files. - - `"gpt-4-turbo"` + - `type: "file_path"` - - `"gpt-4-turbo-2024-04-09"` + The type of the file path. Always `file_path`. - - `"gpt-4-0125-preview"` + - `"file_path"` - - `"gpt-4-turbo-preview"` + - `logprobs: array of object { token, bytes, logprob, top_logprobs }` - - `"gpt-4-1106-preview"` + - `token: string` - - `"gpt-4-vision-preview"` + - `bytes: array of number` - - `"gpt-4"` + - `logprob: number` - - `"gpt-4-0314"` + - `top_logprobs: array of object { token, bytes, logprob }` - - `"gpt-4-0613"` + - `token: string` - - `"gpt-4-32k"` + - `bytes: array of number` - - `"gpt-4-32k-0314"` + - `logprob: number` - - `"gpt-4-32k-0613"` + - `text: string` - - `"gpt-3.5-turbo"` + The text output from the model. - - `"gpt-3.5-turbo-16k"` + - `type: "output_text"` - - `"gpt-3.5-turbo-0301"` + The type of the output text. Always `output_text`. - - `"gpt-3.5-turbo-0613"` + - `"output_text"` - - `"gpt-3.5-turbo-1106"` + - `BetaResponseOutputRefusal object { refusal, type }` - - `"gpt-3.5-turbo-0125"` + A refusal from the model. - - `"gpt-3.5-turbo-16k-0613"` + - `refusal: string` - - `"o1-pro"` + The refusal explanation from the model. - - `"o1-pro-2025-03-19"` + - `type: "refusal"` - - `"o3-pro"` + The type of the refusal. Always `refusal`. - - `"o3-pro-2025-06-10"` + - `"refusal"` - - `"o3-deep-research"` + - `role: "assistant"` - - `"o3-deep-research-2025-06-26"` + The role of the output message. Always `assistant`. - - `"o4-mini-deep-research"` + - `"assistant"` - - `"o4-mini-deep-research-2025-06-26"` + - `status: "in_progress" or "completed" or "incomplete"` - - `"computer-use-preview"` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `"computer-use-preview-2025-03-11"` + - `"in_progress"` - - `"gpt-5-codex"` + - `"completed"` - - `"gpt-5-pro"` + - `"incomplete"` - - `"gpt-5-pro-2025-10-06"` + - `type: "message"` - - `"gpt-5.1-codex-max"` + The type of the output message. Always `message`. - - `string` + - `"message"` - - `object: "response"` + - `agent: optional object { agent_name }` - The object type of this resource - always set to `response`. + The agent that produced this item. - - `"response"` + - `agent_name: string` - - `output: array of BetaResponseOutputItem` + The canonical name of the agent that produced this item. - An array of content items generated by the model. + - `phase: optional "commentary" or "final_answer"` - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). + For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend + phase on all assistant messages — dropping it can degrade performance. Not used for user messages. - - `BetaResponseOutputMessage object { id, content, role, 4 more }` + - `"commentary"` - An output message from the model. + - `"final_answer"` - `FileSearchCall object { id, queries, status, 3 more }` @@ -23631,66 +21539,36 @@ Retrieves a model response with the given ID. The text that was retrieved from the file. - - `FunctionCall object { arguments, call_id, name, 6 more }` + - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` - A tool call to run a function. See the - [function calling guide](/docs/guides/function-calling) for more information. + A tool call to a computer use tool. See the + [computer use guide](/docs/guides/tools-computer-use) for more information. - - `arguments: string` + - `id: string` - A JSON string of the arguments to pass to the function. + The unique ID of the computer call. - `call_id: string` - The unique ID of the function tool call generated by the model. - - - `name: string` - - The name of the function to run. - - - `type: "function_call"` - - The type of the function tool call. Always `function_call`. - - - `"function_call"` - - - `id: optional string` - - The unique ID of the function tool call. - - - `agent: optional object { agent_name }` - - The agent that produced this item. - - - `agent_name: string` - - The canonical name of the agent that produced this item. - - - `caller: optional object { type } or object { caller_id, type }` - - The execution context that produced this tool call. - - - `Direct object { type }` - - - `type: "direct"` + An identifier used when responding to the tool call with output. - - `"direct"` + - `pending_safety_checks: array of object { id, code, message }` - - `Program object { caller_id, type }` + The pending safety checks for the computer call. - - `caller_id: string` + - `id: string` - The call ID of the program item that produced this tool call. + The ID of the pending safety check. - - `type: "program"` + - `code: optional string` - - `"program"` + The type of the pending safety check. - - `namespace: optional string` + - `message: optional string` - The namespace of the function to run. + Details about the pending safety check. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `status: "in_progress" or "completed" or "incomplete"` The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. @@ -23701,273 +21579,247 @@ Retrieves a model response with the given ID. - `"incomplete"` - - `FunctionCallOutput object { id, call_id, output, 5 more }` - - - `id: string` - - The unique ID of the function call tool output. - - - `call_id: string` - - The unique ID of the function tool call generated by the model. - - - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - - The output from the function call generated by your code. - Can be a string or an list of output content. - - - `StringOutput = string` - - A string of the output of the function call. - - - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - - Text, image, or file output of the function call. - - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - A text input to the model. - - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - - An image input to the model. Learn about [image inputs](/docs/guides/vision). - - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + - `type: "computer_call"` - A file input to the model. + The type of the computer call. Always `computer_call`. - - `status: "in_progress" or "completed" or "incomplete"` + - `"computer_call"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `action: optional BetaComputerAction` - - `"in_progress"` + A click action. - - `"completed"` + - `Click object { button, type, x, 2 more }` - - `"incomplete"` + A click action. - - `type: "function_call_output"` + - `button: "left" or "right" or "wheel" or 2 more` - The type of the function tool call output. Always `function_call_output`. + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - - `"function_call_output"` + - `"left"` - - `agent: optional object { agent_name }` + - `"right"` - The agent that produced this item. + - `"wheel"` - - `agent_name: string` + - `"back"` - The canonical name of the agent that produced this item. + - `"forward"` - - `caller: optional object { type } or object { caller_id, type }` + - `type: "click"` - The execution context that produced this tool call. + Specifies the event type. For a click action, this property is always `click`. - - `Direct object { type }` + - `"click"` - - `type: "direct"` + - `x: number` - The caller type. Always `direct`. + The x-coordinate where the click occurred. - - `"direct"` + - `y: number` - - `Program object { caller_id, type }` + The y-coordinate where the click occurred. - - `caller_id: string` + - `keys: optional array of string` - The call ID of the program item that produced this tool call. + The keys being held while clicking. - - `type: "program"` + - `DoubleClick object { keys, type, x, y }` - The caller type. Always `program`. + A double click action. - - `"program"` + - `keys: array of string` - - `created_by: optional string` + The keys being held while double-clicking. - The identifier of the actor that created the item. + - `type: "double_click"` - - `AgentMessage object { id, author, content, 3 more }` + Specifies the event type. For a double click action, this property is always set to `double_click`. - - `id: string` + - `"double_click"` - The unique ID of the agent message. + - `x: number` - - `author: string` + The x-coordinate where the double click occurred. - The sending agent identity. + - `y: number` - - `content: array of BetaResponseInputText or BetaResponseOutputText or object { text, type } or 7 more` + The y-coordinate where the double click occurred. - Encrypted content sent between agents. + - `Drag object { path, type, keys }` - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + A drag action. - A text input to the model. + - `path: array of object { x, y }` - - `BetaResponseOutputText object { annotations, logprobs, text, type }` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - A text output from the model. + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `Text object { text, type }` + - `x: number` - A text content. + The x-coordinate. - - `text: string` + - `y: number` - - `type: "text"` + The y-coordinate. - - `"text"` + - `type: "drag"` - - `SummaryText object { text, type }` + Specifies the event type. For a drag action, this property is always set to `drag`. - A summary text from the model. + - `"drag"` - - `text: string` + - `keys: optional array of string` - A summary of the reasoning output from the model so far. + The keys being held while dragging the mouse. - - `type: "summary_text"` + - `Keypress object { keys, type }` - The type of the object. Always `summary_text`. + A collection of keypresses the model would like to perform. - - `"summary_text"` + - `keys: array of string` - - `ReasoningText object { text, type }` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - Reasoning text from the model. + - `type: "keypress"` - - `text: string` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - The reasoning text from the model. + - `"keypress"` - - `type: "reasoning_text"` + - `Move object { type, x, y, keys }` - The type of the reasoning text. Always `reasoning_text`. + A mouse move action. - - `"reasoning_text"` + - `type: "move"` - - `BetaResponseOutputRefusal object { refusal, type }` + Specifies the event type. For a move action, this property is always set to `move`. - A refusal from the model. + - `"move"` - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + - `x: number` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + The x-coordinate to move to. - - `ComputerScreenshot object { detail, file_id, image_url, 2 more }` + - `y: number` - A screenshot of a computer. + The y-coordinate to move to. - - `detail: "low" or "high" or "auto" or "original"` + - `keys: optional array of string` - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The keys being held while moving the mouse. - - `"low"` + - `Screenshot object { type }` - - `"high"` + A screenshot action. - - `"auto"` + - `type: "screenshot"` - - `"original"` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `file_id: string` + - `"screenshot"` - The identifier of an uploaded file that contains the screenshot. + - `Scroll object { scroll_x, scroll_y, type, 3 more }` - - `image_url: string` + A scroll action. - The URL of the screenshot image. + - `scroll_x: number` - - `type: "computer_screenshot"` + The horizontal scroll distance. - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `scroll_y: number` - - `"computer_screenshot"` + The vertical scroll distance. - - `prompt_cache_breakpoint: optional object { mode }` + - `type: "scroll"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `mode: "explicit"` + - `"scroll"` - The breakpoint mode. Always `explicit`. + - `x: number` - - `"explicit"` + The x-coordinate where the scroll occurred. - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + - `y: number` - A file input to the model. + The y-coordinate where the scroll occurred. - - `EncryptedContent object { encrypted_content, type }` + - `keys: optional array of string` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + The keys being held while scrolling. - - `encrypted_content: string` + - `Type object { text, type }` - Opaque encrypted content. + An action to type in text. - - `type: "encrypted_content"` + - `text: string` - The type of the input item. Always `encrypted_content`. + The text to type. - - `"encrypted_content"` + - `type: "type"` - - `recipient: string` + Specifies the event type. For a type action, this property is always set to `type`. - The destination agent identity. + - `"type"` - - `type: "agent_message"` + - `Wait object { type }` - The type of the item. Always `agent_message`. + A wait action. - - `"agent_message"` + - `type: "wait"` - - `agent: optional object { agent_name }` + Specifies the event type. For a wait action, this property is always set to `wait`. - The agent that produced this item. + - `"wait"` - - `agent_name: string` + - `actions: optional BetaComputerActionList` - The canonical name of the agent that produced this item. + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - - `MultiAgentCall object { id, action, arguments, 3 more }` + - `Click object { button, type, x, 2 more }` - - `id: string` + A click action. - The unique ID of the multi-agent call item. + - `DoubleClick object { keys, type, x, y }` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + A double click action. - The multi-agent action to execute. + - `Drag object { path, type, keys }` - - `"spawn_agent"` + A drag action. - - `"interrupt_agent"` + - `Keypress object { keys, type }` - - `"list_agents"` + A collection of keypresses the model would like to perform. - - `"send_message"` + - `Move object { type, x, y, keys }` - - `"followup_task"` + A mouse move action. - - `"wait_agent"` + - `Screenshot object { type }` - - `arguments: string` + A screenshot action. - The JSON string of arguments generated for the action. + - `Scroll object { scroll_x, scroll_y, type, 3 more }` - - `call_id: string` + A scroll action. - The unique ID linking this call to its output. + - `Type object { text, type }` - - `type: "multi_agent_call"` + An action to type in text. - The type of the multi-agent call. Always `multi_agent_call`. + - `Wait object { type }` - - `"multi_agent_call"` + A wait action. - `agent: optional object { agent_name }` @@ -23977,55 +21829,58 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `MultiAgentCallOutput object { id, action, call_id, 3 more }` + - `ComputerCallOutput object { call_id, output, type, 4 more }` - - `id: string` + The output of a computer tool call. - The unique ID of the multi-agent call output item. + - `call_id: string` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + The ID of the computer tool call that produced the output. - The multi-agent action that produced this result. + - `output: BetaResponseComputerToolCallOutputScreenshot` - - `"spawn_agent"` + A computer screenshot image used with the computer use tool. - - `"interrupt_agent"` + - `type: "computer_screenshot"` - - `"list_agents"` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - - `"send_message"` + - `"computer_screenshot"` - - `"followup_task"` + - `file_id: optional string` - - `"wait_agent"` + The identifier of an uploaded file that contains the screenshot. - - `call_id: string` + - `image_url: optional string` - The unique ID of the multi-agent call. + The URL of the screenshot image. - - `output: array of BetaResponseOutputText` + - `type: "computer_call_output"` - Text output returned by the multi-agent action. + The type of the computer tool call output. Always `computer_call_output`. - - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` + - `"computer_call_output"` - The annotations of the text output. + - `id: optional string` - - `logprobs: array of object { token, bytes, logprob, top_logprobs }` + The ID of the computer tool call output. - - `text: string` + - `acknowledged_safety_checks: optional array of object { id, code, message }` - The text output from the model. + The safety checks reported by the API that have been acknowledged by the developer. - - `type: "output_text"` + - `id: string` - The type of the output text. Always `output_text`. + The ID of the pending safety check. - - `type: "multi_agent_call_output"` + - `code: optional string` - The type of the multi-agent result. Always `multi_agent_call_output`. + The type of the pending safety check. - - `"multi_agent_call_output"` + - `message: optional string` + + Details about the pending safety check. - `agent: optional object { agent_name }` @@ -24035,6 +21890,16 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. + - `status: optional "in_progress" or "completed" or "incomplete"` + + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + - `WebSearchCall object { id, action, status, 2 more }` The results of a web search tool call. See the @@ -24139,36 +22004,66 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` + - `FunctionCall object { arguments, call_id, name, 6 more }` - A tool call to a computer use tool. See the - [computer use guide](/docs/guides/tools-computer-use) for more information. + A tool call to run a function. See the + [function calling guide](/docs/guides/function-calling) for more information. - - `id: string` + - `arguments: string` - The unique ID of the computer call. + A JSON string of the arguments to pass to the function. - `call_id: string` - An identifier used when responding to the tool call with output. + The unique ID of the function tool call generated by the model. - - `pending_safety_checks: array of object { id, code, message }` + - `name: string` - The pending safety checks for the computer call. + The name of the function to run. - - `id: string` + - `type: "function_call"` - The ID of the pending safety check. + The type of the function tool call. Always `function_call`. - - `code: optional string` + - `"function_call"` - The type of the pending safety check. + - `id: optional string` - - `message: optional string` + The unique ID of the function tool call. - Details about the pending safety check. + - `agent: optional object { agent_name }` - - `status: "in_progress" or "completed" or "incomplete"` + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `namespace: optional string` + + The namespace of the function to run. + + - `status: optional "in_progress" or "completed" or "incomplete"` The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. @@ -24179,121 +22074,145 @@ Retrieves a model response with the given ID. - `"incomplete"` - - `type: "computer_call"` + - `FunctionCallOutput object { call_id, output, type, 4 more }` - The type of the computer call. Always `computer_call`. + The output of a function tool call. - - `"computer_call"` + - `call_id: string` - - `action: optional BetaComputerAction` + The unique ID of the function tool call generated by the model. - A click action. + - `output: string or array of BetaResponseInputTextContent or BetaResponseInputImageContent or BetaResponseInputFileContent` - - `actions: optional BetaComputerActionList` + Text, image, or file output of the function tool call. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `string` - - `agent: optional object { agent_name }` + A JSON string of the output of the function tool call. - The agent that produced this item. + - `array of BetaResponseInputTextContent or BetaResponseInputImageContent or BetaResponseInputFileContent` - - `agent_name: string` + An array of content outputs (text, image, file) for the function tool call. - The canonical name of the agent that produced this item. + - `BetaResponseInputTextContent object { text, type, prompt_cache_breakpoint }` - - `ComputerCallOutput object { id, call_id, output, 5 more }` + A text input to the model. - - `id: string` + - `text: string` - The unique ID of the computer call tool output. + The text input to the model. - - `call_id: string` + - `type: "input_text"` - The ID of the computer tool call that produced the output. + The type of the input item. Always `input_text`. - - `output: BetaResponseComputerToolCallOutputScreenshot` + - `"input_text"` - A computer screenshot image used with the computer use tool. + - `prompt_cache_breakpoint: optional object { mode }` - - `status: "completed" or "incomplete" or "failed" or "in_progress"` + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `mode: "explicit"` - - `"completed"` + The breakpoint mode. Always `explicit`. - - `"incomplete"` + - `"explicit"` - - `"failed"` + - `BetaResponseInputImageContent object { type, detail, file_id, 2 more }` - - `"in_progress"` + An image input to the model. Learn about [image inputs](/docs/guides/vision) - - `type: "computer_call_output"` + - `type: "input_image"` - The type of the computer tool call output. Always `computer_call_output`. + The type of the input item. Always `input_image`. - - `"computer_call_output"` + - `"input_image"` - - `acknowledged_safety_checks: optional array of object { id, code, message }` + - `detail: optional "low" or "high" or "auto" or "original"` - The safety checks reported by the API that have been acknowledged by the - developer. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `id: string` + - `"low"` - The ID of the pending safety check. + - `"high"` - - `code: optional string` + - `"auto"` - The type of the pending safety check. + - `"original"` - - `message: optional string` + - `file_id: optional string` - Details about the pending safety check. + The ID of the file to be sent to the model. - - `agent: optional object { agent_name }` + - `image_url: optional string` - The agent that produced this item. + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `agent_name: string` + - `prompt_cache_breakpoint: optional object { mode }` - The canonical name of the agent that produced this item. + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. - - `created_by: optional string` + - `mode: "explicit"` - The identifier of the actor that created the item. + The breakpoint mode. Always `explicit`. - - `Reasoning object { id, summary, type, 4 more }` + - `"explicit"` - 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](/docs/guides/conversation-state). + - `BetaResponseInputFileContent object { type, detail, file_data, 4 more }` - - `id: string` + A file input to the model. - The unique identifier of the reasoning content. + - `type: "input_file"` - - `summary: array of object { text, type }` + The type of the input item. Always `input_file`. - Reasoning summary content. + - `"input_file"` - - `text: string` + - `detail: optional "auto" or "low" or "high"` - A summary of the reasoning output from the model so far. + The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. - - `type: "summary_text"` + - `"auto"` - The type of the object. Always `summary_text`. + - `"low"` - - `"summary_text"` + - `"high"` - - `type: "reasoning"` + - `file_data: optional string` - The type of the object. Always `reasoning`. + The base64-encoded data of the file to be sent to the model. - - `"reasoning"` + - `file_id: optional string` + + The ID of the file to be sent to the model. + + - `file_url: optional string` + + The URL of the file to be sent to the model. + + - `filename: optional string` + + The name of the file to be sent to the model. + + - `prompt_cache_breakpoint: optional object { mode }` + + Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + + - `mode: "explicit"` + + The breakpoint mode. Always `explicit`. + + - `"explicit"` + + - `type: "function_call_output"` + + The type of the function tool call output. Always `function_call_output`. + + - `"function_call_output"` + + - `id: optional string` + + The unique ID of the function tool call output. Populated when this item is returned via API. - `agent: optional object { agent_name }` @@ -24303,30 +22222,33 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `content: optional array of object { text, type }` + - `caller: optional object { type } or object { caller_id, type }` - Reasoning text content. + The execution context that produced this tool call. - - `text: string` + - `Direct object { type }` - The reasoning text from the model. + - `type: "direct"` - - `type: "reasoning_text"` + The caller type. Always `direct`. - The type of the reasoning text. Always `reasoning_text`. + - `"direct"` - - `"reasoning_text"` + - `Program object { caller_id, type }` - - `encrypted_content: optional string` + - `caller_id: string` - The encrypted content of the reasoning item. This is populated by default - for reasoning items returned by `POST /v1/responses` and WebSocket - `response.create` requests. + The call ID of the program item that produced this tool call. + + - `type: "program"` + + The caller type. Always `program`. + + - `"program"` - `status: optional "in_progress" or "completed" or "incomplete"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - `"in_progress"` @@ -24334,29 +22256,53 @@ Retrieves a model response with the given ID. - `"incomplete"` - - `Program object { id, call_id, code, 3 more }` + - `AgentMessage object { author, content, recipient, 3 more }` - - `id: string` + A message routed between agents. - The unique ID of the program item. + - `author: string` - - `call_id: string` + The sending agent identity. - The stable call ID of the program item. + - `content: array of BetaResponseInputTextContent or BetaResponseInputImageContent or object { encrypted_content, type }` - - `code: string` + Plaintext, image, or encrypted content sent between agents. - The JavaScript source executed by programmatic tool calling. + - `BetaResponseInputTextContent object { text, type, prompt_cache_breakpoint }` - - `fingerprint: string` + A text input to the model. - Opaque program replay fingerprint that must be round-tripped. + - `BetaResponseInputImageContent object { type, detail, file_id, 2 more }` - - `type: "program"` + An image input to the model. Learn about [image inputs](/docs/guides/vision) - The type of the item. Always `program`. + - `EncryptedContent object { encrypted_content, type }` - - `"program"` + Opaque encrypted content that Responses API decrypts inside trusted model execution. + + - `encrypted_content: string` + + Opaque encrypted content. + + - `type: "encrypted_content"` + + The type of the input item. Always `encrypted_content`. + + - `"encrypted_content"` + + - `recipient: string` + + The destination agent identity. + + - `type: "agent_message"` + + The item type. Always `agent_message`. + + - `"agent_message"` + + - `id: optional string` + + The unique ID of this agent message item. - `agent: optional object { agent_name }` @@ -24366,33 +22312,41 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `ProgramOutput object { id, call_id, result, 3 more }` + - `MultiAgentCall object { action, arguments, call_id, 3 more }` - - `id: string` + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - The unique ID of the program output item. + The multi-agent action that was executed. - - `call_id: string` + - `"spawn_agent"` - The call ID of the program item. + - `"interrupt_agent"` - - `result: string` + - `"list_agents"` - The result produced by the program item. + - `"send_message"` - - `status: "completed" or "incomplete"` + - `"followup_task"` - The terminal status of the program output item. + - `"wait_agent"` - - `"completed"` + - `arguments: string` - - `"incomplete"` + The action arguments as a JSON string. - - `type: "program_output"` + - `call_id: string` - The type of the item. Always `program_output`. + The unique ID linking this call to its output. - - `"program_output"` + - `type: "multi_agent_call"` + + The item type. Always `multi_agent_call`. + + - `"multi_agent_call"` + + - `id: optional string` + + The unique ID of this multi-agent call. - `agent: optional object { agent_name }` @@ -24402,43 +22356,127 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `ToolSearchCall object { id, arguments, call_id, 5 more }` + - `MultiAgentCallOutput object { action, call_id, output, 3 more }` - - `id: string` + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - The unique ID of the tool search call item. + The multi-agent action that produced this result. - - `arguments: unknown` + - `"spawn_agent"` - Arguments used for the tool search call. + - `"interrupt_agent"` + + - `"list_agents"` + + - `"send_message"` + + - `"followup_task"` + + - `"wait_agent"` - `call_id: string` - The unique ID of the tool search call generated by the model. + The unique ID of the multi-agent call. - - `execution: "server" or "client"` + - `output: array of object { text, type, annotations }` - Whether tool search was executed by the server or by the client. + Text output returned by the multi-agent action. - - `"server"` + - `text: string` - - `"client"` + The text content. - - `status: "in_progress" or "completed" or "incomplete"` + - `type: "output_text"` - The status of the tool search call item that was recorded. + The content type. Always `output_text`. - - `"in_progress"` + - `"output_text"` - - `"completed"` + - `annotations: optional array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more }` - - `"incomplete"` + Citations associated with the text content. - - `type: "tool_search_call"` + - `FileCitation object { file_id, filename, index, type }` - The type of the item. Always `tool_search_call`. + - `file_id: string` - - `"tool_search_call"` + The ID of the file. + + - `filename: string` + + The filename of the file cited. + + - `index: number` + + The index of the file in the list of files. + + - `type: "file_citation"` + + The citation type. Always `file_citation`. + + - `"file_citation"` + + - `URLCitation object { end_index, start_index, title, 2 more }` + + - `end_index: number` + + The index of the last character of the citation in the message. + + - `start_index: number` + + The index of the first character of the citation in the message. + + - `title: string` + + The title of the cited resource. + + - `type: "url_citation"` + + The citation type. Always `url_citation`. + + - `"url_citation"` + + - `url: string` + + The URL of the cited resource. + + - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` + + - `container_id: string` + + The ID of the container. + + - `end_index: number` + + The index of the last character of the citation in the message. + + - `file_id: string` + + The ID of the container file. + + - `filename: string` + + The filename of the container file cited. + + - `start_index: number` + + The index of the first character of the citation in the message. + + - `type: "container_file_citation"` + + The citation type. Always `container_file_citation`. + + - `"container_file_citation"` + + - `type: "multi_agent_call_output"` + + The item type. Always `multi_agent_call_output`. + + - `"multi_agent_call_output"` + + - `id: optional string` + + The unique ID of this multi-agent call output. - `agent: optional object { agent_name }` @@ -24448,21 +22486,35 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `created_by: optional string` + - `ToolSearchCall object { arguments, type, id, 4 more }` - The identifier of the actor that created the item. + - `arguments: unknown` - - `ToolSearchOutput object { id, call_id, execution, 5 more }` + The arguments supplied to the tool search call. - - `id: string` + - `type: "tool_search_call"` - The unique ID of the tool search output item. + The item type. Always `tool_search_call`. - - `call_id: string` + - `"tool_search_call"` + + - `id: optional string` + + The unique ID of this tool search call. + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `call_id: optional string` The unique ID of the tool search call generated by the model. - - `execution: "server" or "client"` + - `execution: optional "server" or "client"` Whether tool search was executed by the server or by the client. @@ -24470,9 +22522,9 @@ Retrieves a model response with the given ID. - `"client"` - - `status: "in_progress" or "completed" or "incomplete"` + - `status: optional "in_progress" or "completed" or "incomplete"` - The status of the tool search output item that was recorded. + The status of the tool search call. - `"in_progress"` @@ -24480,9 +22532,11 @@ Retrieves a model response with the given ID. - `"incomplete"` + - `ToolSearchOutput object { tools, type, id, 4 more }` + - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - The loaded tool definitions returned by tool search. + The loaded tool definitions returned by the tool search output. - `Function object { name, parameters, strict, 5 more }` @@ -25003,8 +23057,40 @@ Retrieves a model response with the given ID. - `BetaContainerNetworkPolicyDisabled object { type }` + - `type: "disabled"` + + Disable outbound network access. Always `disabled`. + + - `"disabled"` + - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` + - `allowed_domains: array of string` + + A list of allowed domains when type is `allowlist`. + + - `type: "allowlist"` + + Allow outbound network access only to specified domains. Always `allowlist`. + + - `"allowlist"` + + - `domain_secrets: optional array of BetaContainerNetworkPolicyDomainSecret` + + Optional domain-scoped secrets for allowlisted domains. + + - `domain: string` + + The domain associated with the secret. + + - `name: string` + + The name of the secret to inject for the domain. + + - `value: string` + + The secret value to inject for the domain. + - `type: "code_interpreter"` The type of the code interpreter tool. Always `code_interpreter`. @@ -25185,10 +23271,128 @@ Retrieves a model response with the given ID. - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` + - `type: "container_auto"` + + Automatically creates a container for this request + + - `"container_auto"` + + - `file_ids: optional array of string` + + An optional list of uploaded files to make available to your code. + + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` + + The memory limit for the container. + + - `"1g"` + + - `"4g"` + + - `"16g"` + + - `"64g"` + + - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` + + Network access policy for the container. + + - `BetaContainerNetworkPolicyDisabled object { type }` + + - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` + + - `skills: optional array of BetaSkillReference or BetaInlineSkill` + + An optional list of skills referenced by id or inline data. + + - `BetaSkillReference object { skill_id, type, version }` + + - `skill_id: string` + + The ID of the referenced skill. + + - `type: "skill_reference"` + + References a skill created with the /v1/skills endpoint. + + - `"skill_reference"` + + - `version: optional string` + + Optional skill version. Use a positive integer or 'latest'. Omit for default. + + - `BetaInlineSkill object { description, name, source, type }` + + - `description: string` + + The description of the skill. + + - `name: string` + + The name of the skill. + + - `source: BetaInlineSkillSource` + + Inline skill payload + + - `data: string` + + Base64-encoded skill zip bundle. + + - `media_type: "application/zip"` + + The media type of the inline skill payload. Must be `application/zip`. + + - `"application/zip"` + + - `type: "base64"` + + The type of the inline skill source. Must be `base64`. + + - `"base64"` + + - `type: "inline"` + + Defines an inline skill for this request. + + - `"inline"` + - `BetaLocalEnvironment object { type, skills }` + - `type: "local"` + + Use a local computer environment. + + - `"local"` + + - `skills: optional array of BetaLocalSkill` + + An optional list of skills. + + - `description: string` + + The description of the skill. + + - `name: string` + + The name of the skill. + + - `path: string` + + The path to the directory containing the skill. + - `BetaContainerReference object { container_id, type }` + - `container_id: string` + + The ID of the referenced container. + + - `type: "container_reference"` + + References a container created with the /v1/containers endpoint + + - `"container_reference"` + - `Custom object { name, type, allowed_callers, 3 more }` A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) @@ -25475,10 +23679,14 @@ Retrieves a model response with the given ID. - `type: "tool_search_output"` - The type of the item. Always `tool_search_output`. + The item type. Always `tool_search_output`. - `"tool_search_output"` + - `id: optional string` + + The unique ID of this tool search output. + - `agent: optional object { agent_name }` The agent that produced this item. @@ -25487,39 +23695,39 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `created_by: optional string` + - `call_id: optional string` - The identifier of the actor that created the item. + The unique ID of the tool search call generated by the model. - - `AdditionalTools object { id, role, tools, 2 more }` + - `execution: optional "server" or "client"` - - `id: string` + Whether tool search was executed by the server or by the client. - The unique ID of the additional tools item. + - `"server"` - - `role: "unknown" or "user" or "assistant" or 5 more` + - `"client"` - The role that provided the additional tools. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"unknown"` + The status of the tool search output. - - `"user"` + - `"in_progress"` - - `"assistant"` + - `"completed"` - - `"system"` + - `"incomplete"` - - `"critic"` + - `AdditionalTools object { role, tools, type, 2 more }` - - `"discriminator"` + - `role: "developer"` - - `"developer"` + The role that provided the additional tools. Only `developer` is supported. - - `"tool"` + - `"developer"` - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - The additional tool definitions made available at this item. + A list of additional tools made available at this item. - `Function object { name, parameters, strict, 5 more }` @@ -26464,77 +24672,147 @@ Retrieves a model response with the given ID. - `"medium"` - - `"high"` + - `"high"` + + - `user_location: optional object { type, city, country, 2 more }` + + The user's location. + + - `type: "approximate"` + + The type of location approximation. Always `approximate`. + + - `"approximate"` + + - `city: optional string` + + Free text input for the city of the user, e.g. `San Francisco`. + + - `country: optional string` + + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + + - `region: optional string` + + Free text input for the region of the user, e.g. `California`. + + - `timezone: optional string` + + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + + - `ApplyPatch object { type, allowed_callers }` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `type: "apply_patch"` + + The type of the tool. Always `apply_patch`. + + - `"apply_patch"` + + - `allowed_callers: optional array of "direct" or "programmatic"` + + The tool invocation context(s). + + - `"direct"` + + - `"programmatic"` + + - `type: "additional_tools"` + + The item type. Always `additional_tools`. + + - `"additional_tools"` + + - `id: optional string` + + The unique ID of this additional tools item. + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `Reasoning object { id, summary, type, 4 more }` + + 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](/docs/guides/conversation-state). + + - `id: string` - - `user_location: optional object { type, city, country, 2 more }` + The unique identifier of the reasoning content. - The user's location. + - `summary: array of object { text, type }` - - `type: "approximate"` + Reasoning summary content. - The type of location approximation. Always `approximate`. + - `text: string` - - `"approximate"` + A summary of the reasoning output from the model so far. - - `city: optional string` + - `type: "summary_text"` - Free text input for the city of the user, e.g. `San Francisco`. + The type of the object. Always `summary_text`. - - `country: optional string` + - `"summary_text"` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `type: "reasoning"` - - `region: optional string` + The type of the object. Always `reasoning`. - Free text input for the region of the user, e.g. `California`. + - `"reasoning"` - - `timezone: optional string` + - `agent: optional object { agent_name }` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + The agent that produced this item. - - `ApplyPatch object { type, allowed_callers }` + - `agent_name: string` - Allows the assistant to create, delete, or update files using unified diffs. + The canonical name of the agent that produced this item. - - `type: "apply_patch"` + - `content: optional array of object { text, type }` - The type of the tool. Always `apply_patch`. + Reasoning text content. - - `"apply_patch"` + - `text: string` - - `allowed_callers: optional array of "direct" or "programmatic"` + The reasoning text from the model. - The tool invocation context(s). + - `type: "reasoning_text"` - - `"direct"` + The type of the reasoning text. Always `reasoning_text`. - - `"programmatic"` + - `"reasoning_text"` - - `type: "additional_tools"` + - `encrypted_content: optional string` - The type of the item. Always `additional_tools`. + The encrypted content of the reasoning item. This is populated by default + for reasoning items returned by `POST /v1/responses` and WebSocket + `response.create` requests. - - `"additional_tools"` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `agent: optional object { agent_name }` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The agent that produced this item. + - `"in_progress"` - - `agent_name: string` + - `"completed"` - The canonical name of the agent that produced this item. + - `"incomplete"` - - `Compaction object { id, encrypted_content, type, 2 more }` + - `Compaction object { encrypted_content, type, id, agent }` A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - - `id: string` - - The unique ID of the compaction item. - - `encrypted_content: string` - The encrypted content that was produced by compaction. + The encrypted content of the compaction summary. - `type: "compaction"` @@ -26542,6 +24820,10 @@ Retrieves a model response with the given ID. - `"compaction"` + - `id: optional string` + + The ID of the compaction item. + - `agent: optional object { agent_name }` The agent that produced this item. @@ -26550,10 +24832,6 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `created_by: optional string` - - The identifier of the actor that created the item. - - `ImageGenerationCall object { id, result, status, 2 more }` An image generation request made by the model. @@ -26771,13 +25049,9 @@ Retrieves a model response with the given ID. - `"incomplete"` - - `ShellCall object { id, action, call_id, 6 more }` - - A tool call that executes one or more shell commands in a managed environment. - - - `id: string` + - `ShellCall object { action, call_id, type, 5 more }` - The unique ID of the shell tool call. Populated when this item is returned via API. + A tool representing a request to execute one or more shell commands. - `action: object { commands, max_output_length, timeout_ms }` @@ -26785,60 +25059,30 @@ Retrieves a model response with the given ID. - `commands: array of string` - - `max_output_length: number` + Ordered shell commands for the execution environment to run. - Optional maximum number of characters to return from each command. + - `max_output_length: optional number` - - `timeout_ms: number` + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - Optional timeout in milliseconds for the commands. + - `timeout_ms: optional number` + + Maximum wall-clock time in milliseconds to allow the shell commands to run. - `call_id: string` The unique ID of the shell tool call generated by the model. - - `environment: BetaResponseLocalEnvironment or BetaResponseContainerReference` - - Represents the use of a local environment to perform shell actions. - - - `BetaResponseLocalEnvironment object { type }` - - Represents the use of a local environment to perform shell actions. - - - `type: "local"` - - The environment type. Always `local`. - - - `"local"` - - - `BetaResponseContainerReference object { container_id, type }` - - Represents a container created with /v1/containers. - - - `container_id: string` - - - `type: "container_reference"` - - The environment type. Always `container_reference`. - - - `"container_reference"` - - - `status: "in_progress" or "completed" or "incomplete"` - - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` - - `type: "shell_call"` The type of the item. Always `shell_call`. - `"shell_call"` + - `id: optional string` + + The unique ID of the shell tool call. Populated when this item is returned via API. + - `agent: optional object { agent_name }` The agent that produced this item. @@ -26855,6 +25099,8 @@ Retrieves a model response with the given ID. - `type: "direct"` + The caller type. Always `direct`. + - `"direct"` - `Program object { caller_id, type }` @@ -26865,35 +25111,43 @@ Retrieves a model response with the given ID. - `type: "program"` + The caller type. Always `program`. + - `"program"` - - `created_by: optional string` + - `environment: optional BetaLocalEnvironment or BetaContainerReference` - The ID of the entity that created this tool call. + The environment to execute the shell commands in. - - `ShellCallOutput object { id, call_id, max_output_length, 6 more }` + - `BetaLocalEnvironment object { type, skills }` - The output of a shell tool call that was emitted. + - `BetaContainerReference object { container_id, type }` - - `id: string` + - `status: optional "in_progress" or "completed" or "incomplete"` - The unique ID of the shell call output. Populated when this item is returned via API. + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `call_id: string` + - `"in_progress"` - The unique ID of the shell tool call generated by the model. + - `"completed"` - - `max_output_length: number` + - `"incomplete"` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + - `ShellCallOutput object { call_id, output, type, 5 more }` - - `output: array of object { outcome, stderr, stdout, created_by }` + The streamed output items emitted by a shell tool call. - An array of shell call output contents + - `call_id: string` + + The unique ID of the shell tool call generated by the model. + + - `output: array of BetaResponseFunctionShellCallOutputContent` + + Captured chunks of stdout and stderr output, along with their associated outcomes. - `outcome: object { type } or object { exit_code, type }` - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + The exit or timeout outcome associated with this shell call. - `Timeout object { type }` @@ -26911,7 +25165,7 @@ Retrieves a model response with the given ID. - `exit_code: number` - Exit code from the shell process. + The exit code returned by the shell process. - `type: "exit"` @@ -26921,32 +25175,22 @@ Retrieves a model response with the given ID. - `stderr: string` - The standard error output that was captured. + Captured stderr output for the shell call. - `stdout: string` - The standard output that was captured. - - - `created_by: optional string` - - The identifier of the actor that created the item. - - - `status: "in_progress" or "completed" or "incomplete"` - - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. - - - `"in_progress"` - - - `"completed"` - - - `"incomplete"` + Captured stdout output for the shell call. - `type: "shell_call_output"` - The type of the shell call output. Always `shell_call_output`. + The type of the item. Always `shell_call_output`. - `"shell_call_output"` + - `id: optional string` + + The unique ID of the shell tool call output. Populated when this item is returned via API. + - `agent: optional object { agent_name }` The agent that produced this item. @@ -26963,6 +25207,8 @@ Retrieves a model response with the given ID. - `type: "direct"` + The caller type. Always `direct`. + - `"direct"` - `Program object { caller_id, type }` @@ -26973,19 +25219,27 @@ Retrieves a model response with the given ID. - `type: "program"` + The caller type. Always `program`. + - `"program"` - - `created_by: optional string` + - `max_output_length: optional number` - The identifier of the actor that created the item. + The maximum number of UTF-8 characters captured for this shell call's combined output. - - `ApplyPatchCall object { id, call_id, operation, 5 more }` + - `status: optional "in_progress" or "completed" or "incomplete"` - A tool call that applies file diffs by creating, deleting, or updating files. + The status of the shell call output. - - `id: string` + - `"in_progress"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `"completed"` + + - `"incomplete"` + + - `ApplyPatchCall object { call_id, operation, status, 4 more }` + + A tool call representing a request to create, delete, or update files using diff patches. - `call_id: string` @@ -26993,55 +25247,55 @@ Retrieves a model response with the given ID. - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + The specific create, delete, or update instruction for the apply_patch tool call. - `CreateFile object { diff, path, type }` - Instruction describing how to create a file via the apply_patch tool. + Instruction for creating a new file via the apply_patch tool. - `diff: string` - Diff to apply. + Unified diff content to apply when creating the file. - `path: string` - Path of the file to create. + Path of the file to create relative to the workspace root. - `type: "create_file"` - Create a new file with the provided diff. + The operation type. Always `create_file`. - `"create_file"` - `DeleteFile object { path, type }` - Instruction describing how to delete a file via the apply_patch tool. + Instruction for deleting an existing file via the apply_patch tool. - `path: string` - Path of the file to delete. + Path of the file to delete relative to the workspace root. - `type: "delete_file"` - Delete the specified file. + The operation type. Always `delete_file`. - `"delete_file"` - `UpdateFile object { diff, path, type }` - Instruction describing how to update a file via the apply_patch tool. + Instruction for updating an existing file via the apply_patch tool. - `diff: string` - Diff to apply. + Unified diff content to apply to the existing file. - `path: string` - Path of the file to update. + Path of the file to update relative to the workspace root. - `type: "update_file"` - Update an existing file with the provided diff. + The operation type. Always `update_file`. - `"update_file"` @@ -27059,6 +25313,10 @@ Retrieves a model response with the given ID. - `"apply_patch_call"` + - `id: optional string` + + The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `agent: optional object { agent_name }` The agent that produced this item. @@ -27075,6 +25333,8 @@ Retrieves a model response with the given ID. - `type: "direct"` + The caller type. Always `direct`. + - `"direct"` - `Program object { caller_id, type }` @@ -27085,19 +25345,13 @@ Retrieves a model response with the given ID. - `type: "program"` - - `"program"` - - - `created_by: optional string` - - The ID of the entity that created this tool call. - - - `ApplyPatchCallOutput object { id, call_id, status, 5 more }` + The caller type. Always `program`. - The output emitted by an apply patch tool call. + - `"program"` - - `id: string` + - `ApplyPatchCallOutput object { call_id, status, type, 4 more }` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + The streamed output emitted by an apply patch tool call. - `call_id: string` @@ -27117,6 +25371,10 @@ Retrieves a model response with the given ID. - `"apply_patch_call_output"` + - `id: optional string` + + The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `agent: optional object { agent_name }` The agent that produced this item. @@ -27133,6 +25391,8 @@ Retrieves a model response with the given ID. - `type: "direct"` + The caller type. Always `direct`. + - `"direct"` - `Program object { caller_id, type }` @@ -27143,15 +25403,131 @@ Retrieves a model response with the given ID. - `type: "program"` + The caller type. Always `program`. + - `"program"` - - `created_by: optional string` + - `output: optional string` - The ID of the entity that created this tool call output. + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - `output: optional string` + - `McpListTools object { id, server_label, tools, 3 more }` - Optional textual output returned by the apply patch tool. + A list of tools available on an MCP server. + + - `id: string` + + The unique ID of the list. + + - `server_label: string` + + The label of the MCP server. + + - `tools: array of object { input_schema, name, annotations, description }` + + The tools available on the server. + + - `input_schema: unknown` + + The JSON schema describing the tool's input. + + - `name: string` + + The name of the tool. + + - `annotations: optional unknown` + + Additional annotations about the tool. + + - `description: optional string` + + The description of the tool. + + - `type: "mcp_list_tools"` + + The type of the item. Always `mcp_list_tools`. + + - `"mcp_list_tools"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `error: optional string` + + Error message if the server could not list tools. + + - `McpApprovalRequest object { id, arguments, name, 3 more }` + + A request for human approval of a tool invocation. + + - `id: string` + + The unique ID of the approval request. + + - `arguments: string` + + A JSON string of arguments for the tool. + + - `name: string` + + The name of the tool to run. + + - `server_label: string` + + The label of the MCP server making the request. + + - `type: "mcp_approval_request"` + + The type of the item. Always `mcp_approval_request`. + + - `"mcp_approval_request"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `McpApprovalResponse object { approval_request_id, approve, type, 3 more }` + + A response to an MCP approval request. + + - `approval_request_id: string` + + The ID of the approval request being answered. + + - `approve: boolean` + + Whether the request was approved. + + - `type: "mcp_approval_response"` + + The type of the item. Always `mcp_approval_response`. + + - `"mcp_approval_response"` + + - `id: optional string` + + The unique ID of the approval response + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `reason: optional string` + + Optional reason for the decision. - `McpCall object { id, arguments, name, 7 more }` @@ -27214,43 +25590,48 @@ Retrieves a model response with the given ID. - `"failed"` - - `McpListTools object { id, server_label, tools, 3 more }` + - `CustomToolCallOutput object { call_id, output, type, 3 more }` - A list of tools available on an MCP server. + The output of a custom tool call from your code, being sent back to the model. - - `id: string` + - `call_id: string` - The unique ID of the list. + The call ID, used to map this custom tool call output to a custom tool call. - - `server_label: string` + - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - The label of the MCP server. + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `tools: array of object { input_schema, name, annotations, description }` + - `StringOutput = string` - The tools available on the server. + A string of the output of the custom tool call. - - `input_schema: unknown` + - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - The JSON schema describing the tool's input. + Text, image, or file output of the custom tool call. - - `name: string` + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - The name of the tool. + A text input to the model. - - `annotations: optional unknown` + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - Additional annotations about the tool. + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `description: optional string` + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - The description of the tool. + A file input to the model. - - `type: "mcp_list_tools"` + - `type: "custom_tool_call_output"` - The type of the item. Always `mcp_list_tools`. + The type of the custom tool call output. Always `custom_tool_call_output`. - - `"mcp_list_tools"` + - `"custom_tool_call_output"` + + - `id: optional string` + + The unique ID of the custom tool call output in the OpenAI platform. - `agent: optional object { agent_name }` @@ -27260,35 +25641,55 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `error: optional string` + - `caller: optional object { type } or object { caller_id, type }` - Error message if the server could not list tools. + The execution context that produced this tool call. - - `McpApprovalRequest object { id, arguments, name, 3 more }` + - `Direct object { type }` - A request for human approval of a tool invocation. + - `type: "direct"` - - `id: string` + The caller type. Always `direct`. - The unique ID of the approval request. + - `"direct"` - - `arguments: string` + - `Program object { caller_id, type }` - A JSON string of arguments for the tool. + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + The caller type. Always `program`. + + - `"program"` + + - `CustomToolCall object { call_id, input, name, 5 more }` + + A call to a custom tool created by the model. + + - `call_id: string` + + An identifier used to map this custom tool call to a tool call output. + + - `input: string` + + The input for the custom tool call generated by the model. - `name: string` - The name of the tool to run. + The name of the custom tool being called. - - `server_label: string` + - `type: "custom_tool_call"` - The label of the MCP server making the request. + The type of the custom tool call. Always `custom_tool_call`. - - `type: "mcp_approval_request"` + - `"custom_tool_call"` - The type of the item. Always `mcp_approval_request`. + - `id: optional string` - - `"mcp_approval_request"` + The unique ID of the custom tool call in the OpenAI platform. - `agent: optional object { agent_name }` @@ -27298,27 +25699,93 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `McpApprovalResponse object { id, approval_request_id, approve, 3 more }` + - `caller: optional object { type } or object { caller_id, type }` - A response to an MCP approval request. + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `namespace: optional string` + + The namespace of the custom tool being called. + + - `CompactionTrigger object { type, agent }` + + Compacts the current context. Must be the final input item. + + - `type: "compaction_trigger"` + + The type of the item. Always `compaction_trigger`. + + - `"compaction_trigger"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `ItemReference object { id, agent, type }` + + An internal identifier for an item to reference. - `id: string` - The unique ID of the approval response + The ID of the item to reference. - - `approval_request_id: string` + - `agent: optional object { agent_name }` - The ID of the approval request being answered. + The agent that produced this item. - - `approve: boolean` + - `agent_name: string` - Whether the request was approved. + The canonical name of the agent that produced this item. - - `type: "mcp_approval_response"` + - `type: optional "item_reference"` - The type of the item. Always `mcp_approval_response`. + The type of item to reference. Always `item_reference`. - - `"mcp_approval_response"` + - `"item_reference"` + + - `Program object { id, call_id, code, 3 more }` + + - `id: string` + + The unique ID of this program item. + + - `call_id: string` + + The stable call ID of the program item. + + - `code: string` + + The JavaScript source executed by programmatic tool calling. + + - `fingerprint: string` + + Opaque program replay fingerprint that must be round-tripped. + + - `type: "program"` + + The item type. Always `program`. + + - `"program"` - `agent: optional object { agent_name }` @@ -27328,166 +25795,647 @@ Retrieves a model response with the given ID. The canonical name of the agent that produced this item. - - `reason: optional string` + - `ProgramOutput object { id, call_id, result, 3 more }` - Optional reason for the decision. + - `id: string` - - `CustomToolCall object { call_id, input, name, 5 more }` + The unique ID of this program output item. + + - `call_id: string` + + The call ID of the program item. + + - `result: string` + + The result produced by the program item. + + - `status: "completed" or "incomplete"` + + The terminal status of the program output. + + - `"completed"` + + - `"incomplete"` + + - `type: "program_output"` + + The item type. Always `program_output`. + + - `"program_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + +- `instructions: optional string` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + +- `max_output_tokens: optional number` + + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning). + +- `max_tool_calls: optional number` + + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + +- `metadata: optional map[string]` + + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + +- `model: optional "gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more or string` + + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](/docs/models) + to browse and compare available models. + + - `"gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more` + + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](/docs/models) + to browse and compare available models. + + - `"gpt-5.6-sol"` + + - `"gpt-5.6-terra"` + + - `"gpt-5.6-luna"` + + - `"gpt-5.4"` + + - `"gpt-5.4-mini"` + + - `"gpt-5.4-nano"` + + - `"gpt-5.4-mini-2026-03-17"` + + - `"gpt-5.4-nano-2026-03-17"` + + - `"gpt-5.3-chat-latest"` + + - `"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"` + + - `string` + +- `moderation: optional object { model, policy }` + + Configuration for running moderation on the input and output of this response. + + - `model: string` + + The moderation model to use for moderated completions, e.g. 'omni-moderation-latest'. + + - `policy: optional object { input, output }` + + The policy to apply to moderated response input and output. + + - `input: optional object { mode }` + + The moderation policy for the response input. + + - `mode: "score" or "block"` + + - `"score"` + + - `"block"` + + - `output: optional object { mode }` + + The moderation policy for the response output. + + - `mode: "score" or "block"` + + - `"score"` + + - `"block"` + +- `multi_agent: optional object { enabled, max_concurrent_subagents }` + + Configuration for server-hosted multi-agent execution. + + - `enabled: boolean` + + Whether to enable server-hosted multi-agent execution for this response. + + - `max_concurrent_subagents: optional number` + + `max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent. + The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run. + +- `parallel_tool_calls: optional boolean` + + Whether to allow the model to run tool calls in parallel. + +- `previous_response_id: optional string` + + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + +- `prompt: optional BetaResponsePrompt` + + Reference to a prompt template and its variables. + [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts). + + - `id: string` + + The unique identifier of the prompt template to use. + + - `variables: optional map[string or BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile]` + + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. + + - `string` + + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + + A text input to the model. + + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + + An image input to the model. Learn about [image inputs](/docs/guides/vision). + + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + + A file input to the model. + + - `version: optional string` + + Optional version of the prompt template. + +- `prompt_cache_key: optional string` + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching). + +- `prompt_cache_options: optional object { mode, ttl }` + + Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](/docs/guides/prompt-caching) for current details. + + - `mode: optional "implicit" or "explicit"` + + Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. + + - `"implicit"` + + - `"explicit"` + + - `ttl: optional "30m"` + + The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. + + - `"30m"` + +- `prompt_cache_retention: optional "in_memory" or "24h"` + + Deprecated. Use `prompt_cache_options.ttl` instead. + + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + + - `"in_memory"` + + - `"24h"` + +- `reasoning: optional object { context, effort, generate_summary, 2 more }` + + **gpt-5 and o-series models only** + + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + + - `context: optional "auto" or "current_turn" or "all_turns"` + + Controls which reasoning items are rendered back to the model on later turns. + If omitted or set to `auto`, the model determines the context mode. The + `gpt-5.6` model family defaults to `all_turns`; earlier models default to + `current_turn`. + + When returned on a response, this is the effective reasoning context mode + used for the response. + + - `"auto"` + + - `"current_turn"` + + - `"all_turns"` + + - `effort: optional "none" or "minimal" or "low" or 4 more` + + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. + + - `"none"` + + - `"minimal"` + + - `"low"` + + - `"medium"` + + - `"high"` + + - `"xhigh"` + + - `"max"` + + - `generate_summary: optional "auto" or "concise" or "detailed"` + + **Deprecated:** use `summary` instead. + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + - `"auto"` - A call to a custom tool created by the model. + - `"concise"` - - `call_id: string` + - `"detailed"` - An identifier used to map this custom tool call to a tool call output. + - `mode: optional string or "standard" or "pro"` - - `input: string` + Controls the reasoning execution mode for the request. - The input for the custom tool call generated by the model. + When returned on a response, this is the effective execution mode. - - `name: string` + - `string` - The name of the custom tool being called. + - `"standard" or "pro"` - - `type: "custom_tool_call"` + Controls the reasoning execution mode for the request. - The type of the custom tool call. Always `custom_tool_call`. + When returned on a response, this is the effective execution mode. - - `"custom_tool_call"` + - `"standard"` - - `id: optional string` + - `"pro"` - The unique ID of the custom tool call in the OpenAI platform. + - `summary: optional "auto" or "concise" or "detailed"` - - `agent: optional object { agent_name }` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - The agent that produced this item. + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - - `agent_name: string` + - `"auto"` - The canonical name of the agent that produced this item. + - `"concise"` - - `caller: optional object { type } or object { caller_id, type }` + - `"detailed"` - The execution context that produced this tool call. +- `safety_identifier: optional string` - - `Direct object { type }` + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). - - `type: "direct"` +- `service_tier: optional "auto" or "default" or "flex" or 2 more` - - `"direct"` + Specifies the processing type used for serving the request. - - `Program object { caller_id, type }` + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - - `caller_id: string` + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - The call ID of the program item that produced this tool call. + - `"auto"` - - `type: "program"` + - `"default"` - - `"program"` + - `"flex"` - - `namespace: optional string` + - `"scale"` - The namespace of the custom tool being called. + - `"priority"` - - `CustomToolCallOutput object { id, call_id, output, 5 more }` +- `store: optional boolean` - - `id: string` + Whether to store the generated model response for later retrieval via + API. - The unique ID of the custom tool call output item. +- `stream: optional boolean` - - `call_id: string` + If set to true, the model response data will be streamed to the client + as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the [Streaming section below](/docs/api-reference/responses-streaming) + for more information. - The call ID, used to map this custom tool call output to a custom tool call. +- `stream_options: optional object { include_obfuscation }` - - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + Options for streaming responses. Only set this when you set `stream: true`. - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + - `include_obfuscation: optional boolean` - - `StringOutput = string` + When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events to + normalize payload sizes as a mitigation to certain side-channel attacks. + These obfuscation fields are included by default, but add a small amount + of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between + your application and the OpenAI API. - A string of the output of the custom tool call. +- `temperature: optional number` - - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - Text, image, or file output of the custom tool call. +- `text: optional BetaResponseTextConfig` - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - A text input to the model. + - [Text inputs and outputs](/docs/guides/text) + - [Structured Outputs](/docs/guides/structured-outputs) - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + - `format: optional BetaResponseFormatTextConfig` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + An object specifying the format that the model must output. - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](/docs/guides/structured-outputs). - A file input to the model. + The default format is `{ "type": "text" }` with no additional options. - - `status: "in_progress" or "completed" or "incomplete"` + **Not recommended for gpt-4o and newer models:** - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - - `"in_progress"` + - `Text object { type }` - - `"completed"` + Default response format. Used to generate text responses. - - `"incomplete"` + - `type: "text"` - - `type: "custom_tool_call_output"` + The type of response format being defined. Always `text`. - The type of the custom tool call output. Always `custom_tool_call_output`. + - `"text"` - - `"custom_tool_call_output"` + - `BetaResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }` - - `agent: optional object { agent_name }` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](/docs/guides/structured-outputs). - The agent that produced this item. + - `name: string` - - `agent_name: string` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - The canonical name of the agent that produced this item. + - `schema: map[unknown]` - - `caller: optional object { type } or object { caller_id, type }` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - The execution context that produced this tool call. + - `type: "json_schema"` - - `Direct object { type }` + The type of response format being defined. Always `json_schema`. - - `type: "direct"` + - `"json_schema"` - The caller type. Always `direct`. + - `description: optional string` - - `"direct"` + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `Program object { caller_id, type }` + - `strict: optional boolean` - - `caller_id: string` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](/docs/guides/structured-outputs). - The call ID of the program item that produced this tool call. + - `JSONObject object { type }` - - `type: "program"` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - The caller type. Always `program`. + - `type: "json_object"` - - `"program"` + The type of response format being defined. Always `json_object`. - - `created_by: optional string` + - `"json_object"` - The identifier of the actor that created the item. + - `verbosity: optional "low" or "medium" or "high"` - - `parallel_tool_calls: boolean` + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. The default is + `medium`. - Whether to allow the model to run tool calls in parallel. + - `"low"` - - `temperature: number` + - `"medium"` - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `"high"` - - `tool_choice: BetaToolChoiceOptions or BetaToolChoiceAllowed or BetaToolChoiceTypes or 6 more` +- `tool_choice: optional BetaToolChoiceOptions or BetaToolChoiceAllowed or BetaToolChoiceTypes or 6 more` How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools @@ -27657,7 +26605,7 @@ Retrieves a model response with the given ID. - `"shell"` - - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` +- `tools: optional array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. @@ -28666,7 +27614,14 @@ Retrieves a model response with the given ID. - `"programmatic"` - - `top_p: number` +- `top_logprobs: optional number` + + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. + +- `top_p: optional number` An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability @@ -28675,472 +27630,7 @@ Retrieves a model response with the given ID. We generally recommend altering this or `temperature` but not both. - - `background: optional boolean` - - Whether to run the model response in the background. - [Learn more](/docs/guides/background). - - - `completed_at: optional number` - - Unix timestamp (in seconds) of when this Response was completed. - Only present when the status is `completed`. - - - `conversation: optional object { id }` - - The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - - - `id: string` - - The unique ID of the conversation that this response was associated with. - - - `max_output_tokens: optional number` - - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning). - - - `max_tool_calls: optional number` - - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - - - `moderation: optional object { input, output }` - - Moderation results for the response input and output, if moderated completions were requested. - - - `input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }` - - Moderation for the response input. - - - `ModerationResult object { categories, category_applied_input_types, category_scores, 3 more }` - - A moderation result produced for the response input or output. - - - `categories: map[boolean]` - - A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - - `category_applied_input_types: map[array of "text" or "image"]` - - Which modalities of input are reflected by the score for each category. - - - `"text"` - - - `"image"` - - - `category_scores: map[number]` - - A dictionary of moderation categories to scores. - - - `flagged: boolean` - - A boolean indicating whether the content was flagged by any category. - - - `model: string` - - The moderation model that produced this result. - - - `type: "moderation_result"` - - The object type, which was always `moderation_result` for successful moderation results. - - - `"moderation_result"` - - - `Error object { code, message, type }` - - An error produced while attempting moderation for the response input or output. - - - `code: string` - - The error code. - - - `message: string` - - The error message. - - - `type: "error"` - - The object type, which was always `error` for moderation failures. - - - `"error"` - - - `output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }` - - Moderation for the response output. - - - `ModerationResult object { categories, category_applied_input_types, category_scores, 3 more }` - - A moderation result produced for the response input or output. - - - `categories: map[boolean]` - - A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - - `category_applied_input_types: map[array of "text" or "image"]` - - Which modalities of input are reflected by the score for each category. - - - `"text"` - - - `"image"` - - - `category_scores: map[number]` - - A dictionary of moderation categories to scores. - - - `flagged: boolean` - - A boolean indicating whether the content was flagged by any category. - - - `model: string` - - The moderation model that produced this result. - - - `type: "moderation_result"` - - The object type, which was always `moderation_result` for successful moderation results. - - - `"moderation_result"` - - - `Error object { code, message, type }` - - An error produced while attempting moderation for the response input or output. - - - `code: string` - - The error code. - - - `message: string` - - The error message. - - - `type: "error"` - - The object type, which was always `error` for moderation failures. - - - `"error"` - - - `output_text: optional string` - - SDK-only convenience property that contains the aggregated text output - from all `output_text` items in the `output` array, if any are present. - Supported in the Python and JavaScript SDKs. - - - `previous_response_id: optional string` - - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - - - `prompt: optional BetaResponsePrompt` - - Reference to a prompt template and its variables. - [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts). - - - `id: string` - - The unique identifier of the prompt template to use. - - - `variables: optional map[string or BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile]` - - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. - - - `string` - - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - - A text input to the model. - - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - - An image input to the model. Learn about [image inputs](/docs/guides/vision). - - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - - A file input to the model. - - - `version: optional string` - - Optional version of the prompt template. - - - `prompt_cache_key: optional string` - - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching). - - - `prompt_cache_options: optional object { mode, ttl }` - - The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - - - `mode: "implicit" or "explicit"` - - Whether implicit prompt-cache breakpoints were enabled. - - - `"implicit"` - - - `"explicit"` - - - `ttl: "30m"` - - The minimum lifetime applied to each cache breakpoint. - - - `"30m"` - - - `prompt_cache_retention: optional "in_memory" or "24h"` - - Deprecated. Use `prompt_cache_options.ttl` instead. - - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). - This field expresses a maximum retention policy, while - `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two - fields are independent and do not interact. - For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - - For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - - - Organizations without ZDR enabled default to `24h`. - - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - - - `"in_memory"` - - - `"24h"` - - - `reasoning: optional object { context, effort, generate_summary, 2 more }` - - **gpt-5 and o-series models only** - - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). - - - `context: optional "auto" or "current_turn" or "all_turns"` - - Controls which reasoning items are rendered back to the model on later turns. - If omitted or set to `auto`, the model determines the context mode. The - `gpt-5.6` model family defaults to `all_turns`; earlier models default to - `current_turn`. - - When returned on a response, this is the effective reasoning context mode - used for the response. - - - `"auto"` - - - `"current_turn"` - - - `"all_turns"` - - - `effort: optional "none" or "minimal" or "low" or 4 more` - - Constrains effort on reasoning for reasoning models. Currently supported - values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. - Reducing reasoning effort can result in faster responses and fewer tokens - used on reasoning in a response. Not all reasoning models support every - value. See the - [reasoning guide](https://platform.openai.com/docs/guides/reasoning) - for model-specific support. - - - `"none"` - - - `"minimal"` - - - `"low"` - - - `"medium"` - - - `"high"` - - - `"xhigh"` - - - `"max"` - - - `generate_summary: optional "auto" or "concise" or "detailed"` - - **Deprecated:** use `summary` instead. - - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. - - - `"auto"` - - - `"concise"` - - - `"detailed"` - - - `mode: optional string or "standard" or "pro"` - - Controls the reasoning execution mode for the request. - - When returned on a response, this is the effective execution mode. - - - `string` - - - `"standard" or "pro"` - - Controls the reasoning execution mode for the request. - - When returned on a response, this is the effective execution mode. - - - `"standard"` - - - `"pro"` - - - `summary: optional "auto" or "concise" or "detailed"` - - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. - - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - - - `"auto"` - - - `"concise"` - - - `"detailed"` - - - `safety_identifier: optional string` - - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). - - - `service_tier: optional "auto" or "default" or "flex" or 2 more` - - Specifies the processing type used for serving the request. - - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. - - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - - - `"auto"` - - - `"default"` - - - `"flex"` - - - `"scale"` - - - `"priority"` - - - `status: optional BetaResponseStatus` - - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - - - `"completed"` - - - `"failed"` - - - `"in_progress"` - - - `"cancelled"` - - - `"queued"` - - - `"incomplete"` - - - `text: optional BetaResponseTextConfig` - - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: - - - [Text inputs and outputs](/docs/guides/text) - - [Structured Outputs](/docs/guides/structured-outputs) - - - `format: optional BetaResponseFormatTextConfig` - - An object specifying the format that the model must output. - - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](/docs/guides/structured-outputs). - - The default format is `{ "type": "text" }` with no additional options. - - **Not recommended for gpt-4o and newer models:** - - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. - - - `Text object { type }` - - Default response format. Used to generate text responses. - - - `type: "text"` - - The type of response format being defined. Always `text`. - - - `"text"` - - - `BetaResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }` - - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). - - - `name: string` - - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - - - `schema: map[unknown]` - - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - - - `type: "json_schema"` - - The type of response format being defined. Always `json_schema`. - - - `"json_schema"` - - - `description: optional string` - - A description of what the response format is for, used by the model to - determine how to respond in the format. - - - `strict: optional boolean` - - Whether to enable strict schema adherence when generating the output. - If set to true, the model will always follow the exact schema defined - in the `schema` field. Only a subset of JSON Schema is supported when - `strict` is `true`. To learn more, read the [Structured Outputs - guide](/docs/guides/structured-outputs). - - - `JSONObject object { type }` - - 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: "json_object"` - - The type of response format being defined. Always `json_object`. - - - `"json_object"` - - - `verbosity: optional "low" or "medium" or "high"` - - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. The default is - `medium`. - - - `"low"` - - - `"medium"` - - - `"high"` - - - `top_logprobs: optional number` - - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. - - - `truncation: optional "auto" or "disabled"` +- `truncation: optional "auto" or "disabled"` The truncation strategy to use for the model response. @@ -29154,363 +27644,12 @@ Retrieves a model response with the given ID. - `"disabled"` - - `usage: optional BetaResponseUsage` - - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. - - - `input_tokens: number` - - The number of input tokens. - - - `input_tokens_details: object { cache_write_tokens, cached_tokens }` - - A detailed breakdown of the input tokens. - - - `cache_write_tokens: number` - - The number of input tokens that were written to the cache. - - - `cached_tokens: number` - - The number of tokens that were retrieved from the cache. - [More on prompt caching](/docs/guides/prompt-caching). - - - `output_tokens: number` - - The number of output tokens. - - - `output_tokens_details: object { reasoning_tokens }` - - A detailed breakdown of the output tokens. - - - `reasoning_tokens: number` - - The number of reasoning tokens. - - - `total_tokens: number` - - The total number of tokens used. - - - `user: optional string` +- `user: optional string` This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). -### Example - -```http -curl https://api.openai.com/v1/responses/$RESPONSE_ID \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "id", - "created_at": 0, - "error": { - "code": "server_error", - "message": "message" - }, - "incomplete_details": { - "reason": "max_output_tokens" - }, - "instructions": "string", - "metadata": { - "foo": "string" - }, - "model": "gpt-5.1", - "object": "response", - "output": [ - { - "id": "id", - "content": [ - { - "annotations": [ - { - "file_id": "file_id", - "filename": "filename", - "index": 0, - "type": "file_citation" - } - ], - "logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0, - "top_logprobs": [ - { - "token": "token", - "bytes": [ - 0 - ], - "logprob": 0 - } - ] - } - ], - "text": "text", - "type": "output_text" - } - ], - "role": "assistant", - "status": "in_progress", - "type": "message", - "agent": { - "agent_name": "agent_name" - }, - "phase": "commentary" - } - ], - "parallel_tool_calls": true, - "temperature": 1, - "tool_choice": "none", - "tools": [ - { - "name": "name", - "parameters": { - "foo": "bar" - }, - "strict": true, - "type": "function", - "allowed_callers": [ - "direct" - ], - "defer_loading": true, - "description": "description", - "output_schema": { - "foo": "bar" - } - } - ], - "top_p": 1, - "background": true, - "completed_at": 0, - "conversation": { - "id": "id" - }, - "max_output_tokens": 0, - "max_tool_calls": 0, - "moderation": { - "input": { - "categories": { - "foo": true - }, - "category_applied_input_types": { - "foo": [ - "text" - ] - }, - "category_scores": { - "foo": 0 - }, - "flagged": true, - "model": "model", - "type": "moderation_result" - }, - "output": { - "categories": { - "foo": true - }, - "category_applied_input_types": { - "foo": [ - "text" - ] - }, - "category_scores": { - "foo": 0 - }, - "flagged": true, - "model": "model", - "type": "moderation_result" - } - }, - "output_text": "output_text", - "previous_response_id": "previous_response_id", - "prompt": { - "id": "id", - "variables": { - "foo": "string" - }, - "version": "version" - }, - "prompt_cache_key": "prompt-cache-key-1234", - "prompt_cache_options": { - "mode": "implicit", - "ttl": "30m" - }, - "prompt_cache_retention": "in_memory", - "reasoning": { - "context": "auto", - "effort": "none", - "generate_summary": "auto", - "mode": "standard", - "summary": "auto" - }, - "safety_identifier": "safety-identifier-1234", - "service_tier": "auto", - "status": "completed", - "text": { - "format": { - "type": "text" - }, - "verbosity": "low" - }, - "top_logprobs": 0, - "truncation": "auto", - "usage": { - "input_tokens": 0, - "input_tokens_details": { - "cache_write_tokens": 0, - "cached_tokens": 0 - }, - "output_tokens": 0, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 0 - }, - "user": "user-1234" -} -``` - -### Example - -```http -curl https://api.openai.com/v1/responses/resp_123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44", - "object": "response", - "created_at": 1741386163, - "status": "completed", - "completed_at": 1741386164, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-2024-08-06", - "output": [ - { - "type": "message", - "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44", - "status": "completed", - "role": "assistant", - "content": [ - { - "type": "output_text", - "text": "Silent circuits hum, \nThoughts emerge in data streams— \nDigital dawn breaks.", - "annotations": [] - } - ] - } - ], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1.0, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1.0, - "truncation": "disabled", - "usage": { - "input_tokens": 32, - "input_tokens_details": { - "cached_tokens": 0, - "cache_write_tokens": 0 - }, - "output_tokens": 18, - "output_tokens_details": { - "reasoning_tokens": 0 - }, - "total_tokens": 50 - }, - "user": null, - "metadata": {} -} -``` - -## Delete a model response - -**delete** `/responses/{response_id}?beta=true` - -Deletes a model response with the given ID. - -### Path Parameters - -- `response_id: string` - -### Header Parameters - -- `"openai-beta": optional array of "responses_multi_agent=v1"` - - - `"responses_multi_agent=v1"` - -### Example - -```http -curl https://api.openai.com/v1/responses/$RESPONSE_ID \ - -X DELETE \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -### Example - -```http -curl -X DELETE https://api.openai.com/v1/responses/resp_123 \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" -``` - -#### Response - -```json -{ - "id": "resp_6786a1bec27481909a17d673315b29f6", - "object": "response", - "deleted": true -} -``` - -## Cancel a response - -**post** `/responses/{response_id}/cancel?beta=true` - -Cancels a model response with the given ID. Only responses created with -the `background` parameter set to `true` can be cancelled. -[Learn more](/docs/guides/background). - -### Path Parameters - -- `response_id: string` - -### Header Parameters - -- `"openai-beta": optional array of "responses_multi_agent=v1"` - - - `"responses_multi_agent=v1"` - ### Returns - `BetaResponse object { id, created_at, error, 32 more }` @@ -40259,9 +38398,17 @@ the `background` parameter set to `true` can be cancelled. ### Example ```http -curl https://api.openai.com/v1/responses/$RESPONSE_ID/cancel \ - -X POST \ - -H "Authorization: Bearer $OPENAI_API_KEY" +curl https://api.openai.com/v1/responses \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.1", + "prompt_cache_key": "prompt-cache-key-1234", + "safety_identifier": "safety-identifier-1234", + "temperature": 1, + "top_p": 1, + "user": "user-1234" + }' ``` #### Response @@ -40439,40 +38586,198 @@ curl https://api.openai.com/v1/responses/$RESPONSE_ID/cancel \ } ``` -### Example +### File input ```http -curl -X POST https://api.openai.com/v1/responses/resp_123/cancel \ +curl https://api.openai.com/v1/responses \ -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.4", + "input": [ + { + "role": "user", + "content": [ + {"type": "input_text", "text": "what is in this file?"}, + { + "type": "input_file", + "file_url": "https://www.berkshirehathaway.com/letters/2024ltr.pdf", + "detail": "auto" + } + ] + } + ] + }' ``` #### Response ```json { - "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44", + "id": "resp_686eef60237881a2bd1180bb8b13de430e34c516d176ff86", "object": "response", - "created_at": 1741386163, - "status": "cancelled", - "background": true, - "completed_at": null, + "created_at": 1752100704, + "status": "completed", + "completed_at": 1752100705, + "background": false, "error": null, "incomplete_details": null, "instructions": null, "max_output_tokens": null, - "model": "gpt-4o-2024-08-06", + "max_tool_calls": null, + "model": "gpt-5.4", "output": [ { + "id": "msg_686eef60d3e081a29283bdcbc4322fd90e34c516d176ff86", "type": "message", - "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44", - "status": "in_progress", + "status": "completed", + "content": [ + { + "type": "output_text", + "annotations": [], + "logprobs": [], + "text": "The file seems to contain excerpts from a letter to the shareholders of Berkshire Hathaway Inc., likely written by Warren Buffett. It covers several topics:\n\n1. **Communication Philosophy**: Buffett emphasizes the importance of transparency and candidness in reporting mistakes and successes to shareholders.\n\n2. **Mistakes and Learnings**: The letter acknowledges past mistakes in business assessments and management hires, highlighting the importance of correcting errors promptly.\n\n3. **CEO Succession**: Mention of Greg Abel stepping in as the new CEO and continuing the tradition of honest communication.\n\n4. **Pete Liegl Story**: A detailed account of acquiring Forest River and the relationship with its founder, highlighting trust and effective business decisions.\n\n5. **2024 Performance**: Overview of business performance, particularly in insurance and investment activities, with a focus on GEICO's improvement.\n\n6. **Tax Contributions**: Discussion of significant tax payments to the U.S. Treasury, credited to shareholders' reinvestments.\n\n7. **Investment Strategy**: A breakdown of Berkshire\u2019s investments in both controlled subsidiaries and marketable equities, along with a focus on long-term holding strategies.\n\n8. **American Capitalism**: Reflections on America\u2019s economic development and Berkshire\u2019s role within it.\n\n9. **Property-Casualty Insurance**: Insights into the P/C insurance business model and its challenges and benefits.\n\n10. **Japanese Investments**: Information about Berkshire\u2019s investments in Japanese companies and future plans.\n\n11. **Annual Meeting**: Details about the upcoming annual gathering in Omaha, including schedule changes and new book releases.\n\n12. **Personal Anecdotes**: Light-hearted stories about family and interactions, conveying Buffett's personable approach.\n\n13. **Financial Performance Data**: Tables comparing Berkshire\u2019s annual performance to the S&P 500, showing impressive long-term gains.\n\nOverall, the letter reinforces Berkshire Hathaway's commitment to transparency, investment in both its businesses and the wider economy, and emphasizes strong leadership and prudent financial management." + } + ], + "role": "assistant" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "service_tier": "default", + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 8438, + "input_tokens_details": { + "cached_tokens": 0, + "cache_write_tokens": 0 + }, + "output_tokens": 398, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 8836 + }, + "user": null, + "metadata": {} +} +``` + +### File search + +```http +curl https://api.openai.com/v1/responses \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.4", + "tools": [{ + "type": "file_search", + "vector_store_ids": ["vs_1234567890"], + "max_num_results": 20 + }], + "input": "What are the attributes of an ancient brown dragon?" + }' +``` + +#### Response + +```json +{ + "id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7", + "object": "response", + "created_at": 1741485253, + "status": "completed", + "completed_at": 1741485254, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-5.4", + "output": [ + { + "type": "file_search_call", + "id": "fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7", + "status": "completed", + "queries": [ + "attributes of an ancient brown dragon" + ], + "results": null + }, + { + "type": "message", + "id": "msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7", + "status": "completed", "role": "assistant", "content": [ { "type": "output_text", - "text": "Silent circuits hum, \nThoughts emerge in data streams— \nDigital dawn breaks.", - "annotations": [] + "text": "The attributes of an ancient brown dragon include...", + "annotations": [ + { + "type": "file_citation", + "index": 320, + "file_id": "file-4wDz5b167pAf72nx1h9eiN", + "filename": "dragons.pdf" + }, + { + "type": "file_citation", + "index": 576, + "file_id": "file-4wDz5b167pAf72nx1h9eiN", + "filename": "dragons.pdf" + }, + { + "type": "file_citation", + "index": 815, + "file_id": "file-4wDz5b167pAf72nx1h9eiN", + "filename": "dragons.pdf" + }, + { + "type": "file_citation", + "index": 815, + "file_id": "file-4wDz5b167pAf72nx1h9eiN", + "filename": "dragons.pdf" + }, + { + "type": "file_citation", + "index": 1030, + "file_id": "file-4wDz5b167pAf72nx1h9eiN", + "filename": "dragons.pdf" + }, + { + "type": "file_citation", + "index": 1030, + "file_id": "file-4wDz5b167pAf72nx1h9eiN", + "filename": "dragons.pdf" + }, + { + "type": "file_citation", + "index": 1156, + "file_id": "file-4wDz5b167pAf72nx1h9eiN", + "filename": "dragons.pdf" + }, + { + "type": "file_citation", + "index": 1225, + "file_id": "file-4wDz5b167pAf72nx1h9eiN", + "filename": "dragons.pdf" + } + ] } ] } @@ -40491,242 +38796,753 @@ curl -X POST https://api.openai.com/v1/responses/resp_123/cancel \ } }, "tool_choice": "auto", - "tools": [], + "tools": [ + { + "type": "file_search", + "filters": null, + "max_num_results": 20, + "ranking_options": { + "ranker": "auto", + "score_threshold": 0.0 + }, + "vector_store_ids": [ + "vs_1234567890" + ] + } + ], "top_p": 1.0, "truncation": "disabled", - "usage": null, + "usage": { + "input_tokens": 18307, + "input_tokens_details": { + "cached_tokens": 0, + "cache_write_tokens": 0 + }, + "output_tokens": 348, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 18655 + }, "user": null, "metadata": {} } ``` -## Compact a response +### Functions -**post** `/responses/compact?beta=true` +```http +curl https://api.openai.com/v1/responses \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.4", + "input": "What is the weather like in Boston today?", + "tools": [ + { + "type": "function", + "name": "get_current_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. San Francisco, CA" + }, + "unit": { + "type": "string", + "enum": ["celsius", "fahrenheit"] + } + }, + "required": ["location", "unit"] + } + } + ], + "tool_choice": "auto" + }' +``` -Compact a conversation. Returns a compacted response object. +#### Response -Learn when and how to compact long-running conversations in the [conversation state guide](/docs/guides/conversation-state#managing-the-context-window). For ZDR-compatible compaction details, see [Compaction (advanced)](/docs/guides/conversation-state#compaction-advanced). +```json +{ + "id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0", + "object": "response", + "created_at": 1741294021, + "status": "completed", + "completed_at": 1741294022, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-5.4", + "output": [ + { + "type": "function_call", + "id": "fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0", + "call_id": "call_unLAR8MvFNptuiZK6K6HCy5k", + "name": "get_current_weather", + "arguments": "{\"location\":\"Boston, MA\",\"unit\":\"celsius\"}", + "status": "completed" + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [ + { + "type": "function", + "description": "Get the current weather in a given location", + "name": "get_current_weather", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. San Francisco, CA" + }, + "unit": { + "type": "string", + "enum": [ + "celsius", + "fahrenheit" + ] + } + }, + "required": [ + "location", + "unit" + ] + }, + "strict": true + } + ], + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 291, + "output_tokens": 23, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 314 + }, + "user": null, + "metadata": {} +} +``` -### Header Parameters +### Image input -- `"openai-beta": optional array of "responses_multi_agent=v1"` +```http +curl https://api.openai.com/v1/responses \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.4", + "input": [ + { + "role": "user", + "content": [ + {"type": "input_text", "text": "what is in this image?"}, + { + "type": "input_image", + "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg" + } + ] + } + ] + }' +``` - - `"responses_multi_agent=v1"` +#### Response -### Body Parameters +```json +{ + "id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41", + "object": "response", + "created_at": 1741476777, + "status": "completed", + "completed_at": 1741476778, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-5.4", + "output": [ + { + "type": "message", + "id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41", + "status": "completed", + "role": "assistant", + "content": [ + { + "type": "output_text", + "text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.", + "annotations": [] + } + ] + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 328, + "input_tokens_details": { + "cached_tokens": 0, + "cache_write_tokens": 0 + }, + "output_tokens": 52, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 380 + }, + "user": null, + "metadata": {} +} +``` -- `model: "gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more or string` +### Reasoning - Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/docs/models) to browse and compare available models. +```http +curl https://api.openai.com/v1/responses \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "o3-mini", + "input": "How much wood would a woodchuck chuck?", + "reasoning": { + "effort": "high" + } + }' +``` - - `"gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more` +#### Response - Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/docs/models) to browse and compare available models. +```json +{ + "id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808", + "object": "response", + "created_at": 1741477868, + "status": "completed", + "completed_at": 1741477869, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "o1-2024-12-17", + "output": [ + { + "type": "message", + "id": "msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808", + "status": "completed", + "role": "assistant", + "content": [ + { + "type": "output_text", + "text": "The classic tongue twister...", + "annotations": [] + } + ] + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": "high", + "summary": null + }, + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 81, + "input_tokens_details": { + "cached_tokens": 0, + "cache_write_tokens": 0 + }, + "output_tokens": 1035, + "output_tokens_details": { + "reasoning_tokens": 832 + }, + "total_tokens": 1116 + }, + "user": null, + "metadata": {} +} +``` - - `"gpt-5.6-sol"` +### Streaming - - `"gpt-5.6-terra"` +```http +curl https://api.openai.com/v1/responses \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.4", + "instructions": "You are a helpful assistant.", + "input": "Hello!", + "stream": true + }' +``` - - `"gpt-5.6-luna"` +#### Response - - `"gpt-5.4"` +```json +event: response.created +data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} - - `"gpt-5.4-mini"` +event: response.in_progress +data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} - - `"gpt-5.4-nano"` +event: response.output_item.added +data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}} - - `"gpt-5.4-mini-2026-03-17"` +event: response.content_part.added +data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} - - `"gpt-5.4-nano-2026-03-17"` +event: response.output_text.delta +data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi"} - - `"gpt-5.3-chat-latest"` +... - - `"gpt-5.2"` +event: response.output_text.done +data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?"} - - `"gpt-5.2-2025-12-11"` +event: response.content_part.done +data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}} - - `"gpt-5.2-chat-latest"` +event: response.output_item.done +data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}} - - `"gpt-5.2-pro"` +event: response.completed +data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-5.4","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}} +``` - - `"gpt-5.2-pro-2025-12-11"` +### Text input - - `"gpt-5.1"` +```http +curl https://api.openai.com/v1/responses \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.4", + "input": "Tell me a three sentence bedtime story about a unicorn." + }' +``` - - `"gpt-5.1-2025-11-13"` +#### Response - - `"gpt-5.1-codex"` +```json +{ + "id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b", + "object": "response", + "created_at": 1741476542, + "status": "completed", + "completed_at": 1741476543, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-5.4", + "output": [ + { + "type": "message", + "id": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b", + "status": "completed", + "role": "assistant", + "content": [ + { + "type": "output_text", + "text": "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.", + "annotations": [] + } + ] + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 36, + "input_tokens_details": { + "cached_tokens": 0, + "cache_write_tokens": 0 + }, + "output_tokens": 87, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 123 + }, + "user": null, + "metadata": {} +} +``` - - `"gpt-5.1-mini"` +### Web search - - `"gpt-5.1-chat-latest"` +```http +curl https://api.openai.com/v1/responses \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" \ + -d '{ + "model": "gpt-5.4", + "tools": [{ "type": "web_search_preview" }], + "input": "What was a positive news story from today?" + }' +``` - - `"gpt-5"` +#### Response - - `"gpt-5-mini"` +```json +{ + "id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c", + "object": "response", + "created_at": 1741484430, + "status": "completed", + "completed_at": 1741484431, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-5.4", + "output": [ + { + "type": "web_search_call", + "id": "ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c", + "status": "completed" + }, + { + "type": "message", + "id": "msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c", + "status": "completed", + "role": "assistant", + "content": [ + { + "type": "output_text", + "text": "As of today, March 9, 2025, one notable positive news story...", + "annotations": [ + { + "type": "url_citation", + "start_index": 442, + "end_index": 557, + "url": "https://.../?utm_source=chatgpt.com", + "title": "..." + }, + { + "type": "url_citation", + "start_index": 962, + "end_index": 1077, + "url": "https://.../?utm_source=chatgpt.com", + "title": "..." + }, + { + "type": "url_citation", + "start_index": 1336, + "end_index": 1451, + "url": "https://.../?utm_source=chatgpt.com", + "title": "..." + } + ] + } + ] + } + ], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [ + { + "type": "web_search_preview", + "domains": [], + "search_context_size": "medium", + "user_location": { + "type": "approximate", + "city": null, + "country": "US", + "region": null, + "timezone": null + } + } + ], + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 328, + "input_tokens_details": { + "cached_tokens": 0, + "cache_write_tokens": 0 + }, + "output_tokens": 356, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 684 + }, + "user": null, + "metadata": {} +} +``` - - `"gpt-5-nano"` +## Delete a model response - - `"gpt-5-2025-08-07"` +**delete** `/responses/{response_id}?beta=true` - - `"gpt-5-mini-2025-08-07"` +Deletes a model response with the given ID. - - `"gpt-5-nano-2025-08-07"` +### Header Parameters - - `"gpt-5-chat-latest"` +- `"openai-beta": optional array of "responses_multi_agent=v1"` - - `"gpt-4.1"` + - `"responses_multi_agent=v1"` - - `"gpt-4.1-mini"` +### Path Parameters - - `"gpt-4.1-nano"` +- `response_id: string` - - `"gpt-4.1-2025-04-14"` +### Example - - `"gpt-4.1-mini-2025-04-14"` +```http +curl https://api.openai.com/v1/responses/$RESPONSE_ID \ + -X DELETE \ + -H "Authorization: Bearer $OPENAI_API_KEY" +``` - - `"gpt-4.1-nano-2025-04-14"` +### Example - - `"o4-mini"` +```http +curl -X DELETE https://api.openai.com/v1/responses/resp_123 \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $OPENAI_API_KEY" +``` - - `"o4-mini-2025-04-16"` +#### Response - - `"o3"` +```json +{ + "id": "resp_6786a1bec27481909a17d673315b29f6", + "object": "response", + "deleted": true +} +``` - - `"o3-2025-04-16"` +## Get a model response - - `"o3-mini"` +**get** `/responses/{response_id}?beta=true` - - `"o3-mini-2025-01-31"` +Retrieves a model response with the given ID. - - `"o1"` +### Header Parameters - - `"o1-2024-12-17"` +- `"openai-beta": optional array of "responses_multi_agent=v1"` - - `"o1-preview"` + - `"responses_multi_agent=v1"` - - `"o1-preview-2024-09-12"` +### Path Parameters - - `"o1-mini"` +- `response_id: string` - - `"o1-mini-2024-09-12"` +### Query Parameters - - `"gpt-4o"` +- `include: optional array of BetaResponseIncludable` - - `"gpt-4o-2024-11-20"` + Additional fields to include in the response. See the `include` + parameter for Response creation above for more information. - - `"gpt-4o-2024-08-06"` + - `"file_search_call.results"` - - `"gpt-4o-2024-05-13"` + - `"web_search_call.results"` - - `"gpt-4o-audio-preview"` + - `"web_search_call.action.sources"` - - `"gpt-4o-audio-preview-2024-10-01"` + - `"message.input_image.image_url"` - - `"gpt-4o-audio-preview-2024-12-17"` + - `"computer_call_output.output.image_url"` - - `"gpt-4o-audio-preview-2025-06-03"` + - `"code_interpreter_call.outputs"` - - `"gpt-4o-mini-audio-preview"` + - `"reasoning.encrypted_content"` - - `"gpt-4o-mini-audio-preview-2024-12-17"` + - `"message.output_text.logprobs"` - - `"gpt-4o-search-preview"` +- `include_obfuscation: optional boolean` - - `"gpt-4o-mini-search-preview"` + When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events + to normalize payload sizes as a mitigation to certain side-channel + attacks. These obfuscation fields are included by default, but add a + small amount of overhead to the data stream. You can set + `include_obfuscation` to false to optimize for bandwidth if you trust + the network links between your application and the OpenAI API. - - `"gpt-4o-search-preview-2025-03-11"` +- `starting_after: optional number` - - `"gpt-4o-mini-search-preview-2025-03-11"` + The sequence number of the event after which to start streaming. - - `"chatgpt-4o-latest"` +- `stream: optional false` - - `"codex-mini-latest"` + If set to true, the model response data will be streamed to the client + as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the [Streaming section below](/docs/api-reference/responses-streaming) + for more information. - - `"gpt-4o-mini"` + - `false` - - `"gpt-4o-mini-2024-07-18"` +### Returns - - `"gpt-4-turbo"` +- `BetaResponse object { id, created_at, error, 32 more }` - - `"gpt-4-turbo-2024-04-09"` + - `id: string` - - `"gpt-4-0125-preview"` + Unique identifier for this Response. - - `"gpt-4-turbo-preview"` + - `created_at: number` - - `"gpt-4-1106-preview"` + Unix timestamp (in seconds) of when this Response was created. - - `"gpt-4-vision-preview"` + - `error: BetaResponseError` - - `"gpt-4"` + An error object returned when the model fails to generate a Response. - - `"gpt-4-0314"` + - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 17 more` - - `"gpt-4-0613"` + The error code for the response. - - `"gpt-4-32k"` + - `"server_error"` - - `"gpt-4-32k-0314"` + - `"rate_limit_exceeded"` - - `"gpt-4-32k-0613"` + - `"invalid_prompt"` - - `"gpt-3.5-turbo"` + - `"data_residency_mismatch"` - - `"gpt-3.5-turbo-16k"` + - `"bio_policy"` - - `"gpt-3.5-turbo-0301"` + - `"vector_store_timeout"` - - `"gpt-3.5-turbo-0613"` + - `"invalid_image"` - - `"gpt-3.5-turbo-1106"` + - `"invalid_image_format"` - - `"gpt-3.5-turbo-0125"` + - `"invalid_base64_image"` - - `"gpt-3.5-turbo-16k-0613"` + - `"invalid_image_url"` - - `"o1-pro"` + - `"image_too_large"` - - `"o1-pro-2025-03-19"` + - `"image_too_small"` - - `"o3-pro"` + - `"image_parse_error"` - - `"o3-pro-2025-06-10"` + - `"image_content_policy_violation"` - - `"o3-deep-research"` + - `"invalid_image_mode"` - - `"o3-deep-research-2025-06-26"` + - `"image_file_too_large"` - - `"o4-mini-deep-research"` + - `"unsupported_image_media_type"` - - `"o4-mini-deep-research-2025-06-26"` + - `"empty_image_file"` - - `"computer-use-preview"` + - `"failed_to_download_image"` - - `"computer-use-preview-2025-03-11"` + - `"image_file_not_found"` - - `"gpt-5-codex"` + - `message: string` - - `"gpt-5-pro"` + A human-readable description of the error. - - `"gpt-5-pro-2025-10-06"` + - `incomplete_details: object { reason }` - - `"gpt-5.1-codex-max"` + Details about why the response is incomplete. - - `string` + - `reason: optional "max_output_tokens" or "content_filter"` -- `input: optional string or array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` + The reason why the response is incomplete. - Text, image, or file inputs to the model, used to generate a response + - `"max_output_tokens"` + + - `"content_filter"` + + - `instructions: string or array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. - `string` - A text input to the model, equivalent to a text input with the `user` role. + A text input to the model, equivalent to a text input with the + `developer` role. - - `array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` + - `InputItemList = array of BetaEasyInputMessage or object { content, role, agent, 2 more } or BetaResponseOutputMessage or 32 more` - A list of one or many input items to the model, containing different content types. + A list of one or many input items to the model, containing + different content types. - `BetaEasyInputMessage object { content, role, phase, type }` @@ -45500,244 +44316,497 @@ Learn when and how to compact long-running conversations in the [conversation st The canonical name of the agent that produced this item. -- `instructions: optional string` + - `metadata: map[string]` - A system (or developer) message inserted into the model's context. - When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses. + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. -- `previous_response_id: optional string` + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + - `model: "gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more or string` -- `prompt_cache_key: optional string` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](/docs/models) + to browse and compare available models. - A key to use when reading from or writing to the prompt cache. + - `"gpt-5.6-sol" or "gpt-5.6-terra" or "gpt-5.6-luna" or 92 more` -- `prompt_cache_options: optional object { mode, ttl }` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](/docs/models) + to browse and compare available models. - Options for prompt caching. Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](/docs/guides/prompt-caching) for current details. + - `"gpt-5.6-sol"` - - `mode: optional "implicit" or "explicit"` + - `"gpt-5.6-terra"` - Controls whether OpenAI automatically creates an implicit cache breakpoint. Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint and writes up to the latest three explicit breakpoints in the request. With `explicit`, OpenAI does not create an implicit breakpoint and writes up to the latest four explicit breakpoints. If there are no explicit breakpoints, the request does not use prompt caching. + - `"gpt-5.6-luna"` - - `"implicit"` + - `"gpt-5.4"` - - `"explicit"` + - `"gpt-5.4-mini"` - - `ttl: optional "30m"` + - `"gpt-5.4-nano"` - The minimum lifetime applied to every implicit and explicit cache breakpoint written by the request. Defaults to `30m`, which is currently the only supported value. The backend may retain cache entries for longer. + - `"gpt-5.4-mini-2026-03-17"` - - `"30m"` + - `"gpt-5.4-nano-2026-03-17"` -- `prompt_cache_retention: optional "in_memory" or "24h"` + - `"gpt-5.3-chat-latest"` - How long to retain a prompt cache entry created by this request. + - `"gpt-5.2"` - - `"in_memory"` + - `"gpt-5.2-2025-12-11"` - - `"24h"` + - `"gpt-5.2-chat-latest"` -- `service_tier: optional "auto" or "default" or "flex" or "priority"` + - `"gpt-5.2-pro"` - The service tier to use for this request. + - `"gpt-5.2-pro-2025-12-11"` - - `"auto"` + - `"gpt-5.1"` - - `"default"` + - `"gpt-5.1-2025-11-13"` - - `"flex"` + - `"gpt-5.1-codex"` - - `"priority"` + - `"gpt-5.1-mini"` -### Returns + - `"gpt-5.1-chat-latest"` -- `BetaCompactedResponse object { id, created_at, object, 2 more }` + - `"gpt-5"` - - `id: string` + - `"gpt-5-mini"` - The unique identifier for the compacted response. + - `"gpt-5-nano"` - - `created_at: number` + - `"gpt-5-2025-08-07"` - Unix timestamp (in seconds) when the compacted conversation was created. + - `"gpt-5-mini-2025-08-07"` - - `object: "response.compaction"` + - `"gpt-5-nano-2025-08-07"` - The object type. Always `response.compaction`. + - `"gpt-5-chat-latest"` - - `"response.compaction"` + - `"gpt-4.1"` - - `output: array of object { id, content, role, 4 more } or object { id, call_id, code, 3 more } or object { id, call_id, result, 3 more } or 28 more` + - `"gpt-4.1-mini"` - The compacted list of output items. + - `"gpt-4.1-nano"` - - `Message object { id, content, role, 4 more }` + - `"gpt-4.1-2025-04-14"` - A message to or from the model. + - `"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"` + + - `string` + + - `object: "response"` + + The object type of this resource - always set to `response`. + + - `"response"` + + - `output: array of BetaResponseOutputItem` + + An array of content items generated by the model. + + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + + - `BetaResponseOutputMessage object { id, content, role, 4 more }` + + An output message from the model. + + - `FileSearchCall object { id, queries, status, 3 more }` + + The results of a file search tool call. See the + [file search guide](/docs/guides/tools-file-search) for more information. - `id: string` - The unique ID of the message. + The unique ID of the file search tool call. - - `content: array of BetaResponseInputText or BetaResponseOutputText or object { text, type } or 7 more` + - `queries: array of string` - The content of the message + The queries used to search for files. - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + - `status: "in_progress" or "searching" or "completed" or 2 more` - A text input to the model. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - - `text: string` + - `"in_progress"` - The text input to the model. + - `"searching"` - - `type: "input_text"` + - `"completed"` - The type of the input item. Always `input_text`. + - `"incomplete"` - - `"input_text"` + - `"failed"` - - `prompt_cache_breakpoint: optional object { mode }` + - `type: "file_search_call"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + The type of the file search tool call. Always `file_search_call`. - - `mode: "explicit"` + - `"file_search_call"` - The breakpoint mode. Always `explicit`. + - `agent: optional object { agent_name }` - - `"explicit"` + The agent that produced this item. - - `BetaResponseOutputText object { annotations, logprobs, text, type }` + - `agent_name: string` - A text output from the model. + The canonical name of the agent that produced this item. - - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` + - `results: optional array of object { attributes, file_id, filename, 2 more }` - The annotations of the text output. + The results of the file search tool call. - - `FileCitation object { file_id, filename, index, type }` + - `attributes: optional map[string or number or boolean]` - A citation to a file. + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. Keys are strings + with a maximum length of 64 characters. Values are strings with a maximum + length of 512 characters, booleans, or numbers. - - `file_id: string` + - `string` - The ID of the file. + - `number` - - `filename: string` + - `boolean` - The filename of the file cited. + - `file_id: optional string` - - `index: number` + The unique ID of the file. - The index of the file in the list of files. + - `filename: optional string` - - `type: "file_citation"` + The name of the file. - The type of the file citation. Always `file_citation`. + - `score: optional number` - - `"file_citation"` + The relevance score of the file - a value between 0 and 1. - - `URLCitation object { end_index, start_index, title, 2 more }` + - `text: optional string` - A citation for a web resource used to generate a model response. + The text that was retrieved from the file. - - `end_index: number` + - `FunctionCall object { arguments, call_id, name, 6 more }` - The index of the last character of the URL citation in the message. + A tool call to run a function. See the + [function calling guide](/docs/guides/function-calling) for more information. - - `start_index: number` + - `arguments: string` - The index of the first character of the URL citation in the message. + A JSON string of the arguments to pass to the function. - - `title: string` + - `call_id: string` - The title of the web resource. + The unique ID of the function tool call generated by the model. - - `type: "url_citation"` + - `name: string` - The type of the URL citation. Always `url_citation`. + The name of the function to run. - - `"url_citation"` + - `type: "function_call"` - - `url: string` + The type of the function tool call. Always `function_call`. - The URL of the web resource. + - `"function_call"` - - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` + - `id: optional string` - A citation for a container file used to generate a model response. + The unique ID of the function tool call. - - `container_id: string` + - `agent: optional object { agent_name }` - The ID of the container file. + The agent that produced this item. - - `end_index: number` + - `agent_name: string` - The index of the last character of the container file citation in the message. + The canonical name of the agent that produced this item. - - `file_id: string` + - `caller: optional object { type } or object { caller_id, type }` - The ID of the file. + The execution context that produced this tool call. - - `filename: string` + - `Direct object { type }` - The filename of the container file cited. + - `type: "direct"` - - `start_index: number` + - `"direct"` - The index of the first character of the container file citation in the message. + - `Program object { caller_id, type }` - - `type: "container_file_citation"` + - `caller_id: string` - The type of the container file citation. Always `container_file_citation`. + The call ID of the program item that produced this tool call. - - `"container_file_citation"` + - `type: "program"` - - `FilePath object { file_id, index, type }` + - `"program"` - A path to a file. + - `namespace: optional string` - - `file_id: string` + The namespace of the function to run. - The ID of the file. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `index: number` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The index of the file in the list of files. + - `"in_progress"` - - `type: "file_path"` + - `"completed"` - The type of the file path. Always `file_path`. + - `"incomplete"` - - `"file_path"` + - `FunctionCallOutput object { id, call_id, output, 5 more }` - - `logprobs: array of object { token, bytes, logprob, top_logprobs }` + - `id: string` - - `token: string` + The unique ID of the function call tool output. - - `bytes: array of number` + - `call_id: string` - - `logprob: number` + The unique ID of the function tool call generated by the model. - - `top_logprobs: array of object { token, bytes, logprob }` + - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - - `token: string` + The output from the function call generated by your code. + Can be a string or an list of output content. - - `bytes: array of number` + - `StringOutput = string` - - `logprob: number` + A string of the output of the function call. - - `text: string` + - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - The text output from the model. + Text, image, or file output of the function call. - - `type: "output_text"` + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - The type of the output text. Always `output_text`. + A text input to the model. - - `"output_text"` + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + + An image input to the model. Learn about [image inputs](/docs/guides/vision). + + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + + A file input to the model. + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "function_call_output"` + + The type of the function tool call output. Always `function_call_output`. + + - `"function_call_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + The caller type. Always `direct`. + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + The caller type. Always `program`. + + - `"program"` + + - `created_by: optional string` + + The identifier of the actor that created the item. + + - `AgentMessage object { id, author, content, 3 more }` + + - `id: string` + + The unique ID of the agent message. + + - `author: string` + + The sending agent identity. + + - `content: array of BetaResponseInputText or BetaResponseOutputText or object { text, type } or 7 more` + + Encrypted content sent between agents. + + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + + A text input to the model. + + - `BetaResponseOutputText object { annotations, logprobs, text, type }` + + A text output from the model. - `Text object { text, type }` @@ -45781,23 +44850,17 @@ Learn when and how to compact long-running conversations in the [conversation st A refusal from the model. - - `refusal: string` - - The refusal explanation from the model. - - - `type: "refusal"` - - The type of the refusal. Always `refusal`. - - - `"refusal"` - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` An image input to the model. Learn about [image inputs](/docs/guides/vision). + - `ComputerScreenshot object { detail, file_id, image_url, 2 more }` + + A screenshot of a computer. + - `detail: "low" or "high" or "auto" or "original"` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - `"low"` @@ -45807,19 +44870,19 @@ Learn when and how to compact long-running conversations in the [conversation st - `"original"` - - `type: "input_image"` + - `file_id: string` - The type of the input item. Always `input_image`. + The identifier of an uploaded file that contains the screenshot. - - `"input_image"` + - `image_url: string` - - `file_id: optional string` + The URL of the screenshot image. - The ID of the file to be sent to the model. + - `type: "computer_screenshot"` - - `image_url: optional string` + Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `"computer_screenshot"` - `prompt_cache_breakpoint: optional object { mode }` @@ -45831,141 +44894,135 @@ Learn when and how to compact long-running conversations in the [conversation st - `"explicit"` - - `ComputerScreenshot object { detail, file_id, image_url, 2 more }` - - A screenshot of a computer. - - - `detail: "low" or "high" or "auto" or "original"` - - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - - `"low"` + A file input to the model. - - `"high"` + - `EncryptedContent object { encrypted_content, type }` - - `"auto"` + Opaque encrypted content that Responses API decrypts inside trusted model execution. - - `"original"` + - `encrypted_content: string` - - `file_id: string` + Opaque encrypted content. - The identifier of an uploaded file that contains the screenshot. + - `type: "encrypted_content"` - - `image_url: string` + The type of the input item. Always `encrypted_content`. - The URL of the screenshot image. + - `"encrypted_content"` - - `type: "computer_screenshot"` + - `recipient: string` - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + The destination agent identity. - - `"computer_screenshot"` + - `type: "agent_message"` - - `prompt_cache_breakpoint: optional object { mode }` + The type of the item. Always `agent_message`. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `"agent_message"` - - `mode: "explicit"` + - `agent: optional object { agent_name }` - The breakpoint mode. Always `explicit`. + The agent that produced this item. - - `"explicit"` + - `agent_name: string` - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + The canonical name of the agent that produced this item. - A file input to the model. + - `MultiAgentCall object { id, action, arguments, 3 more }` - - `type: "input_file"` + - `id: string` - The type of the input item. Always `input_file`. + The unique ID of the multi-agent call item. - - `"input_file"` + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - - `detail: optional "auto" or "low" or "high"` + The multi-agent action to execute. - The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`. + - `"spawn_agent"` - - `"auto"` + - `"interrupt_agent"` - - `"low"` + - `"list_agents"` - - `"high"` + - `"send_message"` - - `file_data: optional string` + - `"followup_task"` - The content of the file to be sent to the model. + - `"wait_agent"` - - `file_id: optional string` + - `arguments: string` - The ID of the file to be sent to the model. + The JSON string of arguments generated for the action. - - `file_url: optional string` + - `call_id: string` - The URL of the file to be sent to the model. + The unique ID linking this call to its output. - - `filename: optional string` + - `type: "multi_agent_call"` - The name of the file to be sent to the model. + The type of the multi-agent call. Always `multi_agent_call`. - - `prompt_cache_breakpoint: optional object { mode }` + - `"multi_agent_call"` - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `agent: optional object { agent_name }` - - `mode: "explicit"` + The agent that produced this item. - The breakpoint mode. Always `explicit`. + - `agent_name: string` - - `"explicit"` + The canonical name of the agent that produced this item. - - `EncryptedContent object { encrypted_content, type }` + - `MultiAgentCallOutput object { id, action, call_id, 3 more }` - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `id: string` - - `encrypted_content: string` + The unique ID of the multi-agent call output item. - Opaque encrypted content. + - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` - - `type: "encrypted_content"` + The multi-agent action that produced this result. - The type of the input item. Always `encrypted_content`. + - `"spawn_agent"` - - `"encrypted_content"` + - `"interrupt_agent"` - - `role: "unknown" or "user" or "assistant" or 5 more` + - `"list_agents"` - The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`. + - `"send_message"` - - `"unknown"` + - `"followup_task"` - - `"user"` + - `"wait_agent"` - - `"assistant"` + - `call_id: string` - - `"system"` + The unique ID of the multi-agent call. - - `"critic"` + - `output: array of BetaResponseOutputText` - - `"discriminator"` + Text output returned by the multi-agent action. - - `"developer"` + - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` - - `"tool"` + The annotations of the text output. - - `status: "in_progress" or "completed" or "incomplete"` + - `logprobs: array of object { token, bytes, logprob, top_logprobs }` - The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + - `text: string` - - `"in_progress"` + The text output from the model. - - `"completed"` + - `type: "output_text"` - - `"incomplete"` + The type of the output text. Always `output_text`. - - `type: "message"` + - `type: "multi_agent_call_output"` - The type of the message. Always set to `message`. + The type of the multi-agent result. Always `multi_agent_call_output`. - - `"message"` + - `"multi_agent_call_output"` - `agent: optional object { agent_name }` @@ -45975,73 +45032,101 @@ Learn when and how to compact long-running conversations in the [conversation st The canonical name of the agent that produced this item. - - `phase: optional "commentary" or "final_answer"` + - `WebSearchCall object { id, action, status, 2 more }` - Labels an `assistant` message as intermediate commentary (`commentary`) or the final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages. + The results of a web search tool call. See the + [web search guide](/docs/guides/tools-web-search) for more information. - - `"commentary"` + - `id: string` - - `"final_answer"` + The unique ID of the web search tool call. - - `Program object { id, call_id, code, 3 more }` + - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` - - `id: string` + An object describing the specific action taken in this web search call. + Includes details on how the model used the web (search, open_page, find_in_page). - The unique ID of the program item. + - `Search object { type, queries, query, sources }` - - `call_id: string` + Action type "search" - Performs a web search query. - The stable call ID of the program item. + - `type: "search"` - - `code: string` + The action type. - The JavaScript source executed by programmatic tool calling. + - `"search"` - - `fingerprint: string` + - `queries: optional array of string` - Opaque program replay fingerprint that must be round-tripped. + The search queries. - - `type: "program"` + - `query: optional string` - The type of the item. Always `program`. + The search query. - - `"program"` + - `sources: optional array of object { type, url }` - - `agent: optional object { agent_name }` + The sources used in the search. - The agent that produced this item. + - `type: "url"` - - `agent_name: string` + The type of source. Always `url`. - The canonical name of the agent that produced this item. + - `"url"` - - `ProgramOutput object { id, call_id, result, 3 more }` + - `url: string` - - `id: string` + The URL of the source. - The unique ID of the program output item. + - `OpenPage object { type, url }` - - `call_id: string` + Action type "open_page" - Opens a specific URL from search results. - The call ID of the program item. + - `type: "open_page"` - - `result: string` + The action type. - The result produced by the program item. + - `"open_page"` - - `status: "completed" or "incomplete"` + - `url: optional string` - The terminal status of the program output item. + The URL opened by the model. + + - `FindInPage object { pattern, type, url }` + + Action type "find_in_page": Searches for a pattern within a loaded page. + + - `pattern: string` + + The pattern or text to search for within the page. + + - `type: "find_in_page"` + + The action type. + + - `"find_in_page"` + + - `url: string` + + The URL of the page searched for the pattern. + + - `status: "in_progress" or "searching" or "completed" or "failed"` + + The status of the web search tool call. + + - `"in_progress"` + + - `"searching"` - `"completed"` - - `"incomplete"` + - `"failed"` - - `type: "program_output"` + - `type: "web_search_call"` - The type of the item. Always `program_output`. + The type of the web search tool call. Always `web_search_call`. - - `"program_output"` + - `"web_search_call"` - `agent: optional object { agent_name }` @@ -46051,32 +45136,60 @@ Learn when and how to compact long-running conversations in the [conversation st The canonical name of the agent that produced this item. - - `FunctionCall object { arguments, call_id, name, 6 more }` + - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` - A tool call to run a function. See the - [function calling guide](/docs/guides/function-calling) for more information. + A tool call to a computer use tool. See the + [computer use guide](/docs/guides/tools-computer-use) for more information. - - `arguments: string` + - `id: string` - A JSON string of the arguments to pass to the function. + The unique ID of the computer call. - `call_id: string` - The unique ID of the function tool call generated by the model. + An identifier used when responding to the tool call with output. - - `name: string` + - `pending_safety_checks: array of object { id, code, message }` - The name of the function to run. + The pending safety checks for the computer call. - - `type: "function_call"` + - `id: string` - The type of the function tool call. Always `function_call`. + The ID of the pending safety check. - - `"function_call"` + - `code: optional string` - - `id: optional string` + The type of the pending safety check. - The unique ID of the function tool call. + - `message: optional string` + + Details about the pending safety check. + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "computer_call"` + + The type of the computer call. Always `computer_call`. + + - `"computer_call"` + + - `action: optional BetaComputerAction` + + A click action. + + - `actions: optional BetaComputerActionList` + + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - `agent: optional object { agent_name }` @@ -46086,76 +45199,98 @@ Learn when and how to compact long-running conversations in the [conversation st The canonical name of the agent that produced this item. - - `caller: optional object { type } or object { caller_id, type }` + - `ComputerCallOutput object { id, call_id, output, 5 more }` - The execution context that produced this tool call. + - `id: string` - - `Direct object { type }` + The unique ID of the computer call tool output. - - `type: "direct"` + - `call_id: string` - - `"direct"` + The ID of the computer tool call that produced the output. - - `Program object { caller_id, type }` + - `output: BetaResponseComputerToolCallOutputScreenshot` - - `caller_id: string` + A computer screenshot image used with the computer use tool. - The call ID of the program item that produced this tool call. + - `status: "completed" or "incomplete" or "failed" or "in_progress"` - - `type: "program"` + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `"program"` + - `"completed"` - - `namespace: optional string` + - `"incomplete"` - The namespace of the function to run. + - `"failed"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"in_progress"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type: "computer_call_output"` - - `"in_progress"` + The type of the computer tool call output. Always `computer_call_output`. - - `"completed"` + - `"computer_call_output"` - - `"incomplete"` + - `acknowledged_safety_checks: optional array of object { id, code, message }` - - `MultiAgentCall object { id, action, arguments, 3 more }` + The safety checks reported by the API that have been acknowledged by the + developer. - `id: string` - The unique ID of the multi-agent call item. + The ID of the pending safety check. - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + - `code: optional string` - The multi-agent action to execute. + The type of the pending safety check. - - `"spawn_agent"` + - `message: optional string` - - `"interrupt_agent"` + Details about the pending safety check. - - `"list_agents"` + - `agent: optional object { agent_name }` - - `"send_message"` + The agent that produced this item. - - `"followup_task"` + - `agent_name: string` - - `"wait_agent"` + The canonical name of the agent that produced this item. - - `arguments: string` + - `created_by: optional string` - The JSON string of arguments generated for the action. + The identifier of the actor that created the item. - - `call_id: string` + - `Reasoning object { id, summary, type, 4 more }` - The unique ID linking this call to its output. + 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](/docs/guides/conversation-state). - - `type: "multi_agent_call"` + - `id: string` - The type of the multi-agent call. Always `multi_agent_call`. + The unique identifier of the reasoning content. - - `"multi_agent_call"` + - `summary: array of object { text, type }` + + Reasoning summary content. + + - `text: string` + + A summary of the reasoning output from the model so far. + + - `type: "summary_text"` + + The type of the object. Always `summary_text`. + + - `"summary_text"` + + - `type: "reasoning"` + + The type of the object. Always `reasoning`. + + - `"reasoning"` - `agent: optional object { agent_name }` @@ -46165,55 +45300,96 @@ Learn when and how to compact long-running conversations in the [conversation st The canonical name of the agent that produced this item. - - `MultiAgentCallOutput object { id, action, call_id, 3 more }` + - `content: optional array of object { text, type }` - - `id: string` + Reasoning text content. - The unique ID of the multi-agent call output item. + - `text: string` - - `action: "spawn_agent" or "interrupt_agent" or "list_agents" or 3 more` + The reasoning text from the model. - The multi-agent action that produced this result. + - `type: "reasoning_text"` - - `"spawn_agent"` + The type of the reasoning text. Always `reasoning_text`. - - `"interrupt_agent"` + - `"reasoning_text"` - - `"list_agents"` + - `encrypted_content: optional string` - - `"send_message"` + The encrypted content of the reasoning item. This is populated by default + for reasoning items returned by `POST /v1/responses` and WebSocket + `response.create` requests. - - `"followup_task"` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"wait_agent"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `Program object { id, call_id, code, 3 more }` + + - `id: string` + + The unique ID of the program item. - `call_id: string` - The unique ID of the multi-agent call. + The stable call ID of the program item. - - `output: array of BetaResponseOutputText` + - `code: string` - Text output returned by the multi-agent action. + The JavaScript source executed by programmatic tool calling. - - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` + - `fingerprint: string` - The annotations of the text output. + Opaque program replay fingerprint that must be round-tripped. - - `logprobs: array of object { token, bytes, logprob, top_logprobs }` + - `type: "program"` - - `text: string` + The type of the item. Always `program`. - The text output from the model. + - `"program"` - - `type: "output_text"` + - `agent: optional object { agent_name }` - The type of the output text. Always `output_text`. + The agent that produced this item. - - `type: "multi_agent_call_output"` + - `agent_name: string` - The type of the multi-agent result. Always `multi_agent_call_output`. + The canonical name of the agent that produced this item. - - `"multi_agent_call_output"` + - `ProgramOutput object { id, call_id, result, 3 more }` + + - `id: string` + + The unique ID of the program output item. + + - `call_id: string` + + The call ID of the program item. + + - `result: string` + + The result produced by the program item. + + - `status: "completed" or "incomplete"` + + The terminal status of the program output item. + + - `"completed"` + + - `"incomplete"` + + - `type: "program_output"` + + The type of the item. Always `program_output`. + + - `"program_output"` - `agent: optional object { agent_name }` @@ -46824,40 +46000,8 @@ Learn when and how to compact long-running conversations in the [conversation st - `BetaContainerNetworkPolicyDisabled object { type }` - - `type: "disabled"` - - Disable outbound network access. Always `disabled`. - - - `"disabled"` - - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `allowed_domains: array of string` - - A list of allowed domains when type is `allowlist`. - - - `type: "allowlist"` - - Allow outbound network access only to specified domains. Always `allowlist`. - - - `"allowlist"` - - - `domain_secrets: optional array of BetaContainerNetworkPolicyDomainSecret` - - Optional domain-scoped secrets for allowlisted domains. - - - `domain: string` - - The domain associated with the secret. - - - `name: string` - - The name of the secret to inject for the domain. - - - `value: string` - - The secret value to inject for the domain. - - `type: "code_interpreter"` The type of the code interpreter tool. Always `code_interpreter`. @@ -47038,128 +46182,10 @@ Learn when and how to compact long-running conversations in the [conversation st - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` - - `type: "container_auto"` - - Automatically creates a container for this request - - - `"container_auto"` - - - `file_ids: optional array of string` - - An optional list of uploaded files to make available to your code. - - - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - The memory limit for the container. - - - `"1g"` - - - `"4g"` - - - `"16g"` - - - `"64g"` - - - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` - - Network access policy for the container. - - - `BetaContainerNetworkPolicyDisabled object { type }` - - - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - - `skills: optional array of BetaSkillReference or BetaInlineSkill` - - An optional list of skills referenced by id or inline data. - - - `BetaSkillReference object { skill_id, type, version }` - - - `skill_id: string` - - The ID of the referenced skill. - - - `type: "skill_reference"` - - References a skill created with the /v1/skills endpoint. - - - `"skill_reference"` - - - `version: optional string` - - Optional skill version. Use a positive integer or 'latest'. Omit for default. - - - `BetaInlineSkill object { description, name, source, type }` - - - `description: string` - - The description of the skill. - - - `name: string` - - The name of the skill. - - - `source: BetaInlineSkillSource` - - Inline skill payload - - - `data: string` - - Base64-encoded skill zip bundle. - - - `media_type: "application/zip"` - - The media type of the inline skill payload. Must be `application/zip`. - - - `"application/zip"` - - - `type: "base64"` - - The type of the inline skill source. Must be `base64`. - - - `"base64"` - - - `type: "inline"` - - Defines an inline skill for this request. - - - `"inline"` - - `BetaLocalEnvironment object { type, skills }` - - `type: "local"` - - Use a local computer environment. - - - `"local"` - - - `skills: optional array of BetaLocalSkill` - - An optional list of skills. - - - `description: string` - - The description of the skill. - - - `name: string` - - The name of the skill. - - - `path: string` - - The path to the directory containing the skill. - - `BetaContainerReference object { container_id, type }` - - `container_id: string` - - The ID of the referenced container. - - - `type: "container_reference"` - - References a container created with the /v1/containers endpoint - - - `"container_reference"` - - `Custom object { name, type, allowed_callers, 3 more }` A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) @@ -48495,170 +47521,894 @@ Learn when and how to compact long-running conversations in the [conversation st The canonical name of the agent that produced this item. - - `AgentMessage object { id, author, content, 3 more }` + - `Compaction object { id, encrypted_content, type, 2 more }` + + A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - `id: string` - The unique ID of the agent message. + The unique ID of the compaction item. - - `author: string` + - `encrypted_content: string` - The sending agent identity. + The encrypted content that was produced by compaction. - - `content: array of BetaResponseInputText or BetaResponseOutputText or object { text, type } or 7 more` + - `type: "compaction"` - Encrypted content sent between agents. + The type of the item. Always `compaction`. - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + - `"compaction"` - A text input to the model. + - `agent: optional object { agent_name }` - - `BetaResponseOutputText object { annotations, logprobs, text, type }` + The agent that produced this item. - A text output from the model. + - `agent_name: string` - - `Text object { text, type }` + The canonical name of the agent that produced this item. - A text content. + - `created_by: optional string` - - `text: string` + The identifier of the actor that created the item. - - `type: "text"` + - `ImageGenerationCall object { id, result, status, 2 more }` - - `"text"` + An image generation request made by the model. - - `SummaryText object { text, type }` + - `id: string` - A summary text from the model. + The unique ID of the image generation call. - - `text: string` + - `result: string` - A summary of the reasoning output from the model so far. + The generated image encoded in base64. - - `type: "summary_text"` + - `status: "in_progress" or "completed" or "generating" or "failed"` - The type of the object. Always `summary_text`. + The status of the image generation call. - - `"summary_text"` + - `"in_progress"` - - `ReasoningText object { text, type }` + - `"completed"` - Reasoning text from the model. + - `"generating"` - - `text: string` + - `"failed"` - The reasoning text from the model. + - `type: "image_generation_call"` - - `type: "reasoning_text"` + The type of the image generation call. Always `image_generation_call`. - The type of the reasoning text. Always `reasoning_text`. + - `"image_generation_call"` - - `"reasoning_text"` + - `agent: optional object { agent_name }` - - `BetaResponseOutputRefusal object { refusal, type }` + The agent that produced this item. - A refusal from the model. + - `agent_name: string` - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + The canonical name of the agent that produced this item. - An image input to the model. Learn about [image inputs](/docs/guides/vision). + - `CodeInterpreterCall object { id, code, container_id, 4 more }` - - `ComputerScreenshot object { detail, file_id, image_url, 2 more }` + A tool call to run code. - A screenshot of a computer. + - `id: string` - - `detail: "low" or "high" or "auto" or "original"` + The unique ID of the code interpreter tool call. - The detail level of the screenshot image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `code: string` - - `"low"` + The code to run, or null if not available. - - `"high"` + - `container_id: string` - - `"auto"` + The ID of the container used to run the code. - - `"original"` + - `outputs: array of object { logs, type } or object { type, url }` - - `file_id: string` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - The identifier of an uploaded file that contains the screenshot. + - `Logs object { logs, type }` - - `image_url: string` + The logs output from the code interpreter. - The URL of the screenshot image. + - `logs: string` - - `type: "computer_screenshot"` + The logs output from the code interpreter. - Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + - `type: "logs"` - - `"computer_screenshot"` + The type of the output. Always `logs`. + + - `"logs"` + + - `Image object { type, url }` + + The image output from the code interpreter. + + - `type: "image"` + + The type of the output. Always `image`. + + - `"image"` + + - `url: string` + + The URL of the image output from the code interpreter. + + - `status: "in_progress" or "completed" or "incomplete" or 2 more` + + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `"interpreting"` + + - `"failed"` + + - `type: "code_interpreter_call"` + + The type of the code interpreter tool call. Always `code_interpreter_call`. + + - `"code_interpreter_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `LocalShellCall object { id, action, call_id, 3 more }` + + A tool call to run a command on the local shell. + + - `id: string` + + The unique ID of the local shell call. + + - `action: object { command, env, type, 3 more }` + + Execute a shell command on the server. + + - `command: array of string` + + The command to run. + + - `env: map[string]` + + Environment variables to set for the command. + + - `type: "exec"` + + The type of the local shell action. Always `exec`. + + - `"exec"` + + - `timeout_ms: optional number` + + Optional timeout in milliseconds for the command. + + - `user: optional string` + + Optional user to run the command as. + + - `working_directory: optional string` + + Optional working directory to run the command in. + + - `call_id: string` + + The unique ID of the local shell tool call generated by the model. + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the local shell call. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "local_shell_call"` + + The type of the local shell call. Always `local_shell_call`. + + - `"local_shell_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `LocalShellCallOutput object { id, output, type, 2 more }` + + The output of a local shell tool call. + + - `id: string` + + The unique ID of the local shell tool call generated by the model. + + - `output: string` + + A JSON string of the output of the local shell tool call. + + - `type: "local_shell_call_output"` + + The type of the local shell tool call output. Always `local_shell_call_output`. + + - `"local_shell_call_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `status: optional "in_progress" or "completed" or "incomplete"` + + The status of the item. One of `in_progress`, `completed`, or `incomplete`. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `ShellCall object { id, action, call_id, 6 more }` + + A tool call that executes one or more shell commands in a managed environment. + + - `id: string` + + The unique ID of the shell tool call. Populated when this item is returned via API. + + - `action: object { commands, max_output_length, timeout_ms }` + + The shell commands and limits that describe how to run the tool call. + + - `commands: array of string` + + - `max_output_length: number` + + Optional maximum number of characters to return from each command. + + - `timeout_ms: number` + + Optional timeout in milliseconds for the commands. + + - `call_id: string` + + The unique ID of the shell tool call generated by the model. + + - `environment: BetaResponseLocalEnvironment or BetaResponseContainerReference` + + Represents the use of a local environment to perform shell actions. + + - `BetaResponseLocalEnvironment object { type }` + + Represents the use of a local environment to perform shell actions. + + - `type: "local"` + + The environment type. Always `local`. + + - `"local"` + + - `BetaResponseContainerReference object { container_id, type }` + + Represents a container created with /v1/containers. + + - `container_id: string` + + - `type: "container_reference"` + + The environment type. Always `container_reference`. + + - `"container_reference"` + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "shell_call"` + + The type of the item. Always `shell_call`. + + - `"shell_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `created_by: optional string` + + The ID of the entity that created this tool call. + + - `ShellCallOutput object { id, call_id, max_output_length, 6 more }` + + The output of a shell tool call that was emitted. + + - `id: string` + + The unique ID of the shell call output. Populated when this item is returned via API. + + - `call_id: string` + + The unique ID of the shell tool call generated by the model. + + - `max_output_length: number` + + The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + + - `output: array of object { outcome, stderr, stdout, created_by }` + + An array of shell call output contents + + - `outcome: object { type } or object { exit_code, type }` + + Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + + - `Timeout object { type }` + + Indicates that the shell call exceeded its configured time limit. + + - `type: "timeout"` + + The outcome type. Always `timeout`. + + - `"timeout"` + + - `Exit object { exit_code, type }` + + Indicates that the shell commands finished and returned an exit code. + + - `exit_code: number` + + Exit code from the shell process. + + - `type: "exit"` + + The outcome type. Always `exit`. + + - `"exit"` + + - `stderr: string` + + The standard error output that was captured. + + - `stdout: string` + + The standard output that was captured. + + - `created_by: optional string` + + The identifier of the actor that created the item. + + - `status: "in_progress" or "completed" or "incomplete"` + + The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "shell_call_output"` + + The type of the shell call output. Always `shell_call_output`. + + - `"shell_call_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `created_by: optional string` + + The identifier of the actor that created the item. + + - `ApplyPatchCall object { id, call_id, operation, 5 more }` + + A tool call that applies file diffs by creating, deleting, or updating files. + + - `id: string` + + The unique ID of the apply patch tool call. Populated when this item is returned via API. + + - `call_id: string` + + The unique ID of the apply patch tool call generated by the model. + + - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` + + One of the create_file, delete_file, or update_file operations applied via apply_patch. + + - `CreateFile object { diff, path, type }` + + Instruction describing how to create a file via the apply_patch tool. + + - `diff: string` + + Diff to apply. + + - `path: string` + + Path of the file to create. + + - `type: "create_file"` + + Create a new file with the provided diff. + + - `"create_file"` + + - `DeleteFile object { path, type }` + + Instruction describing how to delete a file via the apply_patch tool. + + - `path: string` + + Path of the file to delete. + + - `type: "delete_file"` + + Delete the specified file. + + - `"delete_file"` + + - `UpdateFile object { diff, path, type }` + + Instruction describing how to update a file via the apply_patch tool. + + - `diff: string` + + Diff to apply. + + - `path: string` + + Path of the file to update. + + - `type: "update_file"` + + Update an existing file with the provided diff. + + - `"update_file"` + + - `status: "in_progress" or "completed"` + + The status of the apply patch tool call. One of `in_progress` or `completed`. + + - `"in_progress"` + + - `"completed"` + + - `type: "apply_patch_call"` + + The type of the item. Always `apply_patch_call`. + + - `"apply_patch_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `created_by: optional string` + + The ID of the entity that created this tool call. + + - `ApplyPatchCallOutput object { id, call_id, status, 5 more }` + + The output emitted by an apply patch tool call. + + - `id: string` + + The unique ID of the apply patch tool call output. Populated when this item is returned via API. + + - `call_id: string` + + The unique ID of the apply patch tool call generated by the model. + + - `status: "completed" or "failed"` + + The status of the apply patch tool call output. One of `completed` or `failed`. + + - `"completed"` + + - `"failed"` + + - `type: "apply_patch_call_output"` + + The type of the item. Always `apply_patch_call_output`. + + - `"apply_patch_call_output"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `caller: optional object { type } or object { caller_id, type }` + + The execution context that produced this tool call. + + - `Direct object { type }` + + - `type: "direct"` + + - `"direct"` + + - `Program object { caller_id, type }` + + - `caller_id: string` + + The call ID of the program item that produced this tool call. + + - `type: "program"` + + - `"program"` + + - `created_by: optional string` + + The ID of the entity that created this tool call output. + + - `output: optional string` + + Optional textual output returned by the apply patch tool. + + - `McpCall object { id, arguments, name, 7 more }` + + An invocation of a tool on an MCP server. + + - `id: string` + + The unique ID of the tool call. + + - `arguments: string` + + A JSON string of the arguments passed to the tool. + + - `name: string` + + The name of the tool that was run. + + - `server_label: string` + + The label of the MCP server running the tool. + + - `type: "mcp_call"` + + The type of the item. Always `mcp_call`. + + - `"mcp_call"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `approval_request_id: optional string` + + Unique identifier for the MCP tool call approval request. + Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call. + + - `error: optional string` + + The error from the tool call, if any. + + - `output: optional string` + + The output from the tool call. + + - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` + + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `"calling"` + + - `"failed"` + + - `McpListTools object { id, server_label, tools, 3 more }` + + A list of tools available on an MCP server. + + - `id: string` + + The unique ID of the list. + + - `server_label: string` + + The label of the MCP server. + + - `tools: array of object { input_schema, name, annotations, description }` + + The tools available on the server. + + - `input_schema: unknown` + + The JSON schema describing the tool's input. + + - `name: string` + + The name of the tool. + + - `annotations: optional unknown` + + Additional annotations about the tool. + + - `description: optional string` + + The description of the tool. + + - `type: "mcp_list_tools"` + + The type of the item. Always `mcp_list_tools`. + + - `"mcp_list_tools"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `error: optional string` + + Error message if the server could not list tools. + + - `McpApprovalRequest object { id, arguments, name, 3 more }` + + A request for human approval of a tool invocation. + + - `id: string` + + The unique ID of the approval request. + + - `arguments: string` + + A JSON string of arguments for the tool. + + - `name: string` + + The name of the tool to run. + + - `server_label: string` + + The label of the MCP server making the request. + + - `type: "mcp_approval_request"` + + The type of the item. Always `mcp_approval_request`. + + - `"mcp_approval_request"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `McpApprovalResponse object { id, approval_request_id, approve, 3 more }` + + A response to an MCP approval request. + + - `id: string` + + The unique ID of the approval response + + - `approval_request_id: string` + + The ID of the approval request being answered. + + - `approve: boolean` + + Whether the request was approved. + + - `type: "mcp_approval_response"` + + The type of the item. Always `mcp_approval_response`. + + - `"mcp_approval_response"` + + - `agent: optional object { agent_name }` + + The agent that produced this item. + + - `agent_name: string` + + The canonical name of the agent that produced this item. + + - `reason: optional string` + + Optional reason for the decision. + + - `CustomToolCall object { call_id, input, name, 5 more }` + + A call to a custom tool created by the model. + + - `call_id: string` + + An identifier used to map this custom tool call to a tool call output. + + - `input: string` + + The input for the custom tool call generated by the model. + + - `name: string` - - `prompt_cache_breakpoint: optional object { mode }` + The name of the custom tool being called. - Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block. + - `type: "custom_tool_call"` - - `mode: "explicit"` + The type of the custom tool call. Always `custom_tool_call`. - The breakpoint mode. Always `explicit`. + - `"custom_tool_call"` - - `"explicit"` + - `id: optional string` - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + The unique ID of the custom tool call in the OpenAI platform. - A file input to the model. + - `agent: optional object { agent_name }` - - `EncryptedContent object { encrypted_content, type }` + The agent that produced this item. - Opaque encrypted content that Responses API decrypts inside trusted model execution. + - `agent_name: string` - - `encrypted_content: string` + The canonical name of the agent that produced this item. - Opaque encrypted content. + - `caller: optional object { type } or object { caller_id, type }` - - `type: "encrypted_content"` + The execution context that produced this tool call. - The type of the input item. Always `encrypted_content`. + - `Direct object { type }` - - `"encrypted_content"` + - `type: "direct"` - - `recipient: string` + - `"direct"` - The destination agent identity. + - `Program object { caller_id, type }` - - `type: "agent_message"` + - `caller_id: string` - The type of the item. Always `agent_message`. + The call ID of the program item that produced this tool call. - - `"agent_message"` + - `type: "program"` - - `agent: optional object { agent_name }` + - `"program"` - The agent that produced this item. + - `namespace: optional string` - - `agent_name: string` + The namespace of the custom tool being called. - The canonical name of the agent that produced this item. + - `CustomToolCallOutput object { id, call_id, output, 5 more }` - - `FunctionCallOutput object { call_id, output, type, 4 more }` + - `id: string` - The output of a function tool call. + The unique ID of the custom tool call output item. - `call_id: string` - The unique ID of the function tool call generated by the model. + The call ID, used to map this custom tool call output to a custom tool call. - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - The output from the function call generated by your code. + The output from the custom tool call generated by your code. Can be a string or an list of output content. - `StringOutput = string` - A string of the output of the function call. + A string of the output of the custom tool call. - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` - Text, image, or file output of the function call. + Text, image, or file output of the custom tool call. - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` @@ -48672,16 +48422,22 @@ Learn when and how to compact long-running conversations in the [conversation st A file input to the model. - - `type: "function_call_output"` + - `status: "in_progress" or "completed" or "incomplete"` - The type of the function tool call output. Always `function_call_output`. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `"function_call_output"` + - `"in_progress"` - - `id: optional string` + - `"completed"` - The unique ID of the function tool call output. Populated when this item - is returned via API. + - `"incomplete"` + + - `type: "custom_tool_call_output"` + + The type of the custom tool call output. Always `custom_tool_call_output`. + + - `"custom_tool_call_output"` - `agent: optional object { agent_name }` @@ -48715,1578 +48471,1690 @@ Learn when and how to compact long-running conversations in the [conversation st - `"program"` - - `status: optional "in_progress" or "completed" or "incomplete"` - - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `created_by: optional string` - - `"in_progress"` + The identifier of the actor that created the item. - - `"completed"` + - `parallel_tool_calls: boolean` - - `"incomplete"` + Whether to allow the model to run tool calls in parallel. - - `FileSearchCall object { id, queries, status, 3 more }` + - `temperature: number` - The results of a file search tool call. See the - [file search guide](/docs/guides/tools-file-search) for more information. + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. - - `id: string` + - `tool_choice: BetaToolChoiceOptions or BetaToolChoiceAllowed or BetaToolChoiceTypes or 6 more` - The unique ID of the file search tool call. + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. - - `queries: array of string` + - `BetaToolChoiceOptions = "none" or "auto" or "required"` - The queries used to search for files. + Controls which (if any) tool is called by the model. - - `status: "in_progress" or "searching" or "completed" or 2 more` + `none` means the model will not call any tool and instead generates a message. - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + `auto` means the model can pick between generating a message or calling one or + more tools. - - `"in_progress"` + `required` means the model must call one or more tools. - - `"searching"` + - `"none"` - - `"completed"` + - `"auto"` - - `"incomplete"` + - `"required"` - - `"failed"` + - `BetaToolChoiceAllowed object { mode, tools, type }` - - `type: "file_search_call"` + Constrains the tools available to the model to a pre-defined set. - The type of the file search tool call. Always `file_search_call`. + - `mode: "auto" or "required"` - - `"file_search_call"` + Constrains the tools available to the model to a pre-defined set. - - `agent: optional object { agent_name }` + `auto` allows the model to pick from among the allowed tools and generate a + message. - The agent that produced this item. + `required` requires the model to call one or more of the allowed tools. - - `agent_name: string` + - `"auto"` - The canonical name of the agent that produced this item. + - `"required"` - - `results: optional array of object { attributes, file_id, filename, 2 more }` + - `tools: array of map[unknown]` - The results of the file search tool call. + A list of tool definitions that the model should be allowed to call. - - `attributes: optional map[string or number or boolean]` + For the Responses API, the list of tool definitions might look like: - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. Keys are strings - with a maximum length of 64 characters. Values are strings with a maximum - length of 512 characters, booleans, or numbers. + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` - - `string` + - `type: "allowed_tools"` - - `number` + Allowed tool configuration type. Always `allowed_tools`. - - `boolean` + - `"allowed_tools"` - - `file_id: optional string` + - `BetaToolChoiceTypes object { type }` - The unique ID of the file. + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](/docs/guides/tools). - - `filename: optional string` + - `type: "file_search" or "web_search_preview" or "computer" or 5 more` - The name of the file. + The type of hosted tool the model should to use. Learn more about + [built-in tools](/docs/guides/tools). - - `score: optional number` + Allowed values are: - The relevance score of the file - a value between 0 and 1. + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` - - `text: optional string` + - `"file_search"` - The text that was retrieved from the file. + - `"web_search_preview"` - - `WebSearchCall object { id, action, status, 2 more }` + - `"computer"` - The results of a web search tool call. See the - [web search guide](/docs/guides/tools-web-search) for more information. + - `"computer_use_preview"` - - `id: string` + - `"computer_use"` - The unique ID of the web search tool call. + - `"web_search_preview_2025_03_11"` - - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` + - `"image_generation"` - An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find_in_page). + - `"code_interpreter"` - - `Search object { type, queries, query, sources }` + - `BetaToolChoiceFunction object { name, type }` - Action type "search" - Performs a web search query. + Use this option to force the model to call a specific function. - - `type: "search"` + - `name: string` - The action type. + The name of the function to call. - - `"search"` + - `type: "function"` - - `queries: optional array of string` + For function calling, the type is always `function`. - The search queries. + - `"function"` - - `query: optional string` + - `BetaToolChoiceMcp object { server_label, type, name }` - The search query. + Use this option to force the model to call a specific tool on a remote MCP server. - - `sources: optional array of object { type, url }` + - `server_label: string` - The sources used in the search. + The label of the MCP server to use. - - `type: "url"` + - `type: "mcp"` - The type of source. Always `url`. + For MCP tools, the type is always `mcp`. - - `"url"` + - `"mcp"` - - `url: string` + - `name: optional string` - The URL of the source. + The name of the tool to call on the server. - - `OpenPage object { type, url }` + - `BetaToolChoiceCustom object { name, type }` - Action type "open_page" - Opens a specific URL from search results. + Use this option to force the model to call a specific custom tool. - - `type: "open_page"` + - `name: string` - The action type. + The name of the custom tool to call. - - `"open_page"` + - `type: "custom"` - - `url: optional string` + For custom tool calling, the type is always `custom`. - The URL opened by the model. + - `"custom"` - - `FindInPage object { pattern, type, url }` + - `BetaSpecificProgrammaticToolCallingParam object { type }` - Action type "find_in_page": Searches for a pattern within a loaded page. + - `type: "programmatic_tool_calling"` - - `pattern: string` + The tool to call. Always `programmatic_tool_calling`. - The pattern or text to search for within the page. + - `"programmatic_tool_calling"` - - `type: "find_in_page"` + - `BetaToolChoiceApplyPatch object { type }` - The action type. + Forces the model to call the apply_patch tool when executing a tool call. - - `"find_in_page"` + - `type: "apply_patch"` - - `url: string` + The tool to call. Always `apply_patch`. - The URL of the page searched for the pattern. + - `"apply_patch"` - - `status: "in_progress" or "searching" or "completed" or "failed"` + - `BetaToolChoiceShell object { type }` - The status of the web search tool call. + Forces the model to call the shell tool when a tool call is required. - - `"in_progress"` + - `type: "shell"` - - `"searching"` + The tool to call. Always `shell`. - - `"completed"` + - `"shell"` - - `"failed"` + - `tools: array of object { name, parameters, strict, 5 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 13 more` - - `type: "web_search_call"` + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. - The type of the web search tool call. Always `web_search_call`. + We support the following categories of tools: - - `"web_search_call"` + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](/docs/guides/tools-web-search) + or [file search](/docs/guides/tools-file-search). Learn more about + [built-in tools](/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](/docs/guides/function-calling). You can also use + custom tools to call your own code. - - `agent: optional object { agent_name }` + - `Function object { name, parameters, strict, 5 more }` - The agent that produced this item. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `agent_name: string` + - `name: string` - The canonical name of the agent that produced this item. + The name of the function to call. - - `ImageGenerationCall object { id, result, status, 2 more }` + - `parameters: map[unknown]` - An image generation request made by the model. + A JSON schema object describing the parameters of the function. - - `id: string` + - `strict: boolean` - The unique ID of the image generation call. + Whether strict parameter validation is enforced for this function tool. - - `result: string` + - `type: "function"` - The generated image encoded in base64. + The type of the function tool. Always `function`. - - `status: "in_progress" or "completed" or "generating" or "failed"` + - `"function"` - The status of the image generation call. + - `allowed_callers: optional array of "direct" or "programmatic"` - - `"in_progress"` + The tool invocation context(s). - - `"completed"` + - `"direct"` - - `"generating"` + - `"programmatic"` - - `"failed"` + - `defer_loading: optional boolean` - - `type: "image_generation_call"` + Whether this function is deferred and loaded via tool search. - The type of the image generation call. Always `image_generation_call`. + - `description: optional string` - - `"image_generation_call"` + A description of the function. Used by the model to determine whether or not to call the function. - - `agent: optional object { agent_name }` + - `output_schema: optional map[unknown]` - The agent that produced this item. + A JSON schema object describing the JSON value encoded in string outputs for this function. - - `agent_name: string` + - `FileSearch object { type, vector_store_ids, filters, 2 more }` - The canonical name of the agent that produced this item. + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `ComputerCall object { id, call_id, pending_safety_checks, 5 more }` + - `type: "file_search"` - A tool call to a computer use tool. See the - [computer use guide](/docs/guides/tools-computer-use) for more information. + The type of the file search tool. Always `file_search`. - - `id: string` + - `"file_search"` - The unique ID of the computer call. + - `vector_store_ids: array of string` - - `call_id: string` + The IDs of the vector stores to search. - An identifier used when responding to the tool call with output. + - `filters: optional object { key, type, value } or object { filters, type }` - - `pending_safety_checks: array of object { id, code, message }` + A filter to apply. - The pending safety checks for the computer call. + - `ComparisonFilter object { key, type, value }` - - `id: string` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - The ID of the pending safety check. + - `key: string` - - `code: optional string` + The key to compare against the value. - The type of the pending safety check. + - `type: "eq" or "ne" or "gt" or 5 more` - - `message: optional string` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - Details about the pending safety check. + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in - - `status: "in_progress" or "completed" or "incomplete"` + - `"eq"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `"ne"` - - `"in_progress"` + - `"gt"` - - `"completed"` + - `"gte"` - - `"incomplete"` + - `"lt"` - - `type: "computer_call"` + - `"lte"` - The type of the computer call. Always `computer_call`. + - `"in"` - - `"computer_call"` + - `"nin"` - - `action: optional BetaComputerAction` + - `value: string or number or boolean or array of string or number` - A click action. + The value to compare against the attribute key; supports string, number, or boolean types. - - `Click object { button, type, x, 2 more }` + - `string` - A click action. + - `number` - - `button: "left" or "right" or "wheel" or 2 more` + - `boolean` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + - `array of string or number` - - `"left"` + - `string` - - `"right"` + - `number` - - `"wheel"` + - `CompoundFilter object { filters, type }` - - `"back"` + Combine multiple filters using `and` or `or`. - - `"forward"` + - `filters: array of object { key, type, value } or unknown` - - `type: "click"` + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - Specifies the event type. For a click action, this property is always `click`. + - `ComparisonFilter object { key, type, value }` - - `"click"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `x: number` + - `key: string` - The x-coordinate where the click occurred. + The key to compare against the value. - - `y: number` + - `type: "eq" or "ne" or "gt" or 5 more` - The y-coordinate where the click occurred. + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `keys: optional array of string` + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in - The keys being held while clicking. + - `"eq"` - - `DoubleClick object { keys, type, x, y }` + - `"ne"` - A double click action. + - `"gt"` - - `keys: array of string` + - `"gte"` - The keys being held while double-clicking. + - `"lt"` - - `type: "double_click"` + - `"lte"` - Specifies the event type. For a double click action, this property is always set to `double_click`. + - `"in"` - - `"double_click"` + - `"nin"` - - `x: number` + - `value: string or number or boolean or array of string or number` - The x-coordinate where the double click occurred. + The value to compare against the attribute key; supports string, number, or boolean types. - - `y: number` + - `string` - The y-coordinate where the double click occurred. + - `number` - - `Drag object { path, type, keys }` + - `boolean` - A drag action. + - `array of string or number` - - `path: array of object { x, y }` + - `string` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + - `number` - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `unknown` - - `x: number` + - `type: "and" or "or"` - The x-coordinate. + Type of operation: `and` or `or`. - - `y: number` + - `"and"` - The y-coordinate. + - `"or"` - - `type: "drag"` + - `max_num_results: optional number` - Specifies the event type. For a drag action, this property is always set to `drag`. + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `"drag"` + - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` - - `keys: optional array of string` + Ranking options for search. - The keys being held while dragging the mouse. + - `hybrid_search: optional object { embedding_weight, text_weight }` - - `Keypress object { keys, type }` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - A collection of keypresses the model would like to perform. + - `embedding_weight: number` - - `keys: array of string` + The weight of the embedding in the reciprocal ranking fusion. - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + - `text_weight: number` - - `type: "keypress"` + The weight of the text in the reciprocal ranking fusion. - Specifies the event type. For a keypress action, this property is always set to `keypress`. + - `ranker: optional "auto" or "default-2024-11-15"` - - `"keypress"` + The ranker to use for the file search. - - `Move object { type, x, y, keys }` + - `"auto"` - A mouse move action. + - `"default-2024-11-15"` - - `type: "move"` + - `score_threshold: optional number` - Specifies the event type. For a move action, this property is always set to `move`. + The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. - - `"move"` + - `Computer object { type }` - - `x: number` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The x-coordinate to move to. + - `type: "computer"` - - `y: number` + The type of the computer tool. Always `computer`. - The y-coordinate to move to. + - `"computer"` - - `keys: optional array of string` + - `ComputerUsePreview object { display_height, display_width, environment, type }` - The keys being held while moving the mouse. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `Screenshot object { type }` + - `display_height: number` - A screenshot action. + The height of the computer display. - - `type: "screenshot"` + - `display_width: number` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + The width of the computer display. - - `"screenshot"` + - `environment: "windows" or "mac" or "linux" or 2 more` - - `Scroll object { scroll_x, scroll_y, type, 3 more }` + The type of computer environment to control. - A scroll action. + - `"windows"` - - `scroll_x: number` + - `"mac"` - The horizontal scroll distance. + - `"linux"` - - `scroll_y: number` + - `"ubuntu"` - The vertical scroll distance. + - `"browser"` - - `type: "scroll"` + - `type: "computer_use_preview"` - Specifies the event type. For a scroll action, this property is always set to `scroll`. + The type of the computer use tool. Always `computer_use_preview`. - - `"scroll"` + - `"computer_use_preview"` - - `x: number` + - `WebSearch object { type, filters, search_context_size, user_location }` - The x-coordinate where the scroll occurred. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). - - `y: number` + - `type: "web_search" or "web_search_2025_08_26"` - The y-coordinate where the scroll occurred. + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `keys: optional array of string` + - `"web_search"` - The keys being held while scrolling. + - `"web_search_2025_08_26"` - - `Type object { text, type }` + - `filters: optional object { allowed_domains }` - An action to type in text. + Filters for the search. - - `text: string` + - `allowed_domains: optional array of string` - The text to type. + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `type: "type"` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - Specifies the event type. For a type action, this property is always set to `type`. + - `search_context_size: optional "low" or "medium" or "high"` - - `"type"` + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - - `Wait object { type }` + - `"low"` - A wait action. + - `"medium"` - - `type: "wait"` + - `"high"` - Specifies the event type. For a wait action, this property is always set to `wait`. + - `user_location: optional object { city, country, region, 2 more }` - - `"wait"` + The approximate location of the user. - - `actions: optional BetaComputerActionList` + - `city: optional string` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + Free text input for the city of the user, e.g. `San Francisco`. - - `Click object { button, type, x, 2 more }` + - `country: optional string` - A click action. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `DoubleClick object { keys, type, x, y }` + - `region: optional string` - A double click action. + Free text input for the region of the user, e.g. `California`. - - `Drag object { path, type, keys }` + - `timezone: optional string` - A drag action. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `Keypress object { keys, type }` + - `type: optional "approximate"` - A collection of keypresses the model would like to perform. + The type of location approximation. Always `approximate`. - - `Move object { type, x, y, keys }` + - `"approximate"` - A mouse move action. + - `Mcp object { server_label, type, allowed_callers, 9 more }` - - `Screenshot object { type }` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). - A screenshot action. + - `server_label: string` - - `Scroll object { scroll_x, scroll_y, type, 3 more }` + A label for this MCP server, used to identify it in tool calls. - A scroll action. + - `type: "mcp"` - - `Type object { text, type }` + The type of the MCP tool. Always `mcp`. - An action to type in text. + - `"mcp"` - - `Wait object { type }` + - `allowed_callers: optional array of "direct" or "programmatic"` - A wait action. + The tool invocation context(s). - - `agent: optional object { agent_name }` + - `"direct"` - The agent that produced this item. + - `"programmatic"` - - `agent_name: string` + - `allowed_tools: optional array of string or object { read_only, tool_names }` - The canonical name of the agent that produced this item. + List of allowed tool names or a filter object. - - `ComputerCallOutput object { id, call_id, output, 5 more }` + - `McpAllowedTools = array of string` - - `id: string` + A string array of allowed tool names - The unique ID of the computer call tool output. + - `McpToolFilter object { read_only, tool_names }` - - `call_id: string` + A filter object to specify which tools are allowed. - The ID of the computer tool call that produced the output. + - `read_only: optional boolean` - - `output: BetaResponseComputerToolCallOutputScreenshot` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - A computer screenshot image used with the computer use tool. + - `tool_names: optional array of string` - - `type: "computer_screenshot"` + List of allowed tool names. - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `authorization: optional string` - - `"computer_screenshot"` + An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application + must handle the OAuth authorization flow and provide the token here. - - `file_id: optional string` + - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` - The identifier of an uploaded file that contains the screenshot. + Identifier for service connectors, like those available in ChatGPT. One of + `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more + about service connectors [here](/docs/guides/tools-remote-mcp#connectors). - - `image_url: optional string` + Currently supported `connector_id` values are: - The URL of the screenshot image. + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` - - `status: "completed" or "incomplete" or "failed" or "in_progress"` + - `"connector_dropbox"` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `"connector_gmail"` - - `"completed"` + - `"connector_googlecalendar"` - - `"incomplete"` + - `"connector_googledrive"` - - `"failed"` + - `"connector_microsoftteams"` - - `"in_progress"` + - `"connector_outlookcalendar"` - - `type: "computer_call_output"` + - `"connector_outlookemail"` - The type of the computer tool call output. Always `computer_call_output`. + - `"connector_sharepoint"` - - `"computer_call_output"` + - `defer_loading: optional boolean` - - `acknowledged_safety_checks: optional array of object { id, code, message }` + Whether this MCP tool is deferred and discovered via tool search. - The safety checks reported by the API that have been acknowledged by the - developer. + - `headers: optional map[string]` - - `id: string` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - The ID of the pending safety check. + - `require_approval: optional object { always, never } or "always" or "never"` - - `code: optional string` + Specify which of the MCP server's tools require approval. - The type of the pending safety check. + - `McpToolApprovalFilter object { always, never }` - - `message: optional string` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - Details about the pending safety check. + - `always: optional object { read_only, tool_names }` - - `agent: optional object { agent_name }` + A filter object to specify which tools are allowed. - The agent that produced this item. + - `read_only: optional boolean` - - `agent_name: string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The canonical name of the agent that produced this item. + - `tool_names: optional array of string` - - `created_by: optional string` + List of allowed tool names. - The identifier of the actor that created the item. + - `never: optional object { read_only, tool_names }` - - `Reasoning object { id, summary, type, 4 more }` + A filter object to specify which tools are allowed. - 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](/docs/guides/conversation-state). + - `read_only: optional boolean` - - `id: string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The unique identifier of the reasoning content. + - `tool_names: optional array of string` - - `summary: array of object { text, type }` + List of allowed tool names. - Reasoning summary content. + - `McpToolApprovalSetting = "always" or "never"` - - `text: string` + Specify a single approval policy for all tools. One of `always` or + `never`. When set to `always`, all tools will require approval. When + set to `never`, all tools will not require approval. - A summary of the reasoning output from the model so far. + - `"always"` - - `type: "summary_text"` + - `"never"` - The type of the object. Always `summary_text`. + - `server_description: optional string` - - `"summary_text"` + Optional description of the MCP server, used to provide more context. - - `type: "reasoning"` + - `server_url: optional string` - The type of the object. Always `reasoning`. + The URL for the MCP server. One of `server_url`, `connector_id`, or + `tunnel_id` must be provided. - - `"reasoning"` + - `tunnel_id: optional string` - - `agent: optional object { agent_name }` + The Secure MCP Tunnel ID to use instead of a direct server URL. One of + `server_url`, `connector_id`, or `tunnel_id` must be provided. - The agent that produced this item. + - `CodeInterpreter object { container, type, allowed_callers }` - - `agent_name: string` + A tool that runs Python code to help generate a response to a prompt. - The canonical name of the agent that produced this item. + - `container: string or object { type, file_ids, memory_limit, network_policy }` - - `content: optional array of object { text, type }` + The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an + optional `memory_limit` setting. - Reasoning text content. + - `string` - - `text: string` + The container ID. - The reasoning text from the model. + - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` - - `type: "reasoning_text"` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - The type of the reasoning text. Always `reasoning_text`. + - `type: "auto"` - - `"reasoning_text"` + Always `auto`. - - `encrypted_content: optional string` + - `"auto"` - The encrypted content of the reasoning item. This is populated by default - for reasoning items returned by `POST /v1/responses` and WebSocket - `response.create` requests. + - `file_ids: optional array of string` - - `status: optional "in_progress" or "completed" or "incomplete"` + An optional list of uploaded files to make available to your code. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - `"in_progress"` + The memory limit for the code interpreter container. - - `"completed"` + - `"1g"` - - `"incomplete"` + - `"4g"` - - `Compaction object { id, encrypted_content, type, 2 more }` + - `"16g"` - A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). + - `"64g"` - - `id: string` + - `network_policy: optional BetaContainerNetworkPolicyDisabled or BetaContainerNetworkPolicyAllowlist` - The unique ID of the compaction item. + Network access policy for the container. - - `encrypted_content: string` + - `BetaContainerNetworkPolicyDisabled object { type }` - The encrypted content that was produced by compaction. + - `BetaContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `type: "compaction"` + - `type: "code_interpreter"` - The type of the item. Always `compaction`. + The type of the code interpreter tool. Always `code_interpreter`. - - `"compaction"` + - `"code_interpreter"` - - `agent: optional object { agent_name }` + - `allowed_callers: optional array of "direct" or "programmatic"` - The agent that produced this item. + The tool invocation context(s). - - `agent_name: string` + - `"direct"` - The canonical name of the agent that produced this item. + - `"programmatic"` - - `created_by: optional string` + - `ProgrammaticToolCalling object { type }` - The identifier of the actor that created the item. + - `type: "programmatic_tool_calling"` - - `CodeInterpreterCall object { id, code, container_id, 4 more }` + The type of the tool. Always `programmatic_tool_calling`. - A tool call to run code. + - `"programmatic_tool_calling"` - - `id: string` + - `ImageGeneration object { type, action, background, 9 more }` - The unique ID of the code interpreter tool call. + A tool that generates images using the GPT image models. - - `code: string` + - `type: "image_generation"` - The code to run, or null if not available. + The type of the image generation tool. Always `image_generation`. - - `container_id: string` + - `"image_generation"` - The ID of the container used to run the code. + - `action: optional "generate" or "edit" or "auto"` - - `outputs: array of object { logs, type } or object { type, url }` + Whether to generate a new image or edit an existing image. Default: `auto`. - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - `"generate"` - - `Logs object { logs, type }` + - `"edit"` - The logs output from the code interpreter. + - `"auto"` - - `logs: string` + - `background: optional "transparent" or "opaque" or "auto"` - The logs output from the code interpreter. + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. - - `type: "logs"` + - `"transparent"` - The type of the output. Always `logs`. + - `"opaque"` - - `"logs"` + - `"auto"` - - `Image object { type, url }` + - `input_fidelity: optional "high" or "low"` - The image output from the code interpreter. + Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. - - `type: "image"` + - `"high"` - The type of the output. Always `image`. + - `"low"` - - `"image"` + - `input_image_mask: optional object { file_id, image_url }` - - `url: string` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - The URL of the image output from the code interpreter. + - `file_id: optional string` - - `status: "in_progress" or "completed" or "incomplete" or 2 more` + File ID for the mask image. - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `image_url: optional string` - - `"in_progress"` + Base64-encoded mask image. - - `"completed"` + - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `"incomplete"` + The image generation model to use. Default: `gpt-image-1`. - - `"interpreting"` + - `string` - - `"failed"` + - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `type: "code_interpreter_call"` + The image generation model to use. Default: `gpt-image-1`. - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `"gpt-image-1"` - - `"code_interpreter_call"` + - `"gpt-image-1-mini"` - - `agent: optional object { agent_name }` + - `"gpt-image-1.5"` - The agent that produced this item. + - `moderation: optional "auto" or "low"` - - `agent_name: string` + Moderation level for the generated image. Default: `auto`. - The canonical name of the agent that produced this item. + - `"auto"` - - `LocalShellCall object { id, action, call_id, 3 more }` + - `"low"` - A tool call to run a command on the local shell. + - `output_compression: optional number` - - `id: string` + Compression level for the output image. Default: 100. - The unique ID of the local shell call. + - `output_format: optional "png" or "webp" or "jpeg"` - - `action: object { command, env, type, 3 more }` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - Execute a shell command on the server. + - `"png"` - - `command: array of string` + - `"webp"` - The command to run. + - `"jpeg"` - - `env: map[string]` + - `partial_images: optional number` - Environment variables to set for the command. + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `type: "exec"` + - `quality: optional "low" or "medium" or "high" or "auto"` - The type of the local shell action. Always `exec`. + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `"exec"` + - `"low"` - - `timeout_ms: optional number` + - `"medium"` - Optional timeout in milliseconds for the command. + - `"high"` - - `user: optional string` + - `"auto"` - Optional user to run the command as. + - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - `working_directory: optional string` + The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. - Optional working directory to run the command in. + - `string` - - `call_id: string` + - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` - The unique ID of the local shell tool call generated by the model. + The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. - - `status: "in_progress" or "completed" or "incomplete"` + - `"1024x1024"` - The status of the local shell call. + - `"1024x1536"` - - `"in_progress"` + - `"1536x1024"` - - `"completed"` + - `"auto"` - - `"incomplete"` + - `LocalShell object { type }` - - `type: "local_shell_call"` + A tool that allows the model to execute shell commands in a local environment. - The type of the local shell call. Always `local_shell_call`. + - `type: "local_shell"` - - `"local_shell_call"` + The type of the local shell tool. Always `local_shell`. - - `agent: optional object { agent_name }` + - `"local_shell"` - The agent that produced this item. + - `Shell object { type, allowed_callers, environment }` - - `agent_name: string` + A tool that allows the model to execute shell commands. - The canonical name of the agent that produced this item. + - `type: "shell"` - - `LocalShellCallOutput object { id, output, type, 2 more }` + The type of the shell tool. Always `shell`. - The output of a local shell tool call. + - `"shell"` - - `id: string` + - `allowed_callers: optional array of "direct" or "programmatic"` - The unique ID of the local shell tool call generated by the model. + The tool invocation context(s). - - `output: string` + - `"direct"` - A JSON string of the output of the local shell tool call. + - `"programmatic"` - - `type: "local_shell_call_output"` + - `environment: optional BetaContainerAuto or BetaLocalEnvironment or BetaContainerReference` - The type of the local shell tool call output. Always `local_shell_call_output`. + - `BetaContainerAuto object { type, file_ids, memory_limit, 2 more }` - - `"local_shell_call_output"` + - `BetaLocalEnvironment object { type, skills }` - - `agent: optional object { agent_name }` + - `BetaContainerReference object { container_id, type }` - The agent that produced this item. + - `Custom object { name, type, allowed_callers, 3 more }` - - `agent_name: string` + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - The canonical name of the agent that produced this item. + - `name: string` - - `status: optional "in_progress" or "completed" or "incomplete"` + The name of the custom tool, used to identify it in tool calls. - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `type: "custom"` - - `"in_progress"` + The type of the custom tool. Always `custom`. - - `"completed"` + - `"custom"` - - `"incomplete"` + - `allowed_callers: optional array of "direct" or "programmatic"` - - `ShellCall object { id, action, call_id, 6 more }` + The tool invocation context(s). - A tool call that executes one or more shell commands in a managed environment. + - `"direct"` - - `id: string` + - `"programmatic"` - The unique ID of the shell tool call. Populated when this item is returned via API. + - `defer_loading: optional boolean` - - `action: object { commands, max_output_length, timeout_ms }` + Whether this tool should be deferred and discovered via tool search. - The shell commands and limits that describe how to run the tool call. + - `description: optional string` - - `commands: array of string` + Optional description of the custom tool, used to provide more context. - - `max_output_length: number` + - `format: optional object { type } or object { definition, syntax, type }` - Optional maximum number of characters to return from each command. + The input format for the custom tool. Default is unconstrained text. - - `timeout_ms: number` + - `Text object { type }` - Optional timeout in milliseconds for the commands. + Unconstrained free-form text. - - `call_id: string` + - `type: "text"` - The unique ID of the shell tool call generated by the model. + Unconstrained text format. Always `text`. - - `environment: BetaResponseLocalEnvironment or BetaResponseContainerReference` + - `"text"` - Represents the use of a local environment to perform shell actions. + - `Grammar object { definition, syntax, type }` - - `BetaResponseLocalEnvironment object { type }` + A grammar defined by the user. - Represents the use of a local environment to perform shell actions. + - `definition: string` - - `type: "local"` + The grammar definition. - The environment type. Always `local`. + - `syntax: "lark" or "regex"` - - `"local"` + The syntax of the grammar definition. One of `lark` or `regex`. - - `BetaResponseContainerReference object { container_id, type }` + - `"lark"` - Represents a container created with /v1/containers. + - `"regex"` - - `container_id: string` + - `type: "grammar"` - - `type: "container_reference"` + Grammar format. Always `grammar`. - The environment type. Always `container_reference`. + - `"grammar"` - - `"container_reference"` + - `Namespace object { description, name, tools, type }` - - `status: "in_progress" or "completed" or "incomplete"` + Groups function/custom tools under a shared namespace. - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `description: string` - - `"in_progress"` + A description of the namespace shown to the model. - - `"completed"` + - `name: string` - - `"incomplete"` + The namespace name used in tool calls (for example, `crm`). - - `type: "shell_call"` + - `tools: array of object { name, type, allowed_callers, 5 more } or object { name, type, allowed_callers, 3 more }` - The type of the item. Always `shell_call`. + The function/custom tools available inside this namespace. - - `"shell_call"` + - `Function object { name, type, allowed_callers, 5 more }` - - `agent: optional object { agent_name }` + - `name: string` - The agent that produced this item. + - `type: "function"` - - `agent_name: string` + - `"function"` - The canonical name of the agent that produced this item. + - `allowed_callers: optional array of "direct" or "programmatic"` - - `caller: optional object { type } or object { caller_id, type }` + The tool invocation context(s). - The execution context that produced this tool call. + - `"direct"` - - `Direct object { type }` + - `"programmatic"` - - `type: "direct"` + - `defer_loading: optional boolean` - - `"direct"` + Whether this function should be deferred and discovered via tool search. - - `Program object { caller_id, type }` + - `description: optional string` - - `caller_id: string` + - `output_schema: optional map[unknown]` - The call ID of the program item that produced this tool call. + A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs. - - `type: "program"` + - `parameters: optional unknown` - - `"program"` + - `strict: optional boolean` - - `created_by: optional string` + Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise. - The ID of the entity that created this tool call. + - `Custom object { name, type, allowed_callers, 3 more }` - - `ShellCallOutput object { id, call_id, max_output_length, 6 more }` + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - The output of a shell tool call that was emitted. + - `name: string` - - `id: string` + The name of the custom tool, used to identify it in tool calls. - The unique ID of the shell call output. Populated when this item is returned via API. + - `type: "custom"` - - `call_id: string` + The type of the custom tool. Always `custom`. - The unique ID of the shell tool call generated by the model. + - `"custom"` - - `max_output_length: number` + - `allowed_callers: optional array of "direct" or "programmatic"` - The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output. + The tool invocation context(s). - - `output: array of object { outcome, stderr, stdout, created_by }` + - `"direct"` - An array of shell call output contents + - `"programmatic"` - - `outcome: object { type } or object { exit_code, type }` + - `defer_loading: optional boolean` - Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + Whether this tool should be deferred and discovered via tool search. - - `Timeout object { type }` + - `description: optional string` - Indicates that the shell call exceeded its configured time limit. + Optional description of the custom tool, used to provide more context. - - `type: "timeout"` + - `format: optional object { type } or object { definition, syntax, type }` - The outcome type. Always `timeout`. + The input format for the custom tool. Default is unconstrained text. - - `"timeout"` + - `Text object { type }` - - `Exit object { exit_code, type }` + Unconstrained free-form text. - Indicates that the shell commands finished and returned an exit code. + - `type: "text"` - - `exit_code: number` + Unconstrained text format. Always `text`. - Exit code from the shell process. + - `"text"` - - `type: "exit"` + - `Grammar object { definition, syntax, type }` - The outcome type. Always `exit`. + A grammar defined by the user. - - `"exit"` + - `definition: string` - - `stderr: string` + The grammar definition. - The standard error output that was captured. + - `syntax: "lark" or "regex"` - - `stdout: string` + The syntax of the grammar definition. One of `lark` or `regex`. - The standard output that was captured. + - `"lark"` - - `created_by: optional string` + - `"regex"` - The identifier of the actor that created the item. + - `type: "grammar"` - - `status: "in_progress" or "completed" or "incomplete"` + Grammar format. Always `grammar`. - The status of the shell call output. One of `in_progress`, `completed`, or `incomplete`. + - `"grammar"` - - `"in_progress"` + - `type: "namespace"` - - `"completed"` + The type of the tool. Always `namespace`. - - `"incomplete"` + - `"namespace"` - - `type: "shell_call_output"` + - `ToolSearch object { type, description, execution, parameters }` - The type of the shell call output. Always `shell_call_output`. + Hosted or BYOT tool search configuration for deferred tools. - - `"shell_call_output"` + - `type: "tool_search"` - - `agent: optional object { agent_name }` + The type of the tool. Always `tool_search`. - The agent that produced this item. + - `"tool_search"` - - `agent_name: string` + - `description: optional string` - The canonical name of the agent that produced this item. + Description shown to the model for a client-executed tool search tool. - - `caller: optional object { type } or object { caller_id, type }` + - `execution: optional "server" or "client"` - The execution context that produced this tool call. + Whether tool search is executed by the server or by the client. - - `Direct object { type }` + - `"server"` - - `type: "direct"` + - `"client"` - - `"direct"` + - `parameters: optional unknown` - - `Program object { caller_id, type }` + Parameter schema for a client-executed tool search tool. - - `caller_id: string` + - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` - The call ID of the program item that produced this tool call. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `type: "program"` + - `type: "web_search_preview" or "web_search_preview_2025_03_11"` - - `"program"` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `created_by: optional string` + - `"web_search_preview"` - The identifier of the actor that created the item. + - `"web_search_preview_2025_03_11"` - - `ApplyPatchCall object { id, call_id, operation, 5 more }` + - `search_content_types: optional array of "text" or "image"` - A tool call that applies file diffs by creating, deleting, or updating files. + - `"text"` - - `id: string` + - `"image"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `search_context_size: optional "low" or "medium" or "high"` - - `call_id: string` + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - The unique ID of the apply patch tool call generated by the model. + - `"low"` - - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` + - `"medium"` - One of the create_file, delete_file, or update_file operations applied via apply_patch. + - `"high"` - - `CreateFile object { diff, path, type }` + - `user_location: optional object { type, city, country, 2 more }` - Instruction describing how to create a file via the apply_patch tool. + The user's location. - - `diff: string` + - `type: "approximate"` - Diff to apply. + The type of location approximation. Always `approximate`. - - `path: string` + - `"approximate"` - Path of the file to create. + - `city: optional string` - - `type: "create_file"` + Free text input for the city of the user, e.g. `San Francisco`. - Create a new file with the provided diff. + - `country: optional string` - - `"create_file"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `DeleteFile object { path, type }` + - `region: optional string` - Instruction describing how to delete a file via the apply_patch tool. + Free text input for the region of the user, e.g. `California`. - - `path: string` + - `timezone: optional string` - Path of the file to delete. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `type: "delete_file"` + - `ApplyPatch object { type, allowed_callers }` - Delete the specified file. + Allows the assistant to create, delete, or update files using unified diffs. - - `"delete_file"` + - `type: "apply_patch"` - - `UpdateFile object { diff, path, type }` + The type of the tool. Always `apply_patch`. - Instruction describing how to update a file via the apply_patch tool. + - `"apply_patch"` - - `diff: string` + - `allowed_callers: optional array of "direct" or "programmatic"` - Diff to apply. + The tool invocation context(s). - - `path: string` + - `"direct"` - Path of the file to update. + - `"programmatic"` - - `type: "update_file"` + - `top_p: number` - Update an existing file with the provided diff. + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. - - `"update_file"` + We generally recommend altering this or `temperature` but not both. - - `status: "in_progress" or "completed"` + - `background: optional boolean` - The status of the apply patch tool call. One of `in_progress` or `completed`. + Whether to run the model response in the background. + [Learn more](/docs/guides/background). - - `"in_progress"` + - `completed_at: optional number` - - `"completed"` + Unix timestamp (in seconds) of when this Response was completed. + Only present when the status is `completed`. - - `type: "apply_patch_call"` + - `conversation: optional object { id }` - The type of the item. Always `apply_patch_call`. + The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - - `"apply_patch_call"` + - `id: string` - - `agent: optional object { agent_name }` + The unique ID of the conversation that this response was associated with. - The agent that produced this item. + - `max_output_tokens: optional number` - - `agent_name: string` + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning). - The canonical name of the agent that produced this item. + - `max_tool_calls: optional number` - - `caller: optional object { type } or object { caller_id, type }` + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - The execution context that produced this tool call. + - `moderation: optional object { input, output }` - - `Direct object { type }` + Moderation results for the response input and output, if moderated completions were requested. - - `type: "direct"` + - `input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }` - - `"direct"` + Moderation for the response input. - - `Program object { caller_id, type }` + - `ModerationResult object { categories, category_applied_input_types, category_scores, 3 more }` - - `caller_id: string` + A moderation result produced for the response input or output. - The call ID of the program item that produced this tool call. + - `categories: map[boolean]` - - `type: "program"` + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `"program"` + - `category_applied_input_types: map[array of "text" or "image"]` - - `created_by: optional string` + Which modalities of input are reflected by the score for each category. - The ID of the entity that created this tool call. + - `"text"` - - `ApplyPatchCallOutput object { id, call_id, status, 5 more }` + - `"image"` - The output emitted by an apply patch tool call. + - `category_scores: map[number]` - - `id: string` + A dictionary of moderation categories to scores. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `flagged: boolean` - - `call_id: string` + A boolean indicating whether the content was flagged by any category. - The unique ID of the apply patch tool call generated by the model. + - `model: string` - - `status: "completed" or "failed"` + The moderation model that produced this result. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `type: "moderation_result"` - - `"completed"` + The object type, which was always `moderation_result` for successful moderation results. - - `"failed"` + - `"moderation_result"` - - `type: "apply_patch_call_output"` + - `Error object { code, message, type }` - The type of the item. Always `apply_patch_call_output`. + An error produced while attempting moderation for the response input or output. - - `"apply_patch_call_output"` + - `code: string` - - `agent: optional object { agent_name }` + The error code. - The agent that produced this item. + - `message: string` - - `agent_name: string` + The error message. - The canonical name of the agent that produced this item. + - `type: "error"` - - `caller: optional object { type } or object { caller_id, type }` + The object type, which was always `error` for moderation failures. - The execution context that produced this tool call. + - `"error"` - - `Direct object { type }` + - `output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }` - - `type: "direct"` + Moderation for the response output. - - `"direct"` + - `ModerationResult object { categories, category_applied_input_types, category_scores, 3 more }` - - `Program object { caller_id, type }` + A moderation result produced for the response input or output. - - `caller_id: string` + - `categories: map[boolean]` - The call ID of the program item that produced this tool call. + A dictionary of moderation categories to booleans, True if the input is flagged under this category. - - `type: "program"` + - `category_applied_input_types: map[array of "text" or "image"]` - - `"program"` + Which modalities of input are reflected by the score for each category. - - `created_by: optional string` + - `"text"` - The ID of the entity that created this tool call output. + - `"image"` - - `output: optional string` + - `category_scores: map[number]` - Optional textual output returned by the apply patch tool. + A dictionary of moderation categories to scores. - - `McpListTools object { id, server_label, tools, 3 more }` + - `flagged: boolean` - A list of tools available on an MCP server. + A boolean indicating whether the content was flagged by any category. - - `id: string` + - `model: string` - The unique ID of the list. + The moderation model that produced this result. - - `server_label: string` + - `type: "moderation_result"` - The label of the MCP server. + The object type, which was always `moderation_result` for successful moderation results. - - `tools: array of object { input_schema, name, annotations, description }` + - `"moderation_result"` - The tools available on the server. + - `Error object { code, message, type }` - - `input_schema: unknown` + An error produced while attempting moderation for the response input or output. - The JSON schema describing the tool's input. + - `code: string` - - `name: string` + The error code. - The name of the tool. + - `message: string` - - `annotations: optional unknown` + The error message. - Additional annotations about the tool. + - `type: "error"` - - `description: optional string` + The object type, which was always `error` for moderation failures. - The description of the tool. + - `"error"` - - `type: "mcp_list_tools"` + - `output_text: optional string` - The type of the item. Always `mcp_list_tools`. + SDK-only convenience property that contains the aggregated text output + from all `output_text` items in the `output` array, if any are present. + Supported in the Python and JavaScript SDKs. - - `"mcp_list_tools"` + - `previous_response_id: optional string` - - `agent: optional object { agent_name }` + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. - The agent that produced this item. + - `prompt: optional BetaResponsePrompt` - - `agent_name: string` + Reference to a prompt template and its variables. + [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts). - The canonical name of the agent that produced this item. + - `id: string` - - `error: optional string` + The unique identifier of the prompt template to use. - Error message if the server could not list tools. + - `variables: optional map[string or BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile]` - - `McpApprovalRequest object { id, arguments, name, 3 more }` + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. - A request for human approval of a tool invocation. + - `string` - - `id: string` + - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` - The unique ID of the approval request. + A text input to the model. - - `arguments: string` + - `BetaResponseInputImage object { detail, type, file_id, 2 more }` - A JSON string of arguments for the tool. + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `name: string` + - `BetaResponseInputFile object { type, detail, file_data, 4 more }` - The name of the tool to run. + A file input to the model. - - `server_label: string` + - `version: optional string` - The label of the MCP server making the request. + Optional version of the prompt template. - - `type: "mcp_approval_request"` + - `prompt_cache_key: optional string` - The type of the item. Always `mcp_approval_request`. + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching). - - `"mcp_approval_request"` + - `prompt_cache_options: optional object { mode, ttl }` - - `agent: optional object { agent_name }` + The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models. - The agent that produced this item. + - `mode: "implicit" or "explicit"` - - `agent_name: string` + Whether implicit prompt-cache breakpoints were enabled. - The canonical name of the agent that produced this item. + - `"implicit"` - - `McpApprovalResponse object { id, approval_request_id, approve, 3 more }` + - `"explicit"` - A response to an MCP approval request. + - `ttl: "30m"` - - `id: string` + The minimum lifetime applied to each cache breakpoint. - The unique ID of the approval response + - `"30m"` - - `approval_request_id: string` + - `prompt_cache_retention: optional "in_memory" or "24h"` - The ID of the approval request being answered. + Deprecated. Use `prompt_cache_options.ttl` instead. - - `approve: boolean` + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). + This field expresses a maximum retention policy, while + `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two + fields are independent and do not interact. + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. - Whether the request was approved. + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: - - `type: "mcp_approval_response"` + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - The type of the item. Always `mcp_approval_response`. + - `"in_memory"` - - `"mcp_approval_response"` + - `"24h"` - - `agent: optional object { agent_name }` + - `reasoning: optional object { context, effort, generate_summary, 2 more }` - The agent that produced this item. + **gpt-5 and o-series models only** - - `agent_name: string` + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). - The canonical name of the agent that produced this item. + - `context: optional "auto" or "current_turn" or "all_turns"` - - `reason: optional string` + Controls which reasoning items are rendered back to the model on later turns. + If omitted or set to `auto`, the model determines the context mode. The + `gpt-5.6` model family defaults to `all_turns`; earlier models default to + `current_turn`. - Optional reason for the decision. + When returned on a response, this is the effective reasoning context mode + used for the response. - - `McpCall object { id, arguments, name, 7 more }` + - `"auto"` - An invocation of a tool on an MCP server. + - `"current_turn"` - - `id: string` + - `"all_turns"` - The unique ID of the tool call. + - `effort: optional "none" or "minimal" or "low" or 4 more` - - `arguments: string` + Constrains effort on reasoning for reasoning models. Currently supported + values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. + Reducing reasoning effort can result in faster responses and fewer tokens + used on reasoning in a response. Not all reasoning models support every + value. See the + [reasoning guide](https://platform.openai.com/docs/guides/reasoning) + for model-specific support. - A JSON string of the arguments passed to the tool. + - `"none"` - - `name: string` + - `"minimal"` - The name of the tool that was run. + - `"low"` - - `server_label: string` + - `"medium"` - The label of the MCP server running the tool. + - `"high"` - - `type: "mcp_call"` + - `"xhigh"` - The type of the item. Always `mcp_call`. + - `"max"` - - `"mcp_call"` + - `generate_summary: optional "auto" or "concise" or "detailed"` - - `agent: optional object { agent_name }` + **Deprecated:** use `summary` instead. - The agent that produced this item. + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `agent_name: string` + - `"auto"` - The canonical name of the agent that produced this item. + - `"concise"` - - `approval_request_id: optional string` + - `"detailed"` - Unique identifier for the MCP tool call approval request. - Include this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call. + - `mode: optional string or "standard" or "pro"` - - `error: optional string` + Controls the reasoning execution mode for the request. - The error from the tool call, if any. + When returned on a response, this is the effective execution mode. - - `output: optional string` + - `string` - The output from the tool call. + - `"standard" or "pro"` - - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` + Controls the reasoning execution mode for the request. - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + When returned on a response, this is the effective execution mode. - - `"in_progress"` + - `"standard"` - - `"completed"` + - `"pro"` - - `"incomplete"` + - `summary: optional "auto" or "concise" or "detailed"` - - `"calling"` + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. - - `"failed"` + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. - - `CustomToolCall object { call_id, input, name, 5 more }` + - `"auto"` - A call to a custom tool created by the model. + - `"concise"` - - `call_id: string` + - `"detailed"` - An identifier used to map this custom tool call to a tool call output. + - `safety_identifier: optional string` - - `input: string` + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). - The input for the custom tool call generated by the model. + - `service_tier: optional "auto" or "default" or "flex" or 2 more` - - `name: string` + Specifies the processing type used for serving the request. - The name of the custom tool being called. + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. - - `type: "custom_tool_call"` + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. - The type of the custom tool call. Always `custom_tool_call`. + - `"auto"` - - `"custom_tool_call"` + - `"default"` - - `id: optional string` + - `"flex"` - The unique ID of the custom tool call in the OpenAI platform. + - `"scale"` - - `agent: optional object { agent_name }` + - `"priority"` - The agent that produced this item. + - `status: optional BetaResponseStatus` - - `agent_name: string` + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. - The canonical name of the agent that produced this item. + - `"completed"` - - `caller: optional object { type } or object { caller_id, type }` + - `"failed"` - The execution context that produced this tool call. + - `"in_progress"` - - `Direct object { type }` + - `"cancelled"` - - `type: "direct"` + - `"queued"` - - `"direct"` + - `"incomplete"` - - `Program object { caller_id, type }` + - `text: optional BetaResponseTextConfig` - - `caller_id: string` + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: - The call ID of the program item that produced this tool call. + - [Text inputs and outputs](/docs/guides/text) + - [Structured Outputs](/docs/guides/structured-outputs) - - `type: "program"` + - `format: optional BetaResponseFormatTextConfig` - - `"program"` + An object specifying the format that the model must output. - - `namespace: optional string` + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](/docs/guides/structured-outputs). - The namespace of the custom tool being called. + The default format is `{ "type": "text" }` with no additional options. - - `CustomToolCallOutput object { call_id, output, type, 3 more }` + **Not recommended for gpt-4o and newer models:** - The output of a custom tool call from your code, being sent back to the model. + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. - - `call_id: string` + - `Text object { type }` - The call ID, used to map this custom tool call output to a custom tool call. + Default response format. Used to generate text responses. - - `output: string or array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + - `type: "text"` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + The type of response format being defined. Always `text`. - - `StringOutput = string` + - `"text"` - A string of the output of the custom tool call. + - `BetaResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }` - - `OutputContentList = array of BetaResponseInputText or BetaResponseInputImage or BetaResponseInputFile` + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](/docs/guides/structured-outputs). - Text, image, or file output of the custom tool call. + - `name: string` - - `BetaResponseInputText object { text, type, prompt_cache_breakpoint }` + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. - A text input to the model. + - `schema: map[unknown]` - - `BetaResponseInputImage object { detail, type, file_id, 2 more }` + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). - An image input to the model. Learn about [image inputs](/docs/guides/vision). + - `type: "json_schema"` - - `BetaResponseInputFile object { type, detail, file_data, 4 more }` + The type of response format being defined. Always `json_schema`. - A file input to the model. + - `"json_schema"` - - `type: "custom_tool_call_output"` + - `description: optional string` - The type of the custom tool call output. Always `custom_tool_call_output`. + A description of what the response format is for, used by the model to + determine how to respond in the format. - - `"custom_tool_call_output"` + - `strict: optional boolean` - - `id: optional string` + Whether to enable strict schema adherence when generating the output. + If set to true, the model will always follow the exact schema defined + in the `schema` field. Only a subset of JSON Schema is supported when + `strict` is `true`. To learn more, read the [Structured Outputs + guide](/docs/guides/structured-outputs). - The unique ID of the custom tool call output in the OpenAI platform. + - `JSONObject object { type }` - - `agent: optional object { agent_name }` + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. - The agent that produced this item. + - `type: "json_object"` - - `agent_name: string` + The type of response format being defined. Always `json_object`. - The canonical name of the agent that produced this item. + - `"json_object"` - - `caller: optional object { type } or object { caller_id, type }` + - `verbosity: optional "low" or "medium" or "high"` - The execution context that produced this tool call. + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. The default is + `medium`. - - `Direct object { type }` + - `"low"` - - `type: "direct"` + - `"medium"` - The caller type. Always `direct`. + - `"high"` - - `"direct"` + - `top_logprobs: optional number` - - `Program object { caller_id, type }` + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. - - `caller_id: string` + - `truncation: optional "auto" or "disabled"` - The call ID of the program item that produced this tool call. + The truncation strategy to use for the model response. - - `type: "program"` + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. - The caller type. Always `program`. + - `"auto"` - - `"program"` + - `"disabled"` - - `usage: BetaResponseUsage` + - `usage: optional BetaResponseUsage` - Token accounting for the compaction pass, including cached, reasoning, and total tokens. + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. - `input_tokens: number` @@ -50321,16 +50189,17 @@ Learn when and how to compact long-running conversations in the [conversation st The total number of tokens used. + - `user: optional string` + + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). + ### Example ```http -curl https://api.openai.com/v1/responses/compact \ - -H 'Content-Type: application/json' \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.6-sol", - "previous_response_id": "resp_123" - }' +curl https://api.openai.com/v1/responses/$RESPONSE_ID \ + -H "Authorization: Bearer $OPENAI_API_KEY" ``` #### Response @@ -50339,20 +50208,55 @@ curl https://api.openai.com/v1/responses/compact \ { "id": "id", "created_at": 0, - "object": "response.compaction", + "error": { + "code": "server_error", + "message": "message" + }, + "incomplete_details": { + "reason": "max_output_tokens" + }, + "instructions": "string", + "metadata": { + "foo": "string" + }, + "model": "gpt-5.1", + "object": "response", "output": [ { "id": "id", "content": [ { - "text": "text", - "type": "input_text", - "prompt_cache_breakpoint": { - "mode": "explicit" + "annotations": [ + { + "file_id": "file_id", + "filename": "filename", + "index": 0, + "type": "file_citation" + } + ], + "logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0, + "top_logprobs": [ + { + "token": "token", + "bytes": [ + 0 + ], + "logprob": 0 + } + ] } + ], + "text": "text", + "type": "output_text" } ], - "role": "unknown", + "role": "assistant", "status": "in_progress", "type": "message", "agent": { @@ -50361,6 +50265,102 @@ curl https://api.openai.com/v1/responses/compact \ "phase": "commentary" } ], + "parallel_tool_calls": true, + "temperature": 1, + "tool_choice": "none", + "tools": [ + { + "name": "name", + "parameters": { + "foo": "bar" + }, + "strict": true, + "type": "function", + "allowed_callers": [ + "direct" + ], + "defer_loading": true, + "description": "description", + "output_schema": { + "foo": "bar" + } + } + ], + "top_p": 1, + "background": true, + "completed_at": 0, + "conversation": { + "id": "id" + }, + "max_output_tokens": 0, + "max_tool_calls": 0, + "moderation": { + "input": { + "categories": { + "foo": true + }, + "category_applied_input_types": { + "foo": [ + "text" + ] + }, + "category_scores": { + "foo": 0 + }, + "flagged": true, + "model": "model", + "type": "moderation_result" + }, + "output": { + "categories": { + "foo": true + }, + "category_applied_input_types": { + "foo": [ + "text" + ] + }, + "category_scores": { + "foo": 0 + }, + "flagged": true, + "model": "model", + "type": "moderation_result" + } + }, + "output_text": "output_text", + "previous_response_id": "previous_response_id", + "prompt": { + "id": "id", + "variables": { + "foo": "string" + }, + "version": "version" + }, + "prompt_cache_key": "prompt-cache-key-1234", + "prompt_cache_options": { + "mode": "implicit", + "ttl": "30m" + }, + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": "auto", + "effort": "none", + "generate_summary": "auto", + "mode": "standard", + "summary": "auto" + }, + "safety_identifier": "safety-identifier-1234", + "service_tier": "auto", + "status": "completed", + "text": { + "format": { + "type": "text" + }, + "verbosity": "low" + }, + "top_logprobs": 0, + "truncation": "auto", "usage": { "input_tokens": 0, "input_tokens_details": { @@ -50372,79 +50372,79 @@ curl https://api.openai.com/v1/responses/compact \ "reasoning_tokens": 0 }, "total_tokens": 0 - } + }, + "user": "user-1234" } ``` ### Example ```http -curl -X POST https://api.openai.com/v1/responses/compact \ +curl https://api.openai.com/v1/responses/resp_123 \ -H "Content-Type: application/json" \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -d '{ - "model": "gpt-5.1-codex-max", - "input": [ - { - "role": "user", - "content": "Create a simple landing page for a dog petting café." - }, - { - "id": "msg_001", - "type": "message", - "status": "completed", - "content": [ - { - "type": "output_text", - "annotations": [], - "logprobs": [], - "text": "Below is a single file, ready-to-use landing page for a dog petting café:..." - } - ], - "role": "assistant" - } - ] - }' + -H "Authorization: Bearer $OPENAI_API_KEY" ``` #### Response ```json { - "id": "resp_001", - "object": "response.compaction", - "created_at": 1764967971, + "id": "resp_67cb71b351908190a308f3859487620d06981a8637e6bc44", + "object": "response", + "created_at": 1741386163, + "status": "completed", + "completed_at": 1741386164, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-2024-08-06", "output": [ { - "id": "msg_000", "type": "message", + "id": "msg_67cb71b3c2b0819084d481baaaf148f206981a8637e6bc44", "status": "completed", + "role": "assistant", "content": [ { - "type": "input_text", - "text": "Create a simple landing page for a dog petting cafe." + "type": "output_text", + "text": "Silent circuits hum, \nThoughts emerge in data streams— \nDigital dawn breaks.", + "annotations": [] + } + ] } ], - "role": "user" + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null }, - { - "id": "cmp_001", - "type": "compaction", - "encrypted_content": "gAAAAABpM0Yj-...=" + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" } - ], + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1.0, + "truncation": "disabled", "usage": { - "input_tokens": 139, + "input_tokens": 32, "input_tokens_details": { "cached_tokens": 0, "cache_write_tokens": 0 }, - "output_tokens": 438, + "output_tokens": 18, "output_tokens_details": { - "reasoning_tokens": 64 + "reasoning_tokens": 0 }, - "total_tokens": 577 - } + "total_tokens": 50 + }, + "user": null, + "metadata": {} } ``` @@ -198955,6 +198955,12 @@ curl -X POST https://api.openai.com/v1/responses/compact \ Returns a list of input items for a given response. +### Header Parameters + +- `"openai-beta": optional array of "responses_multi_agent=v1"` + + - `"responses_multi_agent=v1"` + ### Path Parameters - `response_id: string` @@ -199002,12 +199008,6 @@ Returns a list of input items for a given response. - `"desc"` -### Header Parameters - -- `"openai-beta": optional array of "responses_multi_agent=v1"` - - - `"responses_multi_agent=v1"` - ### Returns - `BetaResponseItemList object { data, first_id, has_more, 2 more }`