# 24K Labs IP CIDR Calculator

> 24K Labs 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, supports mask-to-prefix conversion, optional contains check, and subnet splitting.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/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/24k-labs-ip-cidr-calculator-3f7c71a7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OwKTceauKJ1QGn_0cMtni

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 24k-labs-ip-cidr-calculator-3f7c71a7 -d '<json body>'
```

Example prompt: Can you do the CIDR math for 10.0.0.0/22 — give me the network address, broadcast, netmask, wildcard mask, usable host range and count, and then split it into 4 equal subnets?

## When to prefer this

Use this endpoint when you need precise, programmatic CIDR subnet calculations without setting up a local library — especially useful in network automation, infrastructure provisioning scripts, or agent workflows that need to validate IP ranges, plan address space, or check containment. Prefer this over general-purpose code execution when the goal is pure CIDR math with reliable structured output.

## Known failure modes

- Invalid CIDR notation returns an error (e.g. missing prefix length or malformed IP)
- Prefix length out of range (e.g. /33 for IPv4) returns validation error
- IP version mismatch between CIDR and contains-check IP returns error
- Requesting too many subnet splits (e.g. splitting /30 into 64 subnets) may return an error or empty result
- Malformed request body returns 400-level error

## 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 structured object containing: network address, broadcast address, netmask, wildcard mask, prefix length, first and last usable host IPs, total usable host count. Optionally includes a boolean result for whether a given IP is contained in the network, and an array of subnet CIDR blocks 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/24k-labs-ip-cidr-calculator-3f7c71a7/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)
