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.
Before you start
Section titled “Before you start”- 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.
1. Set the Gateway Key
Section titled “1. Set the Gateway Key”Set the key as an environment variable in the shell where you run Hermes:
export AI_GATEWAY_API_KEY='<your Gateway Key>'To keep this setting in new terminals, configure it in your shell profile or secret manager.
2. Configure Hermes
Section titled “2. Configure Hermes”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.
3. Check the connection
Section titled “3. Check the connection”Restart Hermes so it reads the updated configuration. Select the configured model and send a short request. If a response arrives, the connection works.
If the model does not appear
Section titled “If the model does not appear”- Confirm that
base_urlis the Gateway base URL shown in the setup dialog. - Confirm that
api_keyrefers to theAI_GATEWAY_API_KEYenvironment variable. - Confirm that the model ID exactly matches the provider/model value shown in the setup dialog.
- Confirm that the model is allowed in that project’s Models menu.