Queries credit usage details by a specified dimension such as user, credit package, or agent.
Operation description
Request description
This API queries credit usage details based on the dimension specified by UsageType (User / CreditPackage / 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 of all active credit packages for the current user.
CreditPackage: Credit package dimension. Returns the total, remaining, and consumption samples of a specified credit package instance.
Agent: Agent dimension. Returns the cumulative usage, current period usage, quota, alert, and other information of a specified agent.
Note:
The
InstanceIdsparameter can be omitted whenUsageType=User. Pass a credit package instance ID whenUsageType=CreditPackage, or pass an AgentId whenUsageType=Agent.Anonymous requests support the
FillInstanceparameter. WhenInstanceIdsis 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
currentCreditConsumeListconsumption samples are 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 (UsageType). Valid values:
|
User |
| InstanceIds |
array |
No |
The scenarios for the operator. Valid values:
|
JzYearlyShare |
|
string |
No |
The instance ID. |
cp-0bszoespx7o1ehjxs |
|
|
No |
The JSON string of the instance ID list. This parameter can be omitted when |
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 business data. |
|
|
array<object> |
The array of business data. |
||
| UsageInfoKey |
string |
The usage primary key. When |
agent-abc |
| UsageInfo |
object |
The usage data details. |
|
| DayUsedCredit |
integer |
The credit usage in the last 1 day. |
Credits consumed in the last day |
| WeekUsedCredit |
integer |
The credit usage in the last 1 week. |
Credits consumed in the last week |
| TotalUsedCredit |
integer |
The cumulative credit usage. |
Total credits consumed |
| TotalCredit |
integer |
The cumulative total credits. |
Credit quota |
| RemainCredit |
integer |
The cumulative remaining credits. |
Remaining credits |
| CurrentTotalCredit |
integer |
The total credits of the currently active credit package. |
Credit quota for the current period |
| CurrentRemainCredit |
integer |
The remaining credits of the currently active credit package. |
Remaining credits for the current period |
| CurrentUsedCredit |
integer |
The used credits of the currently active credit package. |
Credits consumed in the current period |
| CurrentInstanceId |
string |
The instance ID of the currently active credit package. |
cp-inst-001 |
| CreditTrendList |
array<object> |
The hourly consumption samples of the current credit package. |
|
|
object |
The hourly consumption samples of the current credit package. |
||
| TimePoint |
string |
The time point in the format |
2026-05-02 10 |
| UsedCredit |
integer |
The number of credits consumed during the hour. |
12 |
| WarnPercent |
integer |
The alert threshold percentage (0–100). |
80 |
| PeriodUsedCredit |
integer |
The shared credit usage in the current active period. |
120 |
| PeriodTotalCredit |
integer |
The shared credit quota in the current active period. |
300 |
| TodayUsed |
string |
The credits used today. |
200 |
| TotalUsed |
string |
The cumulative credits used. |
100 |
| ContactGroupNames |
array |
The list of contact group names. |
|
|
string |
The first element in the contact group name list. |
CQGG |
|
| LastTriggeredAt |
string |
The last triggered time. |
2026-05-02 10:10:10 |
| AvailableAmount |
integer |
The number of instances currently available for the registered resource. |
9976.00 |
| RemainCreditInfo |
object |
The remaining credit information. |
|
| DeductingAmount |
integer |
The number of instances currently being deducted. |
23 |
| PendingAmount |
integer |
The number of instances pending activation. |
24 |
| CurrentInstanceExpiredTime |
string |
The time when the current instance expires. |
2026-12-02 00:00:00 |
| PeriodSharedUsedCredit |
integer |
The shared credits consumed in the current period. |
120 |
| PeriodPayGoUsedCredit |
integer |
The pay-as-you-go credits consumed in the current period. |
240 |
| PeriodTotalUsedCredit |
integer |
The total credits consumed in the current period. |
360 |
| PeriodCreditQuota |
integer |
The credit quota for the current period. |
2000 |
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": "200",
"TotalUsed": "100",
"ContactGroupNames": [
"CQGG"
],
"LastTriggeredAt": "2026-05-02 10:10:10",
"AvailableAmount": 9976,
"RemainCreditInfo": {
"DeductingAmount": 23,
"PendingAmount": 24
},
"CurrentInstanceExpiredTime": "2026-12-02 00:00:00",
"PeriodSharedUsedCredit": 120,
"PeriodPayGoUsedCredit": 240,
"PeriodTotalUsedCredit": 360,
"PeriodCreditQuota": 2000
}
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.