# code402 Luhn Check

> code402 Luhn Check is a paid API for AI agents from hcrb.in, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-11).

Validates a number using the Luhn algorithm (checksum) to detect transposition/typo errors in credit card numbers, IMEI numbers, and other Luhn-encoded identifiers

## Facts

- Endpoint: POST https://hcrb.in/v1/tools/luhn-check/call?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code402-luhn-check-20b17c3c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hROkChALahtjRP6TbQE7S

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 code402-luhn-check-20b17c3c -d '<json body>'
```

Example prompt: Can you run a Luhn checksum check on the card number 4539578763621486 to see if it's valid or if there's a typo?

## When to prefer this

Choose this endpoint when you need a fast, offline, deterministic Luhn checksum validation with no ML, no external lookups, and no data leaving the compute context — ideal for validating credit card numbers, IMEI numbers, or any Luhn-encoded identifier before submitting to a payment processor or device registry. Prefer this over regex-only validation when you need checksum verification (not just format), and over ML-based validators when you need deterministic, auditable results. The signed receipt and non-custodial payment model make it suitable for compliance-sensitive pipelines.

## Known failure modes

- Malformed or missing input number returns valid:false with an explanatory reason
- Non-numeric characters in input may cause a format rejection
- After 3 free calls per day, a micropayment of $0.005 USDC is required via x402 protocol; missing payment returns 402 Payment Required
- Input that is structurally a valid Luhn sequence but not a real card will still return valid:true — this is checksum-only, not account-existence validation
- Very long or very short inputs may be rejected as out of spec for Luhn

## How this service works

Offline deterministic checks (no ML, no scraping) for business identifiers and rental due-diligence, paid per call via x402 (gasless EIP-3009 USDC on Base). Checksum-verifiable (IBAN, LEI, VAT, ABA, ISBN, SEDOL…) vs format-only (EIN, IFSC, SWIFT/BIC…) — every response returns a scope field. Non-custodial, signed receipts. First 3 calls/day free.

## Output

A JSON object with a boolean 'valid' field indicating whether the number passes the Luhn checksum, a 'reason' string explaining the result (e.g. 'checksum valid' or 'checksum failed'), a 'scope' field indicating what kind of validation was performed (checksum vs format-only), and optionally a 'normalized' form of the identifier and a 'tool' name.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "number"
   ],
   "properties": {
    "number": {
     "type": "string",
     "description": "12-19 digit number; spaces/dashes allowed."
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "schema": {
  "type": "object",
  "required": [
   "valid",
   "reason"
  ],
  "properties": {
   "tool": {
    "type": "string"
   },
   "scope": {
    "type": "string"
   },
   "valid": {
    "type": "boolean"
   },
   "reason": {
    "type": "string"
   },
   "country": {
    "type": "string"
   },
   "normalized": {
    "type": "string"
   }
  }
 },
 "example": {
  "valid": true,
  "reason": "checksum valid"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code402-luhn-check-20b17c3c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from hcrb.in](https://www.zero.xyz/host/hcrb.in/llms.txt)
