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

# Use Hermes CLI with A2Agent 

> Hermes CLI has a built-in slot for a custom OpenAI-compatible endpoint. Add your A2Agent base URL and key with the hermes model command to switch models.

You configure the connection with the `hermes model` command. Hermes keeps its standard CLI, TUI and messaging workflows - only the model backend changes.

## Prerequisites

* Hermes Agent installed — follow the [official installation guide](https://hermes-agent.nousresearch.com/docs/getting-started/installation) if needed
* An A2Agent API key — [sign up at a2agent.me/register](https://a2agent.me/register) to get one

## Setup

<Steps>
  <Step title="Open Hermes model configuration">
    Run:

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

    Select:Custom endpoint (enter URL manually)
  </Step>

  <Step title="Enter the A2Agent endpoint">
    When prompted for the API base URL, enter:

    ```bash theme={null}
    https://api.a2agent.me/v1
    ```

    When prompted for the API key, enter your A2Agent API key.
  </Step>

  <Step title="Select the API compatibility mode">
    Hermes will ask you to select an API compatibility mode.For A2Agent, use one of the following:

    ```bash theme={null}
    1. Auto-detect
    ```

    This is the recommended option for standard OpenAI-compatible endpoints.
  </Step>

  <Step title="Choose an available model">
    Hermes will request the available model list from A2Agent and display the models that can be selected.Choose a model from the list, or type an exact model ID manually.

    Model availability may change. For the latest model IDs and capability information, refer to the [A2Agent Models page](https://a2agent.me/models).
  </Step>

  <Step title="Configure the context length">
    When Hermes asks for the context length:Context length in tokens \[leave blank for auto-detect]:

    Leave the field blank to let Hermes detect the value automatically.

    If you enter the value manually, use the context window shown for that model on the [A2Agent Models page](https://a2agent.me/models). Context limits may vary by model.
  </Step>

  <Step title="Set a display name">
    Hermes will ask for a display name for the endpoint.The display name is only used to identify the custom provider inside Hermes.
  </Step>

  <Step title="Complete the setup">
    After setup is complete, Hermes will save the API key and endpoint as a custom provider and set the selected model as the default.

    You may see messages similar to:

    ```bash theme={null}
    API key saved to .env as HERMES_CUSTOM_API_A2AGENT_ME_API_KEY
    Default model set to: YOUR_MODEL_ID
    Saved to custom providers as "YOUR_NAME"
    ```
  </Step>
</Steps>

## Verify the connection

Start an interactive Hermes session:

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

You can also run a single query:

```bash theme={null}
hermes chat -q "Say hello and briefly describe the active model."
```

If Hermes returns a response, the A2Agent connection is working.

To change the default model later, run:

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

Then select the A2Agent custom provider and choose another model.

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Hermes reached A2Agent, but the API key was rejected.

    * Confirm that you entered a valid A2Agent API key.
    * Make sure the key was copied completely.
    * Check that there are no extra spaces or line breaks.
    * Do not use an OpenAI API key in the A2Agent configuration.
  </Accordion>

  <Accordion title="Endpoint verification failed">
    Confirm that the API base URL is exactly:[https://api.a2agent.me/v1](https://api.a2agent.me/v1)

    Make sure the `/v1` path is included.

    If Hermes reports that verification succeeded at:[https://api.a2agent.me/v1/models](https://api.a2agent.me/v1/models) and saves that working URL, the setup has completed normally.
  </Accordion>

  <Accordion title="No models are available">
    Check the following:

    * The A2Agent API key is valid.
    * The endpoint is set to `https://api.a2agent.me/v1`.
    * The selected API mode is `Auto-detect` or `Chat Completions`.
    * The A2Agent account can access the model list.

    You can compare current model IDs on the [A2Agent Models page](https://a2agent.me/models).
  </Accordion>

  <Accordion title="Model not found">
    The model ID must match an available A2Agent model exactly.

    Model names and availability may change, so run `hermes model` again and select a model from the current list.
  </Accordion>

  <Accordion title="The model change did not affect my running chat">
    A model selected through `hermes model` becomes the default for new sessions. An already-running session may continue using the model it started with.

    Start a new Hermes session after changing the default model.
  </Accordion>
</AccordionGroup>
