Hermes with AI Gateway
Hermes is Nous Research's terminal-based coding agent. It ships an AI Gateway provider, so you can reach every model in the gateway catalog from Hermes with one API key and track spend in one place.
Run the Vercel CLI setup command for Hermes:
npx vercel ai-gateway setup --agent hermesThe command provisions a key, adds a vercel-ai-gateway provider to ~/.hermes/config.yaml with model discovery turned on, and exports AI_GATEWAY_API_KEY from a managed block in your shell startup file. Switch models in-session with /model custom:vercel-ai-gateway:<model-id>.
If you can't use the Vercel CLI, configure Hermes manually:
Go to the AI Gateway section in the Vercel dashboard sidebar and click API keys to create a new API key.
Hermes reads
AI_GATEWAY_API_KEYfrom your environment and from~/.hermes/.env. Export it in your shell:Terminalexport AI_GATEWAY_API_KEY="your-ai-gateway-api-key"To persist the key across sessions, add the same line to
~/.hermes/.envinstead.Run the model picker:
Terminalhermes modelChoose Vercel AI Gateway, then pick a model. Hermes fetches the live catalog with current pricing from the gateway, filtered to language models that support tool calling. Image, video, embedding, and reranking models from the models page don't appear in the picker.
You can also skip the picker and name the provider and model directly:
Terminalhermes --provider ai-gateway -m openai/gpt-6-astraThe provider ID is
ai-gateway. Hermes also acceptsvercelandvercel-ai-gatewayas aliases. Model IDs use the gateway'screator/model-nameformat.
Hermes supports ai-gateway in fallback chains. Add it to fallback_model in ~/.hermes/config.yaml, or run hermes fallback to configure it interactively. When a fallback activates, Hermes swaps the model and provider mid-session without losing your conversation.
View your usage, spend, and request activity in the AI Gateway section in the Vercel dashboard sidebar. See the observability documentation for more details.
Hermes identifies itself to the gateway, so its requests are attributable in your analytics.
| Variable | Description |
|---|---|
AI_GATEWAY_API_KEY | Your AI Gateway API key. Required |
AI_GATEWAY_BASE_URL | Overrides the gateway base URL. Hermes defaults to the gateway's bare /v1 surface. Set it to https://ai-gateway.vercel.sh/coding-agent/v1, the coding agent surface, to identify the traffic as coming from a coding agent |
- Browse the models catalog for available models
- Learn about model routing and fallbacks
- Configure spend limits on your API key
Was this helpful?