Features2
Modes2
Filters2
Playground
Results from xAI
Features
xAI delivers 2 of the features on the feature list, each from one or more of its modes.
| Feature | Returns |
|---|---|
| Web search (general) | Ranked pages from the open web that match a query, each with a passage. |
| Social posts | Recent public posts on a subject, or an account's latest posts, from social platforms. |
Modes
xAI has 2 search modes. Choose which of them a search may use under Routing on your account page.
- Default search
- Web
Filters xAI applies
Set them under filters. A filter a provider can’t apply returns 400 unsupported_filter.
| Filter | Keeps |
|---|---|
domains | Only these sites, or with "mode": "exclude", none of them. |
recency | The last so many days, or a range of dates. |
request.jsonJSON
{
"query": "which language has the most native speakers",
"top_k": 5,
"requested_provider": "xai",
"filters": {
"domains": { "values": ["en.wikipedia.org"] }
}
}
Pin a query to xAI
- Over the HTTP API, send
"requested_provider": "xai"with the query and your search key. - In an agent connected over MCP, ask it to search with xAI.
Results come back in the same shape for every provider, as the docs describe. Leave the field out, and Grounder routes each query to the provider most likely to answer it well.
search.shShell
curl https://api.grounder.net/v1/search \
-H "Authorization: Bearer $GROUNDER_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "which language has the most native speakers",
"top_k": 5,
"requested_provider": "xai"
}'
import os
import httpx
KEY = os.environ["GROUNDER_KEY"]
r = httpx.post(
"https://api.grounder.net/v1/search",
headers={"Authorization": f"Bearer {KEY}"},
json={
"query": "which language has the most native speakers",
"top_k": 5,
"requested_provider": "xai",
},
timeout=30,
).json()
for hit in r["results"]:
print(hit["rank"], hit["title"], hit["url"])
const res = await fetch("https://api.grounder.net/v1/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GROUNDER_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: "which language has the most native speakers",
top_k: 5,
requested_provider: "xai",
}),
})
const { results } = await res.json()
claude mcp add --transport http grounder \
https://api.grounder.net/mcp
# then /mcp, grounder, Authenticate