All Products
Search
Document Center

Expenses and Costs:DescribeResourceUsageDetail

Last Updated:Jan 27, 2026

Queries the usage details of reserved instances (RIs) or storage capacity units (SCUs).

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

bssapi:DescribeResourceUsageDetail

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

StartPeriod

string

Yes

The beginning of the time range to query. The beginning is included in the time range. Specify the time in the yyyy-MM-dd HH:mm:ss format.

2021-01-01 00:00:00

EndPeriod

string

No

The end of the time range to query. The end is excluded from the time range. If you do not set this parameter, the end time is the current time. Specify the time in the format of yyyy-MM-dd HH:mm:ss.

2021-01-02 00:00:00

PeriodType

string

Yes

The time granularity at which usage details are queried. Valid values: MONTH, DAY, and HOUR.

HOUR

NextToken

string

No

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken. If NextToken is empty, no next page exists.

eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9

MaxResults

integer

No

The maximum number of entries to return. Default value: 20. The maximum value is 300.

200

BillOwnerId

integer

No

The ID of the account whose data you want to query. If you do not specify this parameter, the data of the current Alibaba Cloud account and its Resource Access Management (RAM) users is queried. To query the data of a RAM user, specify the ID of the RAM user.

123745698925000

ResourceType

string

Yes

The type of deduction plan whose usage details are queried. Valid values: RI and SCU.

RI

Response elements

Element

Type

Description

Example

object

Code

string

The response code.

Success

Message

string

The returned message.

Successful!

RequestId

string

The request ID.

79EE7556-0CFD-44EB-9CD6-B3B526E3A85F

Success

boolean

Indicates whether the request was successful.

true

Data

object

The returned data.

NextToken

string

A pagination token. It can be used in the next request to retrieve a new page of results.

eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9

TotalCount

integer

The total number of entries returned.

10000

MaxResults

integer

The number of entries returned on the current page.

200

Items

array<object>

The data entries.

object

Status

string

The status of the deduction plan.

Valid

UsagePercentage

number

The usage rate of the deduction plan.

0.5

ResourceInstanceId

string

The ID of the deduction plan.

ecsri-bp147nnfz21225k9mpix00

TotalQuantity

number

The total capacity of the deduction plan.

2

ReservationCost

string

The fee of the deduction plan.

0

RegionNo

string

The code of the region.

cn-hangzhou-dg-a01

UserId

string

The account ID.

123745698925000

StatusName

string

The name of the status.

生效

CapacityUnit

string

The unit that is used to measure the resources that are deducted.

算力*小时

PotentialSavedCost

string

The potential net savings.

0.13

Currency

string

The type of the currency.

CNY

ZoneName

string

The code of the zone.

杭州 可用区I

InstanceSpec

string

The instance type.

ecs.t5-lc2m1.nano

EndTime

string

The end of the time range in which the usage details were queried.

2021-04-01 01:00:00

PostpaidCost

string

The equivalent of pay-as-you-go costs.

0.06

ImageType

string

The operating system.

linux

StartTime

string

The beginning of the time range in which the usage details were queried.

2021-04-01 00:00:00

Region

string

The region.

华东1(杭州)

DeductQuantity

number

The amount of the deducted resources.

1

SavedCost

string

The net savings.

0.06

Zone

string

The zone.

cn-hangzhou-i

UserName

string

The username of the account.

test@aliyun.com

Quantity

integer

The number of deduction plans.

2

Examples

Success response

JSON format

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
  "Success": true,
  "Data": {
    "NextToken": "eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9",
    "TotalCount": 10000,
    "MaxResults": 200,
    "Items": [
      {
        "Status": "Valid",
        "UsagePercentage": 0.5,
        "ResourceInstanceId": "ecsri-bp147nnfz21225k9mpix00",
        "TotalQuantity": 2,
        "ReservationCost": "0",
        "RegionNo": "cn-hangzhou-dg-a01",
        "UserId": "123745698925000",
        "StatusName": "生效",
        "CapacityUnit": "算力*小时",
        "PotentialSavedCost": "0.13",
        "Currency": "CNY",
        "ZoneName": "杭州 可用区I",
        "InstanceSpec": "ecs.t5-lc2m1.nano",
        "EndTime": "2021-04-01 01:00:00",
        "PostpaidCost": "0.06",
        "ImageType": "linux",
        "StartTime": "2021-04-01 00:00:00",
        "Region": "华东1(杭州)",
        "DeductQuantity": 1,
        "SavedCost": "0.06",
        "Zone": "cn-hangzhou-i",
        "UserName": "test@aliyun.com",
        "Quantity": 2
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.