TL;DR
APIYI fully supports Grok’s official server-side search tools: use the Responses API (/v1/responses) with the web_search / x_search tools. grok-4.5 verifiably performs real searches and returns cited, current results. A default-group key works out of the box.
Verified Results (2026-07-13)
| Tool | Result | Searches per Q&A | Latency |
|---|---|---|---|
web_search | ✅ Accurately returned current-week news (correctly found the July 8 Grok 4.5 launch announcement), with source citations | 5 | ~12s |
x_search | ✅ Accurately returned the latest posts and thread content from a specified X account | 24 | ~45s |
Quick Start
cURL
Python (OpenAI SDK)
X Search Example
Response Structure
Theoutput array contains, in execution order:
| item type | Meaning |
|---|---|
reasoning | The model’s reasoning (search-strategy planning) |
web_search_call | One actually executed web search (x_search produces similar items) |
message | The final answer with inline source citations |
usage.server_side_tool_usage_details reports per-tool call counts (web_search_calls / x_search_calls / code_interpreter_calls / mcp_calls, etc.) — worth logging on your side for cost reconciliation.
Billing
A live-search Q&A has two cost components:| Item | Notes |
|---|---|
| Retrieved-content token cost | Search results are injected into the model context and billed at the model’s standard input rate. This is the dominant cost: measured ~27K input tokens for one web_search Q&A (of which ~11K hit the cache at the discounted rate) |
| Tool call fees | Server-side tools may incur per-call fees; refer to APIYI tool pricing and your actual billing statement |
x_search runs many rounds (24 searches in one measured Q&A), with correspondingly higher token injection and latency than web_search — estimate costs against your expected query volume. Both the search counts and
cached_tokens are self-auditable in the response usage.Notes
- Responses API only:
search_parameterson Chat Completions is gone (410) — don’t use it. - Latency expectations: ~12 s for web_search, ~45 s for x_search (measured; varies with task complexity). Set client timeouts ≥ 120 s.
- Cost control: constrain search behavior in the prompt (e.g. “search at most 2 times”) and monitor
server_side_tool_usage_details. - Verify real search happened: check the
outputarray forweb_search_call(or equivalent) items — an answer with body text but no search items came from training data, not the web.
Related Docs
Grok Overview
Model lineup, pricing, and capability matrix
Code Execution & MCP
The other two server-side tools on the Responses API
Cache Billing
The large input-token injections from search pair well with automatic caching
OpenAI Web Search
Web search usage for the GPT series, for comparison