Obtaining the Service Statistics List
Function
This API is used to obtain the provisioned preset services or deployed user services, and display metrics such as service calling times, calling failure rate, total number of called tokens, number of input/output tokens, and E2E latency. Data is retained for 30 days only.
Constraints
- Region restrictions: Only the CN-Hong Kong region is supported.
- API rate limiting: The total number of requests for this API from all users cannot exceed 1,000 within one minute.
- User request limit: The number of requests for this API from a single user cannot exceed 200 within one minute.
- Rate-limiting response: When the rate limit is exceeded, the API returns the HTTP status code 429 "Too Many Requests".
- Retry suggestion: If the rate limit is exceeded, wait 60 seconds and try again.
URI
POST /v1/{project_id}/maas/monitoring/list-service-statistics
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID and Name. Constraints: N/A Range: The value can contain 32 characters. Only lowercase letters and digits are allowed. Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition: User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details, see Authentication. Constraints: N/A Range: N/A Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| service_names | No | Array of strings | Definition: Service name list, which can be used to filter services by name. If this parameter is not specified, all services are queried. Fuzzy match of service names is supported. Constraints: N/A Range: The service list contains provisioned preset services and deployed user services. Default Value: N/A |
| service_type | Yes | Integer | Definition: Service type. Constraints: N/A Range:
Default Value: N/A |
| api_keys | No | Array of strings | Definition: API key tag list, which is used for filtering. MaaS services support API key calls. Go to the API key management page to get the API key tag. The Tag field in the API key list shows the API key tag.
Constraints: N/A Range:
Default Value: N/A |
| ips | No | Array of strings | Definition: IP address list, which indicates the source IP addresses of the clients that have been called. If this parameter is not specified, all IP addresses are queried. To query the IP address, you can call the API for obtaining the IP address list. Constraints: The value must be in the IP address format. Range: N/A Default Value: N/A |
| start_time | Yes | Long | Definition: Timestamp of the start time, in milliseconds. Constraints: The end time must be within 30 days from the start time. Range: The value must be greater than 0 and no greater than the value of end_time. Default Value: N/A |
| end_time | Yes | Long | Definition: Timestamp of the end time, in milliseconds. Constraints: The end time must be within 30 days from the start time. Range: The value must be greater than 0. Default Value: N/A |
| limit | No | Integer | Definition: Number of records on each page, that is, maximum number of returned records. If this parameter is set to 0, all data is returned without pagination. Constraints: N/A Range: The value must be greater than or equal to 0. Default Value: 0 |
| offset | No | Integer | Definition: Pagination offset, which indicates the number of records to be skipped. Constraints: N/A Range: The value must be greater than or equal to 0. Default Value: 0 |
| timezone | No | String | Definition: Time zone. Constraints: N/A Range: The value must comply with the IANA time zone specifications, such as Asia/Shanghai and UTC. Default Value: Asia/Shanghai (GMT+8) |
| infer_type | Yes | String | Definition: Service inference type. Range:
Constraints: N/A Default Value: N/A |
| model_type | No | string | Definition: Model type. Range:
Constraints: N/A Default Value: Text Generation |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total | Integer | Definition: Total number of queried data records. Range: N/A |
| count | Integer | Definition: Maximum number of data records returned on each page. Range: If pagination is used, the value is that of the input parameter limit. If pagination is not used, the value is the total number of queried data records. |
| items | Array of ServiceStatItem objects | Definition: Service information list. Range: The service list displays only the provisioned preset services, created custom endpoints, and deployed user-defined services. |
| Parameter | Type | Description |
|---|---|---|
| service_id | String | Definition: Service ID. Range: N/A |
| service_name | String | Definition: Service name. Range: N/A |
| request_count | Integer | Definition: Number of calls. Range: N/A |
| error_count | Integer | Definition: Number of failed calls. If batch inference is used, this parameter indicates the number of failed inference times. However, batch inference is under restricted use. To use it, submit a service ticket. Range: N/A |
| error_rate | Double | Definition: Call failure rate. If batch inference is used, this parameter indicates the inference failure rate. However, batch inference is under restricted use. To use it, submit a service ticket. Range: 0 to 1 |
| total_token | Double | Definition: Total number of called tokens, in thousands. If batch inference is used, this parameter indicates the total number of tokens. However, batch inference is under restricted use. To use it, submit a service ticket. Range: N/A |
| prompt_token | Double | Definition: Number of input tokens, in thousands. Range: N/A |
| completion_token | Double | Definition: Number of output tokens Range: N/A |
| avg_latency | Double | Definition: Average E2E latency (ms) Range: N/A |
| avg_ttft | Double | Definition: Average time to first token (TTFT) (ms) Range: N/A |
| avg_tpot | Double | Definition: Average time per output token (TPOT) (ms) Range: N/A |
| infer_times | Integer | Definition: Total number of inference times. (This parameter is related to batch inference. However, batch inference is under restricted use. To use it, submit a service ticket.) Range: N/A |
| scc_count | Integer | Definition: Number of successful calls. If batch inference is used, this parameter indicates the number of successful inference times. However, batch inference is under restricted use. To use it, submit a service ticket. Range: N/A |
| avg_consume_time | Double | Definition: Average task handling duration, in minutes. This parameter is related to batch inference. However, batch inference is under restricted use. To use it, submit a service ticket. Range: N/A |
| completion_tasks_count | Integer | Definition: Number of completed tasks. This parameter is related to batch inference. However, batch inference is under restricted use. To use it, submit a service ticket. Range: N/A |
| cache_token | Double | Definition: Number of cache hits (thousand tokens). Range: N/A |
| cache_hit_ratio | Double | Definition: Cache hit rate, which is number of cache hit tokens/number of input tokens. Range: N/A |
| avg_generation_time | Double | Definition: Average generation duration, that is, the average time generating an image or video. Only video and image models are supported. Range: N/A |
| generation_type | String | Definition: Model type. Range:
|
| video_generate_duration | Double | Definition: Total duration of the generated video. Range: N/A |
| image_generate_nums | Integer | Definition: Total number of generated images. Range: N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, which identifies the error type. For details, see MaaS Error Codes. Range: N/A |
| error_msg | String | Definition: Error description. For details, see MaaS Error Codes. Range: N/A |
Request Example
Query the calling statistics of a preset service whose real-time inference time ranges from 1770048000000 to 1770103717647. A maximum of 100 records can be displayed on each page.
v1/{{project_id}}/maas/monitoring/list-service-statistics
{
"start_time" : 1770048000000,
"end_time" : 1770103717647,
"service_type" : 2,
"limit" : 100,
"offset" : 0,
"service_names" : [ ],
"infer_type" : "real_time",
"model_type" : "Text Generation"
} Response Example
Status code: 200
Success response
{
"total" : 6,
"count" : 100,
"items" : [ {
"service_id" : "21699c35-f333-462b-8a5d-66599926c26f",
"service_name" : "DeepSeek-R1",
"generation_type" : "Text Generation",
"request_count" : 32,
"error_count" : 0,
"error_rate" : 0,
"total_token" : 47.872,
"prompt_token" : 15.104,
"completion_token" : 32.768,
"avg_latency" : 33548.47,
"avg_ttft" : 343.83,
"avg_tpot" : 32.46,
"avg_generation_time" : 0,
"completion_tasks_count" : 0,
"infer_times" : 0,
"scc_count" : 0,
"avg_consume_time" : 0,
"cache_token" : 0,
"cache_hit_ratio" : 0,
"video_generate_duration": 0,
"image_generate_nums": 0
}, {
"service_id" : "3f23f78d-96e3-4146-885a-74fc392ed190",
"service_name" : "DeepSeek-V3.2",
"generation_type" : "Text Generation",
"request_count" : 35,
"error_count" : 0,
"error_rate" : 0,
"total_token" : 68.11,
"prompt_token" : 32.27,
"completion_token" : 35.84,
"avg_latency" : 35744.14,
"avg_ttft" : 1139.02,
"avg_tpot" : 33.73,
"avg_generation_time" : 0,
"completion_tasks_count" : 0,
"infer_times" : 0,
"scc_count" : 0,
"avg_consume_time" : 0,
"cache_token" : 0,
"cache_hit_ratio" : 0,
"video_generate_duration": 0,
"image_generate_nums": 0
}, {
"service_id" : "44e8ee1d-890e-4f8d-9b05-2b2f03a9e514",
"service_name" : "DeepSeek-V3",
"generation_type" : "Text Generation",
"request_count" : 17,
"error_count" : 0,
"error_rate" : 0,
"total_token" : 33.065,
"prompt_token" : 15.657,
"completion_token" : 17.408,
"avg_latency" : 30236.35,
"avg_ttft" : 328.66,
"avg_tpot" : 29.24,
"avg_generation_time" : 0,
"completion_tasks_count" : 0,
"infer_times" : 0,
"scc_count" : 0,
"avg_consume_time" : 0,
"cache_token" : 0,
"cache_hit_ratio" : 0,
"video_generate_duration": 0,
"image_generate_nums": 0
}, {
"service_id" : "780caccf-c894-4fd9-8a8e-ba31f1c644fe",
"service_name" : "Qwen3-32B-32K",
"generation_type" : "Text Generation",
"request_count" : 32,
"error_count" : 0,
"error_rate" : 0,
"total_token" : 70.316,
"prompt_token" : 32.48,
"completion_token" : 37.836,
"avg_latency" : 21912.5,
"avg_ttft" : 349.18,
"avg_tpot" : 18.2,
"avg_generation_time" : 0,
"completion_tasks_count" : 0,
"infer_times" : 0,
"scc_count" : 0,
"avg_consume_time" : 0,
"cache_token" : 0,
"cache_hit_ratio" : 0,
"video_generate_duration": 0,
"image_generate_nums": 0
}, {
"service_id" : "8f658111-64af-44dd-bd3b-a78ec500bc88",
"service_name" : "DeepSeek-V3.2-Exp",
"generation_type" : "Text Generation",
"request_count" : 32,
"error_count" : 0,
"error_rate" : 0,
"total_token" : 57.17,
"prompt_token" : 15.088,
"completion_token" : 42.082,
"avg_latency" : 36555.44,
"avg_ttft" : 0,
"avg_tpot" : 0,
"avg_generation_time" : 0,
"completion_tasks_count" : 0,
"infer_times" : 0,
"scc_count" : 0,
"avg_consume_time" : 0,
"cache_token" : 0,
"cache_hit_ratio" : 0,
"video_generate_duration": 0,
"image_generate_nums": 0
}, {
"service_id" : "ecd6ff0d-4634-4a50-bbe5-641c27b26087",
"service_name" : "DeepSeek-V3.1",
"generation_type" : "Text Generation",
"request_count" : 32,
"error_count" : 0,
"error_rate" : 0,
"total_token" : 59.302,
"prompt_token" : 29.568,
"completion_token" : 29.734,
"avg_latency" : 31596.78,
"avg_ttft" : 504.26,
"avg_tpot" : 32.93,
"avg_generation_time" : 0,
"completion_tasks_count" : 0,
"infer_times" : 0,
"scc_count" : 0,
"avg_consume_time" : 0,
"cache_token" : 0,
"cache_hit_ratio" : 0,
"video_generate_duration": 0,
"image_generate_nums": 0
} ]
} Status code: 400
Failure response
{
"error_code" : "ModelArts.0104",
"error_msg" : "Invalid parameter. Issue: The end time cannot be earlier than the start time."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Success response |
| 400 | Failure response |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
