All Products
Search
Document Center

Elastic Container Instance:DescribeContainerGroupPrice

Last Updated:Oct 17, 2025

Queries the price of an Elastic Container Instance (ECI) instance.

Operation description

  • This operation does not support resource group-based authentication.

  • You can create an ECI instance by specifying the number of vCPUs and memory size, or by specifying an ECS instance type. When you call this operation to query prices, specify the supported specifications.

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

eci:DescribeContainerGroupPrice

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call DescribeRegions to query the latest information about regions and zones.

cn-hangzhou

RegionId

string

Yes

The region ID. You can call DescribeRegions to query the latest information about regions and zones.

cn-hangzhou

Cpu

number

No

The number of vCPUs. For more information about the vCPU and memory specifications that are supported by ECI, see vCPU and memory specifications.

2.0

Memory

number

No

The memory size. Unit: GiB. For more information about the vCPU and memory specifications that are supported by ECI, see vCPU and memory specifications.

4.0

InstanceType

string

No

The ECS instance type. For more information about the ECS instance types that are supported by ECI, see ECS instance types supported by ECI.

Note

If you set this parameter, the specified values for the Cpu and Memory parameters are ignored. The price of only the ECS instance type is returned.

ecs.c5.large

SpotStrategy

string

No

The preemption policy for the instance. Valid values:

  • NoSpot: a regular pay-as-you-go instance.

  • SpotWithPriceLimit: a spot instance for which you specify the maximum hourly price.

  • SpotAsPriceGo: a spot instance for which the system automatically bids based on the current market price.

Default value: NoSpot.

SpotWithPriceLimit

ZoneId

string

No

The zone ID. You can call DescribeRegions to query the latest information about regions and zones.

cn-hangzhou-g

SpotPriceLimit

number

No

The maximum hourly price of the spot instance. The value can be accurate to three decimal places. This parameter is required when SpotStrategy is set to SpotWithPriceLimit.

0.2

EphemeralStorage

integer

No

The size of the temporary storage space. Unit: GiB.

20

SpotDuration

integer

No

The protection period of the spot instance. Unit: hour. Default value: 1. A value of 0 indicates that no protection period is specified.

1

ComputeCategory

string

No

The category of computing power. Set the value to `economy` to query the price of an economy instance type.

economy

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

7A872585-33C7-4D69-AB8E-412E81EBA387

PriceInfo

object

The price information, which includes the price and promotion rules.

SpotPrices

object

SpotPrice

array<object>

The price information of the spot instance.

object

ZoneId

string

The zone ID.

cn-hangzhou-i

SpotPrice

number

The price of the spot instance.

0.056

InstanceType

string

The instance type.

ecs.c5.large

OriginPrice

number

The original price.

0.622

Price

object

The price.

DiscountPrice

number

The discounted price.

0

TradePrice

number

The final price, which is the original price minus the discount.

0.00012252

OriginalPrice

number

The original price.

0.00012252

DetailInfos

object

DetailInfo

array<object>

The details of the price.

array<object>

Resource

string

The resource name.

cpu

DiscountPrice

number

The discounted price.

0

TradePrice

number

The transaction price.

0.000098

OriginalPrice

number

The original price.

0.000098

Rules

object

Rule

array<object>

The pricing rules.

object

Description

string

The description of the rule.

*****

RuleId

integer

The rule ID.

123456

Currency

string

The currency. Valid values:

  • CNY: This value is available only on the China site (aliyun.com).

  • USD: This value is available only on the international site (alibabacloud.com).

CNY

Rules

object

Rule

array<object>

The promotion rules.

object

Description

string

The description of the promotion rule.

*****

RuleId

integer

The promotion ID.

123456

Examples

Success response

JSON format

{
  "RequestId": "7A872585-33C7-4D69-AB8E-412E81EBA387",
  "PriceInfo": {
    "SpotPrices": {
      "SpotPrice": [
        {
          "ZoneId": "cn-hangzhou-i",
          "SpotPrice": 0.056,
          "InstanceType": "ecs.c5.large",
          "OriginPrice": 0.622
        }
      ]
    },
    "Price": {
      "DiscountPrice": 0,
      "TradePrice": 0.00012252,
      "OriginalPrice": 0.00012252,
      "DetailInfos": {
        "DetailInfo": [
          {
            "Resource": "cpu",
            "DiscountPrice": 0,
            "TradePrice": 0.000098,
            "OriginalPrice": 0.000098,
            "Rules": {
              "Rule": [
                {
                  "Description": "*****",
                  "RuleId": 123456
                }
              ]
            }
          }
        ]
      },
      "Currency": "CNY"
    },
    "Rules": {
      "Rule": [
        {
          "Description": "*****",
          "RuleId": 123456
        }
      ]
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParam.CpuOrMemorySpec The specified specification is invalid. The specified specification is invalid.
400 TradeBidCommodityNotMatch The trade ID and the commodity do not match.
400 InvalidSpotCpuMemorySpec The specified CPU and memory are not allowed. You must create spot ECI using standard ECS specifications for CPU and memory.
400 FeatureBasedConstraintConflict A conflict occurs in specified feature constraints: [%s]. A conflict occurs in specified feature constraints
403 Spot.NotMatched %s. We recommend that you use the create multi-zone function to avoid insufficient inventory. For more information, see https://www.alibabacloud.com/help/document_detail/157290.html
403 FeatureAccessRestricted Access to this feature:[%s] is restricted. Please contact Alibaba Cloud ECI support to request access. Access to this feature is restricted. Please contact Alibaba Cloud ECI support to request access.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.