MegaBrain University · guide

How to Use Hermes Agent with Claude, GPT-6 and 100+ Models on One API Key

Updated · 10 min setup

Short answer

To use Hermes Agent with MegaBrain, run hermes model, choose Custom endpoint, and enter the base URL https://getmegabrain.com/api/gateway/v1, your MegaBrain API key and a model ID such as anthropic/claude-sonnet-5.5. Hermes then runs every chat, tool call, cron job and messaging-app conversation through that model, and you can switch to GPT-6, Gemini, Kimi or GLM by changing one line.

Connection settings
Base URL (OpenAI-compatible)https://getmegabrain.com/api/gateway/v1
Base URL for Claude Code and the Anthropic SDKhttps://getmegabrain.com/api/anthropic
KeyAuthorization: Bearer <key> — the API key page in your dashboard
Default modelanthropic/claude-sonnet-5.5
Free model for testingmb-auto/free

What is Hermes Agent

Hermes Agent is an open-source AI agent by Nous Research. It runs on your machine or a server, uses tools (terminal, files, browser, web search), learns reusable skills from finished tasks, keeps memory between sessions, and talks to you through the terminal or through Telegram, Discord, Slack, WhatsApp, Signal and email.

Hermes does not come with a model. It needs an inference provider, and any OpenAI-compatible endpoint works. MegaBrain is one: a single key and balance for Claude, GPT, Gemini, Grok and open models, so you can give Hermes a frontier model for hard work and a cheap one for routine jobs without juggling vendor accounts.

