Summarizes cost information by instance or billable item.
Operation description
Summarizes cost information by instance or billable item.
Try it now
Test
RAM authorization
Request syntax
POST /api/v1/bills/sum HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request parameters for summarizing cost information by instance or billable item. Example: {"startDate":1775714495313,"endDate":1776232895313,"statsType":"FEE_ITEM","topN":8} |
|
| projectNames |
array |
No |
A list of instance names. This parameter is not required if |
|
|
string |
No |
The instance name. |
projectName |
|
| startDate |
integer |
No |
The start time of the billing cycle. |
1715393576201 |
| endDate |
integer |
No |
The end time of the billing cycle. |
1776232895313 |
| statsType |
string |
No |
The dimension by which to summarize costs. Valid values: |
PROJECT |
| topN |
integer |
No |
The number of top results to return after sorting by cost. |
5 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| requestId |
string |
The request ID. |
BB66A390-4EF7-557E-9489-7F98D6F44002 |
| httpCode |
integer |
The HTTP status code. |
200 |
| data |
object |
The returned result. |
|
| totalCost |
string |
The total cost of all returned billable items. |
123.56 |
| currency |
string |
The currency used for all cost values. |
CNY |
| itemBills |
array<object> |
A list of billable items. |
|
|
object |
A billable item object. |
||
| itemName |
string |
The item name. When the request's |
projectName |
| cost |
string |
The cost. |
123.56 |
| currency |
string |
The currency. |
CNY |
| percentage |
number |
The percentage of the total cost that this item represents. The value does not include a percent sign (%). |
56.12 |
Examples
Success response
JSON format
{
"requestId": "BB66A390-4EF7-557E-9489-7F98D6F44002",
"httpCode": 200,
"data": {
"totalCost": "123.56",
"currency": "CNY",
"itemBills": [
{
"itemName": "projectName",
"cost": "123.56",
"currency": "CNY",
"percentage": 56.12
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.