skills$openclaw/xai
mvanhorn4.3k

by mvanhorn

xai – OpenClaw Skill

xai is an OpenClaw Skills integration for coding workflows. Chat with Grok models via xAI API. Supports Grok-3, Grok-3-mini, vision, and more.

4.3k stars6.3k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namexai
descriptionChat with Grok models via xAI API. Supports Grok-3, Grok-3-mini, vision, and more. OpenClaw Skills integration.
ownermvanhorn
repositorymvanhorn/xai
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @mvanhorn/xai
last updatedFeb 7, 2026

Maintainer

mvanhorn

mvanhorn

Maintains xai in the OpenClaw Skills directory.

View GitHub profile
File Explorer
8 files
.
scripts
chat.js
6.4 KB
models.js
2.2 KB
search-x.js
7.1 KB
_meta.json
267 B
package.json
312 B
README.md
1.4 KB
SKILL.md
1.9 KB
SKILL.md

name: xai description: Chat with Grok models via xAI API. Supports Grok-3, Grok-3-mini, vision, and more. homepage: https://docs.x.ai triggers:

  • grok
  • xai
  • ask grok metadata: clawdbot: emoji: "🤖"

xAI / Grok

Chat with xAI's Grok models. Supports text and vision.

Setup

Set your API key in the skill config:

# Via clawdbot config
clawdbot config set skills.entries.xai.apiKey "xai-YOUR-KEY"

# Or environment variable
export XAI_API_KEY="xai-YOUR-KEY"

Get your API key at: https://console.x.ai

Commands

Chat with Grok

node {baseDir}/scripts/chat.js "What is the meaning of life?"

Use a specific model

node {baseDir}/scripts/chat.js --model grok-3-mini "Quick question: 2+2?"

Vision (analyze images)

node {baseDir}/scripts/chat.js --image /path/to/image.jpg "What's in this image?"

🔍 Search X/Twitter (Real-time!)

node {baseDir}/scripts/search-x.js "Remotion video framework"
node {baseDir}/scripts/search-x.js --days 7 "Claude AI tips"
node {baseDir}/scripts/search-x.js --handles @remotion_dev "updates"

Uses xAI Responses API with x_search tool for real X posts with citations.

List available models

node {baseDir}/scripts/models.js

Available Models

  • grok-3 - Most capable, best for complex tasks
  • grok-3-mini - Fast and efficient
  • grok-3-fast - Optimized for speed
  • grok-2-vision-1212 - Vision model for image understanding

Example Usage

User: "Ask Grok what it thinks about AI safety" Action: Run chat.js with the prompt

User: "Use Grok to analyze this image" (with attached image) Action: Run chat.js with --image flag

User: "What Grok models are available?" Action: Run models.js

API Reference

xAI API Docs: https://docs.x.ai/api

Environment Variables

  • XAI_API_KEY - Your xAI API key (required)
  • XAI_MODEL - Default model (optional, defaults to grok-3)
README.md

xAI / Grok Skill for Clawdbot

Chat with xAI's Grok models from Clawdbot. Supports text chat, vision, and all Grok models including Grok-4.

Installation

clawdhub install xai
# or
cd ~/clawd/skills && git clone https://github.com/mvanhorn/clawdbot-skill-xai xai

Setup

Get your API key from console.x.ai, then:

clawdbot config set skills.entries.xai.apiKey "xai-YOUR-KEY"

Or set environment variable:

export XAI_API_KEY="xai-YOUR-KEY"

Usage

Chat with Grok

node scripts/chat.js "What is the meaning of life?"

Use specific model

node scripts/chat.js --model grok-4-0709 "Complex question here"
node scripts/chat.js --model grok-3-mini "Quick question"

Vision (analyze images)

node scripts/chat.js --image photo.jpg "What's in this image?"

System prompts

node scripts/chat.js --system "You are a pirate" "Tell me about ships"

List available models

node scripts/models.js

Available Models

  • grok-3 - Capable general model
  • grok-3-mini - Fast and efficient
  • grok-4-0709 - Latest Grok 4
  • grok-4-fast-reasoning - Fast with reasoning
  • grok-2-vision-1212 - Image understanding
  • grok-2-image-1212 - Image generation

Clawdbot Integration

Once installed, you can just say:

  • "Ask Grok about [topic]"
  • "Use Grok to analyze this image"
  • "Have Grok 4 explain [concept]"

License

MIT

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install xai?

Run openclaw add @mvanhorn/xai in your terminal. This installs xai into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/mvanhorn/xai. Review commits and README documentation before installing.