All Products
Search
Document Center

Elastic Desktop Service:DescribeCreditUsageInfo

Last Updated:Jun 30, 2026

Queries credit usage by a specified dimension such as user, credit package, or agent.

Operation description

Operation description

This API operation queries credit usage details based on the dimension specified by UsageType (User, CreditPackage, or Agent). The response includes the total, remaining, and used credits of the current credit package, hourly consumption samples, alert thresholds, period quotas, and other information.

  • User: User dimension. Returns the aggregated usage and remaining credits across all active credit packages for the current user.

  • CreditPackage: Credit package dimension. Returns the total, remaining, and consumption samples for a specified credit package instance.

  • Agent: Agent dimension. Returns the cumulative usage, current period usage, quota, alert, and other information for a specified agent.

Notes:

  • The InstanceIds parameter can be omitted when UsageType=User. Set this parameter to the credit package instance ID when UsageType=CreditPackage, or to the AgentId when UsageType=Agent.

  • Anonymous requests support the FillInstance parameter. If InstanceIds is not explicitly specified and FillInstance=true, the server automatically populates the bound JVS_COPILOT AgentId based on the current logon wyId.

  • Time window constants: The dayUsedCredit statistics window is now - ONE_DAY_MILLIS, and the weekUsedCredit statistics window is now - ONE_WEEK_MILLIS.

  • The consumption samples in currentCreditConsumeList are aggregated by hour and may have an asynchronous synchronization delay of up to 5 minutes.

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

ecd:DescribeCreditUsageInfo

get

*All Resource

*

None None

Request syntax

GET  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

BizType

string

No

The business type.

BUSINESS

UsageType

string

No

The usage type. Valid values:

  • User: Returns the usage, remaining credits, and consumption trends of the active credit packages for the current user.

  • CreditPackage: Requires a CreditPackageId. Returns the total and remaining credits of the specified credit package.

  • Agent: Requires an AgentId. Returns the cumulative credit usage, cumulative allocated quota, and the percentages of both.

User

InstanceIds

array

No

The JSON string of instance IDs. This parameter can be omitted when UsageType=User. Set this parameter to the credit package instance ID when UsageType=CreditPackage, or to the AgentId when UsageType=Agent.

string

No

The instance ID.

cp-0bszoespx7o1ehjxs

Response elements

Element

Type

Description

Example

object

The return type: ListResult<CreditUsageInfoModel>.

RequestId

string

The request ID.

68BD3312-53D8-123E-BB32-1A9F25E07A03

UsageInfoList

array<object>

The array of usage data.

array<object>

UsageInfoKey

string

The usage primary key. When UsageType=User, this is the aliUid. When UsageType=CreditPackage, this is the credit package instance ID. When UsageType=Agent, this is the AgentId.

agent-abc

UsageInfo

object

The usage data details.

DayUsedCredit

integer

The credit usage in the last 24 hours.

最近一天消耗积分

WeekUsedCredit

integer

The credit usage in the last 7 days.

最近一周消耗积分

TotalUsedCredit

integer

The total credit usage.

共计消耗积分

TotalCredit

integer

The total credit quota.

积分配额

RemainCredit

integer

The remaining credit.

积分余量

CurrentTotalCredit

integer

The total credit in the currently active credit package.

当前周期积分配额

CurrentRemainCredit

integer

The remaining credit in the currently active credit package.

当前周期积分余量

CurrentUsedCredit

integer

The credit used from the currently active credit package.

当前周期积分消耗

CurrentInstanceId

string

The instance ID of the currently active credit package.

cp-inst-001

CreditTrendList

array<object>

A list of hourly credit usage samples for the currently active credit package.

object

TimePoint

string

The timestamp of the hourly sample, in yyyy-MM-dd HH format.

2026-05-02 10

UsedCredit

integer

The number of credits used during the hour.

12

WarnPercent

integer

The alarm threshold, specified as a percentage from 0 to 100.

80

PeriodUsedCredit

integer

The shared credit usage in the current period.

120

PeriodTotalCredit

integer

The shared credit quota for the current period.

300

TodayUsed

string

TotalUsed

string

Examples

Success response

JSON format

{
  "RequestId": "68BD3312-53D8-123E-BB32-1A9F25E07A03",
  "UsageInfoList": [
    {
      "UsageInfoKey": "agent-abc",
      "UsageInfo": {
        "DayUsedCredit": 0,
        "WeekUsedCredit": 0,
        "TotalUsedCredit": 0,
        "TotalCredit": 0,
        "RemainCredit": 0,
        "CurrentTotalCredit": 0,
        "CurrentRemainCredit": 0,
        "CurrentUsedCredit": 0,
        "CurrentInstanceId": "cp-inst-001",
        "CreditTrendList": [
          {
            "TimePoint": "2026-05-02 10",
            "UsedCredit": 12
          }
        ],
        "WarnPercent": 80,
        "PeriodUsedCredit": 120,
        "PeriodTotalCredit": 300,
        "TodayUsed": "",
        "TotalUsed": ""
      }
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.