Hermes Agent

Connect Hermes Agent through a custom endpoint.

Hermes Agent is an open-source command-line assistant from Nous Research. Connect it to this site as a custom endpoint.

  • Protocol: OpenAI-compatible (Chat Completions)
  • Base URL: https://tokenfunc.com/v1
  • Models: models with 64K+ context, for example claude-sonnet-4-5
  1. Install Hermes

    macOS / Linux

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

    Windows

    iex (irm https://hermes-agent.nousresearch.com/install.ps1)
  2. Run the setup wizard

    hermes model

    Choose Custom endpoint and answer the prompts:

    PromptValue
    Base URLhttps://tokenfunc.com/v1
    API keysk-xxxxxxxxxxxxxxxx
    Modelclaude-sonnet-4-5
    API modechat_completions
    Context lengthThe model's context length, for example 200000

    Hermes requires at least 64K of context. This site does not report context length, so enter it yourself.

    Screenshot pendingThe Custom endpoint screen of the hermes model wizardtools/hermes-wizard.png

  3. Verify

    hermes chat -q "reply ok" --oneshot

    A reply means you are connected. hermes doctor also checks the configuration.

Configuring with a file

Instead of the wizard you can edit the config file and keep the key in a .env file next to it:

macOS / Linux

~/.hermes/config.yaml
model:
  default: claude-sonnet-4-5
  provider: custom
  base_url: https://tokenfunc.com/v1
  key_env: TOKENFUNC_API_KEY
~/.hermes/.env
TOKENFUNC_API_KEY=sk-xxxxxxxxxxxxxxxx

Windows

%LOCALAPPDATA%\hermes\config.yaml
model:
  default: claude-sonnet-4-5
  provider: custom
  base_url: https://tokenfunc.com/v1
  key_env: TOKENFUNC_API_KEY
%LOCALAPPDATA%\hermes.env
TOKENFUNC_API_KEY=sk-xxxxxxxxxxxxxxxx

Switching models

In a session type /model custom:<model name>, for example /model custom:claude-sonnet-4-5. To add another endpoint, leave the session and run hermes model again.

Troubleshooting

SymptomCause and fix
OPENAI_BASE_URL is set but ignoredIt now only applies to the official OpenAI provider. Use the wizard or config.yaml
Not enough context at startupThe model has less than 64K context. Pick a longer-context model or enter the right length in the wizard
Connects but replies are garbled or failWrong address or model name. Make sure the address ends with /v1 and the name matches the Model Square
401Wrong key or no quota left. Check it on API Keys