Parameters
xAI extends OpenAILike and accepts all of its parameters.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Parameter reference for the xAI model class, which extends OpenAILike to connect to xAI’s language models.
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "grok-4-1-fast-non-reasoning-latest" | The ID of the xAI model to use |
name | str | "xAI" | The name of the model |
provider | str | "xAI" | The provider of the model |
api_key | Optional[str] | None | The API key for xAI (defaults to XAI_API_KEY env var) |
base_url | str | "https://api.x.ai/v1" | The base URL for the xAI API |
search_parameters | Optional[Dict[str, Any]] | None | Search configuration for xAI live search, sent in the request body |
grok-4-1-fast-non-reasoning-latest is retained here because it is the class default in the pinned source. xAI has retired this alias and redirects it to Grok 4.3. Use xAI(id="grok-4.3", reasoning_effort="none") for the equivalent current configuration.xAI extends OpenAILike and accepts all of its parameters.Was this page helpful?