# Claude web search: the web_search tool and the Anthropic provider Source: https://ofox.ai/docs/develop/models/claude/web-search This page explains how to let Claude search the web with the `web_search` tool. For model IDs, endpoints and providers, see the [Claude family overview](https://ofox.ai/docs/develop/models/claude). **Key point**:Web search requires the Anthropic provider, is limited to Fable 5, Opus 4.8, Opus 4.7 and Sonnet 5, and works only on the Anthropic-native API. Add the official `web_search` server tool to `tools`. The model runs searches on its own and cites sources in its answer: **Python** ```python filename="claude_web_search.py" import os import anthropic client = anthropic.Anthropic( base_url="https://api.ofox.ai/anthropic", api_key=os.environ["OFOX_API_KEY"], default_headers={"X-OfoxAI-Provider-Type": "anthropic"}, ) message = client.messages.create( model="anthropic/claude-sonnet-5", max_tokens=1500, tools=[{"type": "web_search_20250305", "name": "web_search", "max_uses": 3}], messages=[{"role": "user", "content": "What is the latest stable version of Python?"}], ) print("".join(b.text for b in message.content if b.type == "text")) print("Searches:", message.usage.server_tool_use.web_search_requests) ``` **cURL** ```bash filename="Terminal" curl https://api.ofox.ai/anthropic/v1/messages \ -H "x-api-key: $OFOX_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "X-OfoxAI-Provider-Type: anthropic" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-5", "max_tokens": 1500, "tools": [{"type": "web_search_20250305", "name": "web_search", "max_uses": 3}], "messages": [{"role": "user", "content": "What is the latest stable version of Python?"}] }' ``` - The response `content` contains, in order, `server_tool_use` (search queries), `web_search_tool_result` (search results) and `text` (answer) blocks. - `usage.server_tool_use.web_search_requests` is the actual number of searches. Searches are billed per use; see the [model page](https://ofox.ai/models/anthropic/claude-sonnet-5) for the rate. - `max_uses` caps the number of searches in a single request. For other errors, see [Common errors](https://ofox.ai/docs/develop/models/claude#errors).