hermes-gateway-api
Configure and troubleshoot the Hermes Gateway HTTP API server — enabling port 8642, setting API_SERVER_KEY, and connecting external tools (Studio, dashboards…
Skill by mattdanielmurphy
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mattdanielmurphy-hermes-gateway-api
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/hermes-gateway-api
What's inside
- Skill name
hermes-gateway-api- Description
- Configure and troubleshoot the Hermes Gateway HTTP API server — enabling port 8642, setting API_SERVER_KEY, and connecting external tools (Studio, dashboards, scripts) via bearer auth.
- License
- MIT
- Instructions
- 178 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (3)
- SKILL.md
- studio-gateway-connection.md · references/
- websocket-jsonrpc-protocol.md · references/
SKILL.md (first lines)
# Hermes Gateway API Server
The Hermes Gateway can serve an **HTTP API server** on port 8642, which external tools (Hermes Studio, custom dashboards, CLI scripts, the ACP server) connect to for session management, chat, memory, skills, and config.
This API server is **opt-in** — it does not start by default, even when the gateway is running. It requires explicit configuration.
## Prerequisites
- Hermes Agent v0.18.0+ (the `API_SERVER_KEY` security check was added in v0.18.x)
- `hermes gateway run` already works (the gateway process starts for messaging platforms)
## Enabling the API Server
### 1. Enable the API server
Add to `~/.hermes/.env`:
```ini
API_SERVER_ENABLED=true
```
### 2. Set a secure API key
**Required.** The gateway v0.18.x refuses to start the API server without a key, even for loopback-only binds on `127.0.0.1`. The key must be:
- **At least 16 characters** — shorter keys are rejected with: `API_SERVER_KEY is a placeholder or too short (<16 chars)`
- **Not a placeholder** — `dev-key`, `test`, `secret`, etc. are rejected
- **Cryptographically random** — use `openssl rand -hex 16` or similar
```bash
# Generate a secure key
openssl rand -hex 16
# Add to ~/.hermes/.env
API_SERVER_KEY=28582603a4559f46346896b9741de429
```
### 3. Match the key in your client
Any tool connecting to the API server must send `Authorization: Bearer <API_SERVER_KEY>` as an HTTP header.
For **Hermes Studio**, add to the Studio's `.env`:
```ini
HERMES_API_TOKEN=28582603a4559f46346896b9741de429
```
### 4. Restart the gateway
```bash
hermes gateway run --replace
```
## Verification
Check the gateway is listening and the API server is healthy:
```bash
# Port should be listening
lsof -i :8642
# Health endpoint
curl http://localhost:8642/health
# Should return: {"status": "ok", "platform": "hermes-agent", "version": "0.18.2"}
```
## Common Errors
### `ECONNREFUSED 127.0.0.1:8642`
The gateway is running but the API server is not enabled. Check:
1. `API_SERVER_ENABLED=true` is set in `~/.hermes/.env`
2. `API_SERVER_KEY=<32-char-hex>` is set (≥16 chars, not a placeholder)
3. Gateway was restarted after adding these variables
### `API_SERVER_KEY is required for the API server`
The API server is enabled but no key was provided. Generate a key and add it to `.env`.
### `API_SERVER_KEY is a placeholder or too short (<16 chars)`
The key exists but is too short or guessable. Generate a proper key with `openssl rand -hex 16`.
### `Gateway connection refused / 401 Unauthorized`
The client's bearer token doesn't match the server's `API_SERVER_KEY`. Verify:
```bash
# Check the server's expected key
grep API_SERVER_KEY ~/.hermes/.env
# Check the client's token
grep HERMES_API_TOKEN /path/to/client/.env
```
### `Cannot read properties of undefined (reading 'slice')` (500 on `/api/history`)
The Studio connected but the API response format doesn't match. Hermes Gateway v0.18.x returns OpenAI-compatible list format (`{ object, data, limit, offset, has_more }`), but Studio expects `{ items, total }`.
**Fix:** Patch `listSessions()` and `getMessages()` in `src/server/hermes-api.ts` to handle both:
```typescript
return resp.data ?? resp.items ?? []
```
See `references/studio-gateway-connection.md` for full steps.
### `API server rejected invalid API key` (from Studio, using correct .env)
The Studio's `.env` has the right token, but there are two separate places in `vite.config.ts` where the token is needed:
**1. Vite SSR env gap** — `loadEnv` does NOT set `process.env` by default. The Studio's SSR code (in `src/server/gateway-capabilities.ts`) reads `process.env.HERMES_API_TOKEN` at import time — if it's not in the shell environment, the token is empty.
**Fix** — In `vite.config.ts`, forward loaded env vars to `process.env` right after `loadEnv`:
```typescript
const env = loadEnv(mode, process.cwd(), '')
// Forward env vars to process.env so SSR code can read themFrom mattdanielmurphy/ai-os, MIT.
More from mattdanielmurphy/ai-os
- 0.561score
hermes-database-internals
mattdanielmurphy
Hermes Agent's SQLite database architecture — schema layout, FTS5 dual-tokenizer search, trigger-based index sync, and the pattern for safely ingesting…
SkillAFreshness: AClaude Code +9 - 0.559score
agy
mattdanielmurphy
Delegate through the agymcp MCP bridge by default; use the agy CLI only as a documented fallback.
SkillAFreshness: AClaude Code +9 - 0.559score
delegate-deepseek
mattdanielmurphy
Delegate well-scoped coding/verification subtasks to deepseek-v4-flash via the Claude Code CLI in a lightweight, permission-free, context-free mode.
SkillAFreshness: AClaude Code +9 - 0.558score
hermes-to-agy
mattdanielmurphy
Delegate to agy with full Hermes system context (SOUL + memory) for free Antigravity quota.
SkillAFreshness: AClaude Code +9 - 0.552score
_plan-with-gemini
mattdanielmurphy
Initiate high-reasoning implementation planning by spawning a planning subagent with Gemini 3.7 High without requiring GitHub repo sync.
SkillAFreshness: AClaude Code +9 - 0.552score
_plan-with-subagent
mattdanielmurphy
Initiate high-reasoning implementation planning by spawning a native subagent with Gemini 3.7 High without requiring GitHub repo sync.
SkillAFreshness: AClaude Code +9 - 0.552score
agy-extreme-delegation
mattdanielmurphy
Configure agy to delegate EVERYTHING possible — editing, research, context-gathering — to Claude Code or subagent.py.
SkillAFreshness: AClaude Code +9 - 0.551score
hermes-agent-skill-authoring
mattdanielmurphy
Author in-repo SKILL.md files: frontmatter and structure.
SkillAFreshness: AClaude Code +9 - 0.550score
hermes-desktop-plugins
mattdanielmurphy
Write desktop app plugins that add UI panes and commands.
SkillAFreshness: AClaude Code +9 - 0.549score
_manage-memory
mattdanielmurphy
Store, search, and prefetch durable memories via the battle-tested Mem0 engine.
SkillAFreshness: AClaude Code +9 - 0.549score
_plan-with-ai-os
mattdanielmurphy
Initiate high-reasoning planning via ai-os (Gemini) when explicitly requested by user.
SkillAFreshness: AClaude Code +9 - 0.516score
ai-os-audit
mattdanielmurphy
Run token waste audits on agent conversation transcripts using agy's audit_transcripts.py.
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 17, 2026 (12 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/mattdanielmurphy/ai-os
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mattdanielmurphy
- 0.561score
hermes-database-internals
mattdanielmurphy
Hermes Agent's SQLite database architecture — schema layout, FTS5 dual-tokenizer search, trigger-based index sync, and the pattern for safely ingesting…
SkillAFreshness: AClaude Code +9 - 0.559score
agy
mattdanielmurphy
Delegate through the agymcp MCP bridge by default; use the agy CLI only as a documented fallback.
SkillAFreshness: AClaude Code +9 - 0.559score
delegate-deepseek
mattdanielmurphy
Delegate well-scoped coding/verification subtasks to deepseek-v4-flash via the Claude Code CLI in a lightweight, permission-free, context-free mode.
SkillAFreshness: AClaude Code +9 - 0.558score
hermes-to-agy
mattdanielmurphy
Delegate to agy with full Hermes system context (SOUL + memory) for free Antigravity quota.
SkillAFreshness: AClaude Code +9 - 0.552score
agy-extreme-delegation
mattdanielmurphy
Configure agy to delegate EVERYTHING possible — editing, research, context-gathering — to Claude Code or subagent.py.
SkillAFreshness: AClaude Code +9 - 0.552score
_plan-with-gemini
mattdanielmurphy
Initiate high-reasoning implementation planning by spawning a planning subagent with Gemini 3.7 High without requiring GitHub repo sync.
SkillAFreshness: AClaude Code +9
Cite this page
hermes-gateway-api skill. Agent Mart. https://agentmart.dev/skills/mattdanielmurphy-hermes-gateway-api (last updated 2026-10-24)