Agents & CLIsGuide reviewed 2026-10-05

Hermes Agent

Add RouterPlex as a named custom provider in Nous Research's Hermes Agent.

Follow updates Share setup
On this page

Set it up with your coding agent #

Paste your key into the prompt's key field, then copy the prompt into Claude Code, Codex, Cursor, or any coding agent. It configures the tool and keeps testing until a real request goes through RouterPlex, fixing environment problems along the way. Prefer to do it by hand? Follow the manual setup below; your key fills those commands too.

prompt

Optional. It stays in this browser tab and is never saved or sent. No key yet? Create one in guided setup.

Set up Hermes Agent on this machine to use RouterPlex, an OpenAI- and Anthropic-compatible AI gateway. Keep working until a real request from Hermes Agent succeeds through RouterPlex.
 
My RouterPlex API key: YOUR_ROUTERPLEX_API_KEY
 
Key handling:
- If the key line above is a placeholder rather than a real key (real keys start with sk-), use my ROUTERPLEX_API_KEY environment variable. If that is empty too, ask me for the key once, then continue.
- Store the key only in user-level config or my user environment. Never put it in a project file, never commit it, and do not repeat the full key in your replies (show at most its first 8 characters).
 
Config handling:
- Before changing an existing config file or shell startup file, copy it to a .bak file next to it and show me the diff. Merge into what is there; never replace my other settings, providers, or MCP servers.
- If a step needs something only I can do, such as a click in a settings window, print the exact steps instead of guessing.
 
Full guide: https://docs.routerplex.com/hermes
 
Step 1. Prove the key and the RouterPlex gateway work before changing anything else. Run:
curl -sS https://api.routerplex.com/v1/chat/completions -H "Authorization: Bearer YOUR_ROUTERPLEX_API_KEY" -H "Content-Type: application/json" -d '{"model":"claude-sonnet-4-6","max_tokens":32,"messages":[{"role":"user","content":"Reply with exactly: RouterPlex connected."}]}'
On Windows PowerShell, use curl.exe with the body in a file, or Invoke-RestMethod.
- A reply containing "RouterPlex connected.": go on.
- 401: the key is wrong or revoked. Stop and ask me for a correct key.
- 402: my balance or trial credit is used up. 403: this key reached its own spending limit. Stop and tell me; retrying cannot fix these.
- Network, DNS, TLS, or proxy errors: find and fix the cause (proxy variables, VPN, firewall, system clock, outdated CA certificates), then run it again.
 
Step 2. Configure Hermes Agent:
- Run hermes --version. If Hermes is missing, install it with curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash (on Windows, inside WSL).
- Merge this into ~/.hermes/config.yaml (or $HERMES_HOME/config.yaml if HERMES_HOME is set), keeping my other providers and settings. Set context_length from the model's context_tokens in https://routerplex.com/api/models:
providers:
routerplex:
name: RouterPlex
api: https://api.routerplex.com/v1
key_env: ROUTERPLEX_API_KEY
transport: chat_completions
models:
claude-sonnet-4-6:
context_length: 1000000
model:
provider: custom:routerplex
default: claude-sonnet-4-6
- Put ROUTERPLEX_API_KEY=<key> in ~/.hermes/.env (update an existing line instead of adding a second one) and chmod 600 it. Hermes reads secrets from that file, not from shell startup files.
 
Step 3. Test Hermes Agent itself from a new terminal or a restarted app, so you test the saved setup rather than the shell you changed:
From an empty temporary folder: hermes -z "Reply with exactly: RouterPlex connected. Do not read files or run tools."
Expected reply: "RouterPlex connected."
 
Step 4. If step 1 works but step 3 fails, the problem is Hermes Agent's configuration or environment, not RouterPlex. Check these, fix what is wrong, and repeat step 3:
- The key or base URL is set in one place but not where Hermes Agent starts: zsh vs bash startup files, login vs non-login shells, a desktop launcher, a background service, Windows vs WSL, or a remote SSH or container environment.
- Another setting wins: OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_API_BASE, ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, or a project-level config that overrides the user-level one.
- Hermes Agent is outdated, or still needs a full restart to read the new settings.
- If an environment variable cannot be made to reach Hermes Agent reliably and Hermes Agent accepts a key in its user-level config, put the key there instead.
 
Keep repeating steps 3 and 4 until the test reply comes back.
 
Step 5. The test above sends no tools, but real sessions send every tool, MCP server, and plugin schema with each request, and that is where models differ. From a folder with a README.md (create a temporary one containing "# RouterPlex tool check" if needed), run:
hermes -z "List your available tools, then read ./README.md and reply with its first heading."
It passes when the reply lists the tools and quotes the heading. If it fails while step 3 passes, the tool schemas are the problem, not the connection. Tell me the exact error; the chosen model may not handle Hermes Agent's tools, so suggest another tool-capable model from https://routerplex.com/models.
 
Stop early only for a 401, 402, or 403, or for a step only I can do, such as a click in a settings window or a login. Then tell me exactly what to do, wait for me, and continue testing afterwards.
 
When it works, tell me exactly which files you changed and which values you set (key shown by its first 8 characters only) so I can undo it, where the key is stored, and the final test output. Remind me that every request shows up in https://routerplex.com/dashboard/usage.

Manual setup #

Use RouterPlex as a named custom provider in Hermes Agent from Nous Research. Hermes speaks Chat Completions to RouterPlex and reads the key from its own .env file.

1. Install #

macOS, Linux, and WSL:

bash
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

Reopen your terminal and run hermes --version. On Windows, install and run Hermes inside WSL.

2. Add the provider #

Merge this into ~/.hermes/config.yaml, keeping your other providers and settings. If you set HERMES_HOME, edit config.yaml in that folder instead.

yaml
providers:
routerplex:
name: RouterPlex
api: https://api.routerplex.com/v1
key_env: ROUTERPLEX_API_KEY
transport: chat_completions
models:
claude-sonnet-4-6:
context_length: 1000000
model:
provider: custom:routerplex
default: claude-sonnet-4-6

Set context_length from the model's context_tokens in the public catalog. Hermes uses it to decide when to compress history. Add one entry under models for each model you use.

3. Save the key #

Add this line to ~/.hermes/.env, the file Hermes reads secrets from, and restrict it to your user:

bash
echo "ROUTERPLEX_API_KEY=YOUR_ROUTERPLEX_API_KEY" >> ~/.hermes/.env
chmod 600 ~/.hermes/.env

Replace the placeholder with your key. Update an existing ROUTERPLEX_API_KEY line instead of adding a second one.

4. Test #

Run a one-shot request from an empty folder:

bash
hermes -z "Reply with exactly: RouterPlex connected. Do not read files or run tools."

Then check tools from a folder that has a README.md:

bash
hermes -z "List your available tools, then read ./README.md and reply with its first heading."

Confirm both requests in Usage. In a session, /model custom:routerplex:<model-id> switches to another RouterPlex model.

To test without touching your real ~/.hermes (config, sessions, memories), point HERMES_HOME at a temporary folder holding only the config and .env above, and run the same commands with HERMES_HOME=<that folder> in front.

Troubleshooting #

  • 401 or "key_env is set but the variable is empty": the key is missing from ~/.hermes/.env (or the .env of your HERMES_HOME).
  • Model not found: the model ID must match the catalog exactly, with no provider prefix.
  • Session titles fall back to a default: Hermes' title request sets its own sampling values, which some models ignore or reject. The session itself is unaffected.

Official references: providers and custom endpoints, configuration, CLI commands.

Hermes Agent · RouterPlex Docs