创建成本规则
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
polardb:CreateCostRule |
create |
*全部资源
|
无 | 无 |
请求语法
POST HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| GwClusterId |
string |
是 |
网关实例 ID。 |
pg-xxxxxxx |
| ModelName |
string |
是 |
模型名称(如 gpt-4、qwen-turbo) |
gpt-4 |
| ModelServiceId |
string |
是 |
模型服务 ID。 |
ms-xxxxxx |
| InputCostPointsPerMillion |
string |
否 |
输入百万 token 成本点(默认 0) |
0 |
| EffectiveTargetType |
string |
否 |
生效目标类型, 取值 global/consumerGroup/consumer, 默认 global |
global |
| EffectiveTargetValue |
string |
否 |
生效目标值, 生效目标类型非 global 时必填 |
user |
| OutputCostPointsPerMillion |
string |
否 |
输出百万 token 成本点(默认 0) |
0 |
| CacheCostPointsPerMillion |
string |
否 |
Cache 百万 token 成本点(默认 0 |
0 |
| ExplicitCacheCostPointsPerMillion |
string |
否 |
显式缓存读取成本点每百万 Token |
100 |
| CacheCreationCostPointsPerMillion |
string |
否 |
缓存创建(写入)成本点每百万 Token |
400 |
| ImageCostPointsPerCount |
string |
否 |
图片输入成本点每张 |
5 |
| VideoCostPointsPerSecond |
string |
否 |
视频输入成本点每秒 |
20 |
| InputTokenTiers |
string |
否 |
输入 Token 阶梯价格(非累进), JSON 数组字符串, 元素含 Tier 和 InputCostPointsPerMillion, Tier 取值 ""(默认档)/0-32K/32K-64K/64K-128K/128K-256K/256K-512K/512K-1M/1M+, 例如 [{"Tier":"0-32K","InputCostPointsPerMillion":"1000"},{"Tier":"32K-64K","InputCostPointsPerMillion":"1800"}]; 提供时优先于 InputCostPointsPerMillion, 不可传 [] |
[{"Tier":"0-32K","InputCostPointsPerMillion":"1000"},{"Tier":"32K-64K","InputCostPointsPerMillion":"1800"}] |
| EffectiveStartTime |
string |
否 |
生效起始时间, 格式 yyyy-MM-dd HH:mm:ss, 不传则立即生效 |
2026-10-14 00:00:00 |
| RegionId |
string |
否 |
地域 ID。 |
cn-beijing |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| CostRuleId |
string |
成本规则 ID |
924d450014e64e88ac6e8486f8e990** |
| RequestId |
string |
Id of the request |
580EF224-9647-59E7-9950-D9EBFD6A2921 |
示例
正常返回示例
JSON格式
{
"CostRuleId": "924d450014e64e88ac6e8486f8e990**",
"RequestId": "580EF224-9647-59E7-9950-D9EBFD6A2921"
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。