# Connect Hermes Agent to MandAPI

Add MandAPI as a custom Chat Completions endpoint in Hermes.

## Set the custom provider

Use a current Hermes Agent installation and choose a MandAPI model available to your account with Chat Completions support. For coding tasks, also confirm tool calling for that model.

Outside an active chat, run `hermes model` and choose the custom endpoint option. Supply the MandAPI base, your private key and the exact model ID. This wizard is the route for adding a provider; the in-chat `/model` command switches configurations already set up.

## Keep a reproducible configuration

For a manual setup, merge this into `~/.hermes/config.yaml`, replacing `MODEL_ID`:

```yaml
model:
  provider: custom
  base_url: https://api.mandapi.com/v1
  default: MODEL_ID
  key_env: MANDAPI_API_KEY
```

Supply `MANDAPI_API_KEY` through the environment inherited by Hermes. For one Bash terminal:

```bash
read -rsp "MandAPI key: " MANDAPI_API_KEY
printf '\n'
export MANDAPI_API_KEY
```

Or PowerShell:

```powershell
$env:MANDAPI_API_KEY = [Net.NetworkCredential]::new('', (Read-Host 'MandAPI key' -AsSecureString)).Password
```

Start Hermes from that same terminal. With the custom provider, put the endpoint in `model.base_url`; do not rely on a legacy `LLM_MODEL` or an unrelated provider's base-URL variable.

## Check text, then tools

Start `hermes`, ask for a short explanation of a pasted code snippet and inspect the matching usage in MandAPI. Next, open a small project and ask for a README summary without file changes. This separates a model connection problem from a tool-execution problem.

## Troubleshoot and switch back

If the key is missing, check that the Hermes process inherited the named variable without printing it. If `/model` cannot add the endpoint, exit and use `hermes model`. For a missing model, compare the exact account-visible ID rather than adding another provider's prefix. Keep a copy of your previous model settings and restore it when you want to switch back.

## References

- [https://hermes-agent.nousresearch.com/docs/integrations/providers](https://hermes-agent.nousresearch.com/docs/integrations/providers)
- [https://openrouter.ai/docs/cookbook/coding-agents/hermes-integration](https://openrouter.ai/docs/cookbook/coding-agents/hermes-integration)
