# Swift Bot Labs Toolbox – IP CIDR Aggregation

> Swift Bot Labs Toolbox – IP CIDR Aggregation is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Aggregates and summarizes a list of CIDR blocks or individual IPs into the minimal set of covering supernets, reporting input/output counts and any invalid entries.

## Facts

- Endpoint: POST https://x402-toolbox.swiftbotlab.workers.dev/v1/ip/aggregate?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-toolbox-ip-cidr-aggregation-526a060a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_S_gQWMIQb3_gfq0a2UsTE

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 swift-bot-labs-toolbox-ip-cidr-aggregation-526a060a -d '<json body>'
```

Example prompt: Can you aggregate these CIDR blocks into the smallest possible set of supernets: 10.0.0.0/24, 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24, 192.168.1.5 — and tell me how many were invalid?

## When to prefer this

Choose this endpoint when you need a deterministic, serverless, pay-per-call CIDR aggregation without account setup — ideal for occasional or automated network-tooling tasks where a full-featured networking library isn't available, or when operating inside an AI agent pipeline that uses x402 micropayments. Prefer this over manual scripting (e.g. Python netaddr) when a hosted, stateless API call is more convenient and cost at $0.003/call is acceptable.

## Known failure modes

- Malformed CIDR notation in input causes entries to be placed in the 'invalid' array rather than aggregated
- Exceeding 1000 CIDR items or 40,000 character string limit causes a 4xx error
- Passing non-IP data (e.g. domain names) results in those entries being listed as invalid
- Payment failure via x402 returns 402 Payment Required and no result
- Empty input array returns aggregated result with zero CIDRs

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

Returns a JSON object with ok status, the tool name ('cidr-aggregate'), and a result object containing: an array of aggregated CIDR strings (minimally covering supernets), the count of input CIDRs/IPs provided, the count of output aggregated CIDRs, and an array of any invalid/unparseable entries that were ignored.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cidrs": {
   "type": [
    "array",
    "string"
   ],
   "items": {
    "type": "string",
    "maxLength": 64
   },
   "maxItems": 1000,
   "maxLength": 40000,
   "description": "CIDR blocks or single IPs (JSON array, or a comma/space separated string)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "cidr-aggregate",
  "result": {
   "cidrs": [
    "10.0.0.0/22",
    "192.168.1.5/32"
   ],
   "input": 4,
   "output": 2,
   "invalid": []
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-toolbox-ip-cidr-aggregation-526a060a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
