# IP CIDR Calculator

> IP CIDR Calculator is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Performs CIDR math for IPv4/IPv6 addresses: computes network, broadcast, netmask, wildcard, prefix, usable host range and count, and optionally checks if an IP is contained in a subnet or splits a subnet.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/ip-cidr-calc
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ip-cidr-calculator-ce696758
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EkFPBqXsShbqA1td1yVwj

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-cidr-calculator-ce696758 -d '<json body>'
```

Example prompt: Calculate all the CIDR details for 10.0.0.0/22 — give me the network address, broadcast, netmask, wildcard, usable host range and count, and also check if 10.0.1.55 is contained in that subnet.

## When to prefer this

Choose this endpoint when you need fast, reliable CIDR arithmetic for IPv4 or IPv6 without standing up your own networking library. It is ideal for network automation agents, infrastructure provisioning tools, or security workflows that need to validate IP ranges, enumerate subnets, or check containment at low cost ($0.002/call) with no setup required.

## Known failure modes

- Invalid CIDR notation returns a 400 error with a descriptive message
- IPv6 addresses passed with IPv4-only operations may fail or be unsupported
- Prefix length out of range (e.g. /33 for IPv4) returns a validation error
- Malformed IP address strings return a parse error
- Requesting a subnet split with too large a target prefix may time out or return too many results

## How this service works

CIDR math for IPv4/IPv6: network, broadcast, netmask, wildcard, prefix, usable host range and count, mask<->prefix, plus optional contains check and subnet split.

## Output

Returns a JSON object with computed CIDR fields: network address, broadcast address, netmask, wildcard mask, prefix length, first and last usable host, usable host count, and optionally a boolean indicating whether a given IP is contained in the subnet, plus an array of subnets if a split was requested.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cidr": {
   "type": "string"
  },
  "contains": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "network": "192.168.1.0",
  "contains": true,
  "broadcast": "192.168.1.255",
  "num_addresses": 256
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ip-cidr-calculator-ce696758/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
