# Luhn Algorithm Validator (checkdigit.openverbs.com)

> Luhn Algorithm Validator (checkdigit.openverbs.com) is a paid API for AI agents from checkdigit.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Validates any digit string against the Luhn (mod-10) checksum algorithm, returning whether the number has a valid check digit.

## Facts

- Endpoint: POST https://checkdigit.openverbs.com/v1/luhn
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/luhn-algorithm-validator-checkdigit-openverbs-com-a1296cb5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_K6i_69kynDhtdBhdFfSMz

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 luhn-algorithm-validator-checkdigit-openverbs-com-a1296cb5 -d '<json body>'
```

Example prompt: Can you check whether this card number passes the Luhn algorithm: 4532 0151 1283 0366?

## When to prefer this

Choose this endpoint when you need to validate any arbitrary digit string against the Luhn algorithm — for example, generic card numbers, loyalty IDs, or other Luhn-encoded identifiers not covered by the more specific siblings (IMEI, ABA routing, GTIN, ISBN). If you specifically need to validate an IMEI, ABA routing number, GTIN barcode, or ISBN, prefer the dedicated sibling endpoints which apply the appropriate format-specific rules on top of Luhn.

## Known failure modes

- Input string shorter than 2 digits or longer than 34 digits after stripping spaces/hyphens returns a validation error
- Non-digit characters other than spaces and hyphens cause a rejection
- Empty string input returns an error
- Network timeout or payment failure (x402) may prevent the call from completing

## How this service works

Validate a number by the Luhn (mod-10) algorithm — the scheme behind credit/debit card numbers and many IDs. Spaces and hyphens are ignored. A mismatched check digit is a successful { valid: false }.

## Output

Returns a JSON object with a `valid` boolean indicating whether the input digit string passes the Luhn (mod-10) checksum. Spaces and hyphens in the input are ignored. A number with an incorrect check digit returns `{ valid: false }` as a successful (non-error) response.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "number"
     ],
     "properties": {
      "number": {
       "type": "string",
       "maxLength": 64,
       "minLength": 1,
       "description": "Digit string (spaces/hyphens allowed), 2-34 digits."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/luhn-algorithm-validator-checkdigit-openverbs-com-a1296cb5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from checkdigit.openverbs.com](https://www.zero.xyz/host/checkdigit.openverbs.com/llms.txt)
