Goal of this guide: install Hermes Agent (a local AI agent from Nous Research) on a Linux desktop (Ubuntu / Debian as the example) and connect it to your own MYAI168 API, using Claude Opus 4.8.
On Linux, Hermes is installed with the official one-line script (it automatically installs uv, Python, etc.). The setup is almost identical to macOS (the config files live in ~/.hermes/ as well); the only difference is that your shell config file may be ~/.bashrc (bash) or ~/.zshrc (zsh).
Anthropic native endpoint https://www.myai168.com/en/api/anthropic (without /v1)
OpenAI-compatible endpoint https://www.myai168.com/en/api/openai/v1
Main model claude-opus-4-8 (via the Anthropic endpoint)
~/.hermes/config.yaml~/.hermes/.envFirst check which login shell you are using:
echo $SHELL
/bash → use ~/.bashrc/zsh → use ~/.zshrcWherever this guide says "shell config file" below, substitute yours.
Run the official one-line install script:
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
If the installer needs system packages (ripgrep / ffmpeg / build tools), agree to install them (they are installed via apt with sudo, which may ask for your password).
⚠ Same as macOS / Windows: if a Nous Portal login pops up during installation (a browser opens and the terminal shows a portal link with a user_code) — that is Nous's own subscription service, not MYAI168. Press Ctrl + C to skip, close the browser, and do not log in.
Make the command available (substitute your shell config file), then check the version:
source ~/.bashrc # or: source ~/.zshrc
hermes --version
If hermes is not found: make sure ~/.local/bin is on your PATH. You can add:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Step 1: write the keys into .env (replace with your real key):
echo 'MYAI168_CLAUDE_API_KEY=your-key' >> ~/.hermes/.env
echo 'MYAI168_API_KEY=your-key' >> ~/.hermes/.env
Step 2: write config.yaml. On a fresh install (config.yaml has none of your personal settings yet), writing it in one go with a heredoc is the least error-prone way (paste the whole block, press Enter; the heredoc takes care of the formatting, so you never have to worry about indentation):
cat > ~/.hermes/config.yaml << 'EOF'
model:
provider: custom:myai168_claude
default: claude-opus-4-8
context_length: 200000
custom_providers:
- name: myai168_claude
base_url: https://www.myai168.com/en/api/anthropic
key_env: MYAI168_CLAUDE_API_KEY
api_mode: anthropic_messages
- name: myai168
base_url: https://www.myai168.com/en/api/openai/v1
key_env: MYAI168_API_KEY
api_mode: chat_completions
providers: {}
EOF
Note: this overwrites the entire config.yaml — if the file already contains your custom model / toolsets / terminal / TTS / compression settings, they will be wiped and reset to defaults. If you have custom settings to keep, do NOT overwrite wholesale; use the editing approach in the next paragraph and change only the relevant blocks. The base_url must end with .../anthropic (without /v1).
(To keep the existing file and only change the model settings, edit it with hermes config edit — touch only the model: / custom_providers: / providers: blocks, leave the other blocks untouched, and make sure those three top-level keys are flush-left with no leading spaces.)
Check the settings and start:
hermes doctor
hermes
(If doctor only reminds you to "Run hermes setup to configure missing API keys for full tool access", that refers to tools without keys and has nothing to do with the model — ignore it, and do NOT rerun hermes setup, or it may overwrite your settings.)
Once inside the interactive UI, just type and send. If the status bar at the bottom shows claude-opus-4-8, you are done. (If "Auxiliary title generation failed: HTTP 404" appears, that is a minor auxiliary-model feature failing; it does not affect the main conversation and can be ignored.)
source ~/.bashrc (or source ~/.zshrc) or reopen the terminal; if still not found, make sure ~/.local/bin is on your PATH (see "1. Install Hermes"). (On Windows: open a new PowerShell window so PATH takes effect.).../anthropic to .../anthropic/v1 and try again./model inside a conversation; to add a provider, exit the session and run hermes model.Update to the latest version:
hermes update
~/.hermes/.env (same as macOS; on Windows: %LOCALAPPDATA%\hermes\.env).Official docs: https://hermes-agent.nousresearch.com/docs