Grok is the model family from xAI, Elon Musk's AI company. In NicAI it is a second model next to Claude, with 1 job Claude can't do: read X (Twitter) live. Grok's API has first-party search over X posts, so when the question is "what are people saying right now", Claude hands it to Grok and reports the answer with links to the posts.


The company name keeps moving. xAI was folded into SpaceX in 2026 and became SpaceXAI. In October 2026 Musk said it would become SpaceXSI, for "super intelligence", and the API docs now carry that name. The domain is still x.ai, the API is still api.x.ai, and the models are still Grok.
Why Grok, when NicAI runs on Claude
Claude does the thinking in NicAI: it plans, writes, codes and checks. But Claude has no access to X. Web search tools, Perplexity and Firecrawl reach X badly, if at all. Grok reads X posts directly, filters them by account and by date, and returns the post URLs as sources.
So the split is simple:
| Need | Tool |
|---|---|
| Reactions, launches, who said what, trending takes | Grok, X search |
| Research across the web, with citations | Perplexity |
| A known public page, read or extracted | Firecrawl |
| Everything else | Claude |
More on how NicAI uses Firecrawl, see Firecrawl
The rule I apply: if the answer lives in posts from the last few days, ask Grok. If it lives in articles, docs or company pages, don't.
How it is wired
1 shared script, ~/ai/_shared/grok.py, wraps the xAI Responses API with its server-side search tools. X search is on by default. Every project calls the same script, and the API key sits in the shared .env with the others. The script is listed with the other shared tools, see NicAI shared tools
The global skill use-x routes to it. It fires when I say "use X", "ask Grok", "what's on X about..." or "what are people saying on X". Claude turns my ask into a focused query, picks the flags, runs the script and keeps the sources in its reply. The full skill list: see The NicAI skills catalogue
# What's on X about a topic, since a date
python3 ~/ai/_shared/grok.py "what are people on X saying about Kaltura this week" --from 2026-11-21
# Only some accounts
python3 ~/ai/_shared/grok.py "summarise their posts on video infrastructure" --handles netflixeng,netflix
# X and the web together
python3 ~/ai/_shared/grok.py "latest on the Grok 4.7 launch and the reaction" --web
# An image with Grok Imagine
python3 ~/ai/_shared/grok.py "modern office, soft daylight, empty desk" --image --aspect 16:9 --out office.png
The flags that matter:
| Flag | What it does |
|---|---|
--handles a,b |
Search only these X accounts (max 20, no @) |
--exclude a,b |
Leave these accounts out |
--from / --to |
Limit the posts to a date range |
--web |
Add web search next to X search |
--no-x |
Plain model, no search |
--image |
Treat the query as an image prompt (Grok Imagine) |
The script's system prompt tells Grok to answer only from what its searches returned, name the handle behind each claim, and say so when the search comes back thin. The output ends with a numbered Sources list of X post URLs and the token count.
Where NicAI uses it
- Live X signal, on request. The main use: reactions to a launch, what an account has been posting, how a rumour is spreading. On 28th November 2026 I asked about P vs NP and the AI labs: 3 bullets, 3 X posts as sources, about 12,000 tokens.
- Sales research. Recent posts from a prospect's engineering or leadership accounts, before a call. Scoped with
--handles, so it stays cheap and on topic. - Avatar demo backgrounds. The Kaltura avatar demo skill generates the office behind the avatar with Grok Imagine by default.
- Shopping, rarely. The shopping skill can ask X for owner opinions, but X is seldom where product faults are discussed. Reddit and reviews win there.
Cost
Pay as you go, prepaid credits in the xAI console. Prices on 28th November 2026:
| Item | Price |
|---|---|
grok-4.7, grok-4.5 |
2 USD in, 6 USD out per 1M tokens, 500k context |
grok-4.3 |
1.25 USD in, 2.50 USD out per 1M, 1M context |
| X search | 5 USD per 1,000 posts read |
| Web search | 5 USD per 1,000 calls |
Images (grok-imagine-image) |
0.02 USD per image |
A typical X question costs a few US cents: about 0.03 USD in tokens, plus the posts Grok reads. 1 focused query with handles and dates beats 3 vague ones.
Limits
- X only means X. Grok's search covers X posts and, with
--web, the open web. It is no substitute for LinkedIn, which NicAI never touches anyway. - Trust the sources, not the prose. Grok can still blend posts or overstate a consensus. The post URLs are the receipts. An empty Sources list means the search found nothing, whatever the answer says.
- X is a skewed sample. Loud accounts, tech and crypto weigh more than they should. Good for "what is the reaction", weak for "what do customers think".
- Model names move fast.
grok.pydefaults togrok-4.5. xAI releasedgrok-4.7at the same price, with a May 2026 knowledge cut-off.
Further reading

