Web search
Some models can search the web as they answer, and the sources they read come back with the reply.
Today gpt-6.1-sol, gpt-6-astra and gpt-6-luna can search, and capabilities.web_search in the catalog says so for every model. Asking another model to search is refused with 400, and the message names the models that can.
Turn it on
web_search_options set to {}{"type": "web_search_20250305", "name": "web_search"}The two behave differently. On the OpenAI format web_search_options makes the model search on every call unless you also send a tool_choice, and on the Anthropic format the model decides when to search unless tool_choice is any.
reply = client.chat.completions.create(
model="gpt-6-luna",
web_search_options={},
messages=[{"role": "user", "content": "What changed in the latest Python release?"}],
)
print(reply.choices[0].message.content)
for source in reply.choices[0].message.annotations or []:
print(source.url_citation.url)Sources
On the OpenAI format each source is a url_citation annotation with its url and title, on the message or, in a stream, on the delta. On the Anthropic format each source is a web_search_result_location citation on the text block it supports, with its url, title and cited_text, and in a stream it arrives as a citations_delta, while no web_search_tool_result blocks are sent. The utm_source tag is removed from each link.
Cost
A search adds 40,000 input tokens to the hold, because the pages it reads count as input. You then pay for the tokens the model reports, which are usually fewer.
One kind of tool at a time. Web search can't be combined with your own tools in one request, so send it alone or send your tools without it. search_context_size and max_uses are accepted but have no effect yet.