Connect Hermes Agent to TokenCode through the Anthropic Messages protocol.
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
source ~/.zshrc
hermes --version
Windows users should install and run Hermes Agent in WSL2.
npm install -g @tokencode/tokencode
tokencode
Select Hermes Agent in the wizard, or run:
npx @tokencode/tokencode hm -k sk-your-api-key -m claude-sonnet-4-6
hermes config set model.provider custom
hermes config set model.base_url https://tokencode.dev
hermes config set model.api_mode anthropic_messages
hermes config set model.api_key sk-your-api-key
hermes config set model.default claude-sonnet-4-6
The equivalent ~/.hermes/config.yaml settings are:
model:
default: claude-sonnet-4-6
provider: custom
base_url: https://tokencode.dev
api_mode: anthropic_messages
api_key: sk-your-api-key
hermes chat -q "Hello, confirm the connection in one sentence."
hermes chat -m gpt-5.5 -q "Explain the structure of this project."
If Hermes still connects to OpenRouter, set model.provider to custom again and check for an older value in ~/.hermes/config.yaml. In anthropic_messages mode, use https://tokencode.dev without /v1.