Billing management/Update billing rules
Try it now
Test
RAM authorization
Request syntax
PUT /api/v1/modelRouter/open/billing/rules/{id} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| id |
integer |
No |
The ID of the billing rule. |
1 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body for updating a billing rule. |
|
| billingType |
string |
No |
The billing type. Must be |
configurable |
| pricingConfig |
any |
No |
The billing configuration, specified as a JSON object.
|
{ "tiers": [ { "min_tokens": 0, "max_tokens": 32000, "input_price": 2.5, "output_price": 2.5, "thinking_output_price": 10, "cached_input_price": 1.25 }, { "min_tokens": 32000, "max_tokens": 0, "input_price": 1.25, "output_price": 1.25, "thinking_output_price": 5, "cached_input_price": 0.625 } ] } |
| effectiveTime |
string |
No |
The effective time, in RFC3339 format. |
2024-01-01T00:00:00Z |
| expireTime |
string |
No |
The expiration time, in RFC3339 format. |
2025-01-01T00:00:00Z |
| status |
integer |
No |
The status of the billing rule. Use this field to enable or disable the rule. |
1 |
| version |
integer |
No |
The version number of the billing rule. |
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
{ "success": true, "data": {"id": 1, "billing_type": "token_tiered"}, "requestId": "592A27EF-26D3-1434-98C1-97AD63337852" } |
|
| requestId |
string |
The request ID. |
xxxx-xxxx-xxxx-xxxxxxxx |
| success |
boolean |
Indicates whether the request is successful. |
true |
| errCode |
string |
The error code. |
UNKNOWN_ERROR |
| errMessage |
string |
The error message. |
未知错误 |
| httpStatusCode |
integer |
The HTTP status code. |
200 |
| data |
object |
The returned data. |
|
| id |
integer |
The rule ID. |
1 |
| modelId |
integer |
The model ID. |
1 |
| modelCode |
string |
The model ID. |
qwen-plus |
| modelName |
string |
The model name. |
通义千问Plus |
| modelType |
string |
The model type. |
chat |
| symbol |
string |
The vendor ID. |
alibaba |
| billingType |
string |
The billing type. |
token_tiered |
| pricingConfig |
any |
The billing configuration. |
{} |
| effectiveTime |
string |
The time when the rule takes effect. |
2024-01-01T00:00:00Z |
| expireTime |
string |
The expiration time. |
2025-01-01T00:00:00Z |
| version |
integer |
The version number. |
1 |
| deleteTag |
integer |
The deletion tag. |
0 |
| gmtCreate |
string |
The creation time. |
2024-01-01T00:00:00Z |
| gmtModified |
string |
The modification time. |
2024-01-01T00:00:00Z |
Examples
Success response
JSON format
{
"requestId": "xxxx-xxxx-xxxx-xxxxxxxx",
"success": true,
"errCode": "UNKNOWN_ERROR",
"errMessage": "未知错误",
"httpStatusCode": 200,
"data": {
"id": 1,
"modelId": 1,
"modelCode": "qwen-plus",
"modelName": "通义千问Plus",
"modelType": "chat",
"symbol": "alibaba",
"billingType": "token_tiered",
"pricingConfig": "{}",
"effectiveTime": "2024-01-01T00:00:00Z",
"expireTime": "2025-01-01T00:00:00Z",
"version": 1,
"deleteTag": 0,
"gmtCreate": "2024-01-01T00:00:00Z",
"gmtModified": "2024-01-01T00:00:00Z"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 200 | B.Resource.NotFoundException | B.Resource.NotFoundException. | |
| 200 | B.Billing.RuleNotFoundException | B.Billing.RuleNotFoundException. | |
| 500 | Server.Internal.UnknownError | The request processing has failed due to some unknown error. | |
| 403 | B.Permission.OrgNoExistException | B.Permission .OrgNoExistException. | Authentication failed-Organization does not exist |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.