Documentation Index
Fetch the complete documentation index at: https://docs.standardagentbuilder.com/llms.txt
Use this file to discover all available pages before exploring further.
Enabled when
XAI_API_KEY is set in your environment.Overview
The@standardagents/xai package provides a Standard Agents provider for Grok chat and image models. It uses the official @ai-sdk/xai package, supports Grok streaming responses, and routes grok-imagine-image* models through xAI’s image generation/edit APIs.
Key Features
- Official
@ai-sdk/xaiintegration - Grok chat model streaming, reasoning, and tool calls
- xAI provider-executed tools such as
web_search,x_search, andcode_execution - xAI image generation and image editing support
- Built-in pricing for documented Grok text models
- Request inspection support in the admin UI
Installation
pnpm
Quick Start
Common Models
grok-4-0709grok-4-fast-reasoninggrok-4-1-fast-reasoninggrok-code-fast-1grok-3grok-imagine-imagegrok-imagine-image-pro
Provider Options
Chat options includereasoningEffort, logprobs, topLogprobs, parallel_function_calling, searchParameters, store, and previousResponseId.
Image options include aspect_ratio, output_format, resolution, quality, and numberOfImages.
Provider Tools
xAI built-in tools are provider-executed. Enable provider-defined names on the model and select them from prompts:@standardagents/xai into the corresponding xAI
search-tool options. Completed xAI tool calls are reported through the generic
Standard Agents provider-tool log path, not the local function executor.
Environment Setup
.dev.vars