GET /billing/usage/{tenant_id}
查询指定租户的资源使用量统计数据(用户数、存储量、API调用次数)。默认查询近 30 天数据,可通过 start_date/end_date 指定范围。
计费服务 `bearerAuth` application/json
Request Parameters
| Name | In | Type | Required | Default | Example | Constraints | Description |
tenant_id |
path |
string |
Yes |
|
|
|
租户ID |
app_id |
query |
string |
No |
|
|
|
应用ID(可选) |
start_date |
query |
string |
No |
30天前 |
|
|
开始日期 (YYYY-MM-DD) |
end_date |
query |
string |
No |
今天 |
|
|
结束日期 (YYYY-MM-DD) |
Referenced Schemas
dto.UsageStatItem
| Field | Type | Required | Example | Constraints | Description |
limit |
integer |
No |
100 |
|
|
unit |
string |
No |
个 |
|
|
used |
integer |
No |
8 |
|
|
dto.UsageStatsDetailResponse
| Field | Type | Required | Example | Constraints | Description |
code |
integer |
No |
|
|
|
data |
dto.UsageStatsResponse |
No |
|
|
|
message |
string |
No |
|
|
|
timestamp |
string |
No |
|
|
|
dto.UsageStatsResponse
| Field | Type | Required | Example | Constraints | Description |
api_calls |
dto.UsageStatItem |
No |
|
|
|
app_id |
string |
No |
app_001 |
|
|
period_end |
string |
No |
2026-04-01 |
|
|
period_start |
string |
No |
2026-03-01 |
|
|
storage |
dto.UsageStatItem |
No |
|
|
|
tenant_id |
string |
No |
tnt_xyz789 |
|
|
users |
dto.UsageStatItem |
No |
|
|
|