{"uid":"cap_Kv73BiI1_70ftsczIQs-E","slug":"ip-cidr-containment-check-e8915274","name":"IP CIDR Containment Check","description":"Test whether an IP address falls within a CIDR block. A well-formed address of a different family (or simply outside the block) returns contains=false — not an error.","url":"https://ip.openverbs.com/v1/contains","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["cidr","address"],"properties":{"cidr":{"type":"string","maxLength":64,"minLength":3,"description":"CIDR block, e.g. \"10.0.0.0/8\"."},"address":{"type":"string","maxLength":64,"minLength":1,"description":"IP address to test."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Xzqz9cRi3OZuyLHoGNwH_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Tests whether a given IP address (IPv4 or IPv6) falls within a specified CIDR block, returning a boolean contains result.","exampleAgentPrompt":"Is the IP address 203.0.113.45 inside the CIDR block 203.0.113.0/24?","exampleUseCases":[{"title":"Firewall allowlist IP validation","prompt":"I need to check whether 10.20.30.45 is inside our trusted internal subnet 10.20.0.0/16 before allowing it through the firewall — can you confirm if it's in that block?"},{"title":"Cloud VPC subnet membership check","prompt":"Does the IP 172.31.15.200 fall within the AWS VPC subnet 172.31.0.0/20? I need to know if this instance is in the right network segment."},{"title":"IPv6 address range verification","prompt":"Can you tell me if the IPv6 address 2001:db8::ff is contained within the CIDR block 2001:db8::/32?"}],"resultDescription":"Returns a JSON object with a boolean 'contains' field indicating whether the provided IP address falls within the specified CIDR block. A well-formed IP of a different address family or an IP simply outside the range returns contains=false rather than an error.","failureModes":["Malformed CIDR block (e.g. missing prefix length or invalid notation) returns an error","Malformed IP address string returns an error","Missing required fields (cidr or address) returns a validation error","Payment not included or insufficient triggers a 402 response"],"whenToPreferThis":"Use this endpoint when you need a fast, reliable, single-call check to determine if an IP address falls within a CIDR block — especially in agentic workflows that need to validate network membership, enforce IP allowlists/blocklists, or route traffic decisions. Prefer this over rolling your own bitwise math or loading a full networking library when you need a lightweight, pay-per-use microservice with no setup. It handles both IPv4 and IPv6 gracefully without throwing errors on cross-family comparisons.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:30:26.688Z","isFirstParty":false}