Documents

huawei-cloud-billing-bill-query

Try it

Query the Huawei Cloud BSS (Business Support System) bills and fees of the current account within ONE billing cycle (one month). Supports three read-only queries: (1) bill fee records (账单费用记录/账单明细) for a billing cycle (YYYY-MM), (2) resource fee records / 流水账单 for a billing cycle, and (3) monthly cost breakdown (月度成本分析). Uses the huaweicloudsdkbss Python SDK (list_customer_bills_fee_records, list_customerself_resource_records, list_customer_bills_monthly_break_down; v2 API GET /v2/bills/customer-bills/fee-records, /v2/bills/customer-bills/res-fee-records, /v2/costs/cost-analysed-bills/monthly-breakdown) — KooCLI does NOT support the BSS service, so the SDK is the only execution path. The shipped scripts/query_bills.py integrates the execution-quality reporting SDK and reports every run to the skillsopr operations console. Time scope is limited to one month (the current month by default) — no multi-month or unbounded range queries. Read-only — never creates, modifies or deletes any bill

What it does

Query the Huawei Cloud BSS (Business Support System) bills and fees of the current account within ONE billing cycle (one month). Supports three read-only queries: (1) bill fee records (账单费用记录/账单明细) for a billing cycle (YYYY-MM), (2) resource fee records / 流水账单 for a billing cycle, and (3) monthly cost breakdown (月度成本分析). Uses the huaweicloudsdkbss Python SDK (list_customer_bills_fee_records, list_customerself_resource_records, list_customer_bills_monthly_break_down; v2 API GET /v2/bills/customer-bills/fee-records, /v2/bills/customer-bills/res-fee-records, /v2/costs/cost-analysed-bills/monthly-breakdown) — KooCLI does NOT support the BSS service, so the SDK is the only execution path. The shipped scripts/query_bills.py integrates the execution-quality reporting SDK and reports every run to the skillsopr operations console. Time scope is limited to one month (the current month by default) — no multi-month or unbounded range queries. Read-only — never creates, modifies or deletes any billing resource. Use this skill whenever the user wants to check the current Huawei Cloud account's bills, fees, consumption records, 流水账单 or monthly cost within one month, e.g. for cost review, monthly expense check, or budget inspection. Triggers include: "查询账单", "账单查询", "费用查询", "查询费用", "消费记录", "流水账单", "月度账单", "月度费用", "账单明细", "查账单", "bill query", "query bill", "query fees", "billing records", "monthly bill", "cost breakdown", "消费明细", "费用明细".

The skill document

Huawei Cloud Billing Bill Query Skill

Overview

This skill queries the Huawei Cloud BSS (Business Support System) bills and fees of the current account within one billing cycle (one month) via the BSS v2 API and returns a report. It supports three read-only actions:

ActionWhat it returnsBSS v2 API
fee-recordsBill fee records (账单费用记录/账单明细) for a billing cycle: service, resource, region, consume/trade time, consume amount, cash/credit/coupon amountslist_customer_bills_fee_records
res-fee-recordsResource fee records / 流水账单 for a billing cycle: per-resource usage, unit price, amount, cash/credit/coupon amountslist_customerself_resource_records
breakdownMonthly cost breakdown (月度成本分析) for a shared month: amortized amounts per resourcelist_customer_bills_monthly_break_down

The time scope is deliberately limited to one month: the default billing cycle is the current month (YYYY-MM), and the user can pick any single month. Multi-month or unbounded range queries are not supported.

It is a read-only inspection skill: it never creates, modifies, or deletes any billing resource.

Architecture:

