Skip to main content
This page shows how to use Grok’s web search and X (Twitter) search on APIYI, verified hands-on on July 13, 2026 (UTC+8).

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.
The legacy entry point is gone: the search_parameters field on Chat Completions (old Live Search) has been removed by xAI — verified returning 410. Migrate existing code to the Responses API tool format.

Verified Results (2026-07-13)

X search is Grok’s differentiator: it searches real-time posts, account activity, and topic discussions on X (Twitter) — a source no other vendor’s search tool covers. Great for social monitoring, trend tracking, and KOL analysis. Note that x_search runs many search rounds and is noticeably slower (~45 s measured); set client timeouts to 120 s or more.

Quick Start

cURL

Python (OpenAI SDK)

X Search Example

Response Structure

The output array contains, in execution order: 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:
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

  1. Responses API only: search_parameters on Chat Completions is gone (410) — don’t use it.
  2. Latency expectations: ~12 s for web_search, ~45 s for x_search (measured; varies with task complexity). Set client timeouts ≥ 120 s.
  3. Cost control: constrain search behavior in the prompt (e.g. “search at most 2 times”) and monitor server_side_tool_usage_details.
  4. Verify real search happened: check the output array for web_search_call (or equivalent) items — an answer with body text but no search items came from training data, not the web.

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