Package Information
Available Nodes
Documentation generating…
Documentation
n8n-nodes-xai-responses
Grok-only n8n community node for the xAI Responses API, shaped like OpenAI’s “Message a model” but safe for xAI.
Why this exists
Pointing n8n’s OpenAI Message-a-model node at https://api.x.ai/v1 fails on this stack with:
400 Argument not supported: background
n8n always sends OpenAI-only fields (background, and with Web Search also search_context_size). xAI rejects them. This package builds an allowlisted Responses body instead.
Features (MVP)
- Message →
POST /responses - Optional web_search (xAI server-side) with
allowed_domains/excluded_domains - json_schema / json_object / text output formats
- Reasoning effort, temperature, max output tokens, tool_choice
- Outputs:
outputText, parsedoutput(when JSON),web_search_count,usage
Install
Local / custom extensions (self-hosted)
cd /path/to/n8n-nodes-xai-responses
npm install
npm run build
npm pack
On the n8n host:
mkdir -p ~/.n8n/custom
cd ~/.n8n/custom
npm install /path/to/n8n-nodes-xai-responses-0.1.1.tgz
Or set N8N_CUSTOM_EXTENSIONS to the package path and restart n8n.
Community Nodes UI
After the package is published to npm (and optionally verified), install n8n-nodes-xai-responses from Settings → Community Nodes.
Credential
Create xAI Responses API:
| Field | Value |
|---|---|
| API Key | xAI key (xai-...) |
| Base URL | https://api.x.ai/v1 (default) |
You can reuse the same API key as the built-in xAiApi credential; this type is separate so Base URL and test path stay under our control.
Notes
- Prefer this node when you need Grok Responses with hosted
web_searchand/orjson_schema. - Keep n8n’s built-in xAI Grok Chat Model for Agent/Chain chat without hosted web search.
- Keep raw HTTP only as a fallback.
Development
npm install
npm run build
npm run test:body
npm run lint
npm run dev # local n8n with this node loaded
License
MIT