Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/web-search-openai-api-workflow-guide.mdA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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