web_search
Query the web using real-time search results. Optionally restrict or exclude domains to refine answers.
Instructions
Query the web using xAI's real-time web search tool.
Args:
prompt: The research question or search instruction.
allowed_domains: Restrict search to these domains (e.g. ["arxiv.org"]).
excluded_domains: Domains to exclude from search results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| allowed_domains | No | ||
| excluded_domains | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Structured payload for web_search / x_search / code_execution. | |
| text | No | Human-formatted output (includes footers, citations, cost summary). | |
| model | Yes | Actual executing model ID (e.g. 'grok-4.5'). | |
| plane | No | API | |
| route | Yes | High-level route (fast/agentic/research/etc.). | |
| tokens | No | Total tokens consumed. | |
| profile | No | Internal routing profile. | |
| cost_usd | No | Exact USD cost from xAI billing metadata. | |
| response | Yes | Raw model output or primary content. | |
| citations | No | Native xAI/X citations with URL + snippet. | |
| latency_sec | No | ||
| finish_reason | No | unknown | |
| reasoning_effort | No | Grok 4.5+ native reasoning level. |