Skip to main content
View source

xAI

View as Markdown

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 inLane outDescription
questionsanswersSend a question directly, receive a generated answer

Fields

FieldType / DefaultDescription
profilestring, default grok-3Which Grok model profile to use (see Profiles below)
apikeystringxAI API key; must begin with xai-
modelstringxAI model id (Custom profile only)
modelTotalTokensnumber, default 131072Total 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

ProfileModelContext (tokens)Max output (tokens)
Grok 3 (default)grok-3131,072131,072
Grok 3 Minigrok-3-mini131,072131,072
Grok 4grok-4-0709256,000256,000
Grok 4 Fastgrok-4-fast-reasoning2,000,0004,096
Grok 4 Fast Non-Reasoninggrok-4-fast-non-reasoning2,000,0004,096
Grok 4.1 Fastgrok-4-1-fast-reasoning2,000,0004,096
Grok 4.1 Fast Non-Reasoninggrok-4-1-fast-non-reasoning2,000,0004,096
Grok Code Fast 1grok-code-fast-1256,00010,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.

ProfileModelContext (tokens)Max output (tokens)
xAI: Grok 3 Betagrok-3-beta131,072131,072
xAI: Grok 3 Mini Betagrok-3-mini-beta131,072131,072
xAI: Grok 4 Fastgrok-4-fast2,000,00030,000
xAI: Grok 4.1 Fastgrok-4.1-fast2,000,00030,000
xAI: Grok 4.20grok-4.202,000,0004,096
xAI: Grok 4.20 Multi-Agentgrok-4.20-multi-agent2,000,0004,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

FieldTypeDescriptionDefault
modelstringModel
xAI model
modelTotalTokensnumberTokens
Total Tokens
xai.profilestringModel
LLM model
"grok-3"

Dependencies

  • langchain-xai
  • langchain-core
  • langchain