获取 Blob Storage 用量
通过 GET /v1/account/stats 读取你的 Blob Storage 用量:文件数、字节数、内置存储、本月平均用量,以及超出配额部分存储的预估费用。
GET
/
v1
/
account
/
stats
curl --request GET \
--url 'https://blob.squarecloud.app/v1/account/stats' \
--header 'Authorization: YOUR_API_KEY'
{
"status": "success",
"response": {
"usage": {
"objects": 1284,
"storage": 3758096384
},
"plan": {
"included": 1073741824,
"legacy": null
},
"overage": {
"enabled": true,
"cap": 10737418240,
"suspended": false,
"limit": 11811160064
},
"billing": {
"extraStorage": 2684354560,
"billable": 2615080894,
"storagePrice": 0.6,
"objectsPrice": 0,
"totalEstimate": 10,
"pricePerGB": 0.2,
"minimum": 10
},
"month": {
"days": 3,
"average_storage": 3042268501,
"daily": [
{ "day": "2026-12-01", "storage": 2147483648, "billable": 1073741824 },
{ "day": "2026-12-02", "storage": 3221225472, "billable": 2147483648 },
{ "day": "2026-12-03", "storage": 3758096384, "billable": 2684354560 }
]
}
}
}
你账户的 API 密钥。你可以在账户设置中找到它。
blob:read scope。
大小单位为字节,金额单位为 BRL。超额用量在控制台中开启和关闭,无法通过 API 操作。
速率限制
每分钟 20 次请求,超出后会被短暂封禁(
RATE_LIMITED,429)。响应
curl --request GET \
--url 'https://blob.squarecloud.app/v1/account/stats' \
--header 'Authorization: YOUR_API_KEY'
{
"status": "success",
"response": {
"usage": {
"objects": 1284,
"storage": 3758096384
},
"plan": {
"included": 1073741824,
"legacy": null
},
"overage": {
"enabled": true,
"cap": 10737418240,
"suspended": false,
"limit": 11811160064
},
"billing": {
"extraStorage": 2684354560,
"billable": 2615080894,
"storagePrice": 0.6,
"objectsPrice": 0,
"totalEstimate": 10,
"pricePerGB": 0.2,
"minimum": 10
},
"month": {
"days": 3,
"average_storage": 3042268501,
"daily": [
{ "day": "2026-12-01", "storage": 2147483648, "billable": 1073741824 },
{ "day": "2026-12-02", "storage": 3221225472, "billable": 2147483648 },
{ "day": "2026-12-03", "storage": 3758096384, "billable": 2684354560 }
]
}
}
}
错误
| 代码 | HTTP | 触发情况 |
|---|---|---|
PREFIX_NOT_ALLOWED | 403 | API 密钥被限定在前缀内:统计数据需要一个适用于整个账户的密钥。 |
RATE_LIMITED | 429 | 一分钟内超过 20 次请求。 |
相关内容
- Blob SDK:
blob.stats()
⌘I
curl --request GET \
--url 'https://blob.squarecloud.app/v1/account/stats' \
--header 'Authorization: YOUR_API_KEY'
{
"status": "success",
"response": {
"usage": {
"objects": 1284,
"storage": 3758096384
},
"plan": {
"included": 1073741824,
"legacy": null
},
"overage": {
"enabled": true,
"cap": 10737418240,
"suspended": false,
"limit": 11811160064
},
"billing": {
"extraStorage": 2684354560,
"billable": 2615080894,
"storagePrice": 0.6,
"objectsPrice": 0,
"totalEstimate": 10,
"pricePerGB": 0.2,
"minimum": 10
},
"month": {
"days": 3,
"average_storage": 3042268501,
"daily": [
{ "day": "2026-12-01", "storage": 2147483648, "billable": 1073741824 },
{ "day": "2026-12-02", "storage": 3221225472, "billable": 2147483648 },
{ "day": "2026-12-03", "storage": 3758096384, "billable": 2684354560 }
]
}
}
}

