Hermes Agent Custom Provider Setup
Hermes Agent by Nous Research reads provider settings from ~/.hermes/config.yaml. Connect its OpenAI-compatible custom provider to WorldRouter to access Claude, GPT, DeepSeek, GLM, Kimi, and 60+ models with one API key.
Coming from OpenRouter? See WorldRouter vs OpenRouter for model prices and differences. Need credits? Top up with card, Alipay, WeChat Pay, or stablecoin.
Fastest setup (choose one path)
If Hermes is already installed, use either path below. Otherwise, start with Prerequisites.
Option A: Interactive wizard (hermes model)
Run the built-in provider picker and select Custom endpoint:
hermes modelEnter these values when prompted:
- Base URL:
https://inference-api.worldrouter.ai/v1 - API key: your key from the API Keys dashboard.
- Model name: an exact ID from the Models page, such as
claude-opus-4-6orgpt-5.4.
Hermes saves the selection in ~/.hermes/config.yaml. Named providers in current releases use the providers: format shown below; older releases may save a legacy custom-provider entry.
Option B: Edit ~/.hermes/config.yaml directly
Add a named provider and make it the active model.provider. If the file already has providers: or model: sections, merge these settings into them instead of replacing the whole file:
providers:
worldrouter:
base_url: https://inference-api.worldrouter.ai/v1
key_env: WORLDROUTER_API_KEY
transport: chat_completions
models:
claude-opus-4-6: {}
claude-sonnet-4-6: {}
claude-haiku-4-5: {}
gpt-5.4: {}
deepseek-v4-pro: {}
gemini-3.8-flash: {}
model:
default: claude-opus-4-6
provider: custom:worldrouterExport the key in the shell that launches Hermes:
export WORLDROUTER_API_KEY="your_api_key"Then run a one-shot verification:
hermes -z "Reply with 'ok' if you can see this."Prerequisites
- Hermes Agent installed. Follow the Hermes installation guide and verify with
hermes --version. - WorldRouter API key. Create one on the API Keys dashboard. The key is shown once.
- Available credits. Check the Credits page or follow the top-up guide.
Detailed config.yaml setup
1. Open your Hermes config file
Hermes reads settings from:
- macOS / Linux:
~/.hermes/config.yaml - Windows:
%USERPROFILE%\.hermes\config.yaml
For first-time setup, run hermes setup or hermes model to create the file. For an existing installation, preserve unrelated settings and add the WorldRouter provider to the existing provider map.
2. Understand the provider fields
providers.worldrouternames the provider. Theworldrouterkey is referenced bymodel.provider: custom:worldrouter.base_urlishttps://inference-api.worldrouter.ai/v1. Keep the/v1suffix for the chat-completions endpoint. Current Hermes also acceptsapias the endpoint field.key_envnames the environment variable containing the key, without a$prefix. To store a key inline instead, useapi_key: your_api_keyand omitkey_env.transport: chat_completionsselects the OpenAI chat-completions format.modelslists exact, case-sensitive WorldRouter model IDs. Empty{}values use the defaults; per-model settings such ascontext_lengthcan override them.model.defaultselects the default model;model.providerselects the named provider.
Existing custom_providers configurations
Hermes still reads the older custom_providers: list. In that format, an entry has name: worldrouter and uses api_mode: chat_completions. Current releases use a providers: map with transport: chat_completions; hermes update can migrate the legacy format. Keep one WorldRouter entry rather than defining it in both formats.
See the Hermes Custom Providers reference for the supported fields and migration details.
3. Persist your API key
For zsh or bash, add the export to ~/.zshrc or ~/.bashrc and reload the matching profile:
export WORLDROUTER_API_KEY="your_api_key"
source ~/.zshrc # or: source ~/.bashrcFor fish, use its environment-variable syntax:
set -gx WORLDROUTER_API_KEY "your_api_key"Alternatively, add WORLDROUTER_API_KEY=your_api_key to ~/.hermes/.env so Hermes loads it without changing your shell profile. Skip this step if you configured an inline api_key.
4. Verify traffic reaches WorldRouter
Run hermes -z "Reply with 'ok' if you can see this.", or start hermes chat and send a short prompt. Use -z for a one-shot prompt; a bare hermes "<prompt>" is not the same command.
Check the resolved provider with hermes doctor, then inspect the request on the Activity dashboard. Usage records can appear after the response; a missing entry by itself does not establish which provider served the call.
Switch or change provider in Hermes
To switch from OpenRouter, Anthropic, or another provider, run hermes model and select the provider and model you want.
For a manual change, update the top-level model: block and restart the Hermes session:
model:
default: gpt-5.4
provider: custom:worldrouterThe suffix in custom:worldrouter must match the configured provider name. Select an exact model ID from the Models page and include it in the provider’s models: map when maintaining that list manually.
How it works
With this configuration, Hermes sends OpenAI-compatible chat-completions requests to https://inference-api.worldrouter.ai/v1/chat/completions using your WorldRouter key. WorldRouter routes the request to the selected model and records its usage against your account.
Model compatibility notes
- Model families. Change
model.defaultto switch between configured WorldRouter model IDs. The endpoint and key stay the same. - Provider-specific features. Tool use, reasoning parameters, and service tiers depend on the selected model and route. Check the model details before relying on provider-specific behavior.
- Fallbacks. Hermes supports fallback provider configurations. If you configure one, inspect provider resolution and usage when verifying which route handled a request. See the Hermes fallback guide .
Troubleshooting
401 Unauthorized: Confirm thatWORLDROUTER_API_KEYis set in the shell that launches Hermes or in~/.hermes/.env. Check for missing values or whitespace without printing the full key.404 Not Foundormodel not found: Confirm thatbase_urlishttps://inference-api.worldrouter.ai/v1and that the model ID exactly matches the Models page.- Hermes still selects the previous provider: Restart the session after editing
config.yaml, then runhermes doctorto inspect provider resolution. - Expected usage is missing: Check
model.provider,base_url, any fallback configuration, and the Activity dashboard. Allow for usage-processing delay before drawing a routing conclusion.
Reference
- WorldRouter vs OpenRouter — price and model comparison.
- Top up credits with card, Alipay, WeChat Pay, or stablecoin — billing and checkout guide.
- WorldRouter Models — model IDs and pricing.
- WorldRouter API reference — compatible API endpoints.
- Hermes Agent documentation — official documentation.
- Hermes Custom Providers reference — provider fields and legacy configuration support.