Web search
Ground any text model in current search results with clickable sources.
Enable web search
Turn on Web search in the playground, or add web_search: true to Chat Completions, Messages, or Responses requests. Search runs before generation and supplies relevant snippets and numbered source URLs to your selected text model. In the Python OpenAI SDK, pass the gateway option as extra_body={"web_search": True}.
{
"model": "gpt-6.1-sol",
"messages": [
{
"role": "user",
"content": "What changed in the latest Python release?"
}
],
"web_search": true,
"stream": true
}Responses clients may also declare {"type":"web_search"} or {"type":"web_search_preview"} in tools. The gateway performs one search before generation; it does not offer an autonomous multi-search research loop.
Search controls
{
"web_search": {
"query": "Python release notes",
"max_results": 5,
"time_range": "month",
"include_domains": [
"python.org"
],
"exclude_domains": []
}
}| Option | Behavior |
|---|---|
query | Optional explicit query, 1–500 characters; otherwise uses text from the latest user message |
max_results | 1–8 sources; defaults to 5 |
time_range | Optional day, week, month, or year |
include_domains / exclude_domains | Up to 8 public hostnames in each list |
Sources & streaming
The web_search response field contains the search query, retrieval timestamp, cache status, and source titles, URLs, domains, and snippets. Chat streams include this field in an initial chunk with empty choices. Messages streams expose a web_search event. Responses include it in the response object. Continue parsing normal text and tool events as usual.
Privacy & limits
Search is off by default. When enabled, your latest question or explicit query is sent to a search service; full chat history, images, and your DeepThroat API key are not sent. Avoid sensitive information in search queries. Recognizable API tokens are redacted as an additional precaution.
Repeated searches may reuse results for two minutes, isolated per API key. New searches are limited to 6 per minute per key and a shared monthly allowance. Quota and connection failures return an explicit error before model generation; turn search off to continue without it.
There is no separate search surcharge at launch. Retrieved snippets count toward model input tokens, and the normal $0.001 network fee still applies once per successful paid generation request.