Skip to main content
Use CometAPI as the model provider for Hermes Agent. Hermes supports two CometAPI paths in this guide: a general OpenAI-compatible endpoint for most text models and a Claude route through Anthropic Messages.

Prerequisites

  • Git
  • A CometAPI account with an active API key
  • A terminal on macOS, Linux, or WSL2

Installation

1

Get your CometAPI API key

Log in to the CometAPI console. Click Add API Key and copy your CometAPI API key.
CometAPI dashboard showing the Add API Key button
CometAPI API key details with the base URL shown
2

Install Hermes Agent

The following command runs the official installer:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
If the current shell does not see the hermes command yet, reload the shell configuration:
source ~/.zshrc
# or
source ~/.bashrc
Hermes stores config in ~/.hermes/, links the hermes command in ~/.local/bin, and may add ~/.local/bin to your shell PATH.

Configuration

Choose the CometAPI route that matches the model family:
Model familyHermes configurationCometAPI route
OpenAI-compatible text modelsmodel.provider: custom with base_url: https://api.cometapi.com/v1/v1/chat/completions
Claude modelsNamed provider with transport: anthropic_messages/v1/messages
Gemini models in HermesUse the OpenAI-compatible configuration/v1/chat/completions
Direct Gemini API callsUse the Gemini generateContent API outside Hermes/v1beta generateContent
Do not configure Hermes with https://api.cometapi.com/v1beta as a custom Gemini-native provider. Use the OpenAI-compatible Hermes configuration for Gemini models. For direct Gemini API calls, use the Gemini generateContent API.
1

Store your CometAPI key

Open ~/.hermes/.env and add the following values:
COMETAPI_KEY=<COMETAPI_KEY>
OPENAI_API_KEY=<COMETAPI_KEY>
COMETAPI_KEY is used by the named Claude provider. OPENAI_API_KEY keeps Hermes’s custom OpenAI-compatible endpoint fallback working.
2

Configure the OpenAI-compatible route

Use this route for most CometAPI text models, including Gemini models used from Hermes. Open ~/.hermes/config.yaml and make sure the model section looks like this:
model:
  provider: custom
  default: your-model-id
  base_url: https://api.cometapi.com/v1
Replace your-model-id with a current text model ID from the CometAPI Models page.
Keep the API key in ~/.hermes/.env. Do not hardcode secrets in config.yaml.
This setup configures the main chat model. Hermes can use separate auxiliary models for tasks such as vision or web extraction.
3

Configure the Claude Messages route

Use this route when you want Hermes to call Claude models through Anthropic Messages. Open ~/.hermes/config.yaml and use a named provider:
model:
  provider: cometapi-claude
  default: your-claude-model-id

providers:
  cometapi-claude:
    base_url: https://api.cometapi.com
    key_env: COMETAPI_KEY
    transport: anthropic_messages
    default_model: your-claude-model-id
Replace your-claude-model-id with a current Claude model ID from the CometAPI Models page.
Keep base_url at https://api.cometapi.com for this route. Hermes uses the Anthropic Messages transport from the named provider.

Verification

1

Check the configuration

The following command confirms that Hermes can read the config and the API key:
hermes config check
If hermes config check reports missing options after an update, run hermes config migrate and check again.
2

Run a real chat test

The following command sends a real request through CometAPI:
hermes chat -Q --ignore-rules --max-turns 1 -q "Reply with CONNECTED only."
A successful setup returns CONNECTED and no auth or endpoint errors. When the Claude Messages configuration is active, this confirms that Hermes can use the anthropic_messages transport through CometAPI.

Optional configuration

If you are replacing an older Hermes install, use the built-in uninstaller first:
hermes uninstall
In the uninstaller, choose Full uninstall to remove the CLI, PATH entry, and ~/.hermes/ data. Then rerun the install step and continue with the same CometAPI configuration.
If you prefer the interactive flow for the OpenAI-compatible route, run hermes model and choose Custom endpoint.Then enter the following values:
  • Base URL: https://api.cometapi.com/v1
  • API key: your CometAPI API key
  • Model: a current CometAPI text model ID
This flow writes the OpenAI-compatible provider settings into config.yaml. For Claude Messages, edit config.yaml directly so the named provider keeps transport: anthropic_messages.