Skip to main content
Early accessGnani Evon v3.5 is now available as an API to early access registrants.
Answer questions that need up-to-date information, and show where each fact came from. The built-in web search tool runs the searches for you; your code only adds the tool, then turns the [n] citations into links.

When to use this

  • Users ask about things that change: weather, prices, schedules, recent news.
  • You need to show sources next to the answer.
  • You do not want to run your own search or retrieval pipeline.

Ask a question

The output (illustrative, with placeholder sources):

How it works

  1. You add {"type": "web_search"} to tools. You do not write a search function.
  2. The model decides whether it needs to search. For a question it can answer on its own, it may not search at all.
  3. The service runs the searches and gives the results to the model, which writes the answer with numbered citations.
  4. message.web_search lists the queries and the sources. Each source’s id is the number cited as [id].

Options

With "stream": true, chunks with delta.web_search report each search before the answer streams in delta.content:
See Web search for every status value.
You can send your own function tools in the same request. If the model calls one, you get tool_calls back and run it as in Tool calling. Do not name your functions web_search or search.

Gotchas

Searches are limited per day. When they are used up, a request with the web_search tool is refused with 429 web_search_limit_exceeded until midnight IST. The scripts above then ask again without the tool. See Limits.
  • A failed search does not fail the request. The model answers from what it knows and says live search was not available. Check whether sources is empty before you show a “Sources” list.
  • Searched answers use more tokens. usage includes the search results the model read, and counts toward your daily token quota.
  • tool_choice must be auto or none when you send web_search. none turns search off for the request.
  • Search results are screened by the safety filters. A result that fails the check is dropped.

Web search

The web search tool, response fields and streaming events.

Tool calling

Add your own functions next to web search.

Streaming

Stream the answer as it is written.

Limits

Daily search and token limits.