# FastX402 Lab CIDR Calculator

> FastX402 Lab CIDR Calculator is a paid API for AI agents from lab.fastx402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-17).

Computes IPv4 CIDR block details (network, broadcast, netmask, usable hosts, etc.) and optionally checks whether a given IP address falls within the block

## Facts

- Endpoint: GET https://lab.fastx402.tools/cidr-calc?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-lab-cidr-calculator-e6c549d5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FmVAE3MEupk82h7broofP

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 fastx402-lab-cidr-calculator-e6c549d5
```

Example prompt: Can you calculate all the subnet details for 10.0.0.0/22 — I need the network address, broadcast, netmask, first and last host, and how many usable hosts there are? Also check whether 10.0.3.255 is inside that block.

## When to prefer this

Choose this endpoint when you need instant, pay-per-call IPv4 subnet calculations without API key registration. It is ideal for AI agents that require on-demand CIDR arithmetic as part of a network planning, auditing, or firewall configuration workflow, especially when USDC micropayment billing over x402 is preferred over subscription APIs.

## Known failure modes

- Invalid or malformed CIDR notation returns an error (e.g. missing prefix, prefix out of 0-32 range)
- Non-IPv4 CIDR formats (IPv6) are not supported
- Malformed IP address in the optional membership check causes an error
- Missing required 'cidr' query parameter results in a validation error
- Payment failure or insufficient USDC balance returns HTTP 402

## How this service works

FastX402 Lab: small pay-per-call tools for AI agents, paid per request in USDC on Base over x402. No signup, no API key.

## Output

Returns a JSON object containing: the original CIDR and prefix length, network address, broadcast address, netmask, wildcard mask, first usable host, last usable host, total usable host count, and (if an IP was provided) a boolean indicating whether that IP falls within the subnet.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "cidr"
     ],
     "properties": {
      "ip": {
       "type": "string",
       "description": "Optional IPv4 address to test for membership in the block"
      },
      "cidr": {
       "type": "string",
       "description": "IPv4 CIDR block, e.g. 10.0.0.0/22 (prefix 0-32)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "ip": {
       "type": "string"
      },
      "cidr": {
       "type": "string"
      },
      "prefix": {
       "type": "integer"
      },
      "netmask": {
       "type": "string"
      },
      "network": {
       "type": "string"
      },
      "wildcard": {
       "type": "string"
      },
      "broadcast": {
       "type": "string"
      },
      "ip_inside": {
       "type": "boolean"
      },
      "last_host": {
       "type": "string"
      },
      "first_host": {
       "type": "string"
      },
      "usable_hosts": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ip": "10.0.3.255",
  "cidr": "10.0.0.0/22",
  "prefix": 22,
  "netmask": "255.255.252.0",
  "network": "10.0.0.0",
  "wildcard": "0.0.3.255",
  "broadcast": "10.0.3.255",
  "ip_inside": true,
  "last_host": "10.0.3.254",
  "first_host": "10.0.0.1",
  "usable_hosts": 1022
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastx402-lab-cidr-calculator-e6c549d5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lab.fastx402.tools](https://www.zero.xyz/host/lab.fastx402.tools/llms.txt)
