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.
It covers two scenarios:
Difference between Hermes and OpenClaw: OpenClaw is built on Node / npm; Hermes is built on Python. Its install script automatically installs uv and Python 3.11, requires no sudo, and avoids the npm global-directory permission problems.
~/.hermes/config.yaml~/.hermes/.env~/.hermes/ (sessions, logs, cron, etc.)~/.hermes/hermes-agentHave your key ready before installing. MYAI168 offers two endpoints:
OpenAI-compatible endpoint https://www.myai168.com/en/api/openai/v1
Anthropic native endpoint https://www.myai168.com/en/api/anthropic
To use Claude Opus 4.8, use the Anthropic native endpoint.
Run the official one-line install script:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
This automatically installs uv, Python 3.11, clones the project, and completes setup, without sudo.
After installation, make the hermes command available in the current window:
source ~/.zshrc
After installation, the setup wizard starts. Path A applies when you have never installed OpenClaw.
The wizard will not show any OpenClaw migration screen (because it cannot detect ~/.openclaw) and goes straight into setup. Choose as follows:
custom (direct API) or Custom endpoint (enter URL manually). Then enter the following in order:
https://www.myai168.com/en/api/anthropicclaude-opus-4-8anthropic_messages (Anthropic protocol)After setup, it is still recommended to do the "Manually Verify / Fix the Settings" section before validating.
If OpenClaw was installed on the machine and configured with MYAI168, the wizard automatically detects it and asks about migration.
Note: after the wizard finishes, the model block may be overwritten by defaults (OpenRouter / official Anthropic), and the migrated key may not be kept either. So for the migration path, "you must do the manual verification in the next section after it finishes."
Regardless of the path, the setup wizard may fail to point the model at the correct custom endpoint. The most reliable approach is to inspect and edit the config file directly.
cat ~/.hermes/.env
It should contain the following (if not, add the two lines below, replacing with your real key):
echo 'MYAI168_CLAUDE_API_KEY=your-key' >> ~/.hermes/.env
echo 'MYAI168_API_KEY=your-key' >> ~/.hermes/.env
(If the OpenAI and Anthropic endpoints share one key, fill both lines with the same value.)
hermes config edit
Change the model block at the top to the following (use spaces for YAML indentation, not Tab; leave the existing fallback_providers, toolsets, agent and other blocks below untouched):
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: {}
custom:myai168_claude, which corresponds to the entry named myai168_claude below and uses the Anthropic protocol..../anthropic (without /v1); in anthropic_messages mode Hermes appends /v1/messages itself.Ctrl + O then Enter, then Ctrl + X to exit.:wq then Enter.Cmd + S to save, then close.Check the configuration:
hermes doctor
(If it only warns "Run hermes setup to configure missing API keys for full tool access", that refers to the tools you skipped that still have no key. It is unrelated to the model and can be ignored. Do not re-run hermes setup because of it, to avoid overwriting your settings.)
Start chatting — the simplest way is to type hermes to enter the interactive interface:
hermes
Once in the chat screen, just type and press Enter to send. (If you want a single-line test, note that you must use straight quotes: hermes chat "hello".)
What success looks like: the model replies normally, and the status bar at the bottom shows claude-opus-4-8 with a 200K context limit. This means MYAI168 + Claude Opus 4.8 is connected.
source ~/.zshrc, or open a new terminal window..../anthropic to .../anthropic/v1 and try again./model within a conversation to switch to an already-configured model; to add a provider, leave the session and run hermes model.hermes gateway setup.Update to the latest version:
hermes update
hermes model: run in the terminal (outside a session), the full provider setup wizard./model: run within a conversation; can only switch between already-configured providers / models.Official docs: https://hermes-agent.nousresearch.com/docs