billing management / Cost trends
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
aicontent:ModelRouterQueryCostTrendMetrics |
list |
*All Resource
|
None | None |
Request syntax
GET /api/v1/modelRouter/open/billing/cost/trend HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| startTime |
integer |
Yes |
The start time of the query, specified as a Unix timestamp in seconds. |
1700000000 |
| endTime |
integer |
Yes |
The end time of the query, specified as a Unix timestamp in seconds. |
1700086400 |
| modelTypes |
string |
No |
The model types to query, separated by commas. |
LLM,VL |
| clientId |
integer |
No |
Filters the results by department ID. |
1 |
| granularity |
string |
No |
The granularity of the data. Valid values: |
hourly |
| maxResults |
integer |
No |
The maximum number of results to return per page. |
10 |
| nextToken |
string |
No |
The pagination token from a previous response to retrieve the next page of results. If this parameter is omitted, the first page of results is returned. |
xxxx-xxx-xxxxx |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
{ "success": true, "data": {"default_metric": "total_amount", "granularity": "hourly", "metrics": [], "points": []}, "requestId": "592A27EF-26D3-1434-98C1-97AD63337852" } |
|
| requestId |
string |
The unique request ID. If you encounter a problem, provide this ID to technical support for troubleshooting. |
xxxx-xxxx-xxxx-xxxxxxxx |
| success |
boolean |
Indicates whether the request was successful. A value of |
true |
| errCode |
string |
The error code returned when the request fails. |
UNKNOWN_ERROR |
| errMessage |
string |
The error message returned when the request fails. |
未知错误 |
| httpStatusCode |
integer |
The HTTP status code. |
200 |
| data | CostQueryTrendDTO |
The data object containing the cost trend metrics. |
[] |
| maxResults |
integer |
The maximum number of results returned per page. |
10 |
| nextToken |
string |
A token to retrieve the next page of results. If no token is returned, all results have been retrieved. |
xxxx-xxx-xxxxx |
Examples
Success response
JSON format
{
"requestId": "xxxx-xxxx-xxxx-xxxxxxxx",
"success": true,
"errCode": "UNKNOWN_ERROR",
"errMessage": "未知错误",
"httpStatusCode": 200,
"data": {
"defaultMetric": "total_amount",
"granularity": "hourly",
"metrics": [
{
"key": "total_calls",
"label": "调用次数",
"sortable": true,
"unit": "次"
}
],
"points": [
{
"timestamp": 1700000000,
"values": "\"{\\\"total_calls\\\":0,\\\"video_duration\\\":0,\\\"total_amount\\\":0,\\\"model_count\\\":0,\\\"image_count\\\":0}\""
}
]
},
"maxResults": 10,
"nextToken": "xxxx-xxx-xxxxx"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | Server.Internal.UnknownError | The request processing has failed due to some unknown error. | |
| 403 | B.Permission.DeniedException | 鉴权失败或权限不足 | |
| 403 | B.Permission.OrgNoExistException | 组织不存在,请主账号开通权限后再试,或联系管理员 |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.