xai

Chat with Grok models via xAI API. Supports Grok-4, Grok-4.20, Grok-3, Grok-3-mini, vision, and real-time X search.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "xai" with this command: npx skills add mvanhorn/xai

xAI / Grok

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

Setup

Set your API key in the skill config:

# Via openclaw config
openclaw 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)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Ai Competitor Analyzer

提供AI驱动的竞争对手分析,支持批量自动处理,提升企业和专业团队分析效率与专业度。

Registry SourceRecently Updated
General

Ai Data Visualization

提供自动化AI分析与多格式批量处理,显著提升数据可视化效率,节省成本,适用企业和个人用户。

Registry SourceRecently Updated
General

Ai Cost Optimizer

提供基于预算和任务需求的AI模型成本优化方案,计算节省并指导OpenClaw配置与模型切换策略。

Registry SourceRecently Updated