> 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/zlb/load-balancer-instance/inquirypricecreateloadbalancer.md).

# InquiryPriceCreateLoadBalancer

## 1. API Description

This API (InquiryPriceCreateLoadBalancer) is used to query the price for creating a load balancer.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name              | Required | Type                                                                                                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| regionId                    | Yes      | String                                                                                                                  | <p>Region ID.</p><p>It can be obtained by calling <a href="https://docs.console.zenlayer.com/api-reference/zec/location/describeregions.md">DescribeRegions</a>.</p>                                                                                                                                                                                                                                                                                                                                                                       |
| ipStackType                 | No       | [LoadBalancerIpStackType](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#loadbalanceripstacktype) | <p>IP stack type.</p><p>A load balancer instance supports only a single stack, that is, <code>IPv4</code> or <code>IPv6</code>. Dual stack is not supported.</p><p>When <code>IPv6</code> is specified together with <code>internetChargeType</code>, the price is calculated based on assigning 1 public IPv6 block at creation (the block is free; <code>ipv6Price</code> and <code>ipv6NetworkPrice</code> are returned). The line is fixed to BGP, and <code>networkLineType</code> cannot be specified.</p><p>Default value: IPv4</p> |
| internetChargeType          | No       | [InternetChargeType](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#internetchargetype)           | <p>IP network billing model.</p><p><strong>Do not pass this parameter when creating a load balancer with an existing EIP</strong> — omitting it means no new EIP is created and the inquiry result contains no EIP-related fees; passing it prices the request as if a new EIP were created, which adds an extra EIP fee.</p>                                                                                                                                                                                                              |
| ipNetworkType \[Deprecated] | No       | [EipNetworkType](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#eipnetworktype)                   | <p>IP network type.</p><p>Deprecated. Use <code>networkLineType</code> instead.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| networkLineType             | No       | [NetworkLineType](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#networklinetype)                 | <p>IP network type.</p><p>Can only be specified when <code>ipStackType</code> is <code>IPv4</code>. The line of <code>IPv6</code> is fixed to BGP; specifying this parameter returns <code>INVALID\_PARAMETER\_CONFLICT</code>.</p>                                                                                                                                                                                                                                                                                                        |
| bandwidthMbps               | No       | Integer                                                                                                                 | <p>Maximum outbound bandwidth of the elastic IP. Unit: Mbps. The maximum limit is usually 10000 Mbps. If you have additional requirements, please contact Support. This parameter is required when <code>internetChargeType</code> is <code>ByBandwidth</code>.</p><p>Value range: \[1, +)</p>                                                                                                                                                                                                                                             |
| trafficPackageSize          | No       | Float                                                                                                                   | <p>Traffic package size.</p><p>When this parameter is specified, the IP network billing method (<code>internetChargeType</code>) must be <code>ByTrafficPackage</code>; otherwise this parameter does not take effect.</p><p>It can only be set when the billing period is monthly; hourly billing is not supported.</p><p>Value range: \[0.0, 999999.0]</p>                                                                                                                                                                               |
| bandwidthClusterId          | No       | String                                                                                                                  | <p>Bandwidth cluster ID.</p><p>When this parameter is specified, the IP network billing method (<code>internetChargeType</code>) must be <code>BandwidthCluster</code>; otherwise this parameter does not take effect.</p>                                                                                                                                                                                                                                                                                                                 |

## 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>                                                                                                                                    |
| loadBalancerInstancePrice | [PriceItem](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#priceitem)                                            | The price of the load balancer instance.                                                                                                                                                                                                                 |
| eipPrice                  | [PriceItem](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#priceitem)                                            | The price of the elastic IP.                                                                                                                                                                                                                             |
| eipNetworkPrice           | [PriceItem](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#priceitem)                                            | The price of network billing for the elastic IP.                                                                                                                                                                                                         |
| eipNetworkPrices          | Array of [BandwidthPriceResponseItem](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#bandwidthpriceresponseitem) | <p>Bandwidth price details for each traffic direction.</p><p>For the PathBasedBandwidthIP line, multiple items are returned (eipNetworkPrice is null). For other lines, a single item is returned (trafficType=ALL).</p>                                 |
| lcuPrice                  | [PriceItem](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#priceitem)                                            | The price of LCU for the load balance instance.                                                                                                                                                                                                          |
| ipv6Price                 | [PriceItem](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#priceitem)                                            | <p>Price of the public IPv6 block.</p><p>Returned only when <code>ipStackType</code> is <code>IPv6</code> and <code>internetChargeType</code> is specified. The public IPv6 block is free of charge, so the price is always 0.</p>                       |
| ipv6NetworkPrice          | [PriceItem](https://docs.console.zenlayer.com/api-reference/zlb/datastructure.md#priceitem)                                            | <p>Price of the network billing of the public IPv6.</p><p>Returned only when <code>ipStackType</code> is <code>IPv6</code> and <code>internetChargeType</code> is specified; empty when billed by bandwidth cluster (<code>BandwidthCluster</code>).</p> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query the price of creating a public load balancer instance (PremiumBGP line, billed by bandwidth).**

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

Request:
{
  "regionId" : "asia-east-1",
  "internetChargeType" : "ByBandwidth",
  "networkLineType" : "PremiumBGP",
  "bandwidthMbps" : 2,
  "trafficPackageSize" : null
}

Response:
{
  "requestId": "T775F300E-F989-4CC8-BB6E-0452A4C7EA03",
  "response": {
    "requestId": "T775F300E-F989-4CC8-BB6E-0452A4C7EA03",
    "lcuPrice": {
      "unitPrice": null,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": [
        {
          "unitPrice": 1,
          "stepStart": 0,
          "discountUnitPrice": 1,
          "stepEnd": null
        }
      ],
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": null,
      "chargeUnit": "HOUR",
      "amountUnit": "LCU",
      "excessDiscountUnitPrice": null
    },
    "loadBalancerInstancePrice": {
      "unitPrice": 0.016806,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.016806,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipPrice": {
      "unitPrice": 0.076389,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.076389,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipNetworkPrice": {
      "unitPrice": 0.061112,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.061112,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipNetworkPrices": [
      {
        "trafficType": "ALL",
        "price": {
          "unitPrice": 0.061112,
          "originalPrice": null,
          "discountPrice": null,
          "discount": 100,
          "stepPrices": null,
          "excessUnitPrice": null,
          "excessAmountUnit": null,
          "discountUnitPrice": 0.061112,
          "chargeUnit": "HOUR",
          "amountUnit": null,
          "excessDiscountUnitPrice": null
        }
      }
    ]
  }
}
```

**2. Query the price of creating a public load balancer instance (PathBasedBandwidthIP line, billed by bandwidth). eipNetworkPrice is null; see eipNetworkPrices for the bandwidth details.**

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

Request:
{
  "regionId" : "asia-east-1",
  "internetChargeType" : "ByBandwidth",
  "networkLineType" : "PathBasedBandwidthIP",
  "bandwidthMbps" : 2,
  "trafficPackageSize" : null
}

Response:
{
  "requestId": "T885F400E-G990-4DD8-CC7F-1563B5D8FB04",
  "response": {
    "requestId": "T885F400E-G990-4DD8-CC7F-1563B5D8FB04",
    "lcuPrice": {
      "unitPrice": null,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": [
        {
          "unitPrice": 1,
          "stepStart": 0,
          "discountUnitPrice": 1,
          "stepEnd": null
        }
      ],
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": null,
      "chargeUnit": "HOUR",
      "amountUnit": "LCU",
      "excessDiscountUnitPrice": null
    },
    "loadBalancerInstancePrice": {
      "unitPrice": 0.016806,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.016806,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipPrice": {
      "unitPrice": 0.076389,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.076389,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipNetworkPrice": null,
    "eipNetworkPrices": [
      {
        "trafficType": "LOCAL",
        "price": {
          "unitPrice": 0.042000,
          "originalPrice": null,
          "discountPrice": null,
          "discount": 100,
          "stepPrices": null,
          "excessUnitPrice": null,
          "excessAmountUnit": null,
          "discountUnitPrice": 0.042000,
          "chargeUnit": "HOUR",
          "amountUnit": null,
          "excessDiscountUnitPrice": null
        }
      },
      {
        "trafficType": "INTERNATIONAL",
        "price": {
          "unitPrice": 0.088000,
          "originalPrice": null,
          "discountPrice": null,
          "discount": 100,
          "stepPrices": null,
          "excessUnitPrice": null,
          "excessAmountUnit": null,
          "discountUnitPrice": 0.088000,
          "chargeUnit": "HOUR",
          "amountUnit": null,
          "excessDiscountUnitPrice": null
        }
      }
    ]
  }
}
```

**3. Query the price of creating a load balancer instance with an existing elastic IP (EIP). Omitting the IP network parameters means no new EIP is created, so `eipPrice`, `eipNetworkPrice`, and `eipNetworkPrices` are all empty.**

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

Request:
{
  "regionId" : "asia-east-1"
}

Response:
{
  "requestId": "T996G500F-H001-4EE9-DD8G-2674C6E9GC15",
  "response": {
    "requestId": "T996G500F-H001-4EE9-DD8G-2674C6E9GC15",
    "lcuPrice": {
      "unitPrice": null,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": [
        {
          "unitPrice": 1,
          "stepStart": 0,
          "discountUnitPrice": 1,
          "stepEnd": null
        }
      ],
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": null,
      "chargeUnit": "HOUR",
      "amountUnit": "LCU",
      "excessDiscountUnitPrice": null
    },
    "loadBalancerInstancePrice": {
      "unitPrice": 0.016806,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.016806,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipPrice": null,
    "eipNetworkPrice": null,
    "eipNetworkPrices": null
  }
}
```

**4. Query the price of creating an IPv6 load balancer instance and assigning 1 public IPv6 at the same time (billed by bandwidth). The public IPv6 block is free, so `ipv6Price` is 0; see `ipv6NetworkPrice` for the network fee. The line is fixed to BGP, so `networkLineType` does not need to be specified.**

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

Request:
{
  "regionId" : "asia-east-1",
  "ipStackType" : "IPv6",
  "internetChargeType" : "ByBandwidth",
  "bandwidthMbps" : 5
}

Response:
{
  "requestId": "T107H600G-I112-4FF0-EE9H-3785D7F0HD26",
  "response": {
    "requestId": "T107H600G-I112-4FF0-EE9H-3785D7F0HD26",
    "lcuPrice": {
      "unitPrice": null,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": [
        {
          "unitPrice": 1,
          "stepStart": 0,
          "discountUnitPrice": 1,
          "stepEnd": null
        }
      ],
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": null,
      "chargeUnit": "HOUR",
      "amountUnit": "LCU",
      "excessDiscountUnitPrice": null
    },
    "loadBalancerInstancePrice": {
      "unitPrice": 0.016806,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.016806,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "eipPrice": null,
    "eipNetworkPrice": null,
    "eipNetworkPrices": null,
    "ipv6Price": {
      "unitPrice": 0,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    },
    "ipv6NetworkPrice": {
      "unitPrice": 0.152780,
      "originalPrice": null,
      "discountPrice": null,
      "discount": 100,
      "stepPrices": null,
      "excessUnitPrice": null,
      "excessAmountUnit": null,
      "discountUnitPrice": 0.152780,
      "chargeUnit": "HOUR",
      "amountUnit": null,
      "excessDiscountUnitPrice": null
    }
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/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](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                                                     | Description                                                                                                    |
| ---------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| 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. |
| 400              | INVALID\_PARAMETER\_BANDWIDTH\_ERROR                           | The bandwidth limit value is below the minimum limit.                                                          |
| 400              | INVALID\_PARAMETER\_BANDWIDTH\_EXCEED                          | The bandwidth limit value exceeds the maximum limit.                                                           |
| 400              | OPERATION\_DENIED\_EIP\_INTERNET\_CHARGE\_TYPE\_NOT\_AVAILABLE | The specified IP network line type in this node does not support this network billing method.                  |
| 400              | OPERATION\_DENIED\_EIP\_NETWORK\_LINE\_TYPE\_NOT\_ON\_SALE     | The IP network line type is not available for sale in this node.                                               |
