# FastX402 CIDR Calculator

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

Calculates network details for an IPv4 CIDR block (netmask, broadcast, host range, usable hosts) and optionally tests whether a given IP address falls within that block.

## Facts

- Endpoint: GET https://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-cidr-calculator-9d4c3bff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6wdDrnmhTJ3E9URbG5iEl

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-cidr-calculator-9d4c3bff
```

Example prompt: What are the full network details for the CIDR block 10.0.0.0/22, and is the IP address 10.0.3.255 inside that block?

## When to prefer this

Use this endpoint when you need fast, structured IPv4 subnet calculations without setting up an account or API key — particularly useful in networking automation, infrastructure planning, or firewall rule validation workflows where payment via USDC on Base per call is acceptable.

## Known failure modes

- Missing required 'cidr' query parameter returns an error
- Invalid CIDR notation (e.g. malformed prefix or out-of-range prefix length 0-32) returns an error
- Invalid IPv4 format for optional 'ip' parameter returns an error
- Payment not included or invalid x402 payment header results in 402 Payment Required

## How this service works

146 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.

## Output

Returns a JSON object with the CIDR prefix length, netmask, wildcard mask, network address, broadcast address, first and last usable host addresses, total usable host count, and optionally a boolean indicating whether the provided IP address is within the block.

## 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-cidr-calculator-9d4c3bff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fastx402.tools](https://www.zero.xyz/host/fastx402.tools/llms.txt)
