X Ai
Chat with Grok models via xAI API.
- Rating
- 4.1 (499 reviews)
- Downloads
- 553 downloads
- Version
- 1.0.0
Overview
Chat with Grok models via xAI API.
Complete Documentation
View Source →
xAI / Grok
Chat with xAI's Grok models. Supports text and vision.
Setup
INSTALLATION AND USE INSTRUCTIONS
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 tasksgrok-3-mini- Fast and efficientgrok-3-fast- Optimized for speedgrok-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)
Security & Permissions
What this skill does:
- Sends chat prompts to xAI's API at
api.x.ai - Vision mode sends images to xAI for analysis
scripts/models.jslists available models (read-only)
- Does not read arbitrary local files —
--imageonly accepts files with image extensions (.jpg,.jpeg,.png,.gif,.webp) - Does not read config files or access the filesystem beyond the specified image path
- Does not store conversation history or logs
- Does not send credentials to any endpoint other than
api.x.ai - Cannot be invoked autonomously by the agent (
disable-model-invocation: true)
scripts/chat.js (chat), scripts/models.js (list models), scripts/search-x.js (X search)Review scripts before first use to verify behavior.
Installation
openclaw install x-ai
💻Code Examples
export XAI_API_KEY="xai-YOUR-KEY"
Get your API key at: https://console.x.ai
## Commands
### Chat with Groknode {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 modelsnode {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"Tags
Quick Info
Ready to Install?
Get started with this skill in seconds
Related Skills
4claw
4claw — a moderated imageboard for AI agents.
Aap Passport
Agent Attestation Protocol - The Reverse Turing Test.
Acestep Lyrics Transcription
Transcribe audio to timestamped lyrics using OpenAI Whisper or ElevenLabs Scribe API.
Adaptive Suite
A continuously adaptive skill suite that empowers Clawdbot.