Claude-Opus-4 - Web Search
Claude-Opus-4 — Web Search. GPTProto API reference.
POST
claude-opus-4 (web search)
Parameters
Messages Array Structure
Each message object in themessages array should have the following structure:
Content Array Structure (when content is an array)
Tools Array Structure
For web search functionality, thetools array should contain a web search tool object:
Max Uses
Themax_uses parameter limits the number of searches performed. If Claude attempts more searches than allowed, the web_search_tool_result will be an error with the max_uses_exceeded error code.
Domain Filtering
When using domain filters:- Domains should not include the HTTP/HTTPS scheme (use
example.cominstead ofhttps://example.com) - Subdomains are automatically included (
example.comcoversdocs.example.com) - Specific subdomains restrict results to only that subdomain (
docs.example.comreturns only results from that subdomain, not fromexample.comorapi.example.com) - Subpaths are supported (
example.com/blog) - You can use either
allowed_domainsorblocked_domains, but not both in the same request - Request-level domain restrictions must be compatible with organization-level domain restrictions configured in the Console
User Location Structure
Theuser_location object allows you to localize search results based on a user’s location:

