QueryModelUsageList

Updated at:

Queries the invoke count, consumed points, success rate, and time to first token latency for each model by using paging, filtered by business type, statistical window, and model type.

Operation description

Prerequisites

The calling identity must have the RAM permissions for the corresponding API operation. The query scope is limited to the model usage of the specified business under the current account. The returned results depend on the generated statistical data and do not represent that every call has been counted in real time.

Time and missing data

Time boundaries are uniformly based on Asia/Shanghai (UTC+8). To use a custom range, set StatDateType to 1d and specify both StartDate and EndDate. The range includes both the start and end dates, with a maximum span of 90 days. If statistical data is unavailable for some dates, only the existing data within the range is aggregated.

When no date is specified for 24h or 1d queries and no statistical results are available, the aggregation API returns zero values and the list API returns an empty list. This does not mean that no actual calls were made. For other windows or custom date ranges where no statistical results are available, metrics or lists may be empty. Do not treat empty values as zeros.

Combined calls

You can call QueryModelUsageInfo to obtain aggregated metrics and QueryModelUsageList to obtain model details. Both API operations can be called independently. When comparing aggregated and detailed data, BizType, StatDateType, StartDate, EndDate, and ModelType must remain consistent. Keyword applies only to the detail API. Details filtered by keyword cannot be directly compared with unfiltered aggregated results.

Pagination and metrics

Start with PageNumber=1 and increment the page number as needed, keeping other filter conditions and sorting methods consistent. The model list may include models that have historical usage but zero calls within the current query range. All ratio fields are returned as decimals between 0 and 1. An empty metric indicates that it is incalculable or the data is unavailable, which is not equivalent to zero.

When new statistical data is continuously generated, the count and sorting of different pagination requests may change. When comparing totals and details, ensure that the query conditions are consistent and consider the data update time difference between the two requests.

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 to StatDateType=1w and omit both date parameters.

The call counts, 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. Actual usage and available model information are subject to the API response. Custom date queries do not provide TtftP95Ms. The example details show only some fields. Unshown fields do not necessarily return empty values.

Missing statistical records for a single model

If a model already in the model list has no active statistical records within the selected statistical range, CallCount, FailureCount, and PointsConsumption return 0. The input and output point ratios, success rate, cache hit rate, and time to first token latency are empty. In this case, you cannot determine that the model has no actual invoke operations based solely on the zero values.

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

appstreaming:QueryModelUsageList

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:

  • 1: Enterprise Edition.

  • 10: Personal Edition.

  • 20: Commercial Edition.

  • 70: Agentic Computer.

The API directly queries the model usage of the current account based on the passed BizType and does not automatically convert or replace the business type. When querying the usage of the Agentic Computer business, you must explicitly pass BizType=70. Usage of different business types is counted separately.

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).

  • 24h: The last 24 hours up to the most recent available statistical cutoff time. The statistical cutoff time corresponds to the current hour or the previous hour.

  • 1d: If no start and end dates are passed, the cumulative usage for today is queried. If both StartDate and EndDate are passed, the specified natural day range is queried.

  • 1w: The last 7 days up to the day of the request. If the statistical results for the current day are unavailable, the results from the previous day are not used.

  • 30d: The last 30 days up to the day of the request. If the statistical results for the current day are unavailable, the results from the previous day are not used.

  • 1y: The statistical results for the last 365 days. If the results for the current year are unavailable, the statistical results for the previous year may be returned. The actual coverage range may be earlier than the day of the request. This API does not return the statistical cutoff time for this result, so you cannot use it to confirm whether the data has been updated to the current day.

Only 1d supports custom date ranges. Do not pass start and end dates for other windows.

Valid values:

  • 1d :

    Today or custom date range.

  • 24h :

    Last 24 hours.

  • 1w :

    Last 7 days.

  • 30d :

    Last 30 days.

  • 1y :

    Last 365 days.

1d

StartDate

string

No

The start date of the custom query. The format is yyyy-MM-dd. It is interpreted as a natural day in Asia/Shanghai (UTC+8) and includes the current day. This value is a date string and does not contain hours, minutes, seconds, or time zone suffixes.

