# Hermes API Server

> Lets other chat apps use Hermes. They talk to it the way they talk to OpenAI.

**Field:** Artificial Intelligence  
**Category:** Hermes Agent  
**Also known as:** Hermes OpenAI-compatible API, API_SERVER_ENABLED, Hermes port 8642

## Think of it like

It is like a plug that fits every wall socket. Any lamp can use it.

## Definition

The Hermes API server lets other apps talk to Hermes as if it were a model. It speaks the same web format as OpenAI's chat API. You turn it on in ~/.hermes/.env and start the gateway. It then listens on port 8642 on your own machine. Chat apps such as Open WebUI connect to it, and every reply can use Hermes tools, memory and skills.

## Example

Emma already uses Open WebUI. She points it at http://localhost:8642/v1, and her old chat screen now talks to Hermes with all its tools.

## Example code

```bash
API_SERVER_ENABLED=true
API_SERVER_KEY=change-me-local-dev
hermes gateway
```

Two lines in ~/.hermes/.env, then start the gateway. It listens on port 8642.

## Why it matters

You keep the chat screen you like and get an agent behind it, not just a model.

## Common mistake

Opening it to the internet with the sample key. Set a long, secret key before anyone else can reach it.

## Three principles

- **OpenAI format.** Any matching app can connect.
- **Full agent behind it.** Tools, memory and skills.
- **Runs with the gateway.** Start it with hermes gateway.

## Related terms

- [OpenAI-Compatible API](https://learn.benibix.com/term/ai/openai-compatible-api)
- [Open WebUI](https://learn.benibix.com/term/ai/open-webui)
- [Hermes Messaging Gateway](https://learn.benibix.com/term/ai/hermes-gateway)
- [API Key](https://learn.benibix.com/term/development/api-key)
- [API Endpoint](https://learn.benibix.com/term/development/endpoint)

![One Hermes agent in the middle. Four ways in point at it: the TUI in a terminal, chat apps through the gateway, a microphone for voice, and other apps through the API server on port 8642.](https://learn.benibix.com/diagrams/ai8-hermes-front-doors.svg)

---

Source: https://learn.benibix.com/term/ai/hermes-api-server
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
