openai · OpenAI Platform Docs
Web search | OpenAI API
Explains how to implement and use the web search tool within the OpenAI API to allow models to access real-time information from the internet.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Web search | OpenAI API
Explains how to implement and use the web search tool within the OpenAI API to allow models to access real-time information from the internet.
When To Use
Use when you need to enable an AI agent to perform real-time web searches to retrieve up-to-date information during a conversation.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/web-search-openai-api-workflow-guide.md | A guide explaining how to enable web search tools in the Responses and Chat Completions APIs to provide models with real-time internet access and citations. | Questions about a guide explaining how to enable web search tools in the Responses and Chat Completions APIs to provide models with r... |
examples/web-search-openai-api-openai-api-web-search-nodejs.text | A Node.js code example demonstrating how to use the web search tool with the OpenAI client to perform a real-time query. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the web search tool with the OpenAI client to perform a real-time query. |
examples/web-search-openai-api-openai-api-web-search-python.text | A Python code example demonstrating how to use the web search tool with the OpenAI client to query real-time information. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the web search tool with the OpenAI client to query real-time informat... |
examples/web-search-openai-api-openai-api-web-search-curl-request.text | A curl command demonstrating how to call the OpenAI API with the web search tool enabled. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the OpenAI API with the web search tool enabled. |
examples/web-search-openai-api-openai-api-web-search-cli.text | A CLI command example using the OpenAI API to perform a web search via a YAML-formatted tools configuration. | Exact payloads, commands, or snippets shown in A CLI command example using the OpenAI API to perform a web search via a YAML-formatted tools configuration. |
examples/web-search-openai-api-openai-api-web-search-csharp.text | A C# code example demonstrating how to initialize an OpenAI client and add the web search tool to response creation options. | Exact payloads, commands, or snippets shown in A C# code example demonstrating how to initialize an OpenAI client and add the web search tool to response creation o... |
examples/web-search-openai-api-openai-api-web-search-call-json-response.text | A JSON object representing a completed web search tool call response within the OpenAI API. | Exact payloads, commands, or snippets shown in A JSON object representing a completed web search tool call response within the OpenAI API. |
examples/web-search-openai-api-openai-api-web-search-nodejs-completion.text | A Node.js code example demonstrating how to use the OpenAI API to perform a web search within a chat completion request. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI API to perform a web search within a chat completion request. |
examples/web-search-openai-api-openai-api-web-search-python-completion.text | A Python code example demonstrating how to use the OpenAI API to perform a web search via the chat completions endpoint. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the OpenAI API to perform a web search via the chat completions endpoint. |
examples/web-search-openai-api-openai-api-web-search-curl-request-2.text | A curl command demonstrating a POST request to the chat completions endpoint using the web search tool capability. | Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the chat completions endpoint using the web search tool capability. |
examples/web-search-openai-api-openai-api-web-search-assistant-response-citations.text | A JSON representation of an assistant message containing URL citations within the annotations field for a web search tool response. | Exact payloads, commands, or snippets shown in A JSON representation of an assistant message containing URL citations within the annotations field for a web search... |
examples/web-search-openai-api-openai-api-web-search-python-2.text | A Python code example demonstrating how to use the web search tool within an OpenAI API response request. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the web search tool within an OpenAI API response request. |
examples/web-search-openai-api-openai-api-web-search-csharp-implementation.text | A C# code example demonstrating how to initialize an OpenAIResponseClient and configure the web search tool with a specific context size. | Exact payloads, commands, or snippets shown in A C# code example demonstrating how to initialize an OpenAIResponseClient and configure the web search tool with a sp... |
examples/web-search-openai-api-openai-api-web-search-nodejs-2.text | A Node.js code example demonstrating how to use the web search tool within an OpenAI API response request. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the web search tool within an OpenAI API response request. |
examples/web-search-openai-api-openai-api-web-search-curl-request-3.text | A curl command demonstrating a request to the OpenAI API using the web search tool with a specified search context size. | Exact payloads, commands, or snippets shown in A curl command demonstrating a request to the OpenAI API using the web search tool with a specified search context size. |
examples/web-search-openai-api-openai-api-web-search-curl-request-4.text | A curl command demonstrating a request to the OpenAI API using the web search tool with a specified model and reasoning effort. | Exact payloads, commands, or snippets shown in A curl command demonstrating a request to the OpenAI API using the web search tool with a specified model and reasoni... |
examples/web-search-openai-api-openai-api-web-search-nodejs-client.text | A Node.js code example demonstrating how to use the OpenAI client to perform a web search tool call with a specific model and reasoning effort. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI client to perform a web search tool call with a specific m... |
examples/web-search-openai-api-openai-api-web-search-python-3.text | A Python code example demonstrating how to use the web search tool within an OpenAI API response request. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the web search tool within an OpenAI API response request. |
examples/web-search-openai-api-openai-api-web-search-curl-request-5.text | A curl command demonstrating how to call the OpenAI API with the web search tool enabled and domain filters applied. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the OpenAI API with the web search tool enabled and domain filters applied. |
examples/web-search-openai-api-openai-api-web-search-nodejs-client-2.text | A Node.js code example demonstrating how to use the OpenAI client to create a response with the web search tool and domain filters. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI client to create a response with the web search tool and d... |
examples/web-search-openai-api-openai-api-web-search-python-tool-usage.text | A Python code example demonstrating how to use the web_search tool with domain filters in an OpenAI API response request. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the websearch tool with domain filters in an OpenAI API response request. |
examples/web-search-openai-api-openai-api-web-search-python-4.text | A Python code example demonstrating how to use the web search tool within an OpenAI API response request. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the web search tool within an OpenAI API response request. |
examples/web-search-openai-api-openai-api-web-search-csharp-implementation-2.text | A C# code example demonstrating how to initialize an OpenAIResponseClient and configure the web search tool with user location options. | Exact payloads, commands, or snippets shown in A C# code example demonstrating how to initialize an OpenAIResponseClient and configure the web search tool with user... |
examples/web-search-openai-api-openai-api-web-search-nodejs-3.text | A Node.js code example demonstrating how to use the web search tool within an OpenAI API response request. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the web search tool within an OpenAI API response request. |
examples/web-search-openai-api-openai-api-web-search-curl-request-6.text | A curl command demonstrating a request to the OpenAI API using the web_search tool with user location parameters. | Exact payloads, commands, or snippets shown in A curl command demonstrating a request to the OpenAI API using the websearch tool with user location parameters. |
examples/web-search-openai-api-openai-api-python-web-search-completion-request.text | A Python code snippet demonstrating how to use the OpenAI client to create a chat completion with web search options enabled. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the OpenAI client to create a chat completion with web search options... |
examples/web-search-openai-api-openai-api-web-search-nodejs-completion-2.text | A Node.js code example demonstrating how to use the OpenAI API to perform a chat completion with web search options enabled. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI API to perform a chat completion with web search options e... |
examples/web-search-openai-api-openai-api-web-search-curl-request-7.text | A curl command demonstrating a POST request to the chat completions endpoint using the web search tool with location options. | Exact payloads, commands, or snippets shown in A curl command demonstrating a POST request to the chat completions endpoint using the web search tool with location... |
examples/web-search-openai-api-openai-api-web-search-curl-request-8.text | A curl command demonstrating how to call the OpenAI API with the web search tool enabled. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the OpenAI API with the web search tool enabled. |
examples/web-search-openai-api-openai-api-web-search-nodejs-4.text | A Node.js code example demonstrating how to use the web search tool within an OpenAI API response request. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the web search tool within an OpenAI API response request. |
examples/web-search-openai-api-openai-api-web-search-python-5.text | A Python code example demonstrating how to use the web search tool with the OpenAI client to perform a query and retrieve cited information. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the web search tool with the OpenAI client to perform a query and retr... |
What This Skill Covers
- Web search allows models to access up-to-date information from the internet and provide answers with sourced citations. To enable this, use the web search to...
- Main sections:
Choose an integration,Output and citations,Output and citations,Migrating from legacy web search,Search context size.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/tools-web-search
