QueryModelUsageInfo
Queries the number of invoked models, total number of calls, and consumed points by business type, statistical window, and model type.
Operation description
Prerequisites
The caller must have the RAM permissions for the corresponding API operation. The query scope is limited to the model usage of the specified business for the current account. The returned results depend on the generated statistical data and do not indicate that every call is counted in real time.
Time and missing data
Time boundaries are uniformly based on Asia/Shanghai (UTC+8). For a custom range, set StatDateType to 1d and specify both StartDate and EndDate. The range includes both the start and end dates, and the maximum span is 90 days. If statistical data is unavailable for some dates, only the existing data within the range is aggregated.
If no statistical results are available for 24h or 1d queries without specified dates, the summary API returns zero values and the list API returns an empty list. This does not mean that no actual calls were made. If no statistical results are available for other windows or custom date ranges, metrics or lists may be empty. Do not treat empty values as zeros.
Combined calls
You can call QueryModelUsageInfo to obtain summary metrics and QueryModelUsageList to obtain model details. Both API operations can be called independently. When comparing summary and detail data, BizType, StatDateType, StartDate, EndDate, and ModelType must be consistent. Keyword applies only to the detail API. Details filtered by keywords cannot be directly compared with unfiltered summary results.
Request example combinations
In the parameter table, StatDateType=1d, StartDate=2026-08-01, and EndDate=2026-08-07 indicate querying the cumulative usage from August 1 to August 7, 2026 (inclusive), in the Asia/Shanghai (UTC+8) time zone. To query the last 7 days, change the value to StatDateType=1w and omit both date parameters.
The number of calls, points, and model information in the examples are used to illustrate field meanings. They do not represent the actual usage of the current account and do not constitute a commitment to model specifications or pricing. The actual usage and available model information are subject to the API response.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
appstreaming:QueryModelUsageInfo |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| BizType |
integer |
Yes |
The business type. This parameter is required and has no default value. The mapping between business types and values is as follows:
The API directly queries the model usage of the current account based on the specified |
1 |
| StatDateType |
string |
Yes |
The statistical window. This parameter is required, has no default value, is case-sensitive, and does not support leading or trailing spaces. Time boundaries are calculated based on Asia/Shanghai (UTC+8).
Only Valid values:
|
1d |
| StartDate |
string |
No |
The start date of the custom query. The format is This parameter can be specified only when |
2026-08-01 |
| EndDate |
string |
No |
The end date of the custom query. The format is This parameter can be specified only when |
2026-08-07 |
| ModelType |
string |
No |
The model type filter. If this parameter is not specified or an empty string is passed, no filtering by type is performed. The value is case-insensitive:
Non-empty values do not support leading or trailing spaces. Other non-empty values will cause parameter validation to fail. Valid values:
|
LLM |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The API response. |
||
| Data |
object |
The model usage summary for the selected business, statistical window, and model type. If no statistical results are available for |
{"ActiveModelCount":10,"CallCount":13280,"PointsConsumption":120} |
| ActiveModelCount |
integer |
The number of distinct models that have been called at least once within the query range. Unit: models. The value is deduplicated by model code. It may not be equal to the |
10 |
| CallCount |
integer |
The total number of model calls within the query range. Unit: calls. This includes both successful and failed calls. |
13280 |
| PointsConsumption |
number |
The actual points consumed within the query range. Unit: points. The returned value can be displayed directly without further conversion. |
120 |
| RequestId |
string |
The unique identifier of the request, which is used to locate and troubleshoot request issues. |
1CBAFFAB-B697-4049-A9B1-67E1FC5F**** |
Examples
Success response
JSON format
{
"Data": {
"ActiveModelCount": 10,
"CallCount": 13280,
"PointsConsumption": 120
},
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.