Hermes
Use Router9 as a custom provider in Hermes
Hermes is an autonomous AI agent from Nous Research that lives on your server. It speaks the OpenAI API format, so you can point it at Router9 as a custom endpoint — no code changes required.
Setup (recommended: CLI)
Run the interactive model picker from your terminal — not from inside an active Hermes chat session:
hermes modelSelect Custom endpoint (self-hosted / VLLM / etc.), then enter:
| Prompt | Value |
|---|---|
| API base URL | https://api.router9.com/v1 |
| API key | sk-r9k-your-key-here |
| Model name | a model id from GET /v1/models (see Choosing Models) |
Hermes writes the endpoint to config.yaml and stores the key in
~/.hermes/.env, so the setting persists across sessions.
To script it instead of answering prompts, set the same keys directly:
hermes config set model.provider custom
hermes config set model.base_url https://api.router9.com/v1
hermes config set model.default anthropic/claude-opus-5 # any id from GET /v1/modelsVerify with hermes config show, then start a session:
hermes chatYou can also override the provider and model for a single run:
hermes chat --provider custom --model anthropic/claude-opus-5Setup (manual: config.yaml)
Hermes keeps its model configuration in ~/.hermes/config.yaml (hermes config path
prints the exact location; hermes config edit opens it). Add a custom
OpenAI-compatible endpoint under the model: block:
model:
provider: custom
default: auto
base_url: https://api.router9.com/v1
api_key: sk-r9k-your-key-here
api_mode: chat_completions
context_length: 1000000 # optional
max_tokens: 8192 # optional output capWhen base_url is set, Hermes ignores the provider's built-in endpoint and calls
that URL directly. api_mode is chat_completions for Router9's
OpenAI-compatible API (Hermes auto-detects it if you omit the key).
Named custom provider
If you point Hermes at more than one endpoint, register Router9 in
custom_providers and keep the key in an environment variable instead of the
config file:
custom_providers:
- name: router9
base_url: https://api.router9.com/v1
key_env: ROUTER9_API_KEY
api_mode: chat_completionsexport ROUTER9_API_KEY=sk-r9k-your-key-hereThen switch to it mid-session with the /model slash command:
/model custom:router9:anthropic/claude-opus-5API Key
Router9 authenticates with your sk-r9k- key. Supply it one of three ways:
hermes model/hermes config set model.api_key ...— Hermes routes secrets to~/.hermes/.envapi_key:in themodel:block ofconfig.yamlkey_env:on a named custom provider, with the value exported in your shell or~/.hermes/.env
Set the key explicitly rather than relying on
OPENAI_API_KEY. Hermes may fall back to it for custom endpoints, but that variable also drives Hermes' OpenAI STT/TTS integration — sharing it conflates two unrelated credentials.
Choosing Models
model.default (and --model / /model) take the model id Router9 routes on.
Use the exact ids from GET /v1/models — Router9 ids are provider-prefixed
slugs, so short names like gpt-4o return 404 model_not_found:
curl https://api.router9.com/v1/models \
-H "Authorization: Bearer sk-r9k-your-key-here"A typical hosted catalog looks like:
| Provider | Example Models |
|---|---|
| Anthropic | anthropic/claude-opus-5 |
| OpenAI | openai/gpt-5.6-luna |
| DeepSeek | deepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash |
| Others (via OpenRouter) | moonshotai/kimi-k3, z-ai/glm-5.2, minimax/minimax-m3 |
The exact set depends on your deployment — see Models.
Letting Router9 pick
If your deployment has an auto route configured, set the model to auto and
Router9 selects a model for you:
hermes config set model.default auto
autois not a built-in alias. When noautoroute exists it returns404 model_not_found— checkGET /v1/modelsfirst.
MCP Setup
Hermes can use Router9's Skills as tools via Router9's hosted
MCP server. Add it with the CLI — Hermes prompts for the Authorization header
value, where you enter Bearer sk-r9k-your-key-here:
hermes mcp add router9 --url https://api.router9.com/v1/mcp --auth headerCheck the connection with hermes mcp list and hermes mcp test router9. See
Install MCP Server.
Skills (optional): Router9 also offers image and audio Skills as agent tools. MCP is the recommended way to expose them where your harness supports it; otherwise call them directly as REST endpoints (
/v1/image/*,/v1/audio/*,/v1/search/) with yoursk-r9k-key — see the API Reference.
Tips
- Router9's flat monthly pricing pairs well with long-running agent sessions — no per-token cost surprises.
- Hermes can expose itself as an OpenAI-compatible API server, so Router9 also backs any frontend you connect to Hermes (Open WebUI, LibreChat, and others).
- Keep your key in
~/.hermes/.env(or akey_envvariable) rather than committing it toconfig.yaml. hermes config checkflags missing or stale model configuration after an upgrade.