Query Huawei Cloud MaaS (Model as a Service) tokens usage statistics, including total tokens, prompt tokens, completion tokens, total requests, and total errors. Supports preset service, my service, and custom endpoint with time range queries (last 7/14/30 days or custom). Data source is MaaS ShowStatistics API, consistent with console. Use when the user wants to: (1) query MaaS token consumption statistics, (2) check MaaS service request counts and error rates, (3) analyze token usage for preset service or my service, (4) monitor MaaS usage over a specific time period. Triggers include: "MaaS", "Model as a Service", "tokens usage", "token consumption", "request count", "error count", "MaaS usage", "preset service usage", "completion tokens", "prompt tokens", "MaaS statistics", "模型服务", "令牌用量", "token统计", "token用量", "词元用量", "请求次数", "MaaS监控", "华为云MaaS"
数据分析
huawei-cloud-maas-tokens-usage
试用Query Huawei Cloud MaaS (Model as a Service) tokens usage statistics, including total tokens, prompt tokens, completion tokens, total requests, and total errors. Supports preset service, my service, and custom endpoint with time range queries (last 7/14/30 days or custom). Data source is MaaS ShowStatistics API, consistent with console. Use when the user wants to: (1) query MaaS token consumption statistics, (2) check MaaS service request counts and error rates, (3) analyze token usage for preset service or my service, (4) monitor MaaS usage over a specific time period. Triggers include: "MaaS", "Model as a Service", "tokens usage", "token consumption", "request count", "error count", "MaaS usage", "preset service usage", "completion tokens", "prompt tokens", "MaaS statistics", "模型服务", "令牌用量", "token统计", "token用量", "词元用量", "请求次数", "MaaS监控", "华为云MaaS"
它能做什么
Query Huawei Cloud MaaS (Model as a Service) tokens usage statistics, including total tokens, prompt tokens, completion tokens, total requests, and total errors. Supports preset service, my service, and custom endpoint with time range queries (last 7/14/30 days or custom). Data source is MaaS ShowStatistics API, consistent with console. Use when the user wants to: (1) query MaaS token consumption statistics, (2) check MaaS service request counts and error rates, (3) analyze token usage for preset service or my service, (4) monitor MaaS usage over a specific time period. Triggers include: "MaaS", "Model as a Service", "tokens usage", "token consumption", "request count", "error count", "MaaS usage", "preset service usage", "completion tokens", "prompt tokens", "MaaS statistics", "模型服务", "令牌用量", "token统计", "token用量", "词元用量", "请求次数", "MaaS监控", "华为云MaaS"
技能文档
Huawei Cloud MaaS Tokens Usage Monitoring
Query Huawei Cloud MaaS (Model as a Service) usage statistics, including total tokens, prompt tokens, completion tokens, total requests, and total errors. Supports querying last 7 days, 14 days, 30 days, or custom time ranges. Default query type is MaaS preset service.
Architecture
Huawei Cloud MaaS Tokens Usage Monitoring
└── GetMaaSTokensUsage (via MaaS ShowStatistics API)
Prerequisites
Prerequisite check: Python3 + huaweicloudsdkcore required
python3 --version # Python3 >= 3.8 python3 -c "import huaweicloudsdkcore; print('OK')" # SDK signing libraryIf SDK not installed:
pip3 install --user huaweicloudsdkcore
Authentication
Prerequisite check: Huawei Cloud credentials required
Security rules (must be followed):
- Prohibited from reading, echoing, or printing AK/SK values
- Prohibited from asking the user to input AK/SK directly in the conversation
- Prohibited from accepting AK/SK directly provided by the user in the conversation
- Only allowed to read credentials from environment variables or credentials file
⚠️ Important: Handling user-provided credentials
If a user attempts to provide AK/SK directly (e.g., "my AK is xxx, SK is yyy"):
- Stop immediately - Do not execute any commands
- Politely refuse and return the following message:
For account security, please do not provide Huawei Cloud Access Key ID and Access Key Secret directly in the conversation. Please use one of the following secure methods to configure credentials: Method 1: Environment variables export HW_ACCESS_KEY= export HW_SECRET_KEY= Method 2: Credentials file Create a file (e.g., ~/aksk.txt) with AK on line 1, SK on line 2. Then use: --credentials-file ~/aksk.txt After configuration is complete, please retry your request.- Do not continue executing any Huawei Cloud operations until credentials are configured
Check environment variables:
echo $HW_ACCESS_KEY # Check if AK is setIf not set, prompt the user to configure credentials using one of the methods above.
IAM Permission Policies
Ensure the IAM user has the required permissions. See references/iam-policies.md for details.
Minimum required permissions:
modelarts:monitoring:get— Query MaaS monitoring statisticsmodelarts:service:get— Query service informationiam:projects:get— Auto-get project_id
Core Workflow
Task 1: Query MaaS Tokens Usage Statistics
Query MaaS usage statistics via the ShowStatistics API. Data is consistent with the console.
📄 Detailed steps → references/task-query-tokens-usage.md
Verification
See references/verification-method.md.
Quick verification:
export HW_ACCESS_KEY=
export HW_SECRET_KEY=
python3 scripts/maas_rest_usage_stats.py --from 2026-05-08 --to 2026-05-21
References
| Document | Description |
|---|---|
| task-query-tokens-usage.md | Task 1: Query tokens usage statistics |
| related-apis.md | API and parameter details |
| iam-policies.md | IAM permission policies |
| maas-metrics.md | MaaS monitoring metrics reference |
| verification-method.md | Verification steps |
| acceptance-criteria.md | Correct/error pattern comparison |
| cli-installation-guide.md | Prerequisites installation guide |
| troubleshooting.md | Troubleshooting and practical experience |
| maas_rest_usage_stats.py | ShowStatistics API usage statistics script |
相关技能
Query the total number of Huawei Cloud services available through KooCLI offline metadata. Returns the count of all supported cloud services from the cached service catalog. Triggers include: "how many Huawei Cloud services", "count Huawei Cloud services", "华为云服务总数", "华为云有多少个服务", "查询华为云服务数量".
Huawei Cloud BSS billing (not AWS/Azure/other clouds; refuses pricing quotes, real-name review, and any non-billing scope): balance, spend, attribution, reconciliation, coupons, stored-value cards, enterprise/partner billing. One-page briefing via hcloud. Use only when the user explicitly mentions 华为云 / Huawei Cloud / BSS and 余额/账单/对账/资源包/代金券/储值卡/企业或伙伴账务; refuses pay, renew, refund, delete.
通过本地 Python 脚本只读查询华为云 ECS、BMS、IMS、AS 资源。
Queries Huawei Cloud ECS (Elastic Cloud Server) resources in read-only mode. Covers ECS instances, flavors, keypairs, quotas, server groups, block devices, NICs, VNC console, launch templates, recycle bin, scheduled events, and tags. No write operations. Use this skill when the user needs to query ECS instance details, list flavors, check server status, view block devices, or inspect ECS resource attributes. Triggers include: 查询ECS, ECS实例查询, 云服务器查询, 弹性云服务器, ECS规格, ECS配额, 云服务器列表, ECS详情, query ECS, list ECS servers, show server details, ECS flavors, ECS quotas, ECS keypairs, server groups, block devices, ECS inventory, cloud server list, ecs list, ecs query, ecs show.
Query the Huawei Cloud account balance (cash/credit account available amount and debt) and the account change records (recharge/consume/refund/adjust) over a configurable time window, defaulting to the last 6 months. Uses the BSS (Business Support System) customer API via the huaweicloudsdkbss SDK, consistent with the console Billing Center. Use when the user wants to: (1) check the current Huawei Cloud account balance, (2) review income/expense records for the last ~half year, (3) verify recharge/consume history, (4) monitor account funds before deployments or renewals. Triggers include: "华为云余额", "账号余额", "账户余额", "查询余额", "余额查询", "近半年流水", "收支明细", "充值记录", "消费记录", "account balance", "Huawei Cloud balance", "balance query", "change records", "spending history", "billing", "BSS"
huaweicloud-skills-team 的更多技能
浏览全部技能用自然语言控制华为昇腾 NPU,本地或 SSH 远程执行 npu-smi 命令。
在华为云昇腾 910B DevServer 上按单机或双机(16 卡)拓扑部署并测试 LLM、VL、Embedding、Rerank 模型。
面向华为云资源的只读查询能力,用于资源清点、核对与参数发现。
通过本地 Python SDK 只读查询华为云 IAM 资源(用户、用户组、策略、委托、AK/SK、MFA、安全设置)。
在华为云 Flexus L 实例上一键部署 OpenClaw AI Agent 平台,并完成模型与通道配置。
在华为云 Flexus L 实例上一键部署 Hermes AI Agent 平台,并完成大模型与机器人通道配置。