Guide
Hermes Agent + Grok: Use xAI Grok Models with Hermes
xAI's Grok models — 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.20 is xAI's current flagship; Grok 4.1 Fast is the speed-optimized variant for lower-latency interactions.
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.20 | Complex reasoning, research, demanding agent tasks | Current xAI flagship |
x-ai/grok-4.1-fast | Fast responses, real-time chat, lower latency | Speed-optimized variant |
For most Hermes agent tasks, Grok 4.20 is the recommended pick. Its reasoning depth is competitive with Claude Sonnet and GPT-5.5 on complex multi-step problems. 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.20 and Grok 4.1 Fast 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.20 or Grok 4.1 Fast from the model dropdown.
- Connect your channel and click Deploy. Your Grok-powered Hermes Agent is live in roughly 10 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-...
hermes inference set x-ai
hermes model set grok-4.20
# config.yaml equivalent:
# inference:
# provider: x-ai
# model:
# default: grok-4.20Get 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-...
hermes inference set openrouter
hermes model set x-ai/grok-4.20Grok 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.5 | 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.1-fastWhat's Next?
- Hermes Agent + GPT-5.5 — 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