> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Xai

> Python API reference for the xai llm provider.

<Card title="Usage guide" icon="book" href="/plugins/llm/xai" horizontal>
  Setup, environment variables, and Python/JavaScript/Go usage examples.
</Card>

## XAILLM

LLM Plugin for xAI (Grok) API.

Slot: llm. Route: plugins -- direct to the vendor, with XAI\_API\_KEY or an
explicit api\_key.

```python theme={null}
from zeroruntime.plugins import XAILLM  # direct to the vendor, with your key
```

### Fields

<ParamField path="model" type="str" default="grok-4-1-fast-non-reasoning" />

<ParamField path="base_url" type="str" default="https://api.x.ai/v1" />

<ParamField path="temperature" type="float" default="0.7" />

<ParamField path="tool_choice" type="Literal['auto', 'required', 'none']" default="UNSET" />

<ParamField path="max_completion_tokens" type="int | None" default="None" />
