Hermes Agent

Updated at:

Use Alibaba Cloud Model Studio models in Hermes Agent.

Quick Start

Choose your client and complete the configuration.

CLI

  1. 1

    Get an API key

  2. 2

    Configure the model

    Run hermes model, select the provider for your billing plan, enter the API key, and select a model.

    Token Plan

    1. Select Qwen > Alibaba Cloud (Token Plan, China).
    2. Enter the Token Plan API key and keep the default Base URL.
    3. Select a model. For supported models, see the Personal Edition supported models and Team Edition supported models.

    Pay-as-you-go

    1. Select Qwen > Alibaba Cloud DashScope (China).
    2. Enter a Model Studio API key.
    3. The following example uses China North 2 (Beijing). Enter https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 as the Base URL, and replace {WorkspaceId} with your actual Workspace ID.
    4. Select a model. For supported models, see Supported models.

    Coding Plan

    1. Select Qwen > Alibaba Cloud (Coding Plan, China).
    2. Enter the Coding Plan dedicated API key and keep the default Base URL.
    3. Select a model. For supported models, see Coding Plan supported models.

    NoteThe provider list may include models that your plan does not support. The plan's supported model list is authoritative.

  3. 3

    Verify

    Run the following command to verify:

    hermes chat -q "hello"
    

Desktop

  1. 1

    Configure the model

    Add the configuration for your plan as described in Configure with a configuration file, or complete the CLI configuration first.

  2. 2

    Select the model

    Open Hermes Desktop, go to Settings → Model, and select the same provider and model.

Configure with a configuration file

The provider list in hermes model includes Alibaba Cloud Model Studio from v2026.8.31. If it is not in the list, use the following steps.

  1. 1

    Open or create the configuration file

    • macOS / Linux / WSL2: ~/.hermes/config.yaml
    • Windows: %LOCALAPPDATA%\hermes\config.yaml
  2. 2

    Add the configuration

    Replace YOUR_API_KEY with the API key for that plan (and {WorkspaceId} for pay-as-you-go), and add the configuration to the model section.

    Token Plan

    OpenAI-compatible

    model:
      default: auto
      provider: custom
      base_url: https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
      api_key: YOUR_API_KEY
    

    Anthropic-compatible

    model:
      default: auto
      provider: custom
      base_url: https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic
      api_mode: anthropic_messages
      api_key: YOUR_API_KEY
    

    Pay-as-you-go

    The following example uses China North 2 (Beijing).

    OpenAI-compatible

    model:
      default: qwen3.8-max
      provider: custom
      base_url: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
      api_key: YOUR_API_KEY
    

    Anthropic-compatible

    model:
      default: qwen3.8-max
      provider: custom
      base_url: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/apps/anthropic
      api_mode: anthropic_messages
      api_key: YOUR_API_KEY
    

    Coding Plan

    OpenAI-compatible

    model:
      default: qwen3.7-plus
      provider: custom
      base_url: https://coding.dashscope.aliyuncs.com/v1
      api_key: YOUR_API_KEY
    

    Anthropic-compatible

    model:
      default: qwen3.7-plus
      provider: custom
      base_url: https://coding.dashscope.aliyuncs.com/apps/anthropic
      api_mode: anthropic_messages
      api_key: YOUR_API_KEY
    
  3. 3

    Verify

    After saving, run hermes chat -q "Hello" to verify.

Error codes

If you encounter an error during configuration, see the FAQ for your billing plan:

FAQ

No Model Studio provider in hermes model

Model is unavailable

The model list in hermes model may include models that your plan does not support. Select a model from the plan's supported model list, or select Enter custom model name and enter a model ID.

How do I use savings plans and resource plans?

Savings plans and resource plans use the same access method as Pay-as-you-go. They automatically deduct eligible usage charges. For deduction rules, see Savings plans and resource plans.