> 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="/api-reference/zec/location/describeregions.md">DescribeRegions</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ipStackType                 | No       | [LoadBalancerIpStackType](/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, the public network parameters (<code>internetChargeType</code>, <code>networkLineType</code>, <code>bandwidthMbps</code>, <code>trafficPackageSize</code>, <code>bandwidthClusterId</code>) cannot be configured. The public addresses of an IPv6 load balancer are assigned separately through <a href="/api-reference/zlb/load-balancer-instance/assignloadbalanceripv6.md">AssignLoadBalancerIpv6</a>.</p><p>Default value: IPv4</p> |
| internetChargeType          | No       | [InternetChargeType](/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](/api-reference/zlb/datastructure.md#eipnetworktype)                   | <p>IP network type.</p><p>Deprecated. Use <code>networkLineType</code> instead.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| networkLineType             | No       | [NetworkLineType](/api-reference/zlb/datastructure.md#networklinetype)                 | IP network type.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 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](/api-reference/zlb/datastructure.md#priceitem)                                            | The price of the load balancer instance.                                                                                                                                                                                 |
| eipPrice                  | [PriceItem](/api-reference/zlb/datastructure.md#priceitem)                                            | The price of the elastic IP.                                                                                                                                                                                             |
| eipNetworkPrice           | [PriceItem](/api-reference/zlb/datastructure.md#priceitem)                                            | The price of network billing for the elastic IP.                                                                                                                                                                         |
| eipNetworkPrices          | Array of [BandwidthPriceResponseItem](/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](/api-reference/zlb/datastructure.md#priceitem)                                            | The price of LCU for the load balance instance.                                                                                                                                                                          |

## 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
  }
}
```

{% 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\_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. |
