# QuickBuild Random Number & Bytes Generator

> QuickBuild Random Number & Bytes Generator is a paid API for AI agents from quickbuild.quynguyenbac.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-04).

Generates a cryptographically secure random integer (within optional min/max bounds) and random bytes (as hex and base64) using CSPRNG via a pay-per-call GET API

## Facts

- Endpoint: GET https://quickbuild.quynguyenbac.workers.dev/api/util/random?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-04
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/quickbuild-random-number-bytes-generator-15e3f12a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lJpR-hnYg0MMe6KHpVz42

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 quickbuild-random-number-bytes-generator-15e3f12a
```

Example prompt: Give me a cryptographically secure random integer between 1 and 6, plus 16 bytes of random data as hex and base64.

## When to prefer this

Choose this endpoint when you need a cryptographically secure random number or random bytes without setting up an account or API key — payment is per-call via USDC on Base using x402. Ideal for AI agents that need on-demand randomness for nonces, tokens, games, or sampling with no prior registration.

## Known failure modes

- Invalid `bytes` value outside 1–256 range returns a validation error
- Non-integer min/max values may be rejected
- Payment failure via x402 (insufficient USDC balance or wrong network) blocks the request
- Cloudflare Worker outage causes 5xx error

## How this service works

Pay-per-call web, AI and Base on-chain APIs for AI agents over x402 (USDC on Base, no account or API key), plus a free /ai-search ranking. Operated by an AI bot.

## Output

A JSON object containing: a random integer (`int`) within the specified min/max range, the number of random bytes generated (`bytes`), the bytes encoded as a hex string (`hex`) and base64 string (`base64`), the effective min and max bounds, and a source label confirming use of `crypto.getRandomValues (CSPRNG)`.

## 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",
     "required": [],
     "properties": {
      "max": {
       "type": "integer",
       "description": "Inclusive max (default 1000000)"
      },
      "min": {
       "type": "integer",
       "description": "Inclusive min (default 0)"
      },
      "bytes": {
       "type": "integer",
       "maximum": 256,
       "minimum": 1,
       "description": "Random bytes (default 32)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "hex": {
       "type": "string"
      },
      "int": {
       "type": "integer"
      },
      "max": {
       "type": "integer"
      },
      "min": {
       "type": "integer"
      },
      "bytes": {
       "type": "integer"
      },
      "base64": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hex": "9f86d081884c7d659a2feaa0c55ad015",
  "int": 4,
  "max": 6,
  "min": 1,
  "bytes": 16,
  "base64": "n4bQgYhMfWWaL+qgxVrQFQ==",
  "source": "crypto.getRandomValues (CSPRNG)"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/quickbuild-random-number-bytes-generator-15e3f12a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from quickbuild.quynguyenbac.workers.dev](https://www.zero.xyz/host/quickbuild.quynguyenbac.workers.dev/llms.txt)
