> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/compute/zec/elastic-ip/describeeipprice.md).

# DescribeEipPrice

## 1. API Description

This API (DescribeEipPrice) is used to query the price of elastic IPs.

{% hint style="info" %}
**Notes**

* The size of the guaranteed traffic package is only valid for billing periods of one month.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name          | Required | Type                                                                                 | Description                                                                                                                                                                                                                                   |
| ----------------------- | -------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| regionId                | Yes      | String                                                                               | Region ID                                                                                                                                                                                                                                     |
| internetChargeType      | Yes      | [InternetChargeType](/api-reference/compute/zec/datastructure.md#internetchargetype) | Network billing methods.                                                                                                                                                                                                                      |
| amount                  | No       | Integer                                                                              | <p>Quantity.</p><p>Value range: \[1, +)</p><p>Default value: 1</p>                                                                                                                                                                            |
| eipV4Type \[Deprecated] | No       | [EipNetworkType](/api-reference/compute/zec/datastructure.md#eipnetworktype)         | <p>Network types of public IPv4.</p><p>Deprecated. Please use networkLineType instead.</p>                                                                                                                                                    |
| networkLineType         | No       | [NetworkLineType](/api-reference/compute/zec/datastructure.md#networklinetype)       | Network types of public IPv4.                                                                                                                                                                                                                 |
| bandwidth               | No       | Integer                                                                              | <p>Bandwidth limit for the elastic public IP.</p><p>Unit: Mbps.</p><p>Value range: \[1, +)</p>                                                                                                                                                |
| flowPackage             | No       | Float                                                                                | <p>Traffic package size of the EIP.</p><p>Unit: TB.</p><p>The value must be 0 or a multiple of 0.1.</p><p>Required when the network billing type is traffic package billing (<code>ByTrafficPackage</code>).</p><p>Value range: \[0.0, +)</p> |
| cidrId                  | No       | String                                                                               | <p>CIDR ID. Specifies the CIDR block from which an elastic IP is allocated.</p><p>This field and <code>eipV4Type</code> cannot be specified at the same time.</p>                                                                             |
| clusterId               | No       | String                                                                               | <p>Shared bandwidth package ID.</p><p>Required when <code>peerRegionId</code> is specified and the network billing method is shared bandwidth package billing (<code>BandwidthCluster</code>).</p>                                            |
| peerRegionId            | No       | String                                                                               | Remote region ID.                                                                                                                                                                                                                             |

## 3. Output Parameters

| Parameter Name       | Type                                                                                                          | Description                                                                                                                             |
| -------------------- | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| requestId            | String                                                                                                        | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p>                   |
| eipPrice             | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem)                                            | <p>Reservation price of the elastic public IP.</p><p>If the elastic IP is created from a CIDR block, the reservation price is null.</p> |
| bandwidthPrice       | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem)                                            | Price of bandwidth.                                                                                                                     |
| bandwidthPrices      | Array of [BandwidthPriceResponseItem](/api-reference/compute/zec/datastructure.md#bandwidthpriceresponseitem) | Bandwidth price details for each traffic direction.                                                                                     |
| remoteBandwidthPrice | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem)                                            | Price of remote ipt.                                                                                                                    |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query the price of a BGP public IP, using traffic package billing. The traffic package size is 10TB.**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeEipPrice
<Common Request Params>

Request：
{
  "regionId": "asia-east-1",
  "amount": 1,
  "internetChargeType": "ByTrafficPackage",
  "networkLineType": "PremiumBGP",
  "bandwidth": 50,
  "flowPackage": 10
}


Response：
{
  "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
  "response": {
    "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
    "eipPrice": {
      "discount": 95.0,
      "discountPrice": 100.0,
      "originalPrice": 100.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
    "bandwidthPrice": {
      "discount": 95.0,
      "discountPrice": 100.0,
      "originalPrice": 100.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
    "bandwidthPrices": [
      {
        "trafficType": "ALL",
        "price": {
          "discount": 95.0,
          "discountPrice": 100.0,
          "originalPrice": 100.0,
          "unitPrice": null,
          "discountUnitPrice": null,
          "chargeUnit": null,
          "stepPrices": null
        }
      }
    ],
    "remoteBandwidthPrice": null
  }
}
```

**2. Query the price of a PathBasedBandwidthIP, billed by bandwidth, with a bandwidth of 50Mbps. Domestic and international bandwidth prices are returned separately, and bandwidthPrice is null.**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeEipPrice
<Common Request Params>

Request：
{
  "regionId": "asia-east-1",
  "amount": 1,
  "internetChargeType": "ByBandwidth",
  "networkLineType": "PathBasedBandwidthIP",
  "bandwidth": 50
}


Response：
{
  "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
  "response": {
    "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
    "eipPrice": {
      "discount": 95.0,
      "discountPrice": 100.0,
      "originalPrice": 100.0,
      "unitPrice": null,
      "discountUnitPrice": null,
      "chargeUnit": null,
      "stepPrices": null
    },
    "bandwidthPrice": null,
    "bandwidthPrices": [
      {
        "trafficType": "LOCAL",
        "price": {
          "discount": 100.0,
          "discountPrice": 80.0,
          "originalPrice": 80.0,
          "unitPrice": null,
          "discountUnitPrice": null,
          "chargeUnit": null,
          "stepPrices": null
        }
      },
      {
        "trafficType": "INTERNATIONAL",
        "price": {
          "discount": 100.0,
          "discountPrice": 120.0,
          "originalPrice": 120.0,
          "unitPrice": null,
          "discountUnitPrice": null,
          "chargeUnit": null,
          "stepPrices": null
        }
      }
    ],
    "remoteBandwidthPrice": null
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                                                     | Description                                                                                                    |
| ---------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| 400              | INVALID\_PREFIX\_LENGTH\_OUT\_OF\_RANGE                        | The prefix length of the EIP is invalid.                                                                       |
| 400              | OPERATION\_DENIED\_FLOW\_PACKAGE\_NOT\_SUPPORTED\_HOUR\_PERIOD | The current product cycle is based on hourly billing and does not support setting a minimum data package size. |
