WritersLogic Verifiable AI Agent Hub Cidr Math API
The Cidr Math API from WritersLogic Verifiable AI Agent Hub — 1 operation(s) for cidr math.
The Cidr Math API from WritersLogic Verifiable AI Agent Hub — 1 operation(s) for cidr math.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/writerslogic-com:writerslogic-com-cidr-math-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: WritersLogic Verifiable AI Agent Hub Cidr Math API
version: 2.0.0
description: Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.
contact:
name: WritersLogic
url: https://writerslogic.com/agents
email: agents@writerslogic.com
servers:
- url: https://agents.writerslogic.com
tags:
- name: Cidr Math
paths:
/api/v1/cidr-math:
post:
operationId: cidr_math
summary: 'CIDR math: IPv4 and IPv6 overlap, adjacency, merge, subtract, membership'
description: 'Computes exact CIDR relations for agents planning networks, firewall rules or allow-lists: for up to 200 IPv4/IPv6 blocks it reports which pairs are equal, nested, partially overlapping or merely adjacent, the minimal merged CIDR list, a subtraction (blocks minus exclusions), address membership with the most specific match, or each block''s first/last address, count and host-bits-set errors. It does not resolve hostnames, look up ownership or routing, interpret IPv6 zone ids, or decide whether an overlap is intentional; IPv4-mapped IPv6 stays a separate family unless normalizeMapped is true.
Price: 0.005 USDC on Base (x402).'
x-x402-price-usdc: '0.005'
x-x402-amount: '5000'
x-payment-info:
protocols:
- x402
price:
mode: fixed
currency: USD
amount: '0.005'
x-audience: developer
x-sample-url: https://agents.writerslogic.com/api/v1/samples/cidr-math
security:
- x402: []
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- op
- ranges
properties:
op:
type: string
enum:
- inspect
- relations
- merge
- subtract
- contains
description: 'inspect: normalize each range and flag host bits set. relations: pairwise equal/contains/overlap/adjacent/disjoint (pass only when no two ranges intersect). merge: minimal CIDR cover of the union. subtract: ranges minus exclude. contains: which ranges contain each address (pass only when every address is covered).'
ranges:
type: array
minItems: 1
maxItems: 200
items:
type: string
maxLength: 100
description: CIDR (10.0.0.0/8, 2001:db8::/32), a bare address (a /32 or /128), or an inclusive range 10.0.0.1-10.0.0.9.
exclude:
type: array
maxItems: 200
items:
type: string
maxLength: 100
description: Only for op=subtract.
addresses:
type: array
maxItems: 500
items:
type: string
maxLength: 64
description: Only for op=contains.
normalizeMapped:
type: boolean
description: Treat ::ffff:a.b.c.d (and prefixes of 96 bits or longer inside ::ffff:0:0/96) as the IPv4 block a.b.c.d. Default false.
example:
op: relations
ranges:
- 10.0.0.0/24
- 10.0.1.0/24
- 10.0.0.128/25
- 2001:db8::/32
responses:
'200':
description: Paid result with provenance
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
status:
type: string
enum:
- pass
- fail
- unknown
- unsupported
description: 'pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.'
op:
type: string
ranges:
type: array
items:
type: object
properties:
input:
type: string
error:
type: string
family:
type: integer
cidr:
type: string
description: Minimal CIDR cover (several blocks when the input is not CIDR-aligned); the first 16 blocks when there are more.
cidrBlocks:
type: integer
description: Number of blocks in the full minimal cover.
first:
type: string
last:
type: string
count:
type: string
description: Decimal address count (exceeds 2^53 for IPv6).
kind:
type: string
enum:
- host
- cidr
- range
canonical:
type: boolean
description: false when a CIDR had host bits set; it was masked to its network address.
ipv4Mapped:
type: boolean
pairs:
type: array
items:
type: object
properties:
a:
type: integer
b:
type: integer
relation:
type: string
description: 'relations: every non-disjoint pair (adjacent included) by range index.'
cidrs:
type: array
items:
type: string
description: 'merge/subtract: resulting CIDR blocks in address order.'
matches:
type: array
items:
type: object
properties:
address:
type: string
rangeIndexes:
type: array
items:
type: integer
mostSpecific:
type: integer
description: Index of the smallest containing range, -1 if none.
total:
type: integer
description: Number of CIDR blocks before truncation.
truncated:
type: boolean
witnesses:
type: array
items:
type: object
properties:
ruleId:
type: string
detail:
type: string
path:
type: string
description: JSON pointer or dotted path into the input.
offset:
type: integer
index:
type: integer
expected:
description: What the rule required.
actual:
description: What the input had.
versions:
type: object
description: Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limits:
type: array
items:
type: string
deterministic:
type: boolean
description: 'Always true: pure code, no model.'
_provenance:
type: object
description: C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance
required:
- data
- _provenance
'400':
description: Invalid request (no payment consumed)
content:
application/json:
schema:
type: object
properties:
error:
type: string
code:
type: string
'401':
description: Invalid X-API-KEY
content:
application/json:
schema:
type: object
properties:
error:
type: string
code:
type: string
'402':
description: Payment required or invalid
content:
application/json:
schema:
type: object
description: x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)
properties:
x402Version:
type: integer
error:
type: string
code:
type: string
resource:
type: object
accepts:
type: array
items:
type: object
extensions:
type: object
'502':
description: Upstream failure; the payment is released or not settled
content:
application/json:
schema:
type: object
properties:
error:
type: string
code:
type: string
tags:
- Cidr Math
components:
securitySchemes:
x402:
type: apiKey
in: header
name: PAYMENT-SIGNATURE
description: x402 v2 payment payload (base64) sent after a 402 challenge
apiKey:
type: apiKey
in: header
name: X-API-KEY