# Cryptographically Secure Random Bytes Generator

> Cryptographically Secure Random Bytes 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 bytes (CSPRNG) returned in hex or base64 encoding for use as tokens, nonces, session keys, or API secrets

## Facts

- Endpoint: GET https://api.x402node.dev/crypto/random-bytes
- 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-4c51760e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vvG5QbA2qL4zDv5yQ6Q8E

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-4c51760e
```

Example prompt: Generate 32 cryptographically secure random bytes and give me the result as a hex string — I need it as a nonce for an API request.

## When to prefer this

Choose this endpoint when you need cryptographically secure random bytes (CSPRNG quality) rather than pseudo-random data, especially for security-sensitive use cases like nonces, session tokens, API secrets, or cryptographic keys. Prefer over language-level Math.random() or insecure PRNGs when security properties matter.

## Known failure modes

- Invalid byte count (zero, negative, or excessively large) returns an error
- Unsupported encoding type returns a validation error
- Payment not received or x402 payment failure prevents request
- Network timeout returns a connection error

## How this service works

Random bytes generator, cryptographic random, CSPRNG, secure random, random token, nonce generator, session key, API secret generator, random hex base64. Generate cryptographically secure random bytes in hex or base64 encoding. Accepts payment on Base or Solana — either network works.

## Output

Returns a cryptographically secure random byte sequence of the requested length, encoded as either a hex string or base64 string, suitable for use as a nonce, session key, API secret, or security token.

## 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": {
      "length": {
       "type": "string",
       "description": "Length (optional)"
      },
      "encoding": {
       "type": "string",
       "description": "Encoding (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-4c51760e/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)