Setup, step by step

  1. Step 1. Get a MegaBrain API key

    Sign up with GitHub, Google or email, add funds on the Balance page and create a key on the API key page. The key works for every text, image and video model, and each request is paid from your balance — no subscription.

    Put the key in an environment variable so it never lands in a config file you share:

    # ~/.zshrc or ~/.bashrc
    export MEGABRAIN_API_KEY="your-megabrain-key"
    curl https://getmegabrain.com/api/gateway/v1/chat/completions \
      -H "Authorization: Bearer $MEGABRAIN_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"model": "anthropic/claude-sonnet-5.5", "messages": [{"role": "user", "content": "Say OK"}]}'

    Check the key before you touch the agent. A JSON reply with choices means the key, the balance and the model all work:

  2. Step 2. Install Hermes Agent

    On macOS, Linux or WSL2:

    curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
    source ~/.zshrc   # or ~/.bashrc

    On Windows (PowerShell): iex (irm https://hermes-agent.nousresearch.com/install.ps1).

  3. Step 3. Point Hermes at MegaBrain

    Run hermes model and pick Custom endpoint (self-hosted / VLLM / etc.). Enter the base URL, paste your key and type the model ID:

    Base URL:  https://getmegabrain.com/api/gateway/v1
    API key:   your-megabrain-key
    Model:     anthropic/claude-sonnet-5.5

    The wizard writes ~/.hermes/config.yaml. You can also edit it by hand:

    model:
      provider: custom
      base_url: https://getmegabrain.com/api/gateway/v1
      api_key: your-megabrain-key
      default: anthropic/claude-sonnet-5.5

    OPENAI_BASE_URL does not configure a custom endpoint in Hermes — config.yaml is the source of truth. Keep the file private: it holds your key.

  4. Step 4. Start a session and check it

    Run hermes and give it a task that needs a tool, for example “List the files in this folder and summarize what each one does”. If Hermes runs a command and answers, tool calling works. Switch models inside a session with /model custom:openai/gpt-6.1-sol.

  5. Step 5. Connect a messaging app and run it 24/7

    Run hermes gateway setup to connect Telegram, Discord, Slack, WhatsApp, Signal or email, then hermes gateway start. To keep it running after you close the terminal (cron jobs need this), install it as a service with hermes gateway install.

Which model to choose

Hermes needs a model that supports tool calling and a context window of at least 64K tokens. Every model below qualifies. Start with Claude Sonnet 5.5; move routine cron jobs to Gemini Flash or DeepSeek Flash once they work.

Model IDWhen to use it
anthropic/claude-sonnet-5.5The default for an agent: reliable tool calls, holds long tasks, 1M-token context.
anthropic/claude-opus-5.5Hard multi-step work, code review and analysis where a mistake costs more than tokens.
openai/gpt-6.1-solOpenAI's flagship: the alternative to Claude for code and reasoning.
google/gemini-3.8-flashFast and cheap: long documents, spreadsheets, inbox triage.
moonshotai/kimi-k3.1-proA strong open-weight model for agents and code.
z-ai/glm-5.3Open-weight model for code and tools with good price-to-quality.
deepseek/deepseek-v4.1-flashHigh-volume routine work: classification, drafts, summaries.
mb-auto/freeFree, for checking your setup. 128K context, weaker at tool calls; do not send confidential data.

Every model with its price and context window is in the catalog. They all work with the same key.

What you can do

Chat apps as the interface

One Hermes process answers in Telegram, Discord, Slack, WhatsApp, Signal and email, so your team can use the agent without a terminal.

Scheduled jobs

Create cron jobs in plain language (“every Monday at 9am send me…”) or with hermes cron create "every 2h" "…", and deliver the result to a chat.

Skills it writes itself

After a task Hermes can save the procedure as a skill (agentskills.io format) and reuse it next time. See them with /skills.

MCP servers

Add MCP servers under mcp_servers: in config.yaml or with hermes mcp install <name> to give the agent your CRM, database or docs.

Business use cases

Morning business brief in Telegram

A cron job reads yesterday’s numbers (a sheet, a database through MCP, or an export folder), compares them with the week before and sends three bullet points to the founders’ chat every morning.

Task for the agent:

Every weekday at 8:00, read sales.csv in ~/reports, compare yesterday with the same weekday last week, and send me in Telegram: revenue, orders, top 3 products, and anything that changed by more than 20%. Keep it under 10 lines.

Support inbox triage

Connect the support mailbox. Hermes labels each new email (bug, billing, sales lead, spam), drafts a reply from your FAQ and posts the urgent ones to Slack. A cheap fast model is enough here.

Product images on request

The same key works for MegaBrain’s image and video API. Ask Hermes to call https://getmegabrain.com/api/gateway/v1/queue/nano-banana-pro with curl and save the result, then make it a skill: the marketing team gets “make 4 banner variants for this product” in a chat.

Task for the agent:

Using the MegaBrain media API (docs: https://getmegabrain.com/docs/media, key in $MEGABRAIN_API_KEY), generate a 1:1 product shot of our blue ceramic mug on a light oak table with Nano Banana Pro, save it to ~/marketing, and save the steps as a skill called product-shot.

Competitor and price monitoring

Every night Hermes visits a list of competitor pages, notes price and feature changes and keeps a running log; on Mondays it sends a summary.

Troubleshooting

401 Unauthorized

The key is missing or mistyped, or the agent did not read the environment variable (restart the agent after export). Test the key with the curl command from step 1.

402 Payment Required

The balance is empty. Add funds on the Balance page, or switch to mb-auto/free to keep testing.

Model not found

The model ID must match the catalog exactly, including the lab prefix: anthropic/claude-sonnet-5.5, not claude-sonnet-5.5. The base URL must end in /v1.

Hermes prints tool calls as text instead of running them

The model does not support tool calling. Pick one from the table above; anthropic/claude-sonnet-5.5 is the safe default.

Cron jobs do not fire

Jobs run only while the gateway is running. Install it as a service with hermes gateway install.

FAQ

Can Hermes Agent use Claude?

Yes. Choose Custom endpoint in hermes model, set the base URL to https://getmegabrain.com/api/gateway/v1 and the model to anthropic/claude-sonnet-5.5, anthropic/claude-opus-5.5 or anthropic/claude-fable-5.2. No Anthropic account is needed.

Is the Hermes Agent the same as the Hermes models?

No. Hermes Agent is the agent program by Nous Research; Hermes 3/4 are language models by the same lab. The agent works with any model that supports tool calling, including Claude, GPT and Gemini.

How much does it cost?

You pay per token at each model’s price, from a prepaid balance in US dollars topped up by card. There is no subscription and no seat fee, so an agent that sits idle costs nothing. Prices per million tokens are in the model catalog; mb-auto/free costs nothing at all.

Do I need separate Anthropic, OpenAI or Google accounts?

No. One MegaBrain key reaches Claude, GPT, Gemini, Grok, Kimi, GLM, DeepSeek, Qwen and MiniMax. You switch models by changing the model ID, not the provider or the key.

Can I try it for free?

Yes: set the model to mb-auto/free. It routes each request to an available free model (128K context). It is fine for checking the setup, weaker at long tool-using tasks, and its providers may log prompts, so do not send private data.

MegaBrain · one API for every model

Claude, GPT, Gemini, Kimi, GLM and DeepSeek in any agent — one key, one balance.

Sign up, add funds by card and pay only for what your agents use. No subscription. Free models work without a key.

Sources

More MegaBrain University guides