In short.
The xAI Web Search guide is an integration reference for developers building Grok apps, but it provides no pricing or measured reliability results. It documents web search and page browsing through the xAI SDK, OpenAI-compatible Responses requests and Vercel AI SDK. Useful details include mutually exclusive domain filters and the distinction between inspecting images and finding images. The captured page says Vercel does not expose the image-search option. No examples were executed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is limited to the complete selected page at [https://docs.x.ai/developers/tools/web-search.md], including its SDK examples, parameter tables, image-feature notices and illustrative output. Linked pages, including the citation guide, are excluded. Runtime behavior, output quality, pricing and reuse permissions were not established; no examples were executed.
The overview
Identity
This is xAI's developer documentation for the Web Search tool, available at [https://docs.x.ai/developers/tools/web-search.md]. The resource is a guide to configuring a Grok capability through code. Its examples cover JavaScript, Python and direct HTTP requests.
Practical assessment
The guide provides useful implementation detail: request structure, SDK-specific option names, domain restrictions and image-related controls. These details help developers choose an integration route and prepare an initial request.
Its evidence supports understanding the documented interface. Search accuracy, citation quality, latency and operational reliability are not assessed, so the page alone cannot establish whether the tool meets a particular application's quality requirements.
Who it suits
The examples suit developers building assistants that need current web information, page content or relevant images. Beginners get concrete request examples, although the page assumes familiarity with API keys, client libraries and application code.
Experienced developers can use the SDK differences and response-field examples to plan integration. Someone seeking a ready-to-use search application would still need to build or supply the surrounding interface.
Documented capabilities
The tool lets Grok search the web, browse pages and extract information for responses. Developers can restrict browsing and search to specified domains or exclude specified domains.
Two separate image options are documented. Image understanding lets Grok inspect images encountered while browsing. Image search finds relevant images, includes them in the model's context and can return image embeds in the response.
The examples also show access to citations through Vercel's sources result and the xAI SDK's response.citations field. Detailed citation handling is referred to a separate page.
Using it
Requirements
The Python and HTTP examples require an xAI API key, read from XAI_API_KEY. SDK examples require the corresponding libraries and runtime: openai or xai_sdk for Python, or @ai-sdk/xai and ai for JavaScript. Package versions and installation commands are not supplied.
The examples use grok-4.7. This is an example model identifier, not a complete compatibility list. The OpenAI client example sends requests to xAI at [https://api.x.ai/v1]; using that client library does not mean the request goes to OpenAI.
How it works
Applications register web_search as an available model tool. Grok can then invoke search and browsing while preparing its answer. In Responses requests, domain restrictions sit inside the tool's filters object; the xAI Python helper accepts domain arguments directly. Vercel's example uses webSearch with the camelCase allowedDomains option.
Enabling image understanding grants access to view_image. The page says these calls appear as SERVER_SIDE_TOOL_VIEW_IMAGE in response.server_side_tool_usage. In the xAI SDK, successful image searches appear in response.server_side_tool_usage as SERVER_SIDE_TOOL_IMAGE_SEARCH; the page does not say how image-search usage is reported for the other routes. These are documented usage counters, not monetary prices.
Setup
For the documented Python Responses route, make XAI_API_KEY available, construct an OpenAI client with the xAI base URL, and call client.responses.create with a model, user input and a tools entry whose type is web_search. The direct HTTP example posts the equivalent request to [https://api.x.ai/v1/responses] with bearer authentication.
The xAI Python route uses Client, client.chat.create and web_search(). The Vercel route uses generateText with xai.responses and xai.tools.webSearch(). Configuration names differ across these routes, so options should follow the relevant example.
Example use
The basic examples ask what SpaceXSI is, select grok-4.7 and enable web_search. The Vercel example prints text and sources. The xAI streaming example shows how to display tool calls, reasoning-token usage, answer content and citations.
A separate example requests images of Starship on a launch pad with enable_image_search enabled. The page includes an illustrative response containing an image embed. Neither example establishes factual accuracy or repeatable output, and neither was executed for this report.
Assessment & evidence
Limits and gaps
Each domain list accepts at most five domains, and allowed_domains cannot be combined with excluded_domains in one request. The captured page says the Vercel AI SDK does not expose enableImageSearch.
Enabling image understanding for Web Search also enables it for X Search when that tool is included in the same request. This matters when configuring requests with both tools.
Search coverage, latency, quotas, failure handling and the detailed citation schema are not established here. The linked citation documentation is outside the selected page.
Fit reasoning
The documented controls suggest a useful starting point for applications that need current web information and some control over which sites are consulted. Domain restrictions can narrow the sources available to the tool; they do not establish that its answers will be correct or complete.
The distinction between finding images and inspecting images is especially useful for planning. A developer who only enables image understanding should not assume that this also enables the separate image-search feature.
Integration options
The page offers several routes to the same xAI capability: the xAI SDK, OpenAI-compatible Responses requests, Vercel AI SDK and direct HTTP. For image search, it supplies Responses and xAI Python examples while identifying a missing Vercel option.
Competing search services and other providers' tools are not compared. This evidence cannot establish a price, quality or performance advantage over another product.
Evidence
The evidence consists of the complete captured xAI Web Search documentation page at [https://docs.x.ai/developers/tools/web-search.md]. It contains parameter descriptions, SDK and HTTP examples, response-field references and illustrative image output.
These are documentation claims and examples. No code or API request was executed, and the supplied material contains no measured accuracy, latency or cost results.
Access & freshness
Costs
The selected page provides no model-token prices, search charges, image-operation charges, free allowance or billing rules. The cost of using the documented features is unknown.
The image-operation counters can reveal documented activity, but the page supplies no rates for converting those counts into a cost estimate.
Rights and reuse
The page states no licence for redistributing its documentation or example code and supplies no terms governing reuse of generated answers, retrieved page content or returned images. Those permissions remain unknown from this evidence.
An image appearing in an example response does not establish permission to republish it.
Freshness
The supplied page was captured on 15 November 2026 at 04:06 UTC. Its text gives no publication or last-updated date.
The grok-4.7 examples and the stated Vercel image-search limitation describe the captured documentation. Availability and SDK feature parity beyond that capture are unknown.
Suggested next steps
Choose the documented integration route that matches the application's language and required features. Begin with a text-search request and inspect its answer and citation output. Add domain restrictions if the application needs a defined set of sources.
For image retrieval, follow a documented Responses or xAI Python image-search example. Before committing to deployment, confirm current model support and pricing, measure accuracy and latency on representative queries, and establish reuse permissions for any content or images the application will publish.
