GetGatewayQuotaRuleSubjectUsage
Queries the usage details of a consumer under a gateway quota rate-limiting rule, including used quota, total quota, whether the limit is exceeded, usage details, and consumption records.
Operation description
Retrieves the usage details of a specific consumer under a quota rule. This operation applies only to AI gateways whose version is later than 2.1.19.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apig:GetGatewayQuotaRuleSubjectUsage |
none |
*Gateway
|
None | None |
Request syntax
GET /v1/gateways/{gatewayId}/quota-rules/{ruleId}/subjects/{subjectId}/usage HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| gatewayId |
string |
No |
The gateway ID. |
gw-123456 |
| ruleId |
string |
No |
The rule ID. |
qr-d8j7fpmm1hks65kxxxxx |
| subjectId |
string |
No |
The subject (consumer) ID. |
cs-d8kkaium1xxxxxxxxxxx |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| pageNumber |
integer |
No |
The page number for the consumption records of the consumer within the current cycle. |
1 |
| pageSize |
integer |
No |
The number of consumption records per page for the consumer within the current cycle. Maximum value: 10. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| requestId |
string |
The request ID. |
1234567890 |
| code |
string |
The status code. |
200 |
| message |
string |
The response message. |
success |
| data |
object |
The response data. |
{"usedAmount":500} |
| usedAmount |
integer |
The total used amount of the subject. |
500 |
| totalQuota |
integer |
The total quota of the subject. |
1000 |
| overLimit |
boolean |
Indicates whether the quota limit is exceeded. |
false |
| inputAmount |
integer |
The total input token consumption. |
300 |
| outputAmount |
integer |
The total output token consumption. |
180 |
| cachedAmount |
integer |
The total cached token consumption. |
20 |
| details |
object |
The paginated consumption details. |
{"totalSize":100} |
| totalSize |
integer |
100 |
|
| pageNumber |
integer |
1 |
|
| pageSize |
integer |
10 |
|
| items |
array<object> |
[{"model":"qwen-plus",'usedAmount':210}] |
|
|
object |
{'model':'qwen-plus','usedAmount':210} |
||
| model |
string |
qwen-plus |
|
| inputAmount |
integer |
120 |
|
| outputAmount |
integer |
80 |
|
| cachedAmount |
integer |
10 |
|
| usedAmount |
integer |
210 |
|
| startTime |
string |
2026-06-05 13:16:31 |
Examples
Success response
JSON format
{
"requestId": "1234567890",
"code": "200",
"message": "success",
"data": {
"usedAmount": 500,
"totalQuota": 1000,
"overLimit": false,
"inputAmount": 300,
"outputAmount": 180,
"cachedAmount": 20,
"details": {
"totalSize": 100,
"pageNumber": 1,
"pageSize": 10,
"items": [
{
"model": "qwen-plus",
"inputAmount": 120,
"outputAmount": 80,
"cachedAmount": 10,
"usedAmount": 210,
"startTime": "2026-06-05 13:16:31"
}
]
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.