Setup Guide
How to Use Grok (xAI) with OpenClaw
Power your OpenClaw AI agent with Grok — xAI's frontier model with real-time knowledge, blazing-fast inference, and a distinct personality. Deploy a Grok bot on Telegram or Discord in under 10 seconds.
What Is Grok?
Grok is the AI model built by xAI, Elon Musk's AI company. Unlike most AI models trained on static datasets, Grok has access to real-time information from X (formerly Twitter), giving it up-to-date knowledge about current events, trending topics, and the latest news. Grok is known for its fast inference speed, competitive pricing, and a distinct personality that leans toward wit and directness.
Grok 3 and Grok 3 Mini are the flagship models — available via the xAI API directly or through OpenRouter, which lets you access Grok alongside Claude, GPT-4o, Gemini, and others with a single API key.
Why Use Grok with OpenClaw?
- Real-time knowledge: Grok has access to live X/Twitter data, making it ideal for news-aware agents and trend monitoring bots.
- Fast inference: Grok 3 Mini delivers very low-latency responses, great for chat bots where response speed matters.
- Competitive pricing: Grok models are among the most cost-effective frontier-class options available via OpenRouter.
- Distinct personality: Grok's direct, witty style works well for casual conversation bots and community assistants.
- OpenRouter access: No separate xAI account needed — access Grok through your existing OpenRouter key alongside all other models.
Grok vs Other Models
| Model | Speed | Knowledge Cutoff | Pricing (input/output) | Strengths |
|---|---|---|---|---|
| Grok 3 | Fast | Real-time (X data) | $3 / $15 per 1M tokens | Real-time info, wit, reasoning |
| Grok 3 Mini | Very fast | Real-time (X data) | $0.30 / $0.50 per 1M tokens | Speed, cost efficiency, casual chat |
| Claude Sonnet 4 | Fast | August 2025 | $3 / $15 per 1M tokens | Writing, nuanced conversation, safety |
| GPT-4o | Fast | October 2023 | $2.50 / $10 per 1M tokens | All-around, broad knowledge, tools |
| Gemini 2.5 Flash | Very fast | Early 2025 | $0.15 / $0.60 per 1M tokens | Long context, multilingual, value |
Grok stands out for its real-time awareness — ideal when your bot needs to discuss current events, trending topics, or X/Twitter content. For writing-heavy or safety-sensitive tasks, Claude remains the top choice.
How to Use Grok on OpenClaw Launch
If you use OpenClaw Launch (the managed hosting service), Grok is available from the model selector — no API key setup required on your end:
- Go to openclawlaunch.com and open the configurator.
- Navigate to the Models page and select Grok 3 or Grok 3 Mini.
- Connect your chat platform (Telegram, Discord, or Web) and click Deploy.
Your Grok-powered agent will be live in seconds. You can switch between Grok and other models at any time using the /model command in chat.
How to Use Grok on Self-Hosted OpenClaw
If you self-host OpenClaw, the easiest way to access Grok is via OpenRouter. OpenRouter provides a unified API key that covers Grok, Claude, GPT, Gemini, DeepSeek, and hundreds of other models.
Step 1: Get an OpenRouter API Key
- Go to openrouter.ai/keys and sign in.
- Click Create Key and copy your key.
- Add credits to your OpenRouter account — Grok 3 Mini is very affordable at $0.30 / $0.50 per 1M tokens.
Step 2: Configure openclaw.json
Add the OpenRouter provider and set Grok as your primary model:
{
"models": {
"providers": {
"openrouter": {
"apiKey": "sk-or-v1-..."
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "openrouter/xai/grok-3"
}
}
}
}To use the smaller, faster model instead, set "primary": "openrouter/xai/grok-3-mini".
openrouter/xai/grok-3, not just xai/grok-3. The full prefix is required for OpenClaw to route the request correctly.Best Use Cases for Grok
- News and current events bots: Grok's real-time X data integration makes it ideal for bots that answer questions about today's news.
- Community assistants on X/Twitter-focused servers: Works especially well in Discord communities built around social media, crypto, or tech trends.
- Casual conversation: Grok's direct and slightly irreverent personality is a good fit for casual Telegram groups.
- High-volume, cost-sensitive bots: Grok 3 Mini is one of the cheapest frontier-class models — great for bots that handle many messages per day.
- Trend monitoring: Build an agent that surfaces trending topics from X and summarizes them for your team.
What's Next?
- OpenRouter Setup Guide — unify all your AI models under one key
- Claude Setup Guide — best for writing and nuanced conversation
- DeepSeek Setup Guide — best value for technical and coding tasks
- Compare all supported models
Frequently Asked Questions
Can I use Grok with OpenClaw without an xAI account?
Yes. The easiest way is via OpenRouter, which gives you access to Grok 3 and Grok 3 Mini without needing a separate xAI account. Just add OpenRouter credits and set your model ID to openrouter/xai/grok-3.
Does Grok really have real-time information?
Grok has access to real-time data from X (Twitter) and can discuss current events more accurately than models with a fixed training cutoff. However, it is not a live web search tool — for full web browsing, pair it with OpenClaw's web search skill.
Which Grok model should I use?
Grok 3 Mini is the best starting point for most bots — it is extremely fast, very affordable, and capable enough for everyday chat and Q&A. Upgrade to Grok 3 if you need stronger reasoning, longer outputs, or more nuanced responses.
Can I switch from Grok to another model without redeploying?
Yes. OpenClaw supports live model switching. Type /model in your chat to see available models and switch on the fly — no restart or redeployment required.