This parameter can be passed only when StatDateType=1d, and it must be passed or omitted together with EndDate. The start date cannot be later than the end date. The total number of days, including the start and end dates, must be between 1 and 90. If both are omitted, the cumulative usage for today is queried. When custom dates are not used, omit these two parameters directly. Do not pass empty strings or pure spaces.

2026-08-01

EndDate

string

No

The end date of the custom query. The format is yyyy-MM-dd. It is interpreted as a natural day in Asia/Shanghai (UTC+8) and includes the current day. This value is a date string and does not contain hours, minutes, seconds, or time zone suffixes.

This parameter can be passed only when StatDateType=1d, and it must be passed or omitted together with StartDate. The end date cannot be earlier than the start date. The total number of days, including the start and end dates, cannot exceed 90. When custom dates are not used, omit these two parameters directly. Do not pass empty strings or pure spaces.

2026-08-07

ModelType

string

No

The model type filter condition. If this parameter is not passed or an empty string is passed, no filtering by type is performed. The value is case-insensitive:

  • LLM: Large language model.

  • IMAGE: Image model.

  • VIDEO: Video model.

  • AUDIO: Audio model.

  • EMBEDDING: Embedding model.

Non-empty values do not support leading or trailing spaces. Other non-empty values besides the preceding ones cause parameter validation to fail.

Valid values:

  • IMAGE :

    Image model.

  • EMBEDDING :

    Embedding model.

  • VIDEO :

    Video model.

  • LLM :

    Large language model.

  • AUDIO :

    Audio model.

LLM

Keyword

string

No

The keyword for the model name or model code. After removing leading and trailing spaces, a case-insensitive inclusion match is performed. It is not a regular expression. If this parameter is not passed or is completely blank, no filtering by keyword is performed. If it is passed together with ModelType, both conditions take effect simultaneously.

The translated display names of some models do not participate in name matching. To stably locate a model, we recommend that you use the returned LlmCode as the keyword.

qwen

SortType

string

No

The sort order. If this parameter is not passed or is blank, the default value is CALL_COUNT_DESC. The value is case-sensitive, and non-empty values do not support leading or trailing spaces:

  • CALL_COUNT_DESC: Sort by call count in descending order.

  • POINTS_CONSUMPTION_DESC: Sort by consumed points in descending order.

  • SUCCESS_RATE_ASC: Sort by call success rate in ascending order. Models with unavailable success rates are ranked last.

  • AVG_TTFT_DESC: Sort by average time to first token latency in descending order. Models with unavailable latency are ranked last.

When sort values are the same, sort by model code LlmCode in ascending order. Filter and sort first, then paginate. Other non-empty values besides the preceding ones cause parameter validation to fail.

Valid values:

  • CALL_COUNT_DESC :

    Call count in descending order.

  • SUCCESS_RATE_ASC :

    Call success rate in ascending order.

  • POINTS_CONSUMPTION_DESC :

    Consumed points in descending order.

  • AVG_TTFT_DESC :

    Average time to first token latency in descending order.

CALL_COUNT_DESC

PageNumber

integer

No

The page number. It starts from 1 and the default value is 1. It must be an integer greater than or equal to 1. It is used together with PageSize for pagination. If the page number exceeds the range of the filtered results, an empty list is returned.

1

PageSize

integer

No

The maximum number of models returned per page. The default value is 10. Valid values: 1 to 100.

1

Language

string

No

The model display language. Valid values:

  • zh-CN: Simplified Chinese.

  • en-US: English.

  • ja-JP: Japanese.

  • zh-TW: Traditional Chinese.

If this parameter is not passed, is blank, or has an unsupported value, zh-CN is used. It is also compatible with zh_CN, en_US, ja_JP, zh_TW, en, and ja. Case and leading or trailing spaces are ignored.

The returned content is not guaranteed to be entirely in the selected language. Some model names and descriptions are provided in Japanese or Traditional Chinese. For other model information, brands, and capability tags, English is used when ja-JP is selected, and Simplified Chinese is used when zh-TW is selected. If the corresponding translation is missing, the existing content is retained. If the model name is missing, the model code is returned.

