Skip to content
AI GatewayAI Gateway Manual

Connect Hermes to AI Gateway

How to configure Hermes to use an AI Gateway project model.

This guide explains how to connect Hermes to a model that AI Gateway exposes through its OpenAI-compatible endpoint.

  • Install Hermes.
  • Issue a Gateway Key from the Gateway Keys menu of the project you want to use. See Issue a Gateway Key.
  • Check that the model appears in the Models menu of the same project.

A Gateway Key is a secret. Do not put the key value directly in source control or a shared configuration file.

Set the key as an environment variable in the shell where you run Hermes:

Terminal window
export AI_GATEWAY_API_KEY='<your Gateway Key>'

To keep this setting in new terminals, configure it in your shell profile or secret manager.

In AI Gateway, open the project you want to use, then open Models in the top menu. In the row of the model you want, select the gear icon in the Installation column and check the Gateway base URL and model ID.

Add or merge the Gateway custom provider in ~/.hermes/config.yaml:

model:
default: "<provider-name>/<model-id>"
provider: "custom"
base_url: "https://<gateway-host>/v1/"
api_key: "${AI_GATEWAY_API_KEY}"

If the file already exists, preserve unrelated Hermes settings and merge the Gateway model section.

Restart Hermes so it reads the updated configuration. Select the configured model and send a short request. If a response arrives, the connection works.

  1. Confirm that base_url is the Gateway base URL shown in the setup dialog.
  2. Confirm that api_key refers to the AI_GATEWAY_API_KEY environment variable.
  3. Confirm that the model ID exactly matches the provider/model value shown in the setup dialog.
  4. Confirm that the model is allowed in that project’s Models menu.