Guide
Hermes Agent + Grok: Use xAI Grok Models with Hermes
xAI's Grok models — Grok 4.6, Grok 4.20 and Grok 4.1 Fast — bring strong reasoning and real-time knowledge to Hermes Agent. Grok is built by Elon Musk's xAI team with a focus on wit, directness, and cutting-edge model capability.
What Is xAI Grok?
xAI is an AI lab founded by Elon Musk and a team of researchers focused on building advanced AI systems. Their Grok model family is known for strong reasoning capability, a direct communication style, and integration with X (Twitter) data for real-time knowledge. Grok 4.6, released on 12 August 2026, is xAI's current flagship — a 500K context window and, per xAI, the fastest model it has shipped. Grok 4.20 remains available, and Grok 4.1 Fast is the speed-optimized budget variant.
Hermes Agent supports Grok through its built-in xAI provider, which reads the XAI_API_KEY env var and routes to https://api.x.ai/v1. Grok models are also available via OpenRouter.
Available Grok Models
| Model ID | Best For | Notes |
|---|---|---|
x-ai/grok-4.6 | Long agent runs, coding, research, STEM | Current xAI flagship (12 Aug 2026). 500K context, $2 / $6 per 1M tokens |
x-ai/grok-4.20 | Complex reasoning, research, demanding agent tasks | Older flagship, still available |
x-ai/grok-4.3 | Everyday agents, long documents, cost-sensitive work | Cheapest capable Grok here, 1M-token context |
For most Hermes agent tasks, Grok 4.6 is the recommended pick. xAI reports it matching GPT-5.6 Sol on the Artificial Analysis Intelligence Index and leading on CursorBench, DeepSWE and APEX-Agents, while trailing on Terminal-Bench. Grok 4.1 Fast trades some capability for significantly lower latency, which is useful for high-frequency chat or real-time response scenarios.
Option 1: Hermes Agent on OpenClaw Launch (Easiest)
Grok 4.6, Grok 4.20 and Grok 4.3 are available in the OpenClaw Launch model picker. No xAI account or API key required.
- Go to openclawlaunch.com/hermes-hosting and start a Hermes deploy.
- Select Grok 4.6 for the flagship, or Grok 4.3 if you are optimising for cost, from the model dropdown.
- Connect your channel and click Deploy. Your Grok-powered Hermes Agent is live in roughly 30 seconds.
/model command — useful for comparing quality vs latency on your specific tasks.Option 2: xAI API Direct (Self-Hosted)
Hermes's built-in xAI provider reads XAI_API_KEY and routes to xAI's API:
export XAI_API_KEY=xai-...
# Pick the provider and default model (interactive wizard)
hermes model
# config.yaml equivalent:
# model:
# provider: x-ai
# default: grok-4.6Get your xAI API key from the xAI Console. The API base URL is https://api.x.ai/v1 and the interface is OpenAI-compatible.
Option 3: Grok via OpenRouter (Self-Hosted)
Grok models are available on OpenRouter if you prefer a single key across all providers:
export OPENROUTER_API_KEY=sk-or-...
# Pick the provider and default model (interactive wizard)
hermes modelGrok vs Claude vs GPT for Hermes
| Model | Reasoning Depth | Real-Time Knowledge | Writing Style | Cost |
|---|---|---|---|---|
| Grok 4.20 | Excellent | Strong (X data access) | Direct, witty | Moderate |
| Claude Sonnet 4.6 | Excellent | Training cutoff only | Nuanced, careful | ~$3/M |
| GPT-5.6 Terra | Excellent | Training cutoff only | Clear, versatile | Higher |
Grok's differentiator is its connection to X (Twitter) data for more current information and its direct communication style. If your Hermes agent needs to discuss recent events or trending topics, Grok's real-time knowledge is a meaningful advantage over Claude and GPT.
Switching to Grok at Runtime
/model x-ai/grok-4.20
/model x-ai/grok-4.3What's Next?
- Hermes Agent + GPT-5.6 — Compare Grok 4.20 with OpenAI's flagship model
- Hermes Agent + Claude — Claude Opus and Sonnet as alternatives to Grok for Hermes
- Hermes Agent + OpenRouter — Access Grok, Claude, GPT, and 200+ models with one key
- Hermes Agent + MCP — Extend your Grok-powered agent with MCP tool servers