### WebSearchTool Example with Filters and Location Source: https://platform.openai.com/docs/api-reference/responses/compacted-object An example demonstrating the usage of the WebSearchTool with specific allowed domains, a medium search context size, and approximate user location details. ```json { "type": "web_search", "filters": { "allowed_domains": ["pubmed.ncbi.nlm.nih.gov"] }, "search_context_size": "medium", "user_location": { "city": "San Francisco", "country": "US", "region": "California", "timezone": "America/Los_Angeles", "type": "approximate" } } ``` -------------------------------- ### Computer Tool Call Actions (Click, Drag, Keypress) Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Provides examples of computer interaction tool calls, including mouse clicks with button and coordinates, drag actions with a path, and keypress events. ```json { "id": "comp-xxxxxxxxxxxx", "call_id": "call-aaaaaaaaaaaa", "action": { "type": "click", "button": "left", "x": 100, "y": 200 } } ``` ```json { "id": "comp-yyyyyyyyyyyy", "call_id": "call-bbbbbbbbbbbb", "action": { "type": "drag", "path": [ { "x": 100, "y": 200 }, { "x": 200, "y": 300 } ] } } ``` ```json { "id": "comp-zzzzzzzzzzzz", "call_id": "call-cccccccccc", "action": { "type": "keypress", "keys": ["shift", "control", "a"] } } ``` -------------------------------- ### ResponseCodeInterpreterCallInProgressEvent Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Emitted when a code interpreter call is in progress, indicating that execution has started. ```APIDOC ## ResponseCodeInterpreterCallInProgressEvent ### Description Emitted when a code interpreter call is in progress. This event indicates that the code execution has started but is not yet complete. ### Event Type `response.code_interpreter_call.in_progress` ### Fields - **item_id** (string) - Required - The unique identifier of the code interpreter tool call item. - **output_index** (number) - Required - The index of the output item in the response for which the code interpreter call is in progress. - **sequence_number** (number) - Required - The sequence number of this event, used to order streaming events. - **type** (string) - Required - The type of the event. Always `response.code_interpreter_call.in_progress`. ``` -------------------------------- ### ApplyPatchTool Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Allows the assistant to create, delete, or update files using unified diffs. ```APIDOC ## ApplyPatchTool Object ### Description Allows the assistant to create, delete, or update files using unified diffs. ### Fields - **type** (string) - Must be set to `"apply_patch"`. ``` -------------------------------- ### Get Input Token Counts Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Retrieves the input token counts for responses. ```APIDOC ## POST /responses/input_tokens ### Description Gets the input token counts for responses. ### Method POST ### Endpoint /responses/input_tokens ### Parameters #### Request Body - **responses** (array) - Required - A list of response objects for which to calculate token counts. - Each object in the array should conform to the `mcp_approval_response` or `mcp_call` structure. ### Request Example ```json { "responses": [ { "type": "mcp_approval_response", "reason": "Approved" }, { "type": "mcp_call", "id": "call_xyz789", "arguments": "{\"param1\": \"value1\"}", "name": "example_tool", "server_label": "server_a" } ] } ``` ### Response #### Success Response (200) - **total_tokens** (integer) - The total number of input tokens for the provided responses. #### Response Example ```json { "total_tokens": 150 } ``` ``` -------------------------------- ### Computer Use Tool Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Enables interaction with a virtual computer environment. ```APIDOC ## Computer Use Tool ### Description A tool that controls a virtual computer. Learn more about the computer tool. ### Method POST ### Endpoint /computer/use ### Parameters #### Query Parameters - **display_height** (number) - Required - The height of the computer display. - **display_width** (number) - Required - The width of the computer display. - **environment** (string) - Required - The type of computer environment to control. Accepts one of: `windows`, `mac`, `linux`, `ubuntu`, `browser`. - **type** (string) - Required - The type of the computer use tool. Always `computer_use_preview`. ### Request Example ```json { "display_height": 1080, "display_width": 1920, "environment": "windows", "type": "computer_use_preview" } ``` ### Response #### Success Response (200) - **status** (string) - The status of the computer use operation. - **output** (string) - The output from the computer environment. #### Response Example ```json { "status": "success", "output": "Successfully launched Notepad." } ``` ``` -------------------------------- ### Get a model response Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Retrieves a specific model response using its unique identifier. This allows you to fetch details of a previously generated response. ```APIDOC ## GET /responses/{response_id} ### Description Retrieves a specific model response. ### Method GET ### Endpoint /responses/{response_id} ### Parameters #### Path Parameters - **response_id** (string) - Required - The unique identifier of the response to retrieve. #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body example provided." } ``` ### Response #### Success Response (200) - **response** (object) - The details of the requested model response. #### Response Example ```json { "example": "No response body example provided." } ``` ``` -------------------------------- ### Platform Configuration Options Source: https://platform.openai.com/docs/api-reference/responses/compacted-object This section details the various optional parameters available for configuring requests to the OpenAI API, including reasoning, safety identifiers, service tiers, response status, text configurations, token limits, truncation strategies, and usage details. ```APIDOC ## Platform Configuration Options ### Description This endpoint allows for detailed configuration of API requests, affecting model behavior, safety, performance, and response formatting. ### Method N/A (These are parameters for various endpoints, not a standalone endpoint) ### Endpoint N/A ### Parameters #### Query Parameters - **reasoning** (object) - Optional - Configuration options for reasoning models (gpt-5 and o-series models only). Includes `effort`, `generate_summary`, and `summary`. - **safety_identifier** (string) - Optional - A stable identifier to help detect users violating OpenAI's usage policies. Recommended to hash usernames or emails. - **service_tier** (string) - Optional - Specifies the processing type: 'auto', 'default', 'flex', 'scale', or 'priority'. Defaults to 'auto'. - **status** (ResponseStatus) - Optional - The status of the response generation. Accepts 'completed', 'failed', 'in_progress', 'cancelled', 'queued', or 'incomplete'. - **text** (ResponseTextConfig) - Optional - Configuration options for text responses, including `format` and `verbosity`. Can be plain text or structured JSON. - **top_logprobs** (number) - Optional - An integer between 0 and 20 specifying the number of most likely tokens to return at each token position. - **truncation** (string) - Optional - The truncation strategy for the model response: 'auto' or 'disabled'. Defaults to 'disabled'. - **usage** (ResponseUsage) - Optional - Represents token usage details, including input and output tokens and their breakdowns. - **deprecated_user** (string) - Optional - Deprecated. Use `safety_identifier` and `prompt_cache_key` instead. A stable identifier for end-users to boost cache hit rates and prevent abuse. ### Request Example ```json { "reasoning": { "effort": 0.5, "generate_summary": true, "summary": "concise" }, "safety_identifier": "hashed_user_id_123", "service_tier": "flex", "text": { "format": "json", "verbosity": "high" }, "top_logprobs": 5, "truncation": "auto" } ``` ### Response #### Success Response (200) - **service_tier** (string) - The actual service tier used for processing the request (may differ from the requested value). #### Response Example ```json { "service_tier": "flex" } ``` ``` -------------------------------- ### Computer Tool Configuration Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Specifies the configuration for interacting with a virtual computer environment. Key parameters include display dimensions (height and width) and the operating system environment (e.g., Windows, macOS, Linux). The `type` is fixed to `computer_use_preview`. ```json { "computer_tool": { "display_height": 1080, "display_width": 1920, "environment": "windows", "type": "computer_use_preview" } } ``` -------------------------------- ### List MCP Server Tools Source: https://platform.openai.com/docs/api-reference/responses/compacted-object A list of tools available on an MCP server. ```APIDOC ## List MCP Server Tools ### Description A list of tools available on an MCP server. ### Type `mcp_list_tools` ### Fields - **id**: string - **server_label**: string - **tools**: array of object - **input_schema**: unknown - **name**: string - **annotations**: unknown (optional) - **description**: string (optional) - **type**: string (always `mcp_list_tools`) - **error**: string (optional) ### Response Example ```json { "id": "list_tools_xyz", "server_label": "mcp-server-1", "tools": [ { "input_schema": { "type": "object", "properties": { "query": { "type": "string" } } }, "name": "search_documents", "description": "Searches for relevant documents." } ], "type": "mcp_list_tools" } ``` ``` -------------------------------- ### Configure Tool Choice for OpenAI API Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Specifies how the model should select and use tools. This can range from automatically choosing any available tool to explicitly requiring a specific tool or function call. ```json { "type": "auto" } ``` ```json { "type": "required" } ``` ```json { "type": "file_search" } ``` ```json { "type": "function", "name": "get_weather" } ``` ```json { "type": "mcp", "server_label": "deepwiki" } ``` ```json { "type": "custom", "name": "my_custom_tool" } ``` ```json { "type": "apply_patch" } ``` ```json { "type": "shell" } ``` -------------------------------- ### ApplyPatchTool Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Represents a tool that allows the assistant to create, delete, or update files using unified diffs. ```APIDOC ## ApplyPatchTool ### Description Allows the assistant to create, delete, or update files using unified diffs. ### Type `apply_patch` ### Fields - **type** (string) - The type of the tool. Always `apply_patch`. ``` -------------------------------- ### ContainerAuto Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Configuration for automatically creating a container for a request, with options for file IDs, memory limits, and network policy. ```APIDOC ## ContainerAuto ### Description Automatically creates a container for this request. ### Fields - **type** (string) - The type of container configuration. Always `container_auto`. - **file_ids** (array of string, optional) - An optional list of uploaded files to make available to your code. - **memory_limit** (string, optional) - The memory limit for the container. Accepts `1g`, `4g`, `16g`, or `64g`. - **network_policy** (object, optional) - Network access policy for the container. - **ContainerNetworkPolicyDisabled** (object): - **type** (string) - Always `disabled`. - **ContainerNetworkPolicyAllowlist** (object): - **allowed_domains** (array of string) - A list of allowed domains. - **type** (string) - Always `allowlist`. - **domain_secrets** (array of string) - A list of domain secrets. ``` -------------------------------- ### Web Search Tool Call Actions Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Illustrates different action types for web search tool calls: 'search' for queries, 'open_page' to visit a URL, and 'find_in_page' to locate patterns within a URL. ```json { "id": "call-xxxxxxxxxxxx", "status": "completed", "type": "web_search_call", "action": { "type": "search", "queries": ["openai api documentation", "tool calls"], "sources": [ { "type": "url", "url": "https://openai.com/docs" } ] } } ``` ```json { "id": "call-yyyyyyyyyyyy", "status": "completed", "type": "web_search_call", "action": { "type": "open_page", "url": "https://openai.com/docs/api-reference" } } ``` ```json { "id": "call-zzzzzzzzzzzz", "status": "completed", "type": "web_search_call", "action": { "type": "find_in_page", "pattern": "tool call examples", "url": "https://openai.com/docs/api-reference/tool-calls" } } ``` -------------------------------- ### Computer Use Tool Call Actions Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Defines various actions that can be performed by a computer use tool. This includes mouse interactions, keyboard input, and screen actions. ```json { "id": "string", "action": "object { button, type, x, y }" or "object { type, x, y }" or "object { path, type }" or "6 more", "call_id": "string" } ``` -------------------------------- ### Tool Choice Options Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Defines how the model should select which tool to use. ```APIDOC ## Tool Choice Options ### Description Defines how the model should select which tool to use when generating a response. ### Options - **`none`**: The model will not call any tool and instead generates a message. - **`auto`**: The model can pick between generating a message or calling one or more tools. - **`required`**: The model must call one or more tools. ### Example ```json { "tool_choice": "auto" } ``` ## Tool Choice Allowed ### Description Constrains the tools available to the model to a pre-defined set. ### Properties - **mode** (string): Constrains the tools available to the model to a pre-defined set. Accepts `auto` or `required`. - `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. - **tools** (array): An array of tool names that the model is allowed to call. - **type** (string): The type of tool choice. Must be `tool_choice`. ### Example ```json { "tool_choice": { "mode": "required", "tools": ["search_web", "get_weather"] } } ``` ``` -------------------------------- ### LocalEnvironment Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Specifies the use of a local computer environment, optionally including a list of local skills. ```APIDOC ## LocalEnvironment Object ### Description Defines the use of a local computer environment for executing tasks, with an optional list of skills. ### Fields - **type** (string) - Must be set to `"local"`. - **skills** (array of LocalSkill, optional) - An optional list of skills available in the local environment. ``` -------------------------------- ### Utility Actions Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Defines utility actions such as screenshot and wait. ```APIDOC ## Utility Actions ### Description This section details utility actions that can be performed. ### Actions #### Screenshot - **type** (string) - Must be `screenshot`. #### Wait - **type** (string) - Must be `wait`. ``` -------------------------------- ### OpenAI API Response: Computer Use Tool Call Actions Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Defines various actions a computer use tool can perform, such as clicks, drags, keypresses, moves, and screenshots. Each action has a specific type and associated parameters. ```json { "id": "string", "action": { "button": "left" or "right" or "wheel" or "back" or "forward", "type": "click", "x": 0, "y": 0 }, "call_id": "string" } ``` ```json { "id": "string", "action": { "type": "double_click", "x": 0, "y": 0 }, "call_id": "string" } ``` ```json { "id": "string", "action": { "path": [ { "x": 0, "y": 0 } ], "type": "drag" }, "call_id": "string" } ``` ```json { "id": "string", "action": { "keys": [ "string" ], "type": "keypress" }, "call_id": "string" } ``` ```json { "id": "string", "action": { "type": "move", "x": 0, "y": 0 }, "call_id": "string" } ``` ```json { "id": "string", "action": { "type": "screenshot" }, "call_id": "string" } ``` ```json { "id": "string", "action": { "scroll_x": 0, "scroll_y": 0, "type": "scroll" }, "call_id": "string" } ``` -------------------------------- ### Apply Patch Tool Definition Source: https://platform.openai.com/docs/api-reference/responses/compacted-object The ApplyPatchTool allows the assistant to create, delete, or update files using unified diffs. It requires a 'type' parameter set to 'apply_patch'. ```json { "type": "apply_patch" } ``` -------------------------------- ### Image Generation Tool Configuration Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Configure the Image Generation tool, which uses GPT models to create images. Options include specifying the action (generate, edit, auto), background type, input fidelity, and model. ```APIDOC ## Image Generation Tool Configuration ### Description Configure the Image Generation tool, which uses GPT models to create images. Options include specifying the action (generate, edit, auto), background type, input fidelity, and model. ### Method N/A (Configuration object within a larger API call) ### Endpoint N/A ### Parameters #### Request Body - **type** (string) - Required - Always `image_generation`. - **action** (string) - Optional - Whether to generate a new image or edit an existing image. Accepts: `generate`, `edit`, `auto`. Default: `auto`. - **background** (string) - Optional - Background type for the generated image. Accepts: `transparent`, `opaque`, `auto`. Default: `auto`. - **input_fidelity** (string) - Optional - Control how much effort the model will exert to match the style and features of input images. Supports `high` and `low`. Defaults to `low`. - **input_image_mask** (object) - Optional - Optional mask for inpainting. - **file_id** (string) - Optional - File ID for the mask image. - **image_url** (string) - Optional - Base64-encoded mask image. - **model** (string) - Optional - The image generation model to use. Accepts: `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, or custom model strings. Default: `gpt-image-1`. ### Request Example ```json { "tool": { "type": "image_generation", "action": "generate", "background": "transparent", "input_fidelity": "high", "model": "gpt-image-1.5", "prompt": "A futuristic cityscape at sunset." } } ``` ### Response #### Success Response (200) N/A (This is a configuration object, not a direct API response) #### Response Example N/A ``` -------------------------------- ### Skills and Environments Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Defines how skills can be referenced or defined inline, and how local environments are configured. ```APIDOC ## Skills and Environments ### skills (Top-level property) **Description**: An optional list of skills that can be used by the model. Skills can be referenced by ID or defined inline. **Type**: array of (SkillReference or InlineSkill) #### SkillReference **Description**: References a skill that has been previously created using the `/v1/skills` endpoint. **Type**: object **Properties**: - **skill_id** (string) - The unique identifier of the referenced skill. Maximum length: 64, Minimum length: 1. - **type** (string) - The type of the skill reference. Must be `"skill_reference"`. - **version** (optional string) - The specific version of the skill to use. Can be a positive integer or `"latest"`. If omitted, the default version is used. #### InlineSkill **Description**: Defines a skill directly within the request, including its description, name, source, and type. **Type**: object **Properties**: - **description** (string) - A description of the skill. - **name** (string) - The name of the skill. - **source** (InlineSkillSource) - The payload and metadata for the inline skill. - **type** (string) - The type of the skill definition. Must be `"inline"`. #### InlineSkillSource **Description**: Contains the data and metadata for an inline skill. **Type**: object **Properties**: - **data** (string) - The skill package, Base64-encoded. Maximum length: 70254592, Minimum length: 1. - **media_type** (string) - The media type of the skill payload. Must be `"application/zip"`. - **type** (string) - The type of the inline skill source. Must be `"base64"`. ### LocalEnvironment **Description**: Specifies that the model should use the local computer environment for execution. **Type**: object **Properties**: - **type** (string) - The environment type. Must be `"local"`. - **skills** (optional array of LocalSkill) - An optional list of skills available in the local environment. #### LocalSkill **Description**: Defines a skill available in the local environment. **Type**: object **Properties**: - **description** (string) - A description of the skill. - **name** (string) - The name of the skill. - **path** (string) - The file path to the directory containing the skill. ``` -------------------------------- ### Configure Web Search Tool Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Defines the parameters for the WebSearchPreviewTool, which searches the web for relevant results. It accepts a type, search context size, and user location. ```json { "type": "web_search_preview", "search_context_size": "medium", "user_location": { "type": "approximate", "city": "San Francisco", "country": "US", "region": "California", "timezone": "America/Los_Angeles" } } ``` -------------------------------- ### Service Connectors Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Configure integration with external services using connector IDs. One of `server_url` or `connector_id` must be provided. ```APIDOC ## Service Connectors ### Description Integrate with external services using predefined connector IDs or a custom server URL. ### Method Not Applicable (Configuration parameter) ### Endpoint Not Applicable ### Parameters #### Query Parameters - **connector_id** (string) - Optional - Identifier for service connectors. Supported values include `connector_dropbox`, `connector_gmail`, `connector_googlecalendar`, `connector_googledrive`, `connector_microsoftteams`, `connector_outlookcalendar`, `connector_outlookemail`, `connector_sharepoint`. - **server_url** (string) - Optional - The URL for the MCP server. One of `server_url` or `connector_id` must be provided. - **authorization** (string) - Optional - An OAuth access token for remote MCP server authentication. - **headers** (map[string]) - Optional - Additional HTTP headers to send to the MCP server. - **tool_names** (array of string) - Optional - A list of allowed tool names. - **require_approval** (object or string) - Optional - Specifies which tools require approval. Can be `"always"`, `"never"`, or a filter object (`McpToolApprovalFilter`). - **McpToolApprovalFilter** (object) - **always** (object) - Filter for tools that always require approval. - **read_only** (boolean) - Optional - True if the tool is read-only. - **tool_names** (array of string) - Optional - List of allowed tool names. - **never** (object) - Filter for tools that never require approval. - **read_only** (boolean) - Optional - True if the tool is read-only. - **tool_names** (array of string) - Optional - List of allowed tool names. - **server_description** (string) - Optional - A description of the MCP server. ### Request Example ```json { "connector_id": "connector_dropbox", "authorization": "YOUR_OAUTH_TOKEN", "tool_names": ["file_search", "file_upload"], "require_approval": { "always": { "tool_names": ["file_upload"] } } } ``` ### Response #### Success Response (200) Configuration is applied to the API request. #### Response Example N/A (This is a configuration parameter, not an endpoint response.) ``` -------------------------------- ### Web Search Tool Configuration Source: https://platform.openai.com/docs/api-reference/responses/compacted-object This section describes the configuration options for the Web Search Tool, including search type, filters, context size, and user location. ```APIDOC ## Web Search Tool ### Description Search the Internet for sources related to the prompt. Learn more about the web search tool. ### Method POST (Implied, as it's a tool configuration) ### Endpoint N/A (Tool configuration within a larger request) ### Parameters #### Request Body Fields - **type** (string) - Required - The type of the web search tool. Accepts one of: `web_search`, `web_search_2025_08_26`. - **filters** (object) - Optional - Filters for the search. - **allowed_domains** (array of string) - Optional - 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** (string) - Optional - High level guidance for the amount of context window space to use for the search. Accepts one of: `low`, `medium`, `high`. `medium` is the default. - **user_location** (object) - Optional - The approximate location of the user. - **city** (string) - Optional - Free text input for the city of the user, e.g. `San Francisco`. - **country** (string) - Optional - The two-letter ISO country code of the user, e.g. `US`. - **region** (string) - Optional - Free text input for the region of the user, e.g. `California`. - **timezone** (string) - Optional - The IANA timezone of the user, e.g. `America/Los_Angeles`. - **type** (string) - Optional - The type of location approximation. Always `approximate`. ### Request Example ```json { "tool_code": "web_search", "parameters": { "query": "latest AI advancements", "filters": { "allowed_domains": ["openai.com"] }, "search_context_size": "high", "user_location": { "city": "San Francisco", "country": "US", "region": "California", "timezone": "America/Los_Angeles", "type": "approximate" } } } ``` ### Response #### Success Response (200) - **results** (array) - A list of search results. - **title** (string) - The title of the search result. - **url** (string) - The URL of the search result. - **snippet** (string) - A brief snippet of the content from the search result. #### Response Example ```json { "results": [ { "title": "OpenAI Blog", "url": "https://openai.com/blog", "snippet": "Read the latest updates and research from OpenAI." } ] } ``` ``` -------------------------------- ### Models - File Path Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Represents a path to a file. ```APIDOC ## Models - File Path ### Description A path to a file. ### Fields - **file_id** (string) - The ID of the file. - **index** (number) - The index of the file in the list of files. - **type** (string) - The type of the file path. Always `file_path`. ``` -------------------------------- ### MCP List Tools Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Represents a response listing the tools available on an MCP server. ```APIDOC ## MCP List Tools ### Description Represents a response listing the tools available on an MCP server. ### Method N/A (This is a data structure definition) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **type** (string) - The type of the item. Always `mcp_list_tools`. - **id** (string) - The unique ID of the list. - **server_label** (string) - The label of the MCP server. - **tools** (array of object) - The tools available on the server. - **name** (string) - The name of the tool. - **input_schema** (unknown) - The JSON schema describing the tool's input. - **description** (string, optional) - The description of the tool. - **annotations** (unknown, optional) - Additional annotations about the tool. - **error** (string, optional) - Error message if the server could not list tools. #### Response Example ```json { "type": "mcp_list_tools", "id": "mcp_list_123", "server_label": "production-server", "tools": [ { "name": "get_user_info", "input_schema": { "type": "object", "properties": { "user_id": {"type": "string"} }, "required": ["user_id"] }, "description": "Retrieves information about a specific user." } ] } ``` ```json { "type": "mcp_list_tools", "id": "mcp_list_456", "server_label": "staging-server", "error": "Failed to connect to the server." } ``` ``` -------------------------------- ### FunctionShellTool Source: https://platform.openai.com/docs/api-reference/responses/compacted-object A tool that allows the model to execute shell commands within a specified environment. ```APIDOC ## FunctionShellTool ### Description A tool that allows the model to execute shell commands. ### Type `shell` (string) - Always `shell`. ### Parameters #### Optional Parameters - **environment** (ContainerAuto or LocalEnvironment or ContainerReference) - The environment for the shell command. - **ContainerAuto**: - **type** (string) - Always `container_auto`. - **file_ids** (array of string) - Optional list of uploaded files to make available. - **memory_limit** (string) - Memory limit: `1g`, `4g`, `16g`, or `64g`. - **network_policy** (ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist) - Network access policy. - **LocalEnvironment**: - **type** (string) - Type of local environment. - **skills** (array) - Skills available in the local environment. - **ContainerReference**: - **container_id** (string) - The ID of the container. - **type** (string) - Type of container reference. ### Request Example ```json { "type": "shell", "environment": { "type": "container_auto", "memory_limit": "4g", "network_policy": { "type": "container_network_policy_disabled" } } } ``` ### Response (Success response structure not detailed in the provided text) ``` -------------------------------- ### MCP List Tools Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Represents a list of tools available on an MCP server. ```APIDOC ## MCP List Tools ### Description Represents a list of tools available on an MCP server. ### Type `mcp_list_tools` ### Properties - **id** (string): The unique ID of the list. - **server_label** (string): The label of the MCP server. - **tools** (array of object): 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** (unknown, optional): Additional annotations about the tool. - **description** (string, optional): The description of the tool. - **type** (string): The type of the item. Always `mcp_list_tools`. - **error** (string, optional): Error message if the server could not list tools. ### Response Example (McpListTools) ```json { "id": "mcp_list_123", "server_label": "mcp_server_1", "tools": [ { "input_schema": { "type": "object", "properties": { "query": { "type": "string" } } }, "name": "search_web", "description": "Search the web for information." } ], "type": "mcp_list_tools" } ``` ``` -------------------------------- ### Keypress Action in Computer Use Tool Call Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Represents a keypress action in the computer use tool. It takes an array of strings, where each string is a key to be pressed, and the type is set to 'keypress'. ```json { "keys": ["string"], "type": "keypress" } ``` -------------------------------- ### Function Tool Call Output Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Details a tool call to execute a function, including its arguments and output. ```APIDOC ## Function Tool Call Output ### Description Represents a tool call made to execute a specific function, including the arguments provided and the resulting output. ### Fields - **id** (string) - The unique ID of the function tool call. - **call_id** (string) - The unique ID of the function tool call generated by the model. - **output** (string or array) - The output from the function call. Can be a string or a list of output content items. - **StringOutput** (string): A string representing the function call's output. - **OutputContentList** (array): A list of output content items, which can be: - **ResponseInputText** (object): - **text** (string) - The text input to the model. - **type** (string) - Always `input_text`. - **ResponseInputImage** (object): - **detail** (string, optional) - The detail level of the image. Accepts `high`, `low`, or `auto`. - **type** (string) - Always `input_image`. - **file_id** (string, optional) - The ID of the file. - **image_url** (string, optional) - The URL of the image. - **ResponseInputFile** (object): - **type** (string) - Always `input_file`. - **file_data** (string, optional) - The content of the file. - **file_id** (string, optional) - The ID of the file. - **file_url** (string, optional) - The URL of the file. - **filename** (string, optional) - The name of the file. - **type** (string) - Always `function_call_output`. - **status** (string, optional) - The status of the item. Accepts `in_progress`, `completed`, or `incomplete`. ``` -------------------------------- ### FileSearchTool Source: https://platform.openai.com/docs/api-reference/responses/compacted-object A tool that searches for relevant content from uploaded files. It supports filtering and ranking options. ```APIDOC ## FileSearchTool ### Description A tool that searches for relevant content from uploaded files. Learn more about the file search tool. ### Type `file_search` (string) - Always `file_search`. ### Parameters #### Required Parameters - **vector_store_ids** (array of string) - The IDs of the vector stores to search. #### Optional Parameters - **filters** (ComparisonFilter or CompoundFilter) - A filter to apply. - **ComparisonFilter**: - **key** (string) - The key to compare against the value. - **type** (string) - Specifies the comparison operator: `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. - **CompoundFilter**: - **filters** (array of ComparisonFilter or CompoundFilter) - Array of filters to combine. - **type** (string) - Type of operation: `and` or `or`. - **max_num_results** (number) - The maximum number of results to return. Between 1 and 50 inclusive. - **ranking_options** (object) - Ranking options for search. - **hybrid_search** (object) - Weights for balancing semantic and keyword matches. - **embedding_weight** (number) - The weight of the embedding. - **text_weight** (number) - The weight of the text. - **ranker** (string) - The ranker to use: `auto` or `default-2024-11-15`. - **score_threshold** (number) - The score threshold for the file search, between 0 and 1. ### Request Example ```json { "type": "file_search", "vector_store_ids": ["vs_abc123"], "filters": { "type": "and", "filters": [ { "key": "document_id", "type": "eq", "value": "doc_xyz789" } ] }, "max_num_results": 5, "ranking_options": { "hybrid_search": { "embedding_weight": 0.3, "text_weight": 0.7 }, "ranker": "default-2024-11-15", "score_threshold": 0.8 } } ``` ### Response (Success response structure not detailed in the provided text) ``` -------------------------------- ### WebSearchPreviewTool Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Enables the assistant to search the web for relevant results. ```APIDOC ## WebSearchPreviewTool Object ### Description This tool searches the web for relevant results to use in a response. Learn more about the web search tool. ### Fields - **type** (string) - The type of the web search tool. Accepts `"web_search_preview"` or `"web_search_preview_2025_03_11"`. - **search_context_size** (string, optional) - High-level guidance for the amount of context window space to use for the search. Accepts `"low"`, `"medium"` (default), or `"high"`. - **user_location** (object, optional) - The user's location. - **type** (string) - Must be set to `"approximate"`. - **city** (string, optional) - Free text input for the city of the user (e.g., `"San Francisco"`). - **country** (string, optional) - The two-letter ISO country code of the user (e.g., `"US"`). - **region** (string, optional) - Free text input for the region of the user (e.g., `"California"`). - **timezone** (string, optional) - The IANA timezone of the user (e.g., `"America/Los_Angeles"`). ``` -------------------------------- ### MCP List Tools Output Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Represents the output when listing tools available on an MCP server. ```APIDOC ## MCP List Tools Output ### Description A list of tools available on an MCP server. ### Method N/A (Represents an output object) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **id** (string) - The unique ID of the list. - **server_label** (string) - The label of the MCP server. - **tools** (array of object) - The tools available on the server. Each tool object contains: - **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** (string) - The type of the item. Always `mcp_list_tools`. - **error** (optional string) - Error message if the server could not list tools. #### Response Example ```json { "id": "mclt_abc123", "server_label": "us-east-1", "tools": [ { "name": "run_command", "input_schema": { "type": "object", "properties": { "command": { "type": "string" } } }, "description": "Runs a shell command." } ], "type": "mcp_list_tools" } ``` ``` -------------------------------- ### Keyboard and Typing Actions Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Defines actions for keyboard input and typing text. ```APIDOC ## Keyboard and Typing Actions ### Description This section details actions related to keyboard input and text entry. ### Actions #### Keypress - **type** (string) - Must be `keypress`. - **keys** (array of string) - The combination of keys to be pressed. #### Type - **type** (string) - Must be `type`. - **text** (string) - The text to type. ``` -------------------------------- ### Screenshot Action Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Represents a screenshot action, specifying only the type. ```json { "type": "screenshot" } ``` -------------------------------- ### ComputerTool Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Defines a tool that controls a virtual computer environment, specifying display dimensions and the operating system. ```APIDOC ## ComputerTool ### Description A tool that controls a virtual computer. ### Fields - **display_height** (number) - The height of the computer display. - **display_width** (number) - The width of the computer display. - **environment** (string) - The type of computer environment to control. Accepts `windows`, `mac`, `linux`, `ubuntu`, or `browser`. - **type** (string) - The type of the computer use tool. Always `computer_use_preview`. ``` -------------------------------- ### File Path Object Source: https://platform.openai.com/docs/api-reference/responses/compacted-object Represents a path to a file. ```APIDOC ## FilePath ### Description A path to a file. ### Fields - **file_id** (string) - The ID of the file. - **index** (number) - The index of the file in the list of files. - **type** (string) - The type of the file path. Always `file_path`. ```