Valid values:

  • en-US :

    English.

  • zh-TW :

    Traditional Chinese.

  • zh-CN :

    Simplified Chinese.

  • ja-JP :

    Japanese.

zh-CN

Response elements

Element

Type

Description

Example

object

The API response result.

Data

array<object>

The model usage details on the current page. If no models match or the page number exceeds the result range, an empty list is returned. For 24h or 1d queries without specified start and end dates, an empty list is also returned when no statistical results are available. For other windows or custom date ranges, no valid list data is provided when no statistical results are available. The absence of statistical results does not directly indicate that no actual calls were made.

[{"LlmCode":"qwen3-max-2026-01-23","ModelName":"Qwen3 Max","CallCount":12480,"FailureCount":180,"PointsConsumption":100,"InputPointsRate":0.739,"OutputPointsRate":0.261,"SuccessRate":0.98557692,"AvgTtftMs":620,"CacheHitRate":0.86}]

array<object>

The usage and display information of a single model within the selected statistical range.

ModelBrandName

string

The display name of the model brand. The display language is affected by Language. This field is empty when no brand information is available.

Qwen

IconUrl

string

The URL of the model brand icon. This field is empty when no brand icon is available. The example URL only illustrates the URL format and is not a fixed download address.

https://example.com/qwen.png

LlmCode

string

The identifier or code of the model, used to identify the model and associate usage and model information. The return value is an open string and should not be hardcoded as an enumeration on the client side.

qwen3-max-2026-01-23

ModelName

string

The display name of the model. The display language is affected by Language. If no name is available, LlmCode is returned. The name may change, so the model code should be used when associating data.

Qwen3 Max

Description

string

The description of the model. The display language is affected by Language. This field is empty when no description is available.

Qwen large language model

FeatureList

array

The list of model capability tags. The display language is affected by Language. Capabilities without a configured display name retain their original codes. An empty list is returned when no capability information is available. Tags are extensible, not a fixed enumeration, and do not imply that all capabilities can be called through this API operation.

["Text generation","Tool calling"]

string

The display tag for a single model capability. If no display name is available, the capability code is used.

Text generation

ContextWindow

integer

The maximum context length of the model, in tokens. This field is empty when no model information is available.

1000000

MaxOutput

integer

The maximum output length for a single generation of the model, in tokens. This field is empty when no model information is available.

65536

CreditMultiplier

object

The display range of the credit consumption multiplier, in multiples. It is used to display price hints and is not used to recalculate the PointsConsumption returned by this API operation.

  • If Min and Max are equal: fixed multiplier.

  • If Max is greater than Min: multiplier range.

  • If Max is empty: starts from the Min multiplier.

  • If the entire object is empty: the model does not participate in credit billing, or no multiplier information is available. An empty value for this field alone cannot determine whether actual charges apply.

{"Min":1,"Max":3}

Min

number

The lower limit of the credit multiplier, in multiples. If it is equal to Max, it indicates a fixed multiplier.

1

Max

number

The upper limit of the credit multiplier, in multiples. If it is empty, it indicates that the multiplier starts from Min and no maximum multiplier is specified.

3

IsNew

boolean

The new model tag. The current version does not provide this tag. Ignore this field and do not use it to determine whether a model is newly released.

null

CallCount

integer

The total number of model calls within the query range, including both successful and failed calls.

12480

FailureCount

integer

The number of failed calls within the query range, including failed calls that are throttled.

180

PointsConsumption

number

The actual credits consumed within the query range. The return value can be displayed directly without further conversion. CreditMultiplier is only used to display the multiplier and should not be multiplied by this value.

100

InputPointsRate

number

The proportion of input credits to the total consumed credits, expressed as a decimal between 0 and 1. For example, 0.739 indicates 73.9%. This field is provided only when the input and output credit details are complete, the values are valid, and the total credits are greater than 0. Otherwise, it is empty.

The proportion is rounded to a maximum of 8 decimal places. The sum of input and output credits may be less than the total credits. Additionally, adding this value to OutputPointsRate may result in minor rounding errors. Do not calculate other credits or verify bills based solely on the sum of the proportions.

0.739

