-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
Description
Please review the Community Note before submitting
Description
Add detector for Alibaba Cloud DashScope API keys. DashScope is Alibaba Cloud's AI model service platform that provides access to various large language models including Qwen (通义千问) and other AI capabilities.
Preferred Solution
Key Format:
- 32-character hexadecimal string
- Example pattern:
[a-f0-9]{32}
Suggested Regex:
\b[a-f0-9]{32}\bContext-aware detection:
Since the key format is generic, detection should look for context clues:
- Variable names containing:
ALIYUN,DASHSCOPE,QWEN,TONGYI - Proximity to API endpoints:
dashscope.aliyuncs.com - Common header names:
X-DashScope-API-Key,Authorization
Verification Endpoint:
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation
Headers:
Authorization: Bearer <API_KEY>
Content-Type: application/json
Body:
{
"model": "qwen-turbo",
"input": {
"messages": [
{
"role": "user",
"content": "test"
}
]
}
}
A valid key will return 200 OK, invalid keys return 401 or 400 with error messages.
How to Obtain a Test Key:
- Sign up for Alibaba Cloud account at https://www.alibabacloud.com/
- Navigate to DashScope console: https://dashscope.console.aliyun.com/
- Create API key in the API-KEY management section
- Free tier available for testing
Additional Context
DashScope is widely used in China and by international companies building AI applications with Chinese language models. The API keys provide access to:
- Text generation (Qwen models)
- Image generation
- Audio processing
- Multimodal capabilities
References
- Official Documentation: https://help.aliyun.com/zh/dashscope/
- API Reference: https://help.aliyun.com/zh/dashscope/developer-reference/api-details
- Getting Started: https://help.aliyun.com/zh/dashscope/developer-reference/quick-start
- Authentication Guide: https://help.aliyun.com/zh/dashscope/developer-reference/activate-dashscope-and-create-an-api-key