# Blackwood State Random Number Generator (x402)

> Blackwood State Random Number Generator (x402) is a paid API for AI agents from x402-gateway.blackwoodstate8.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-23).

Generates cryptographically secure random values — integers, dice rolls, coin flips, UUIDs, or random bytes — via Workers Web Crypto CSPRNG, paid per call via x402.

## Facts

- Endpoint: POST https://x402-gateway.blackwoodstate8.workers.dev/v1/random?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/blackwood-state-random-number-generator-x402-f10d175d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vKZrt9x0PGeG-2NhEW7EZ

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 blackwood-state-random-number-generator-x402-f10d175d -d '<json body>'
```

Example prompt: Roll 3 six-sided dice and give me the results — I need cryptographically secure rolls, not a predictable sequence.

## When to prefer this

Choose this endpoint when you need unpredictable, cryptographically secure random values for security tokens, nonces, game mechanics, or random selection — especially in agent workflows where reproducibility is undesirable. Prefer this over seeded PRNGs when you cannot afford predictability. Do not use if you need verifiable on-chain randomness (VRF) or reproducible sequences from a seed.

## Known failure modes

- Invalid 'kind' enum value — returns validation error
- 'count' outside 1–100 range — returns schema error
- 'length' outside 1–256 for bytes — returns schema error
- 'sides' outside 2–1000 for dice — returns schema error
- Payment not included or insufficient — returns 402 Payment Required
- Service timeout beyond 500ms p95 — rare but possible under load

## How this service works

Use when you need a random number generator, dice rolls, a coin flip, a uuid or random bytes that no one can predict. Do not use for verifiable on-chain randomness (VRF) or reproducible seeded sequences. Returns JSON with cryptographically secure random values: integers in a range, dice rolls, coin flips, UUIDs or hex bytes, from the Workers Web Crypto CSPRNG for 0.005 USDC per call. Typical response time 500 ms (p95). Category: Infrastructure.

## Output

Returns a JSON object containing the requested kind of random values (array of results), an optional sum (for numeric types), the generation timestamp, and the source/method used (Workers Web Crypto CSPRNG). May also include a 'next' suggestion for chaining calls.

## 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": [
      "kind"
     ],
     "properties": {
      "max": {
       "type": "integer",
       "maximum": 1000000000,
       "minimum": -1000000000,
       "description": "integer: highest value, inclusive (default 100)"
      },
      "min": {
       "type": "integer",
       "maximum": 1000000000,
       "minimum": -1000000000,
       "description": "integer: lowest value, inclusive (default 1)"
      },
      "kind": {
       "enum": [
        "integer",
        "dice",
        "coin",
        "uuid",
        "bytes"
       ],
       "type": "string",
       "description": "integer (count values between min and max), dice (count rolls of a die with sides faces), coin (count flips), uuid (count UUID v4) or bytes (length random bytes as hex)"
      },
      "count": {
       "type": "integer",
       "maximum": 100,
       "minimum": 1,
       "description": "How many values (1-100, default 1); ignored for bytes"
      },
      "sides": {
       "type": "integer",
       "maximum": 1000,
       "minimum": 2,
       "description": "dice: faces of the die (default 6)"
      },
      "length": {
       "type": "integer",
       "maximum": 256,
       "minimum": 1,
       "description": "bytes: how many random bytes (1-256, default 32)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "kind",
      "values",
      "sum",
      "generatedAt",
      "source"
     ],
     "properties": {
      "sum": {
       "type": [
        "number",
        "null"
       ]
      },
      "kind": {
       "type": "string"
      },
      "next": {
       "type": "object",
       "required": [
        "service",
        "tool",
        "method",
        "url",
        "useWhen",
        "sample"
       ],
      
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "sum": 5,
  "kind": "dice",
  "source": "crypto.getRandomValues (Cloudflare Workers CSPRNG)",
  "values": [
   4,
   1
  ],
  "generatedAt": "2026-10-17T16:48:06.750Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/blackwood-state-random-number-generator-x402-f10d175d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway.blackwoodstate8.workers.dev](https://www.zero.xyz/host/x402-gateway.blackwoodstate8.workers.dev/llms.txt)
