xAI

xAI model examples for building agents with Grok, including vision, web search, and financial analysis.

ExampleDescription
xAI BasicRun a Grok agent in sync, async, and streaming modes with xAI.
Finance AgentUse YFinanceTools with Grok to report stock prices, analyst recommendations, company data, and news.
xAI Image AgentDescribe an image URL with Grok 4.5 and search for related news.
xAI Image Agent BytesAnalyze downloaded image bytes with Grok 4.5.
xAI Image Agent With MemoryAnalyze an image with Grok 4.5 and retain history for follow-up questions.
xAI Live Search AgentRequest a news digest using the current xAI Responses web search tool.
xAI Live Search Agent StreamStream a news digest using the current xAI Responses web search tool.
xAI Reasoning AgentUse ReasoningTools and explicit financial data tools with Grok 4.3 for a stock report.
RetryReview retry settings and why invalid model IDs cannot reliably exercise the retry path.
xAI Structured OutputRequest JSON and validate a MovieScript with Pydantic through Grok 4.3.
Build a Web Search Agent using xAIBuild a web search agent on Grok and run it sync, streaming, and async.
Device loginSign in with a SuperGrok subscription instead of an API key and run an agent through xAIResponses.
Chat sign-inSign in with a SuperGrok subscription from inside the conversation.
Per-user sign-inSeveral people share one deployment and each spends their own SuperGrok subscription.