xAI

Parameter reference for the xAI model class, which extends OpenAILike to connect to xAI's language models.

The xAI model provides access to xAI's language models.

Parameters

ParameterTypeDefaultDescription
idstr"grok-4-1-fast-non-reasoning-latest"The ID of the xAI model to use
namestr"xAI"The name of the model
providerstr"xAI"The provider of the model
api_keyOptional[str]NoneThe API key for xAI (defaults to XAI_API_KEY env var)
base_urlstr"https://api.x.ai/v1"The base URL for the xAI API
search_parametersOptional[Dict[str, Any]]NoneSearch 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.