# IPv4 CIDR Calculator

> IPv4 CIDR Calculator is a paid API for AI agents from x402-catalog-history.ai-business-surface.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-18).

Computes full IPv4 subnet details (network, broadcast, netmask, host range, counts, and scope flags) from a CIDR notation input in a single GET request.

## Facts

- Endpoint: GET https://x402-catalog-history.ai-business-surface.workers.dev/cidr?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ipv4-cidr-calculator-0419c470
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EsymZlhTKd3TZxcfrGquT

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 ipv4-cidr-calculator-0419c470
```

Example prompt: What are the network address, broadcast address, netmask, and usable host range for the subnet 192.168.1.10/24? Also tell me if it's a private range and how many usable hosts it has.

## When to prefer this

Choose this endpoint when you need instant, serverless IPv4 subnet calculations with no API key, no account setup, and no external dependencies. Ideal for agents that need to programmatically compute subnet details on-demand as part of network planning, validation, or documentation workflows. The micro-cost ($0.001 USDC) and stateless design make it suitable for high-frequency automated lookups.

## Known failure modes

- Invalid CIDR notation (e.g. missing prefix or malformed IP) returns an error response
- Prefix length out of range (>32 or <0) returns an error
- Missing 'cidr' query parameter results in a bad request error
- First call always returns HTTP 402 with payment terms — must resend with PAYMENT-SIGNATURE header to receive the 200 response

## How this service works

IPv4 CIDR calculator in one GET: network, broadcast, netmask, wildcard, first/last usable host, total and usable counts, and the address-class and scope flags. curl: GET /cidr?cidr=192.168.1.10/24 (a bare address means /32). Response: {"ip":"192.168.1.10","prefix":24,"network":"192.168.1.0","broadcast":"192.168.1.255","netmask":"255.255.255.0","first_host":"192.168.1.1","last_host":"192.168.1.254","total_addresses":256,"usable_hosts":254,"is_private":true}. Computed inside the Worker from the input; no upstream call, no account, no key. 0.001 USDC, one GET, one delivery. A purchase is two calls by design: this first call returns 402 with the price and the payment terms, and you then repeat the same request with the PAYMENT-SIGNATURE header to receive the 200 delivery.

## Output

A JSON object containing: the input IP address, prefix length, network address, broadcast address, netmask, wildcard mask, first and last usable host IPs, total address count, usable host count, and a boolean flag indicating whether the range is private. All values are computed server-side with no external calls.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "cidr"
     ],
     "properties": {
      "cidr": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ipv4-cidr-calculator-0419c470/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-catalog-history.ai-business-surface.workers.dev](https://www.zero.xyz/host/x402-catalog-history.ai-business-surface.workers.dev/llms.txt)
