← Home

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 IDBest ForNotes
x-ai/grok-4.20Complex reasoning, research, demanding agent tasksCurrent xAI flagship
x-ai/grok-4.1-fastFast responses, real-time chat, lower latencySpeed-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.

  1. Go to openclawlaunch.com/hermes-hosting and start a Hermes deploy.
  2. Select Grok 4.20 or Grok 4.1 Fast from the model dropdown.
  3. Connect your channel and click Deploy. Your Grok-powered Hermes Agent is live in roughly 10 seconds.
Tip: switch between Grok 4.20 and Grok 4.1 Fast at runtime with the /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.20

Get 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.20

Grok vs Claude vs GPT for Hermes

ModelReasoning DepthReal-Time KnowledgeWriting StyleCost
Grok 4.20ExcellentStrong (X data access)Direct, wittyModerate
Claude Sonnet 4.6ExcellentTraining cutoff onlyNuanced, careful~$3/M
GPT-5.5ExcellentTraining cutoff onlyClear, versatileHigher

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-fast

What's Next?

Deploy Hermes with Grok

Get a Grok-powered Hermes Agent running in 10 seconds on OpenClaw Launch.

Deploy Hermes