xAI
A RocketRide LLM node that connects xAI Grok models to a pipeline.
What it does
Provides xAI's Grok models as an llm invoke connection for agents and other nodes that need a language model. The node can also be used directly via lanes: send text on the questions lane and receive a generated completion on the answers lane.
Uses langchain-xai (ChatXAI) under the hood. The chat client is always initialized with temperature=0, and max_tokens is set from the selected profile's output-token limit. The default profile is Grok 3 (grok-3).
When the node config is saved, a minimal validation probe (a single-word prompt) is sent to the xAI API to verify the API key and model. Provider and HTTP errors are parsed into a readable Error <code>: <message> warning instead of failing silently.
Configuration
Lanes
| Lane in | Lane out | Description |
|---|---|---|
questions | answers | Send a question directly, receive a generated answer |
Fields
| Field | Type / Default | Description |
|---|---|---|
profile | string, default grok-3 | Which Grok model profile to use (see Profiles below) |
apikey | string | xAI API key; must begin with xai- |
model | string | xAI model id (Custom profile only) |
modelTotalTokens | number, default 131072 | Total token (context) limit (Custom profile only); must be greater than 0 |
For all built-in profiles, model, modelTotalTokens, and modelOutputTokens are preset and only the API key needs to be supplied. The Custom profile additionally exposes model and modelTotalTokens so any xAI model id can be used.
Profiles
xAI-hosted
| Profile | Model | Context (tokens) | Max output (tokens) |
|---|---|---|---|
| Grok 3 (default) | grok-3 | 131,072 | 131,072 |
| Grok 3 Mini | grok-3-mini | 131,072 | 131,072 |
| Grok 4 | grok-4-0709 | 256,000 | 256,000 |
| Grok 4 Fast | grok-4-fast-reasoning | 2,000,000 | 4,096 |
| Grok 4 Fast Non-Reasoning | grok-4-fast-non-reasoning | 2,000,000 | 4,096 |
| Grok 4.1 Fast | grok-4-1-fast-reasoning | 2,000,000 | 4,096 |
| Grok 4.1 Fast Non-Reasoning | grok-4-1-fast-non-reasoning | 2,000,000 | 4,096 |
| Grok Code Fast 1 | grok-code-fast-1 | 256,000 | 10,000 |
| Custom Model | (user-specified) | configurable | (not preset) |
OpenRouter-sourced
These profiles use modelSource: openrouter and carry OpenRouter-style model ids. The apikey field is also exposed for each of these profiles.
| Profile | Model | Context (tokens) | Max output (tokens) |
|---|---|---|---|
| xAI: Grok 3 Beta | grok-3-beta | 131,072 | 131,072 |
| xAI: Grok 3 Mini Beta | grok-3-mini-beta | 131,072 | 131,072 |
| xAI: Grok 4 Fast | grok-4-fast | 2,000,000 | 30,000 |
| xAI: Grok 4.1 Fast | grok-4.1-fast | 2,000,000 | 30,000 |
| xAI: Grok 4.20 | grok-4.20 | 2,000,000 | 4,096 |
| xAI: Grok 4.20 Multi-Agent | grok-4.20-multi-agent | 2,000,000 | 4,096 |
Authentication
Provide an xAI API key in the apikey field. The key is validated at pipeline start: it must begin with the xai- prefix, otherwise the node raises Invalid XAI API key format, please check your API key.
The key is also checked at save time with a minimal probe request, so invalid keys, unknown models, or network problems surface as warnings in the UI before the pipeline runs.
Upstream docs
Schema
| Field | Type | Description | Default |
|---|---|---|---|
model | string | Model xAI model | |
modelTotalTokens | number | Tokens Total Tokens | |
xai.profile | string | Model LLM model | "grok-3" |
Dependencies
langchain-xailangchain-corelangchain