Hermes Agent on Telegram with OpenRouter: setup guide
Hermes Agent is an open-source runtime that keeps an assistant running on a machine you control. This Hermes Agent Telegram guide connects it to a private bot and uses OpenRouter, so you can change the model behind it without rebuilding the assistant.

I wrote the guide I needed when “agent” still sounded like another word for chatbot. It covers the public, reproducible parts of the setup and leaves out private infrastructure, credentials, client data, personal prompts, and the details of any live system.
- Agent
- The open-source runtime that holds sessions, calls tools, runs skills, and completes the work.
- Model
- The reasoning engine Hermes calls. It can come from OpenRouter, Nous Portal, OpenAI, a local endpoint, or another supported provider.
- Gateway
- The background process that connects Hermes to Telegram and other messaging platforms.
- Host
- The laptop, VPS, container, GPU machine, or serverless environment where Hermes runs.
What Hermes Agent is
Hermes Agent is an open-source agent runtime built by Nous Research. It keeps a conversation alive, chooses a configured model, and gives that model tools. It also stores session context, runs skills, schedules jobs, handles files and voice, and returns the result through whichever interface you use. The model is a separate part you can replace, and a Telegram bot is only one of the interfaces.
On its own, a model writes an answer. With Hermes around it, the same model can inspect a folder, search the web, and run a test. It can also create a document, remember the session, pause for approval, and send the finished file back. Hermes supplies the machinery that ties those actions into one task.
- You askText, voice, an image, or a file arrives from Telegram.
- Gateway receivesThe message is matched to the right chat, user, and session.
- Hermes plansContext, skills, tools, and permissions shape the task.
- Model reasonsThe provider you selected supplies the reasoning engine.
- Tools actHermes reads, computes, searches, or prepares a change within the limits you set.
- Result returnsThe answer or generated file arrives in the same chat.
What you need before starting
- A supported host. The official installer supports Linux, macOS, WSL2, and Termux. For an assistant that is always available, use a machine that stays on.
- One model provider. This guide uses OpenRouter, because one API reaches many model families. Hermes supports other providers too.
- A Telegram account. You will create a separate bot through Telegram’s official @BotFather account.
- A narrow security boundary. Before connecting chat, decide which operating-system user, working directory, tools, and folders the agent may reach.
- Comfort with a terminal. You should be able to paste a command, read an error, and keep a secret out of screenshots. Systems engineering experience is optional.
Install Hermes and test it in the terminal first
Run the official installer
On Linux, macOS, WSL2, or Termux, the official quick-install command is:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
If piping a remote script straight into a shell is outside your risk tolerance, download the installer and read it before running it. Installation details change, so treat the official quickstart as the reference.
Configure a model provider
Run the interactive provider picker:
hermes model
Select OpenRouter, enter the API key when prompted, and pick a starting model. Hermes stores secrets in its private configuration area. Never paste the key into a public repository, prompt template, screenshot, or Telegram message.
Test locally before adding Telegram
Start Hermes in the terminal and ask a harmless question. Then list the available tools and confirm that the working directory is the one you intended.
hermes
hermes tools
Connect a remote chat only after the local session authenticates to the intended provider and completes a simple turn. That way you can tell a model problem from a Telegram problem.
Choose models through OpenRouter
OpenRouter exposes many models through one compatible API. For a personal assistant, you can use a fast, inexpensive model for routine sorting, a stronger reasoning model for planning, a vision model for images, or an automatic router. None of these switches needs a reinstall, and the assistant keeps its tools and configuration when the model changes.
- Fast
- Inbox and routine work. Classification, short summaries, formatting, reminders, and low-risk repetitive tasks.
- Balanced
- Everyday assistant. Writing, research synthesis, planning, files, and most multi-step requests.
- Deep
- Complex reasoning. Architecture, difficult debugging, long comparisons, and analysis with real consequences.
- Vision
- Images and documents. Screenshots, diagrams, scanned material, and visual QA, when the selected model supports images.
- Auto
- Let the router choose. OpenRouter’s auto router selects a model from the allowed set based on the request.
Switch models from Telegram
Inside a Hermes messaging session, /model shows or changes the active model. The official command accepts provider:model syntax:
/model
/model openrouter:openrouter/auto
/model openrouter:anthropic/claude-sonnet-4.5
Treat those identifiers as syntax examples. Model catalogues, names, prices, context windows, and availability all change. Check the live OpenRouter catalogue before you standardise on a model, and confirm the active model with /status after switching.
| Question | Why it matters | Practical default |
|---|---|---|
| How sensitive is the task? | With a cloud provider, prompts and attachments leave your host. | Keep secrets and regulated data out; use a local endpoint when that boundary matters. |
| Does it need tools? | Models differ in how well they handle multi-step tool use. | Test it on the Hermes workflow you will run; a chat benchmark will not show this. |
| How expensive can it be? | Long sessions, files, and tool loops can use more tokens than a single chat. | Set an OpenRouter budget and use a cheaper model for routine work. |
| Does it need vision? | Text-only models cannot inspect screenshots or images. | Choose a vision-capable model only for sessions that need it. |
| Do you need consistency? | Automatic routing can change the underlying model between tasks. | Pin a specific model for repeatable workflows; use auto for general requests. |
Connect Hermes to a private Telegram bot
Create the bot with @BotFather
- Open Telegram and message the official @BotFather account.
- Send
/newbot. - Choose a display name.
- Choose a unique username ending in
bot. - Copy the API token into your password manager or straight into the Hermes setup prompt.
The token controls the bot. If it ever appears in a screenshot, log, public repository, or shared chat, run BotFather’s /revoke command at once and replace it.
Find your numeric Telegram user ID
Hermes authorises users by numeric ID, so a username will not work. The official guide recommends messaging @userinfobot or @get_id_bot and saving the number it returns.
Run the gateway wizard
hermes gateway setup
Select Telegram, enter the bot token, and add your numeric user ID to the allowlist. You can set the same values by hand in the environment fields TELEGRAM_BOT_TOKEN and TELEGRAM_ALLOWED_USERS, but the wizard is the safer path for a first install.
Start and verify the gateway
hermes gateway
Open the bot in Telegram and send a simple message. Then run these checks inside the chat:
/whoami
/status
/help
/whoami shows your access tier and scope, and /status confirms the session and model state. If the bot does not respond, check the gateway terminal before changing anything else.
Keep it running after logout or reboot
On a laptop or development machine, install the default user service. On a headless Linux server, the official guide supports either a user service with lingering or a boot-time system service.
hermes gateway install
hermes gateway start
hermes gateway status
Use one service mode per installation. Running both a user unit and a system unit for the gateway makes start, stop, and status behaviour ambiguous.
What a personal Hermes assistant can do
- Ask and orient · read-only
- Summarise a maintained knowledge folder, explain which document owns a decision, or find the safest place to begin.
“Read the project notes and tell me what is current, stale, and still uncertain.” - Research · read-only
- Search, compare sources, keep the links, separate facts from inference, and return a short brief.
“Research this topic from primary sources and give me a claim-by-claim source list.” - Work with files · scoped
- Read attachments, organise documents, produce Markdown, CSV, PDF, images, or code, and send supported files back through Telegram.
“Turn this document into a one-page checklist and send the file back.” - Long-running work · background
- Run research, builds, or checks in a separate background session so the main conversation stays responsive.
“/background Compare these sources and report when the table is ready.” - Scheduled checks
- Run checks on a schedule and deliver the results to a chosen home channel. A good monitor reports whether the state was unchanged or could not be checked.
“Notify me only when the observed state crosses this threshold.” - Session continuity · memory
- Name, resume, compress, or reset sessions. Write the decisions you want to keep into files instead of relying on old chat turns.
“Summarize what changed, the evidence, and the next safe action.” - Voice and images
- Send voice notes, screenshots, photos, and attachments when the configured speech and model providers support them.
“Transcribe this note, extract the actions, and ask before scheduling anything.” - Action-capable workflows · approval
- Prepare a command, message, change, or release, then stop before the step that has consequences and show the final payload first.
“Prepare the change, run the checks, show me the diff, and wait.”
Commands inside Telegram
/new- Start a fresh conversation.
/model- Show or change the model.
/status- Inspect the active session and runtime.
/whoami- See your access tier and allowed commands.
/background- Run a separate task without blocking the main chat.
/stop- Stop the running agent.
/approve- Approve a pending dangerous command.
/deny- Reject the pending command.
/sethome- Choose where scheduled results should arrive.
/compress- Compress long conversation context.
/resume- Resume a named session.
/help- Show available commands.
Add skills for the jobs you repeat
A skill tells Hermes how a particular job should be done. It names the inputs the job needs, the tools it may use, the proof of completion to collect, the output format, and where to stop.
Hermes can browse and install compatible skills:
hermes skills browse
hermes skills install openai/skills/k8s
Treat a community skill as software you are installing. Read its instructions, inspect its scripts, and check its tool access. Pin important behaviour in tests, and remove anything that asks for more authority than the job requires.
- Input
- What must be supplied? Files, URLs, dates, exact scope, and the decision the output has to support.
- Tools
- What may it touch? Read-only sources, a specific folder, browser access, terminal commands, or a named external service.
- Proof
- What proves completion? Exit codes, source links, checksums, screenshots, tests, or a read-back from the live destination.
- Stop
- Where must it pause? Before sending, publishing, purchasing, deleting, granting access, or changing production.
- Memory
- What should survive the chat? Stable preferences, decisions, runbooks, and exact lessons from failures. Raw secrets and unnecessary personal detail stay out.
Security: the host and the allowlist set the boundary
A Hermes Telegram integration can expose terminal tools. That makes it far more capable than a normal bot, and it makes the host, the gateway configuration, and the allowlist the security boundary.
- Allowlist yourself
- Keep
TELEGRAM_ALLOWED_USERSnarrow. Never turn on “allow all” for an agent with terminal access. - Run as a dedicated user
- Give that account only the folders and commands it needs. A test that passes as root does not show that the runtime user can work safely.
- Scope the working directory
- The messaging gateway uses its configured terminal working directory. Check that it does not point at your whole home directory.
- Keep secrets off chat
- Store tokens in Hermes’s private environment. Redact logs and screenshots. Rotate a bot or provider key as soon as it is exposed.
- Keep approval gates
- Read-only work can run on its own. Messages, deployments, purchases, deletions, and permission changes should stop for confirmation.
- Verify the active provider
- After a configuration change, confirm the provider and model in use from the live session state. An old configuration file can be out of date.
- Separate public and private memory
- Operating principles that are safe to publish can be shared. Private paths, identities, client facts, tokens, and internal schedules stay out of anything you publish.
- Update with rollback
- Back up the configuration, know which service mode you run, plan each update, and verify the gateway from the same runtime identity.
Troubleshooting by layer
| Symptom | Check first | Likely boundary |
|---|---|---|
| The bot is silent | Is hermes gateway running, and does its log show Telegram connected? | Gateway process, bot token, or network. |
| You are denied | Does /whoami work, and is your numeric ID in the allowlist? | Authorisation and the allowlist. |
| Direct messages work; groups do not | Check BotFather privacy mode, group membership, mention rules, and allowed chat IDs. | Telegram delivery and group policy. |
| The model errors | Run hermes model, confirm the API key and live model ID, then test locally. | Provider authentication or catalogue drift. |
| The wrong model answers | Use /status after /model, then inspect the configured fallbacks. | Session override or fallback routing. |
| It stops after logout | Check hermes gateway status and the chosen service mode. | Service persistence on the host. |
| A generated file cannot be sent | Can the gateway process read the final host path? | Container and host filesystem visibility. |
| A “success” changed nothing | Read the destination back from its authoritative source. | Whether the change reached its destination. |
A first-week routine
- Day 1 · Terminal only
- Install, choose one model, inspect the tools, and complete harmless read-only tasks.
- Day 2 · Private Telegram DM
- Create the bot, allowlist one user, and check
/whoami,/status, and/stop. - Day 3 · Model comparison
- Run the same real task on a fast model, a balanced model, and a deeper model. Compare cost, tool reliability, and the output itself.
- Day 4 · One scoped skill
- Add a repeatable read-only workflow with a fixed output and a stated proof of completion.
- Day 5 · One background task
- Use
/backgroundfor research or a safe local check while the main chat stays responsive. - Weekend · Persistence and recovery
- Install the gateway service, reboot once, confirm it comes back, review the logs, and write down how to rotate both keys.
Official sources and when they were checked
The guide was last checked against the official documentation on 28 August 2026. On that date the quick-install command above was unchanged and every page linked below resolved. Hermes changes quickly, so check commands and configuration on these pages before installing, and keep the agent current with hermes update.
Sources
- NousResearch/hermes-agent on GitHub ↗︎: repository, installer, feature overview, and releases.
- Hermes Agent quickstart ↗︎: current installation and first-session flow.
- Hermes Telegram guide ↗︎: BotFather, allowlists, privacy mode, voice, files, groups, and service behaviour.
- Hermes provider guide ↗︎: OpenRouter and other model providers.
- OpenRouter quickstart ↗︎: API keys, model identifiers, and compatible requests.
- OpenRouter Auto Router ↗︎: automatic model selection and routing controls.
Quick answers
Do I need Telegram to use Hermes Agent?
No. Hermes runs in the terminal first, and this guide proves the local path before any messaging platform. Telegram is an optional remote interface you add once the terminal session can authenticate and complete a simple turn.
What does it cost to run?
Hermes installs from the official public repository. Running costs can include model-provider usage, the host, storage and paid tools; a local model adds hardware and power costs instead of a hosted per-token bill. Set a provider budget and route routine work to a cheaper model. Long sessions, files, and tool loops consume more tokens than a single chat.
Which model should I start with?
Start with one balanced general model through OpenRouter, then switch by workload with /model: fast models for routine sorting, deeper models for planning, a vision-capable model for images, or the auto router. Verify the active model with /status after switching.
Is it safe to connect an AI agent to Telegram?
Treat Telegram as the interface, not the security boundary. Decide the operating-system user, working directory, tools, and reachable folders before connecting chat; restrict the bot to your own account ID; and keep secrets out of messages and screenshots.
Can Hermes run on a phone?
The official installer supports Termux on Android, so it can. An always-available assistant is better hosted on a machine that stays on, such as a Mac, a Linux box, or a small VPS, with the phone acting as the Telegram client.
← Previous: How I run AI agents on a Hetzner VPS
Want this inside your team’s workflow? The Verified AI Operations Sprint tests one workflow in ten working days. See the sprint →
