Queries cost rules.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:DescribeCostRules |
get |
*All Resource
|
None | None |
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PageNumber |
integer |
No |
The page number. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Valid values:
Default value: 30. |
30 |
| GwClusterId |
string |
Yes |
The gateway instance ID. |
pg-xxxxxxxx |
| CostRuleId |
string |
No |
The ID of the cost rule. |
cr-xxx |
| ModelName |
string |
No |
The name of the model, such as gpt-4 or qwen-turbo. |
qwen3-max |
| ModelServiceId |
string |
No |
The ID of the model service. |
ms-xxxxxx |
| EffectiveTargetType |
string |
No |
The effective target type used to filter the results. Valid values: global, consumerGroup, and consumer. |
global |
| EffectiveTargetValue |
string |
No |
The effective target value used to filter the results. |
user |
| InputTokenTier |
string |
No |
The input token tier used to filter the results. Returns rules that include this tier. Valid values: 0-32K, 32K-64K, 64K-128K, 128K-256K, 256K-512K, 512K-1M, and 1M+. |
0-32K |
| RegionId |
string |
No |
The region ID. |
cn-beijing |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| Items |
array<object> |
The list of cost rules. |
|
|
array<object> |
The cost rule object. |
||
| CacheCostPointsPerMillion |
string |
The cache read cost points per million tokens. Default value: 0. |
0 |
| CacheCreationCostPointsPerMillion |
string |
The cache creation cost points per million tokens. |
400 |
| CostRuleId |
string |
The ID of the cost rule. |
924d450014e64e88ac6e8486f8e990** |
| EffectiveEndTime |
string |
The end time of the effective period. The time is displayed in UTC in the YYYY-MM-DDTHH:mm:ssZ format. |
2026-10-01T00:00:00Z |
| EffectiveStartTime |
string |
The start time of the effective period. The time is displayed in UTC in the YYYY-MM-DDTHH:mm:ssZ format. |
2026-09-01T00:00:00Z |
| EffectiveTargetType |
string |
The type of the effective target. |
global |
| EffectiveTargetValue |
string |
The value of the effective target. |
user |
| ExplicitCacheCostPointsPerMillion |
string |
The explicit cache read cost points per million tokens. |
100 |
| GmtCreated |
string |
The time when the cost rule was created. |
2026-01-04T16:09:29+08:00 |
| GmtModified |
string |
The time when the cost rule was last updated. |
2024-10-16 16:46:20 |
| GwClusterId |
string |
The gateway instance ID. |
pg-xxxxxxxxxx |
| ImageCostPointsPerCount |
string |
The image input cost points per image. |
5 |
| InputCostPointsPerMillion |
string |
The input cost points per million tokens. Default value: 0. |
0 |
| InputTokenTier |
string |
The input token tier. An empty value indicates a legacy or default rule. |
0-32K |
| InputTokenTiers |
array<object> |
The non-cumulative tiered pricing for input tokens. Each element contains Tier and InputCostPointsPerMillion. |
|
|
object |
|||
| InputCostPointsPerMillion |
string |
The input cost points per million tokens for the tier. |
1000 |
| Tier |
string |
The token tier. Valid values: "" (default tier), 0-32K, 32K-64K, 64K-128K, 128K-256K, 256K-512K, 512K-1M, and 1M+. |
0-32K |
| Model |
string |
The name of the model. |
gpt-4 |
| ModelServiceId |
string |
The ID of the model service. |
ms-xxxxxxxxx |
| ModelServiceName |
string |
The model service name. |
qwen-service |
| OutputCostPointsPerMillion |
string |
The output cost points per million tokens. Default value: 0. |
0 |
| VideoCostPointsPerSecond |
string |
The video input cost points per second. |
20 |
| PageNumber |
integer |
The page number. |
1 |
| PageRecordCount |
integer |
The number of entries returned on the current page. |
30 |
| PageSize |
integer |
The number of entries per page. Valid values: 30, 50, and 100. Default value: 30. |
30 |
| RequestId |
string |
Id of the request |
24A1990B-4F6E-482B-B8CB-75C612****** |
| TotalRecordCount |
integer |
The total number of entries. |
1 |
Examples
Success response
JSON format
{
"Items": [
{
"CacheCostPointsPerMillion": "0",
"CacheCreationCostPointsPerMillion": "400",
"CostRuleId": "924d450014e64e88ac6e8486f8e990**",
"EffectiveEndTime": "2026-10-01T00:00:00Z",
"EffectiveStartTime": "2026-09-01T00:00:00Z",
"EffectiveTargetType": "global",
"EffectiveTargetValue": "user",
"ExplicitCacheCostPointsPerMillion": "100",
"GmtCreated": "2026-01-04T16:09:29+08:00",
"GmtModified": "2024-10-16 16:46:20\n",
"GwClusterId": "pg-xxxxxxxxxx",
"ImageCostPointsPerCount": "5",
"InputCostPointsPerMillion": "0",
"InputTokenTier": "0-32K",
"InputTokenTiers": [
{
"InputCostPointsPerMillion": "1000",
"Tier": "0-32K"
}
],
"Model": "gpt-4",
"ModelServiceId": "ms-xxxxxxxxx",
"ModelServiceName": "qwen-service",
"OutputCostPointsPerMillion": "0",
"VideoCostPointsPerSecond": "20"
}
],
"PageNumber": 1,
"PageRecordCount": 30,
"PageSize": 30,
"RequestId": "24A1990B-4F6E-482B-B8CB-75C612******",
"TotalRecordCount": 1
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.