Field Notes · Oct 2026 · Tinkering
This weekend: putting the Grok API through its paces
Sunday morning project. Not reading about xAI's API, using it. Here is what I found.
I put together a small playground script against xAI's OpenAI-compatible endpoint and ran four experiments: baseline chat, agentic tool calling (clean and bogus inputs), model discovery, and image generation. Hypotheses going in: the OpenAI-compatible surface makes migration trivially easy, and tool-call quality on structured args is the thing that will actually differentiate it. Both mostly held up.
Experiment 1: baseline chat. One completion on grok-4.7, a domain question with no tools: what should a bank's model-risk team check before letting an LLM agent move money? Answer came back in 7.1 seconds, and it was genuinely good, non-bypassable controls, authenticated authority, transaction limits, dual approval, audit logs, fail closed. It also followed my "two sentences" instruction exactly. Tone was direct, no throat-clearing.
Experiment 2: agentic tool calling. This was the one I cared about. I gave it a mock wealth-management portfolio lookup and asked for a pre-client-call summary. On the clean account it picked the right tool, passed exactly the right args, and came back with an honest summary, a small markdown table of the portfolio plus flags for the relationship manager, including the cash position sitting above its target band. Total loop time under 8 seconds.
Then the adversarial version: a bogus account id. It called the tool, got back "unknown account," and reported exactly that, no summary, no flags, no invented portfolio. It suggested confirming the correct id format and retrying. For anyone deploying agents inside a bank, that behavior, refusing to hallucinate when the tool errors, is the whole ballgame.
Experiment 3: model discovery. Listing what the key can actually reach returned 14 models, and this is where docs and reality drift. The docs I read pointed at grok-4.7 as the thing, but the API also lists dated grok-4.20 snapshots (reasoning and non-reasoning), a multi-agent variant, and something called grok-build-0.1. Lesson: never hardcode the model your docs mention. List at runtime, pin what you ship.
Experiment 4: image generation. One call to grok-imagine-image-2.0, a lighthouse poster prompt, came back in 13.6 seconds with a working image URL. Note the URLs are temporary, so view or save them promptly.
What I took away:
- The migration story is real. The OpenAI-compatible surface meant my existing client code worked with a base URL swap. For an enterprise deciding between providers, that near-zero switching cost is xAI's sharpest enterprise argument.
- Tool-call discipline is the enterprise bar, and it cleared it. Right tool, right args, honest use of results, clean refusal on errors. I'd still want a proper eval harness before putting it near real money, but the primitives are sound.
- Latency is fine for async, not for real-time. Seven seconds for chat, eight for a tool loop, fourteen for an image. Totally workable for background agents, not for anything conversational without streaming, which I didn't test.
- Version sprawl is the tax. Fourteen models with dated snapshots means your "which model are we on" story needs to be deliberate, not accidental.
Next step if this goes anywhere: turn the playground into a real eval harness. Swap the mock tool for a real one, run the bogus-input cases as a suite, and start measuring tool-call accuracy instead of vibes. The script is small enough to grow up.
Pavan tinkers with AI agents outside of work and writes these notes as he learns. The playground script lives on GitHub.