Problem Description
The Alibaba Cloud (DashScope) provider has a hardcoded default endpoint that doesn't work with standard DashScope API keys! (╥﹏╥)
Root Cause
In hermes_cli/auth.py line 163:
"alibaba": ProviderConfig(
id="alibaba",
name="Alibaba Cloud (DashScope)",
auth_type="***",
inference_base_url="https://coding-intl.dashscope.aliyuncs.com/v1", # ← hardcoded!
api_key_env_vars=("DASH...",),
base_url_env_var="DASHSCOPE_BASE_URL",
),
The coding-intl endpoint is only for Alibaba Coding Plan keys, not standard DashScope API keys!
Three Endpoints, Three Key Types
| Endpoint |
Status |
Key Type Required |
https://coding-intl.dashscope.aliyuncs.com/v1 |
❌ Hardcoded default |
Coding Plan key only |
https://dashscope.aliyuncs.com/compatible-mode/v1 |
❌ China region |
China-registered keys |
https://dashscope-intl.aliyuncs.com/compatible-mode/v1 |
✅ International |
Standard DashScope keys |
Error When Using Standard Key
{
"error": {
"message": "Incorrect API key provided. For details, see: https://help.aliyun.com/zh/model-studio/error-code#apikey-error",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}
Current Workaround
Setting DASHSCOPE_BASE_URL in .env to override:
DASHSCOPE_BASE_URL=https://dashscope-intl.aliyuncs.com/compatible-mode/v1
And also setting base_url in config.yaml:
model:
default: qwen3.5-plus
provider: alibaba
base_url: https://dashscope-intl.aliyuncs.com/compatible-mode/v1
This works! But the default should be the endpoint that works with standard keys~
Proposed Fix
Change the default inference_base_url in auth.py to the international OpenAI-compatible endpoint:
"inference_base_url": "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
This is the endpoint that:
- Works with standard DashScope API keys (the most common type)
- Supports OpenAI-compatible chat completions
- Routes to the international (Singapore) region
Users with Coding Plan keys can still override via DASHSCOPE_BASE_URL env var.
Additional Context
The models.py comments already acknowledge this (lines 211-215):
# Alibaba DashScope Coding platform (coding-intl) — default endpoint.
# Supports Qwen models + third-party providers (GLM, Kimi, MiniMax).
# Users with classic DashScope keys should override DASHSCOPE_BASE_URL
# to https://dashscope-intl.aliyuncs.com/compatible-mode/v1 (OpenAI-compat)
So the code knows standard keys need a different endpoint, but defaults to the Coding Plan one anyway~ This seems backwards! The default should serve the majority of users (standard keys), with Coding Plan users as the override case.
Verification
# Standard DashScope key - FAILS on coding-intl
curl https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions \
-H "Authorization: Bearer sk-standard-key" \
-d '{"model":"qwen3.5-plus","messages":[{"role":"user","content":"test"}],"max_tokens":10}'
# → 401 invalid_api_key
# Standard DashScope key - WORKS on intl compatible-mode
curl https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer sk-standard-key" \
-d '{"model":"qwen3.5-plus","messages":[{"role":"user","content":"test"}],"max_tokens":10}'
# → 200 OK ✨
Tested on Ubuntu 24.04, Hermes v0.5.0, Qwen 3.5 Plus via DashScope Singapore region ヽ(>∀<☆)ノ
Problem Description
The Alibaba Cloud (DashScope) provider has a hardcoded default endpoint that doesn't work with standard DashScope API keys! (╥﹏╥)
Root Cause
In
hermes_cli/auth.pyline 163:The
coding-intlendpoint is only for Alibaba Coding Plan keys, not standard DashScope API keys!Three Endpoints, Three Key Types
https://coding-intl.dashscope.aliyuncs.com/v1https://dashscope.aliyuncs.com/compatible-mode/v1https://dashscope-intl.aliyuncs.com/compatible-mode/v1Error When Using Standard Key
{ "error": { "message": "Incorrect API key provided. For details, see: https://help.aliyun.com/zh/model-studio/error-code#apikey-error", "type": "invalid_request_error", "code": "invalid_api_key" } }Current Workaround
Setting
DASHSCOPE_BASE_URLin.envto override:And also setting
base_urlinconfig.yaml:This works! But the default should be the endpoint that works with standard keys~
Proposed Fix
Change the default
inference_base_urlinauth.pyto the international OpenAI-compatible endpoint:This is the endpoint that:
Users with Coding Plan keys can still override via
DASHSCOPE_BASE_URLenv var.Additional Context
The
models.pycomments already acknowledge this (lines 211-215):So the code knows standard keys need a different endpoint, but defaults to the Coding Plan one anyway~ This seems backwards! The default should serve the majority of users (standard keys), with Coding Plan users as the override case.
Verification
Tested on Ubuntu 24.04, Hermes v0.5.0, Qwen 3.5 Plus via DashScope Singapore region ヽ(>∀<☆)ノ