Hermes Agent is a terminal AI coding tool. You can connect it to Alibaba Cloud Model Studio using Pay-as-you-go, Coding Plan, or Token Plan (Team Edition).
Install Hermes Agent
Run the following command in the terminal to install Hermes Agent. The installation script automatically installs dependencies such as Python and Git.
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bashNoteWindows does not support native installation. Install WSL2 first, then run the above command in WSL2.
After installation, reload the terminal environment.
source ~/.bashrc # If using zsh, change to source ~/.zshrcRun the following command to verify the installation. A version number in the output indicates a successful installation.
hermes --version
Configure Access Credentials
Use the hermes config set command to configure access parameters. Enter the Base URL and API Key corresponding to your chosen plan:
Token Plan (Team Edition): Seat-based subscription; token consumption deducts Credits.
Coding Plan: Fixed monthly subscription, metered by model invocation count.
Pay-as-you-go: Post-paid based on actual usage.
Token Plan (Team Edition)
Replace YOUR_API_KEY with the Token Plan (Team Edition) dedicated API Key. For available models, refer to Token Plan (Team Edition) supported models.
hermes config set model.provider custom
hermes config set model.base_url https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
hermes config set model.api_key YOUR_API_KEY
hermes config set model.default qwen3.6-plusThe above commands write the configuration to ~/.hermes/config.yaml. You can also edit the file directly with the following content:
Coding Plan
Replace YOUR_API_KEY with the Coding Plan dedicated API Key. For available models, refer to Coding Plan supported models.
hermes config set model.provider custom
hermes config set model.base_url https://coding-intl.dashscope.aliyuncs.com/compatible-mode/v1
hermes config set model.api_key YOUR_API_KEY
hermes config set model.default qwen3.6-plusThe above commands write the configuration to ~/.hermes/config.yaml. You can also edit the file directly with the following content:
Pay-as-you-go
Replace YOUR_API_KEY with your Alibaba Cloud Model Studio API Key. For available models, refer to OpenAI compatible - Supported models.
Set base_url based on your region. The API Key must correspond to the selected region:
China North 2 (Beijing):
https://dashscope.aliyuncs.com/compatible-mode/v1Singapore:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1US (Virginia):
https://dashscope-us.aliyuncs.com/compatible-mode/v1
hermes config set model.provider custom
hermes config set model.base_url https://dashscope-intl.aliyuncs.com/compatible-mode/v1
hermes config set model.api_key YOUR_API_KEY
hermes config set model.default qwen3.6-plusThe above commands write the configuration to ~/.hermes/config.yaml. You can also edit the file directly with the following content:
Verify Configuration
After completing the configuration, run the following command to send a test message:
hermes chat -q "Hello"If a normal response is returned, the configuration is successful. To switch models, specify the model using the -m parameter:
hermes chat -m qwen3.6-plusFAQ
Error Codes
If you encounter errors during configuration, refer to the FAQ documentation for the corresponding billing plan:
Pay-as-you-go: Anthropic API Compatible - Error Codes
Coding Plan: Coding Plan FAQ
Token Plan (Team Edition): Token Plan (Team Edition) FAQ
Still connecting to OpenRouter after configuration
Hermes Agent uses OpenRouter as the default inference provider. When connecting to Alibaba Cloud Model Studio, model.provider must be set to custom. Run the following command to verify:
hermes config set model.provider custom