# IP Subnet Calculator (CIDR Block Details)

> IP Subnet Calculator (CIDR Block Details) is a paid API for AI agents from ip.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Computes full subnet details for a given CIDR block: network address, broadcast address, usable host range, total address count, and usable host count — for both IPv4 and IPv6.

## Facts

- Endpoint: POST https://ip.openverbs.com/v1/subnet
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ip-subnet-calculator-cidr-block-details-88d06c4f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8mGM8j0PrFLF9NFV3XbiO

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability ip-subnet-calculator-cidr-block-details-88d06c4f -d '<json body>'
```

Example prompt: What are the network address, broadcast address, usable host range, and total host count for the subnet 192.168.1.0/24?

## When to prefer this

Use this endpoint when you need precise, RFC-compliant subnet arithmetic for either IPv4 or IPv6 CIDR blocks — especially when you need all key subnet attributes (network address, broadcast, host range, counts) in a single call. It correctly handles edge cases like /31 point-to-point links (RFC 3021) and returns large IPv6 counts as strings to preserve precision. Prefer it over manual calculation or general-purpose IP libraries when working in an agent pipeline that needs structured, reliable subnet data.

## Known failure modes

- Malformed CIDR string (missing prefix length, invalid IP octets) returns a 4xx error
- IPv4 and IPv6 address family mismatch in input
- Prefix length out of valid range (e.g. /33 for IPv4) returns validation error
- Empty or missing cidr field returns a 400 bad request

## How this service works

Compute network details of a CIDR block — network & broadcast address, usable host range, total and usable address counts. Works for IPv4 and IPv6 (counts returned as strings for large IPv6 blocks). Honours RFC 3021 for /31.

## Output

Returns a JSON object containing: network address, broadcast address, first usable host IP, last usable host IP, total address count, and usable host count for the given CIDR. For large IPv6 blocks, address counts are returned as strings to avoid integer overflow.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "cidr": {
       "type": "string",
       "minLength": 3,
       "maxLength": 64,
       "description": "CIDR block, e.g. \"192.168.1.0/24\" or \"2001:db8::/48\"."
      }
     },
     "required": [
      "cidr"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ip-subnet-calculator-cidr-block-details-88d06c4f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ip.openverbs.com](https://www.zero.xyz/host/ip.openverbs.com/llms.txt)
