> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timbal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Search

> AI agents can search the web for real-time information using OpenAI or Anthropic models

Agents can search the web for current information using the built-in `WebSearch` tool. This tool works with **OpenAI** and **Anthropic** models.

<Note>
  See the [Model Reference](/models/overview) to check which specific models support web search.
</Note>

```python theme={"dark"}
from timbal import Agent
from timbal.tools import WebSearch

# Works with OpenAI or Anthropic models
agent = Agent(
    name="SearchAgent",
    model="openai/gpt-5.1",
    tools=[WebSearch()],
    system_prompt="Search the web for current information."
)

# Agent will automatically use search when needed
result = await agent(
    prompt="When was the last match of Liverpool?"
).collect()
```

## Key Features

* **Real-time Information**: Access current web data and news
* **Automatic Tool Selection**: Agent decides when to search
* **Citation Support**: Includes source links in responses
