Get your API key

Terminal AI agent · setup guide

Connect Hermes Agent to AllModelAPI

An open-source AI agent from Nous Research that runs in your terminal and can also connect to chat apps. Use it with any AllModelAPI model.

About 10 minutesWindows · macOS · LinuxUses the Chat Completions APIChecked 19 November 2026
1 · Your computer
Stays in this browser tab. It is never saved or sent anywhere. No key yet? Create one.

Pick the easy way

Easiest

Let an AI agent do it

Already use an AI coding agent (any one: Codex, OpenCode, Cursor, another assistant)? Copy this prompt, paste it into that agent and press Enter. It installs Hermes Agent, writes the settings, saves your key and tests everything. It will ask you for your API key.

See what the prompt says
# Task: connect Hermes Agent to AllModelAPI

You are a coding agent on my computer. Set up **Hermes Agent** so it uses **AllModelAPI** as its model provider. Work step by step, tell me briefly what you are doing, and ask me before doing anything not listed here.

## Facts
- Service: AllModelAPI, an API gateway for DeepSeek, Qwen, GLM, Kimi and MiniMax models.
- Hermes Agent talks to it with the Chat Completions API.
- Base URL: `https://api.allmodelapi.com/v1`
- Main model: `deepseek-v4-pro` (DeepSeek V4 Pro, 1000K context). Fast background model: `deepseek-flash`.
- Model IDs are case-sensitive. Full list: https://api.allmodelapi.com/v1/models
- API key: not included. **Ask me to paste my AllModelAPI API key** (I can create one at https://allmodelapi.com/customer/api-keys).
- Human guide: https://allmodelapi.com/documentation/hermes

## Steps
1. Detect my operating system (macOS, Linux or Windows) and shell.
2. Check whether Hermes Agent is installed: `hermes --version`. If it is not, install it with the official command:
   - macOS: `curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash`
   - Linux: `curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash`
   - Windows (PowerShell): `iex (irm https://hermes-agent.nousresearch.com/install.ps1)`
3. Settings file location:
   - macOS / Linux: `~/.hermes/config.yaml`
   - Windows: `%LOCALAPPDATA%\hermes\config.yaml`
4. If the file exists, copy it to `<file>.bak` first. If it contains other settings, **merge**: keep everything unrelated and only add or replace the keys shown below. If it does not exist, create it with exactly this content:

```yaml
# AllModelAPI for Hermes Agent
model:
  provider: custom
  default: deepseek-v4-pro
  base_url: https://api.allmodelapi.com/v1
  key_env: ALLMODELAPI_API_KEY
  context_length: 1000000

```
5. API key: Add the line `ALLMODELAPI_API_KEY=<key>` to Hermes' .env file (`~/.hermes/.env`, or `%LOCALAPPDATA%\hermes\.env` on native Windows). Replace an existing ALLMODELAPI_API_KEY line instead of adding a second one.
6. Verify. Run:
```
hermes doctor
hermes chat --oneshot -Q -q "Reply with just: OK"
```
   A short reply such as "OK" means it works. On 401 re-check the key; on 400 "unknown model" re-check the model ID; on 402 I need more credit.
7. Report: what you changed, where the backup is, and how I start Hermes Agent.

## Rules
- Only touch the files named above. Do not remove other providers, models or settings.
- Never print my full API key in your replies or logs, and never put it in a git repository or project file.
- Use YAML that parses: no comments in JSON, no trailing commas.
One paste

Do it in your terminal

Install Hermes Agent (step 3 below), save your key (step 4), then paste this one command into PowerShell. It backs up your old settings and writes the complete new file.

Or edit the file yourself: open %LOCALAPPDATA%\hermes\config.yaml, delete everything inside, paste the full file, and save.

No key pasted above, so copied text contains PASTE_YOUR_ALLMODELAPI_KEY_HERE. Paste your key at the top first, or replace that text later.

Step by step, for Windows

Never used a terminal before? That's fine. Follow each step in order. Every grey “Why?” box explains what you just did.

  1. Get your AllModelAPI API key

    Sign in, open API Keys and create a key. Copy it and keep it private: anyone with the key can spend your credit. You will see it only once.

    Why? An API key is like a password for apps. It lets a tool use AI models on your account, and your usage is billed to it.

    Create your key here: https://allmodelapi.com/customer/api-keys

  2. Open a terminal

    Press the Windows key, type PowerShell and press Enter. A blue or black window opens. That is your terminal. Use PowerShell, not Command Prompt.

    Why? A terminal is a window where you type commands instead of clicking buttons. Every command on this page is pasted there.

    To paste in a terminal: Ctrl + V in PowerShell, Cmd + V on Mac, Ctrl + Shift + V on Linux. Then press Enter.

  3. Install Hermes Agent

    Paste this command and press Enter. Wait until it finishes. Then close the terminal and open a new one so it can find Hermes Agent.

    Why? This downloads the tool from its official website and adds it to your computer.

    Install (PowerShell)
    iex (irm https://hermes-agent.nousresearch.com/install.ps1)
    Check it installed: this should print a version number
    hermes --version

    Already installed? Skip to the next step.

  4. Save your API key in Hermes's .env file

    This adds one line to (Join-Path $env:LOCALAPPDATA "hermes\.env"). Replace PASTE_YOUR_ALLMODELAPI_KEY_HERE with your key first, or paste your key in the box at the top of this page.

    Why? Hermes reads secrets from its own .env file. That works even when Hermes runs in the background, where normal terminal settings are not visible.

    Add the key (PowerShell)
    $env_file = (Join-Path $env:LOCALAPPDATA "hermes\.env")
    New-Item -ItemType Directory -Force -Path (Split-Path $env_file) | Out-Null
    Add-Content -Path $env_file -Value "ALLMODELAPI_API_KEY=PASTE_YOUR_ALLMODELAPI_KEY_HERE"

    If you run this twice, open the file and delete the older line so only one key remains.

  5. Save the Hermes Agent settings file

    Paste this one command and press Enter. It creates the folder if needed, keeps a backup of any old file (.bak), and writes the complete settings file. Prefer doing it by hand? Use "Copy full config file" at the top, open the file in a text editor, select everything, paste, and save.

    Why? Hermes Agent reads its settings from %LOCALAPPDATA%\hermes\config.yaml. This file tells it to send requests to AllModelAPI and which model to use.

    Write the settings file
    $dir = Join-Path $env:LOCALAPPDATA "hermes"
    New-Item -ItemType Directory -Force -Path $dir | Out-Null
    $file = Join-Path $dir "config.yaml"
    if (Test-Path $file) { Copy-Item $file "$file.bak" -Force; Write-Host "Backup saved: $file.bak" }
    [System.IO.File]::WriteAllText($file, @'
    # AllModelAPI for Hermes Agent
    model:
      provider: custom
      default: deepseek-v4-pro
      base_url: https://api.allmodelapi.com/v1
      key_env: ALLMODELAPI_API_KEY
      context_length: 1000000
    
    '@)
    Write-Host "Saved: $file"

    Your old file had other settings you care about? Use the agent prompt instead. It merges instead of replacing.

  6. Check that it works

    You should see a short reply such as OK. If you see an error instead, look it up in "Something went wrong?" below.

    Why? This sends one tiny request, so you know the key, the address and the model are all correct before you start a real project.

    Check the setup
    hermes doctor
    Ask one question without opening the app
    hermes chat --oneshot -Q -q "Reply with just: OK"
    Test your key directly (PowerShell)
    Invoke-RestMethod -Method Post -Uri "https://api.allmodelapi.com/v1/chat/completions" `
      -Headers @{ Authorization = "Bearer $env:ALLMODELAPI_API_KEY" } `
      -ContentType "application/json" `
      -Body '{"model":"deepseek-v4-pro","max_tokens":20,"messages":[{"role":"user","content":"Reply with just: OK"}]}'
  7. Start building

    Type hermes to start chatting. Run hermes model any time to see or change the model.

The complete settings file

This is the whole file. Every line matters, so copy it with the button instead of selecting it by hand.

%LOCALAPPDATA%\hermes\config.yaml
# AllModelAPI for Hermes Agent
model:
  provider: custom
  default: deepseek-v4-pro
  base_url: https://api.allmodelapi.com/v1
  key_env: ALLMODELAPI_API_KEY
  context_length: 1000000

Something went wrong?

Unknown provider in hermes doctor

Check that config.yaml says provider: custom exactly as on this page. Copy the full file again.

It says the context is only 2,048 or 128K tokens

Keep the context_length line from this page. It tells Hermes the real size of the model.

The installer finished but hermes is not found

Close the terminal and open a new one (on macOS/Linux you can also run source ~/.zshrc or source ~/.bashrc).

401 / invalid API key

The key is missing, mistyped or revoked. Copy it again from https://allmodelapi.com/customer/api-keys and save it again. Keys start with the same prefix you see in your dashboard.

402 / insufficient credit

Your plan credit and pay-as-you-go credit are used up for this request. Add credit or pick a coding plan in Billing, or choose a cheaper model.

400 / unknown model

Model IDs are case-sensitive and must match the AllModelAPI list exactly, for example MiniMax-M3.1-Flash, not minimax-m3.1-flash.

command not found / is not recognized

The tool is not installed, or your terminal was opened before the install finished. Close the terminal, open a new one and try again.

Still stuck? Copy the agent prompt above into any AI assistant and paste the exact error message after it, or write to support@allmodelapi.com. See all models and IDs in the model list.

Hermes Agent is a product of Nous Research. AllModelAPI is an independent service and is not affiliated with or endorsed by Nous Research. The guide only shows how to point the tool at AllModelAPI.

Sources we checked on 19 November 2026. Tools change often; if a step looks different on your screen, follow the official page.