Goal of this guide: install Hermes Agent (a local AI agent from Nous Research) on macOS and connect it to your own MYAI168 API, using Claude Opus 4.8.
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/.envRun the official one-line install script (it automatically installs uv and Python 3.11; no sudo needed):
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
After installation, make the command available:
source ~/.zshrc
hermes --version
After installation the setup wizard starts:
https://www.myai168.com/en/api/anthropicclaude-opus-4-8anthropic_messagesIf you previously installed OpenClaw, the wizard may detect it and offer to migrate; you can accept, but the migrated settings are often overwritten by defaults — be sure to do "2-B. Manually Verify / Fix the Settings" below.
The wizard may not have pointed the model at the correct endpoint; checking and editing the config file directly is the most reliable way.
First confirm the keys (add them if missing; replace with your real key):
cat ~/.hermes/.env
echo 'MYAI168_CLAUDE_API_KEY=your-key' >> ~/.hermes/.env
echo 'MYAI168_API_KEY=your-key' >> ~/.hermes/.env
Edit the config file:
hermes config edit
Change the model block at the top to the following:
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: {}
★★ Paste carefully ★★ YAML is extremely sensitive to indentation. The leading spaces on each line above are exactly the indentation required. The three top-level items model: / custom_providers: / providers: must be flush-left (0 leading spaces); only their sub-items are indented. Do not add extra spaces in front of any line when copying, and never use Tab (spaces only).
Notes: provider refers to the entry below with the same name; key_env takes the environment variable NAME, not the key itself; the Anthropic endpoint base_url must end with .../anthropic (without /v1).
If hermes reports a YAML error like "Failed to parse config.yaml" after manual editing (usually broken indentation or extra pasted spaces), the safest fix is to rewrite the whole file with one command — copy the entire block below, paste it into the terminal, and press Enter (the heredoc takes care of the formatting, so there are no indentation problems). Note: this overwrites the entire config.yaml — any custom model / toolsets / terminal / TTS / compression settings you had will be wiped and reset to defaults. Only use it when the file is already unparseable and beyond rescue; if you have custom settings to keep, fix the indentation by hand instead (touch only the model / custom_providers / providers blocks and leave the other blocks untouched).
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
(This is exactly why cat > is less error-prone than manual editing — just paste the whole block; no need to fix the indentation line by line.)
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 the tools you skipped 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 ~/.zshrc or reopen the terminal. (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. (On Windows: %LOCALAPPDATA%\hermes\.env.)Official docs: https://hermes-agent.nousresearch.com/docs