All Products
Search
Document Center

PolarDB:DescribeCostRules

Last Updated:Oct 22, 2026

Queries cost rules.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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:

  • 30

  • 50

  • 100

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.