> 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/bmc/cidr-block/describeavailableipv4resources.md).

# DescribeAvailableIpv4Resources

## 1. API Description

This API (DescribeAvailableIpv4Resources) is used to query available IPv4 CIDR blocks.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type                                                         | Description                                                                           |
| -------------- | -------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| chargeType     | Yes      | [ChargeType](/api-reference/bmc/datastructure.md#chargetype) | <p>CIDR block pricing model .</p><p>PREPAID: subscription POSTPAID: pay-as-you-go</p> |
| zoneId         | No       | String                                                       | Zone ID to which the CIDR blocks belong.                                              |

## 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> |
| availableIpv4Resources | Array of [AvailableIpv4Resource](/api-reference/bmc/datastructure.md#availableipv4resource) | List of available IPv4 CIDR blocks.                                                                                   |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}

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

Request:
{
  "chargeType": "PREPAID"
}

Response:
{
  "requestId": "T9681F843-24B6-4926-86BA-F3D5C25563E3",
  "response": {
    "requestId": "T9681F843-24B6-4926-86BA-F3D5C25563E3",
    "availableIpv4Resources": [
      {
        "zoneId": "HKG-A",
        "netmask": 29,
        "sellStatus": "SELL"
      },
      {
        "zoneId": "SEL-A",
        "netmask": 29,
        "sellStatus": "SOLD_OUT"
      },
      {
        "zoneId": "HKG-A",
        "netmask": 26,
        "sellStatus": "SELL_SHORTAGE"
      }
    ]
  }
}
```

{% 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     |
| ---------------- | ------------------------- | --------------- |
| 404              | INVALID\_ZONE\_NOT\_FOUND | Zone not found. |
