> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fortapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hermes Agent

> Connect Nous Research's Hermes Agent to FortAPI

[Hermes Agent](https://github.com/NousResearch/hermes-agent) is Nous Research's multi-provider AI agent framework. It supports OAuth, API key, and custom endpoint authentication, and can deliver to Telegram, Discord, Slack, WhatsApp, Signal, and more.

The cleanest way to point Hermes at FortAPI is its **"Custom endpoint"** flow (OpenAI-compatible).

## Prerequisites

<Steps>
  <Step title="FortAPI account + API key">
    Console → **Tokens** → create a `sk-...` key.
  </Step>

  <Step title="OS">
    Linux / macOS / WSL2 are well-supported. Native Windows is still early beta — use WSL2 if you hit rough edges.
  </Step>
</Steps>

## Install Hermes

<Tabs>
  <Tab title="Linux / macOS / WSL2">
    One-liner:

    ```bash theme={null}
    curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
    ```

    Reload your shell:

    ```bash theme={null}
    source ~/.bashrc    # or: source ~/.zshrc
    ```
  </Tab>

  <Tab title="Windows (PowerShell)">
    ```powershell theme={null}
    irm https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.ps1 | iex
    ```

    The installer pulls in Python 3.11, uv, Node.js, ripgrep, ffmpeg, and a portable Git Bash.
  </Tab>
</Tabs>

Confirm:

```bash theme={null}
hermes --version
```

## Configure FortAPI

Launch the provider wizard:

```bash theme={null}
hermes model
```

Follow these steps:

<Steps>
  <Step title="Pick 'Custom endpoint'">
    The wizard lists every built-in provider (Nous Portal / OpenRouter / Anthropic / OpenAI / ...). Scroll to the bottom and select **Custom endpoint (self-hosted / VLLM / etc.)**.
  </Step>

  <Step title="Base URL">
    ```
    https://www.fortapi.com/v1
    ```

    <Warning>
      OpenAI-compatible protocol — the URL **must** end in `/v1`.
    </Warning>
  </Step>

  <Step title="API key">
    Paste your FortAPI token `sk-...`. Hermes writes it to `~/.hermes/.env`.
  </Step>

  <Step title="Name the endpoint">
    For example, `FortAPI`. Hermes creates a matching credential pool.
  </Step>

  <Step title="Choose a model">
    Common picks:

    * `gpt-5` (OpenAI-family)
    * `claude-sonnet` (callable via the OpenAI-compatible protocol on FortAPI)
    * `deepseek-chat`, `kimi-k2.5`, `glm-5`, etc.

    Full list on the [Pricing page](https://www.fortapi.com).
  </Step>
</Steps>

The wizard writes `~/.hermes/config.yaml`:

```yaml theme={null}
model:
  provider: "custom"
  default: "your-model-name"  # see the pricing page on the main site for available model names
  base_url: "https://www.fortapi.com/v1"
```

## First call

Start the CLI:

```bash theme={null}
hermes
```

Inside the prompt:

```
> In one sentence, introduce yourself.
```

A normal reply plus a matching FortAPI Console → **Logs** entry = success.

## Switch models

Inside a session, run `/model` with any model name from the pricing page on the main site:

```
/model your-model-name
```

Or exit and rerun `hermes model` to change the default.

## Wire up Telegram / Discord / etc.

Once the model is configured, set up the gateway:

```bash theme={null}
hermes gateway setup
hermes gateway start
```

Follow the prompts (Telegram bot token, etc.). Once the gateway is up, messages will route through FortAPI. See the [Hermes Messaging Gateway docs](https://hermes-agent.nousresearch.com/docs/user-guide/messaging) for details.

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    * Confirm the API key line in `~/.hermes/.env` is your **FortAPI** token, copied correctly.
    * Check the key status in FortAPI Console → **Tokens**.
  </Accordion>

  <Accordion title="404 / model not found">
    * That model ID isn't on FortAPI — check the [Pricing page](https://www.fortapi.com).
    * `base_url` must end in `/v1`.
  </Accordion>

  <Accordion title="Why not use Hermes's built-in 'Anthropic' provider?">
    Hermes's built-in Anthropic flow is built around Claude Max OAuth — overriding the base URL for third-party gateways isn't reliable. **Custom endpoint (OpenAI-compatible)** is the cleanest path on FortAPI, and Claude models work over it too.
  </Accordion>

  <Accordion title="Run Nous Portal + FortAPI side by side">
    Hermes supports multiple providers. Run `hermes model` again to add another, and use `/model` mid-session to switch.
  </Accordion>

  <Accordion title="Tool / function calling not working">
    Function calling passes through the OpenAI-compatible protocol unchanged. If a tool call fails, first verify the model supports tool use (`gpt-5`, `claude-sonnet` all do).
  </Accordion>
</AccordionGroup>

## Advanced

* **Auxiliary models**: Hermes uses an auxiliary model for vision / web summarization / MoA, defaulting to your main model. To save money, override it to a cheaper one — see [Auxiliary Models](https://hermes-agent.nousresearch.com/docs/user-guide/configuration).
* **Credential pools**: round-robin keys and auto-failover — see [Credential Pools](https://hermes-agent.nousresearch.com/docs/user-guide/features/credential-pools).
