AnRouter

Configure Hermes Agent with AnRouter

Add AnRouter as a custom endpoint through Hermes Desktop or the CLI, then verify it works.

The recommended setup uses hermes model to add a custom endpoint. Current Hermes documentation uses the top-level custom_providers list for named custom endpoints; the manual example below follows that documented schema.

1. Hermes Desktop visual setup

  1. Open model/provider setup during first launch, or reopen it later from the model settings.
  2. Choose Local / custom endpoint, set Endpoint to https://api.anrouter.com/v1, and enter the AnRouter API key.
  3. Use an exact model ID such as glm-5.3. If API mode appears, choose chat_completions.
  4. Save, start a new session, and send a short test message.
Hermes Desktop Local custom endpoint configured with the AnRouter endpoint
The screenshot now shows https://api.anrouter.com/v1 in Endpoint. Enter your own AnRouter key on the next line and never publish a screenshot containing it. Open the image at full size for detail.

2. Install the CLI

# macOS / Linux / WSL2
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

hermes --version
hermes doctor

Windows PowerShell: iex (irm https://hermes-agent.nousresearch.com/install.ps1)

3. CLI recommended: interactive setup

hermes model
ProviderCustom endpoint
API Base URLhttps://api.anrouter.com/v1
API KeyAnRouter API key
Modelglm-5.3
API Modechat_completions
Context lengthLeave blank for endpoint discovery when possible; otherwise use the model catalog

4. Optional: named provider configuration

# ~/.hermes/config.yaml
custom_providers:
  - name: anrouter
    base_url: https://api.anrouter.com/v1
    key_env: ANROUTER_API_KEY
    api_mode: chat_completions

model:
  provider: custom:anrouter
  default: glm-5.3
# ~/.hermes/.env
ANROUTER_API_KEY=your_anrouter_api_key

5. Verify

  1. Run hermes doctor to check the installation and configuration.
  2. Start hermes and send a short prompt first.
  3. Use /model custom:anrouter:glm-5.3 in a session. Exit and run hermes model to add or change a provider.
Context requirement: Hermes requires at least 64,000 tokens for agent tool workflows. Leave the wizard field blank when endpoint discovery is available; only add context_length manually when it matches the current AnRouter model catalog and actual endpoint behavior.

References: Hermes Desktop · Hermes custom endpoints