OutputPointsRate

number

The proportion of output credits to the total consumed credits, expressed as a decimal between 0 and 1. For example, 0.261 indicates 26.1%. This field is provided only when the input and output credit details are complete, the values are valid, and the total credits are greater than 0. Otherwise, it is empty. The proportion is rounded to a maximum of 8 decimal places, and adding this value to InputPointsRate may result in minor rounding errors.

0.261

NormalInputPointsRate

number

The proportion of normal input credits to the total credits. This field is empty when it cannot be calculated.

0.329

ImplicitCacheHitPointsRate

number

The proportion of implicit cache hit credits to the total credits. This field is empty when it cannot be calculated.

0.171

ExplicitCacheCreationPointsRate

number

The proportion of explicit cache creation credits to the total credits. This field is empty when it cannot be calculated.

0.115

ExplicitCacheHitPointsRate

number

The proportion of explicit cache hit credits to the total credits. This field is empty when it cannot be calculated.

0.043

ToolCallPointsRate

number

The proportion of tool calling credits to the total credits. This field is empty when it cannot be calculated.

0

SuccessRate

number

The number of successful calls divided by the total number of calls, expressed as a decimal between 0 and 1, not a percentage. This field is empty when the number of calls is 0. Multiply this value by 100 to display it as a percentage. The return value is rounded to a maximum of 8 decimal places.

0.98557692

AvgTtftMs

integer

The average time to first token (TTFT) latency, which is the total duration of valid TTFT samples divided by the number of samples, in milliseconds, rounded to the nearest integer. This field is empty when no valid samples are available. It does not represent the total time taken for a complete response.

620

TtftP95Ms

integer

The 95th percentile value of the time to first token (TTFT) latency, in milliseconds. This field is provided only when corresponding data exists within a fixed statistical window. It is empty when custom start and end dates are passed, even if the start and end dates are the same. The value 700 in the field table is an example under a fixed statistical window and does not apply to custom date ranges.

700

CacheHitRate

number

The proportion of cached input usage to the total input usage, expressed as a decimal between 0 and 1. For example, 0.86 indicates 86%. It is not the proportion of requests that hit the cache. This field is empty when the base usage is incomplete or the total input usage is 0. The return value is rounded to a maximum of 8 decimal places.

0.86

TotalCount

integer

The total number of models used for pagination. When statistical results are available, this field returns the number of models that meet the model type and keyword conditions. This may include models with 0 calls within the selected date range, so it is not necessarily equal to ActiveModelCount.

When no statistical results are available within the query range, this value returns 0. You cannot determine that the business has no models or no actual calls based solely on TotalCount=0.

10

PageSize

integer

The page size used for this query. The actual number of returned entries may be less than this value.

1

PageNumber

integer

The page number for this query, starting from 1.

1

RequestId

string

The unique identifier for this request, used to locate and troubleshoot request issues.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

Examples

Success response

JSON format

{
  "Data": [
    {
      "ModelBrandName": "Qwen",
      "IconUrl": "https://example.com/qwen.png",
      "LlmCode": "qwen3-max-2026-01-23",
      "ModelName": "Qwen3 Max",
      "Description": "Tongyi Qianwen large language model",
      "FeatureList": [
        "Text generation"
      ],
      "ContextWindow": 1000000,
      "MaxOutput": 65536,
      "CreditMultiplier": {
        "Min": 1,
        "Max": 3
      },
      "IsNew": true,
      "CallCount": 12480,
      "FailureCount": 180,
      "PointsConsumption": 100,
      "InputPointsRate": 0.739,
      "OutputPointsRate": 0.261,
      "NormalInputPointsRate": 0.329,
      "ImplicitCacheHitPointsRate": 0.171,
      "ExplicitCacheCreationPointsRate": 0.115,
      "ExplicitCacheHitPointsRate": 0.043,
      "ToolCallPointsRate": 0,
      "SuccessRate": 0.98557692,
      "AvgTtftMs": 620,
      "TtftP95Ms": 700,
      "CacheHitRate": 0.86
    }
  ],
  "TotalCount": 10,
  "PageSize": 1,
  "PageNumber": 1,
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.