查询成本规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
polardb:DescribeCostRules |
get |
*全部资源
|
无 | 无 |
请求语法
POST HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| PageNumber |
integer |
否 |
页码。 |
1 |
| PageSize |
integer |
否 |
每页记录数,取值范围如下:
默认值为 30。 |
30 |
| GwClusterId |
string |
是 |
网关实例 ID。 |
pg-xxxxxxxx |
| CostRuleId |
string |
否 |
按成本规则 ID 过滤 |
cr-xxx |
| ModelName |
string |
否 |
模型名称(如 gpt-4、qwen-turbo) |
qwen3-max |
| ModelServiceId |
string |
否 |
模型服务 ID。 |
ms-xxxxxx |
| EffectiveTargetType |
string |
否 |
按生效目标类型过滤, 取值 global/consumerGroup/consumer |
global |
| EffectiveTargetValue |
string |
否 |
按生效目标值过滤 |
user |
| InputTokenTier |
string |
否 |
按输入 Token 档位过滤, 返回包含该档位的规则, 取值 0-32K/32K-64K/64K-128K/128K-256K/256K-512K/512K-1M/1M+ |
0-32K |
| RegionId |
string |
否 |
地域 ID。 |
cn-beijing |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| Items |
array<object> |
成本规则列表 |
|
|
array<object> |
成本规则对象 |
||
| CacheCostPointsPerMillion |
string |
Cache 百万 token 成本点(默认 0 |
0 |
| CacheCreationCostPointsPerMillion |
string |
缓存创建(写入)成本点每百万 Token |
400 |
| CostRuleId |
string |
成本规则 ID |
924d450014e64e88ac6e8486f8e990** |
| EffectiveEndTime |
string |
生效结束时间。格式为 YYYY-MM-DDTHH:mm:ssZ(UTC 时间)。 |
2026-10-01T00:00:00Z |
| EffectiveStartTime |
string |
生效开始时间。格式为 YYYY-MM-DDTHH:mm:ssZ(UTC 时间)。 |
2026-09-01T00:00:00Z |
| EffectiveTargetType |
string |
按生效目标类型过滤。 |
global |
| EffectiveTargetValue |
string |
按生效目标值过滤。 |
user |
| ExplicitCacheCostPointsPerMillion |
string |
显式缓存读取成本点每百万 Token |
100 |
| GmtCreated |
string |
创建时间 |
2026-01-04T16:09:29+08:00 |
| GmtModified |
string |
更新时间 |
2024-10-16 16:46:20 |
| GwClusterId |
string |
网关实例 ID。 |
pg-xxxxxxxxxx |
| ImageCostPointsPerCount |
string |
图片输入成本点每张 |
5 |
| InputCostPointsPerMillion |
string |
输入百万 token 成本点(默认 0) |
0 |
| InputTokenTier |
string |
输入 Token 档位, 空表示 legacy/default 规则 |
0-32K |
| InputTokenTiers |
array<object> |
输入 Token 分档定价(非累进), 元素含 Tier 和 InputCostPointsPerMillion |
|
|
object |
|||
| InputCostPointsPerMillion |
string |
该档位输入成本点每百万 Token |
1000 |
| Tier |
string |
Token 档位, 取值 ""(默认档)/0-32K/32K-64K/64K-128K/128K-256K/256K-512K/512K-1M/1M+ |
0-32K |
| Model |
string |
模型名称 |
gpt-4 |
| ModelServiceId |
string |
模型服务 ID |
ms-xxxxxxxxx |
| ModelServiceName |
string |
模型服务名称 |
qwen-service |
| OutputCostPointsPerMillion |
string |
输出百万 token 成本点(默认 0) |
0 |
| VideoCostPointsPerSecond |
string |
视频输入成本点每秒 |
20 |
| PageNumber |
integer |
页码 |
1 |
| PageRecordCount |
integer |
本页记录数。 |
30 |
| PageSize |
integer |
每页记录数,取值范围为 30、50、100,默认值为 30。 |
30 |
| RequestId |
string |
Id of the request |
24A1990B-4F6E-482B-B8CB-75C612****** |
| TotalRecordCount |
integer |
总记录数 |
1 |
示例
正常返回示例
JSON格式
{
"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
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。