← Home

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 30 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 4.6, released on 12 August 2026, is the current flagship — xAI describes it as the most intelligent and fastest model it has built, with a 500K context window and pricing of $2 / $6 per 1M tokens. It sits above Grok 4.5 and the 1M-context Grok 4.3 line, with Grok 4.1 Fast underneath for high-volume chat. All of them are available via the xAI API directly or through OpenRouter, which lets you access Grok alongside Claude, GPT, Gemini, and DeepSeek 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: speed is the Grok line's signature — 4.6 is marketed as xAI's fastest flagship, and Grok 4.1 Fast delivers very low-latency responses for chat bots where every second shows.
  • 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

ModelSpeedX search availablePricing (input/output)Strengths
Grok 4.6Very fastYes$2 / $6 per 1M tokensFlagship: long agent runs, coding, STEM
Grok 4.5FastYes$2 / $6 per 1M tokensPrevious flagship, same price class
Grok 4.3FastYes$1.25 / $2.50 per 1M tokens1M context at half the flagship price
Grok 4.1 FastVery fastYes$0.20 / $0.50 per 1M tokensHigh-volume chat, cheap tool loops
Claude Sonnet 4.6FastNo$3 / $15 per 1M tokensWriting, nuanced conversation, safety
DeepSeek V4 ProSlowerNo$0.44 / $0.87 per 1M tokensCheapest strong agent model

Grok stands out for its real-time awareness — ideal when your bot needs to discuss current events, trending topics, or X/Twitter content. That access is a search tool rather than something baked into the weights: xAI exposes it as x_search, and on OpenClaw Launch you turn it on by picking Grok as the search provider in your instance settings. A Grok model with no search enabled answers from training data like any other model. Since 4.6 it also competes on raw agent capability: xAI reports 69.9 on CursorBench, 65.9 on DeepSWE and 57.5 on APEX-Agents, and a tie with GPT-5.6 Sol on the Artificial Analysis Intelligence Index, though it trails on Terminal-Bench. For writing-heavy or safety-sensitive tasks, Claude remains the top choice. xAI prices both input and output at double the headline rate once a prompt passes 200K tokens, which matters if you run long agent transcripts.

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:

  1. Go to openclawlaunch.com and open the configurator.
  2. Navigate to the Models page and select Grok 4.6 for the flagship, or Grok 4.1 Fast if you are optimising for cost.
  3. 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

  1. Go to openrouter.ai/keys and sign in.
  2. Click Create Key and copy your key.
  3. Add credits to your OpenRouter account — Grok 4.1 Fast is very affordable at $0.20 / $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/x-ai/grok-4.6"
      }
    }
  }
}

To use the cheaper model instead, set "primary": "openrouter/x-ai/grok-4.1-fast". A direct xAI key uses the xai/ prefix instead — but note that OpenClaw builds released before Grok 4.6 resolve xai/grok-4.6 through forward-compat and treat it as text-only, so route 4.6 through OpenRouter if you need image input. On OpenClaw Launch, saving an xAI key selects xai/grok-4.3 for that reason.

Model ID format: Always prefix the provider name when using OpenRouter — use openrouter/x-ai/grok-4.6, not just x-ai/grok-4.6. Note the hyphen: OpenRouter namespaces xAI as x-ai, while a direct xAI key uses xai/ (for example xai/grok-4.3).

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 4.1 Fast 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?

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 the whole Grok 4 line without needing a separate xAI account. Just add OpenRouter credits and set your model ID to openrouter/x-ai/grok-4.6.

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 4.6 is the pick when the bot has real work to do — long agent runs, coding, research. Grok 4.3 costs about half as much and carries a 1M context window, so it is the better fit for long documents on a budget. Grok 4.1 Fast is the cheap option for everyday chat and Q&A.

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.

Deploy a Grok-Powered Bot

Get a Grok AI agent running on Telegram or Discord in under 30 seconds.

Deploy Now