Skip to main content
Enterprise Support Available
Spice.ai Enterprise provides full support for up to 3 years from the release date.
Version: v1.5

xAI Models

To use a language model hosted on xAI, specify xai path in the from field and the associated xai_api_key parameter:

ParamDescriptionDefault
xai_api_keyThe xAI API key.-

Example:

models:
- from: xai:grok2-latest
name: xai
params:
xai_api_key: ${secrets:SPICE_GROK_API_KEY}

Refer to the xAI models documentation for more details on available models and configurations.

note

Although the xAI documentation shows that xAI models can return structured outputs, this is not true.