All Products
Search
Document Center

MaxCompute:SumBills

Last Updated:Apr 16, 2026

Summarizes cost information by instance or billable item.

Operation description

Summarizes cost information by instance or billable item.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

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 statsType is set to FEE_ITEM.

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 (by instance) and FEE_ITEM (by billable item).

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 statsType is PROJECT, this is the instance name. When statsType is FEE_ITEM, this is the billable item type (for example, DRStorage, ComputationSql, or Storage).

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.