Agent → scripts/query_bills.py (quality-reporting wrapper)
       → huaweicloudsdkbss Python SDK (BssClient)
       → Huawei Cloud BSS v2 API (global endpoint https://bss.myhuaweicloud.com)

API paths (verified from huaweicloudsdkbss v2 SDK _http_info):

OperationMethodAPI Path
Query bill fee recordsGET/v2/bills/customer-bills/fee-records
Query resource fee records (流水账单)GET/v2/bills/customer-bills/res-fee-records
Query monthly cost breakdownGET/v2/costs/cost-analysed-bills/monthly-breakdown

Execution-quality reporting: every invocation of scripts/query_bills.py reports a trace_id, status (success / biz_fail / sys_fail), error code and cost to the skillsopr operations console via the vendored scripts/skill_quality_sdk.py. Reporting is non-blocking and fails silently; it never affects the query result.

Applicable Scenarios:

  • Monthly expense check: "how much did I spend last month" / "查一下这个月的账单"
  • Cost review: enumerate consumption per service / resource for one month
  • 流水账单 inspection: per-resource usage and unit prices for one billing cycle
  • Budget check: monthly cost breakdown with amortized amounts
  • Daily inspection: quick bill snapshot of the current month

能力边界(Capability Boundary): 本 Skill 仅查询当前账号一个月内的账单/费用(账单费用记录、流水账单、 月度成本分析)。不查询余额/余额变动,不创建、修改、删除任何账单或资源, 不支持跨多个月的查询。 若用户询问"查余额"、"导出账单"、"开票"、"充值/退款"等,请明确告知本 Skill 不提供该能力。

Prerequisites

  1. Python 3.8+ with huaweicloudsdkbss and huaweicloudsdkcore packages — See references/cli-installation-guide.md (KooCLI does NOT support BSS, so the SDK is the only execution path)
  2. Huawei Cloud AK/SK in environment variables (HUAWEI_ACCESS_KEY/HUAWEI_SECRET_KEY or HUAWEICLOUD_SDK_AK/HUAWEICLOUD_SDK_SK) — must belong to the account whose bills are queried
  3. IAM permissionsbss:bill:view (or the system policy BSS ReadOnlyAccess) is required to query bills. See references/iam-policies.md
  4. BSS is a global service — no region parameter is required; the client uses GlobalCredentials against https://bss.myhuaweicloud.com

Workflow

  1. Identify the intent — Confirm the user wants to query bills/fees (账单/费用/流水账单/月度成本) of the current account.
  2. Determine the billing cycle — Default to the current month (YYYY-MM); let the user override with a single month. Only one month is supported.
  3. Choose the actionfee-records (账单费用记录) is the default; use res-fee-records for 流水账单 or breakdown for monthly cost analysis.
  4. Run the query — Execute scripts/query_bills.py with the requested action and cycle; optionally narrow the date range with --bill-date-begin / --bill-date-end.
  5. Present the results — Show the per-record amounts and totals (consume/cash/coupon), or the raw JSON with --format json.
  6. Handle errors — Missing AK/SK (C01), invalid cycle/date format (U02), missing cycle (U01), or no records (U03) are reported with the quality SDK error codes. Parameter validation is client-side and fail-fast: dates must fall within the selected billing cycle, --limit must be 1-100, --offset must be >= 1, and action-specific parameters (--shared-month, --bill-date-*, --bill-type) are rejected with a clear U02 message when used with an incompatible action.

Core Commands

This skill uses the Python SDK (KooCLI does not support BSS). Run from the skill directory: python3 scripts/query_bills.py [options]

Query bill fee records (default action, current month)

python3 scripts/query_bills.py

Query bill fee records for a specific month (JSON)

python3 scripts/query_bills.py --action fee-records --bill-cycle 2026-07 --format json

Query resource fee records (流水账单) for one month

python3 scripts/query_bills.py --action res-fee-records --cycle 2026-07

Narrow to a date range within the month

python3 scripts/query_bills.py --action res-fee-records --cycle 2026-07 \
  --bill-date-begin 2026-07-01 --bill-date-end 2026-07-31

Query monthly cost breakdown (月度成本分析)

python3 scripts/query_bills.py --action breakdown --shared-month 2026-07 --limit 20

Filter by bill type (1=consumption, 2=refund, 3=adjustment, 4=timed, 5=arrears)

python3 scripts/query_bills.py --action fee-records --bill-cycle 2026-07 --bill-type 1

Parameter Confirmation

ParameterRequiredDescriptionExample
--actionNoQuery action: fee-records (default), res-fee-records, breakdownfee-records
--bill-cycleNoBilling cycle YYYY-MM (fee-records); default current month2026-07
--cycleNoBilling cycle YYYY-MM (res-fee-records); default current month2026-07
--shared-monthNoShared month YYYY-MM (breakdown); default current month2026-07
--bill-date-beginNoStart date YYYY-MM-DD within the month (fee-records / res-fee-records)2026-07-01
--bill-date-endNoEnd date YYYY-MM-DD within the month (fee-records / res-fee-records)2026-07-31
--bill-typeNoBill type: 1=consumption, 2=refund, 3=adjustment, 4=timed, 5=arrears1
--offsetNoPage offset (>=1)1
--limitNoMax records per page (1-100)10
--formatNoOutput format: text (default) or jsonjson

Reference Documents

  • references/cli-installation-guide.md — Python SDK installation and AK/SK configuration (KooCLI does not support BSS)
  • references/iam-policies.md — Least-privilege IAM policies (bss:bill:view)
  • references/verification-method.md — Verification method and manual checks
  • references/dataflow-diagram.md — Mermaid data flow diagram
  • references/acceptance-criteria.md — Acceptance criteria

KooCLI Command Format Standard

KooCLI (hcloud) does not support the BSS service — hcloud BSS --help returns "Unsupported service: BSS". This skill therefore uses the Python SDK (huaweicloudsdkbss) as its only execution path; no hcloud commands are used.

Related skills

Query the Huawei Cloud BSS (Business Support System) account balance and its history across different time periods, and return a report. Supports three read-only queries: (1) current customer account balance (currency, total debt amount, per-account balances for cash/credit/reward/deposit), (2) balance change records (income/expense detail: recharge, consumption, refund, freeze, etc.) within a user-specified date range, and (3) monthly consumption summary for a user-specified billing cycle (YYYY-MM). Uses the huaweicloudsdkbss Python SDK (show_customer_account_balances, list_customer_account_change_records, show_customer_monthly_sum; v2 API GET /v2/accounts/customer-accounts/balances, /v2/accounts/customer-accounts/account-change-records, /v2/bills/customer-bills/monthly-sum) — KooCLI does NOT support the BSS service, so the SDK is the only execution path. The shipped scripts/query_balance_history.py integrates the execution-quality reporting SDK and reports every run to the skillsopr

Query the Huawei Cloud BSS (Business Support System) customer account balance of the current account and return a balance report. Returns the currency, total debt amount, and per-account balances (cash/balance account, credit account, reward account, deposit account) with amounts. Uses the huaweicloudsdkbss Python SDK (`show_customer_account_balances`, v2 API `GET /v2/accounts/customer-accounts/balances`) — KooCLI does NOT support the BSS service, so the SDK is the only execution path. The shipped scripts/query_account_balance.py integrates the execution-quality reporting SDK and reports every run to the skillsopr operations console. Read-only — never creates, modifies or deletes any billing resource. Use this skill whenever the user wants to check the personal Huawei Cloud account balance, remaining balance, debt, or billing account status, e.g. for cost review, before creating pay-per-use resources, or daily inspection. Triggers include: "账户余额", "余额查询", "查询余额", "账单余额", "我的余额", "欠费",

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"

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.

by huaweicloud-skills-team

Queries Huawei Cloud billing and fee details only when Terraform needs a billing or pricing inquiry. Covers balances, bills, coupons, cash coupons, stored-value cards, orders, refunds, costs, free resources, resource usage, enterprise accounts, and on-demand/period/ELB/NAT/DCS pricing. No write operations. Use this skill only when Terraform requires billing details, invoice/bill summaries, coupon or balance status, refund/order billing status, or pricing inquiry. Triggers: Terraform 账单查询, Terraform 费用查询, Terraform 价格询价, Terraform 询价, Terraform billing query, Terraform pricing inquiry, Terraform price quote, Terraform bill summary.

by huaweiclouddev-dev

Queries Huawei Cloud billing and pricing. Covers balances, bills, coupons, cash coupons, stored-value cards, orders, refunds, costs, free resources, resource...

1 installs