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
InstanceIdsparameter can be omitted whenUsageType=User. Set this parameter to the credit package instance ID whenUsageType=CreditPackage, or to the AgentId whenUsageType=Agent.Anonymous requests support the
FillInstanceparameter. IfInstanceIdsis not explicitly specified andFillInstance=true, the server automatically populates the boundJVS_COPILOTAgentId based on the current logonwyId.Time window constants: The
dayUsedCreditstatistics window isnow - ONE_DAY_MILLIS, and theweekUsedCreditstatistics window isnow - ONE_WEEK_MILLIS.The consumption samples in
currentCreditConsumeListare aggregated by hour and may have an asynchronous synchronization delay of up to 5 minutes.
Try it now
Test
RAM authorization
|
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 |
| InstanceIds |
array |
No |
The JSON string of instance IDs. This parameter can be omitted when |
|
|
string |
No |
The instance ID. |
cp-0bszoespx7o1ehjxs |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The return type: |
||
| 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 |
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 |
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.