Skip to content
Last updated

Web search gives your AI assistant access to real-time information from the internet. Use it for current events, live data, recent documentation, and anything beyond the model's training cutoff.

Enable web search on an assistant via the tools configuration or pass it in the request:

{
 "organization_id": "org_your_org_id",
 "assistant_id": "asst_abc123",
 "tools": [{"type": "web_search"}],
 "inputs": [{"role": "user", "content": "What is the current price of Bitcoin?"}]
}

Tool Modes

ModeBehavior
autoModel decides when to search (recommended)
onAlways search before responding
offNever search
{
 "tools": [{"type": "web_search", "mode": "auto"}]
}

How It Works

When the model decides to use web search:

  1. It formulates one or more search queries
  2. The results appear in the response as web_search_call output items
  3. The model synthesizes the results into its final response

You can inspect the search results via response.output items of type web_search_call.

Response Structure

{
 "output": [
 {
 "type": "web_search_call",
 "id": "ws_abc123",
 "status": "completed"
 },
 {
 "type": "message",
 "role": "assistant",
 "content": [
 {
 "type": "output_text",
 "text": "Based on current data, Bitcoin is trading at..."
 }
 ]
 }
 ]
}

Use Cases

  • Current events — News, market data, sports scores
  • Documentation lookups — Latest API docs, package changelogs
  • Fact verification — Cross-check model claims against live sources
  • Research — Gather recent information on any topic

Configuring Sources

You can restrict or expand the sources the search queries, for example limiting results to specific domains. This is configured via web_search_call.action.sources on the assistant or request level.