Skip to content

Hermes Agent

Hermes Agent (by Nous Research) is a personal AI agent that runs across a CLI, a TUI, a desktop app, and ~20 messaging platforms (Telegram, Discord, Slack, …). It supports any OpenAI-compatible endpoint through custom providers, so it works with rout.my out of the box.

Quick setup (interactive)

The easiest path is the built-in wizard:

bash
hermes model

Pick "Custom endpoint" and enter:

FieldValue
Base URLhttps://api.rout.my/v1
API keyyour sk_... key from the dashboard
Modelany ID from /v1/models, e.g. anthropic/claude-fable-5

Hermes saves the endpoint to ~/.hermes/config.yaml and it survives restarts.

Manual config

Alternatively, edit ~/.hermes/config.yaml directly:

yaml
model:
  default: anthropic/claude-fable-5
  provider: custom:rout.my
  base_url: https://api.rout.my/v1

custom_providers:
  - name: rout.my
    base_url: https://api.rout.my/v1
    api_key: sk_YOUR_KEY_HERE
    model: anthropic/claude-fable-5
    prompt_caching: true        # see the warning below — do not skip this
    models:
      anthropic/claude-fable-5:
        context_length: 200000
      openai/gpt-5.5:
        context_length: 128000

Start a session:

bash
hermes chat

IMPORTANT — enable prompt caching (saves ~75% on input tokens)

By default Hermes only sends Anthropic cache_control breakpoints to providers it knows about (OpenRouter, Nous Portal, native Anthropic). For a custom endpoint it sends none — and without explicit breakpoints from the client, our smart-cache system has to guess where to anchor the cache, which is significantly less efficient for agent workloads with huge tool outputs.

rout.my fully supports Anthropic-style cache_control markers on the OpenAI wire for Claude models, honors them verbatim (client markers always take priority over our automatic system), and bills cache reads at 0.1×.

How to enable it — pick one:

  1. Config flag (if your Hermes build supports it): add prompt_caching: true to the rout.my entry under custom_providers, as in the example above. Verify after starting a session — the usage line should show cached_tokens growing turn over turn.

  2. Ask the agent to wire it up itself. Hermes can patch its own provider policy. Paste this into a Hermes session:

    Enable Anthropic prompt caching for my custom provider rout.my (base_url https://api.rout.my/v1). Find anthropic_prompt_cache_policy in agent/agent_runtime_helpers.py and make it return (True, False) (envelope cache_control layout, same as the OpenRouter path) when the active provider is this custom endpoint and the model name contains "claude". The endpoint accepts Anthropic-style cache_control breakpoints on the OpenAI-compatible wire and serves real cache hits. After the change, verify that responses report non-zero cached_tokens in usage on the second turn of a conversation.

Either way, you can confirm it works in the dashboard: open your request log and check the cache_read column — after the first couple of turns it should track your context size, not stay flat.

Which models to use

Everything from /v1/models works. Recommended for agent workloads:

RoleModelWhy
Primaryanthropic/claude-fable-5strongest tool-calling, 200K context, prompt caching
Budgetz-ai/glm-5.2cheap, fast, good tool use
Long contextgoogle/gemini-3.1-pro-preview1M context

Test the key

bash
curl https://api.rout.my/v1/chat/completions \
  -H "Authorization: Bearer sk_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-fable-5",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'

Notes

  • Hermes keeps the conversation prefix byte-stable specifically so prompt caching works — pair that with prompt_caching: true and long agent sessions get dramatically cheaper.
  • Set context_length per model in the models: map (as in the example) so Hermes' context compressor uses the right window instead of a conservative default.
  • Prompt caching applies to anthropic/* models. For other model families rout.my applies its own smart caching automatically where the upstream supports it (DeepSeek, Qwen, Gemini implicit caching) — no client action needed.

API documentation for rout.my.