xAI (Grok) with OpenClaw

Configure xAI Grok models — API key

xAI (Grok) models are supported in OpenClaw. Grok emphasizes real-time knowledge and research-oriented use cases. Configure via API key from the xAI console. Model IDs and availability may change—check OpenClaw docs and x.ai for current options.

Authentication

Create an API key at console.x.ai (or xAI's developer portal). Store in ~/.openclaw/credentials or via openclaw secrets. OAuth is not typically used for xAI with OpenClaw.

Basic Configuration

Minimal config
{
  "agent": {
    "model": "xai/grok-2"
  }
}

Model IDs depend on xAI's current catalog. See Configuration guide and OpenClaw provider docs for the latest.

Why xAI Grok for OpenClaw

  • Real-time — Grok has access to live data; good for current-events and research
  • Research-focused — Designed for deep research and long-context tasks
  • Alternative — Diversify from Claude/GPT; useful for failover or A/B testing

Related