> 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/zec/elastic-ip/describeeipprice.md).

# DescribeEipPrice

## 1. API Description

This API (DescribeEipPrice) is used to inquire the price of creating an elastic IP.

{% 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                                                                       | <p>ID of the region where the EIP is created.</p><p>It can be obtained by calling <a href="/api-reference/zec/location/describeregions.md">DescribeRegions</a>.</p>                                                                                                         |
| internetChargeType      | Yes      | [InternetChargeType](/api-reference/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/zec/datastructure.md#eipnetworktype)         | <p>Network types of public IPv4.</p><p>Deprecated. Please use networkLineType instead.</p>                                                                                                                                                                                  |
| networkLineType         | No       | [NetworkLineType](/api-reference/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>Specify a CIDR ID to allocate the elastic IP from this CIDR block.</p><p>This field and <code>eipV4Type</code> cannot be specified at the same time.</p><p>It can be obtained by calling <a href="/api-reference/zec/cidr-block/describecidrs.md">DescribeCidrs</a>.</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/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/zec/datastructure.md#priceitem)                                            | Price of bandwidth.                                                                                                                                                                                                      |
| bandwidthPrices      | Array of [BandwidthPriceResponseItem](/api-reference/zec/datastructure.md#bandwidthpriceresponseitem) | <p>Bandwidth price details of each traffic direction.</p><p>Multiple items are returned for the PathBasedBandwidthIP line (bandwidthPrice is null), and a single item is returned for other lines (trafficType=ALL).</p> |
| remoteBandwidthPrice | [PriceItem](/api-reference/zec/datastructure.md#priceitem)                                            | Price of remote ipt.                                                                                                                                                                                                     |

## 4. Code Example

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

```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 50 Mbps. The prices for domestic and international bandwidth 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              | OPERATION\_DENIED\_EIP\_NETWORK\_LINE\_TYPE\_NOT\_ON\_SALE     | The IP network line type is not available in this region.                                                      |
| 400              | OPERATION\_DENIED\_EIP\_INTERNET\_CHARGE\_TYPE\_NOT\_AVAILABLE | The specified IP network line type in this region does not support this network billing mode.                  |
| 400              | OPERATION\_DENIED\_INTERNET\_CHARGE\_TYPE\_NOT\_SUPPORT        | IP network billing type is not supported.                                                                      |
| 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. |
