查询日用量 (V2)
本接口查询指定组织指定时间段的日用量。当前用户须为组织所有者或计费管理员。
该 API 的 Base URL 格式如下:
https://api.cloud.zilliz.com
控制面接口速率限制为单用户单接口每秒最多 20 个请求。
如果您在使用该接口过程中遇到任何问题,欢迎您联系 Zilliz Cloud 技术支持。
export BASE_URL="https://api.cloud.zilliz.com"
认证令牌,应为具备适当权限的 API 密钥。
查询时间段的开始时间,采用 RFC 3339 格式(例如 2026-09-16T00:00:00Z)。必须为 UTC 零点整。非 UTC 时区偏移会先被换算为 UTC,日期随之偏移。开始时间不是 UTC 零点时,接口不报错,静默返回当天 items 为空、total 为 0 的日区间。
查询时间段的结束时间,采用 RFC 3339 格式(例如 2026-09-17T00:00:00Z)。结束日期为包含边界:end 与 start 相同时仅返回一个日区间。
export TOKEN="YOUR_API_KEY"
curl --request POST \
--url "${BASE_URL}/v2/usage/query" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"start": "2024-01-01T00:00:00Z",
"end": "2024-02-01T00:00:00Z"
}'
返回指定组织指定时间段的日用量详情。
返回指定组织指定时间段的日用量详情。
响应码。
用量查询结果。整个查询区间在单次响应中完整返回。
查询时间段开始时间,格式为 YYYY-MM-DDTHH:mm:ssZ。
查询时间段结束时间,格式为 YYYY-MM-DDTHH:mm:ssZ。
指定时间段内的用量总金额。
总金额币种。
指定时间段内的用量明细。
费用类型。
当前费用项详情。
产生当前费用项目的集群所属项目 ID。
产生当前费用项目的集群所属区域 ID。
产生当前费用项目的集群的 CU 类型。
产生当前费用项目的集群的订阅计划。
产生当前费用项目的集群 ID。
计费资源类型。
计费资源 ID。
Volume 名称。
计费请求的类别。
当前费用项对应的已使用的资源数量。
当前费用项对应的已使用的资源数量单位。
当前费用项对应的已使用的资源列表价格。
资源单价。
当前费用项对应的已使用的资源实际价格。
资源单价。
当前费用项的费用金额,币种与该时间区间的 currency 一致。
返回错误消息。
响应码。
错误描述。
{
"code": 0,
"data": {
"results": [
{
"intervalStart": "2024-01-01T00:00:00Z",
"intervalEnd": "2024-01-02T00:00:00Z",
"total": 12345.12345678,
"currency": "USD",
"items": [
{
"costType": "compute",
"properties": {
"projectId": "proj-xxxxxxxxxxxxxxxxxxxx",
"regionId": "ali-cn-hangzhou",
"cuType": "Performance-optimized",
"plan": "Standard",
"clusterId": "inxx-xxxxx"
},
"quantity": 55.6778,
"unit": "CU-hours",
"listPrice": {
"unitPrice": 123
},
"price": {
"unitPrice": 123
},
"amount": 12345.12345678
},
{
"costType": "storage",
"properties": {
"projectId": "proj-xxxxxxxxxxxxxxxxxxxx",
"regionId": "ali-cn-hangzhou",
"cuType": "Performance-optimized",
"plan": "Standard",
"clusterId": "inxx-xxxxx"
},
"quantity": 55.6778,
"unit": "...",
"amount": 12345.12345678
},
{
"costType": "read_vcu",
"properties": {
"projectId": "proj-xxxxxxxxxxxxxxxxxxxx",
"regionId": "ali-cn-hangzhou",
"clusterId": "inxx-xxxxx"
},
"quantity": 8123789132,
"unit": "...",
"amount": 12345.12345678,
"listPrice": {
"unitPrice": 123
},
"price": {
"unitPrice": 123
}
}
]
}
]
}
}