# Cryptographically Secure Random Number Generator

> Cryptographically Secure Random Number Generator is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.0022/call, status unknown (last checked 2026-09-13).

Generates cryptographically secure random integers or floats within a specified range, with optional batch generation for dice rolls, lottery picks, coin flips, and similar use cases.

## Facts

- Endpoint: GET https://api.x402node.dev/math/random
- Price: $0.0022/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-x402node-dev-1ea58b2f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PBJiAGyyk50gBxVqcga1u

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 api-x402node-dev-1ea58b2f
```

Example prompt: Give me 6 cryptographically secure random integers between 1 and 49 — I want to pick lottery numbers.

## When to prefer this

Choose this endpoint when you need cryptographically secure (not pseudo-random) number generation, especially for security-sensitive contexts like token generation, fair draws, or lottery-style picks. Prefer this over client-side Math.random() when unpredictability and security guarantees are required. Supports batch generation so you can get multiple numbers in a single call.

## Known failure modes

- Invalid range (min >= max) returns a 400 error
- Batch count exceeds maximum allowed limit returns a 400 or 422 error
- Missing required parameters (min or max) returns a 400 bad request
- Non-numeric range values return a validation error
- Payment not included or insufficient results in a 402 Payment Required response

## How this service works

Random number generator, random integer, random float, dice roll, lottery numbers, coin flip, cryptographically secure random, RNG, number picker. Generate cryptographically secure random numbers in a range with optional batch count. Accepts payment on Base or Solana — either network works.

## Output

Returns one or more cryptographically secure random numbers (integer or float) within the specified min/max range. When batch count is provided, returns an array of random values. Each value is generated using a secure RNG, suitable for security-sensitive or fairness-critical applications.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "max": {
       "type": "string",
       "description": "Max (optional)"
      },
      "min": {
       "type": "string",
       "description": "Min (optional)"
      },
      "type": {
       "type": "string",
       "description": "Type (optional)"
      },
      "count": {
       "type": "string",
       "description": "Count (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-1ea58b2f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
