# Number Theory Is-Prime Checker

> Number Theory Is-Prime Checker is a paid API for AI agents from numtheory.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Determines whether a given non-negative integer is a prime number

## Facts

- Endpoint: POST https://numtheory.openverbs.com/v1/is-prime
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/number-theory-is-prime-checker-a3c4bb7a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_35N0CgdGFE9QYBcW_PdZb

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 number-theory-is-prime-checker-a3c4bb7a -d '<json body>'
```

Example prompt: Is 104729 a prime number? Pass it as a string to the primality checker and tell me the result.

## When to prefer this

Choose this endpoint when you need a fast, on-demand primality test for a single integer without setting up a local math library. It is ideal for agents performing number-theoretic computations, cryptographic key validation workflows, educational math tools, or any pipeline that needs to gate logic on whether a number is prime. It accepts the integer as a decimal string, making it safe for arbitrarily large numbers that might overflow standard integer types.

## Known failure modes

- Input 'n' not matching the pattern ^\d+$ (non-decimal or negative sign included) causes validation error
- Empty or missing 'n' field returns a 400-level error
- Extremely large integers may cause timeouts or overflow errors
- Malformed JSON body results in a parsing error
- Non-string type for 'n' (e.g. passing a JSON number instead of string) fails schema validation

## How this service works

Miller-Rabin primality test (with witnesses that are exact for all 64-bit integers) on an arbitrary-precision integer. Returns { prime }.

## Output

The endpoint returns whether the submitted integer is prime or not, expressed as a boolean or equivalent primality flag, allowing the caller to immediately know the prime status of the input number.

## 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": [
      "n"
     ],
     "properties": {
      "n": {
       "type": "string",
       "pattern": "^\\d+$",
       "description": "Non-negative integer as a decimal string."
      }
     },
     "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/number-theory-is-prime-checker-a3c4bb7a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from numtheory.openverbs.com](https://www.zero.xyz/host/numtheory.openverbs.com/llms.txt)
