# Animica QRNG Draw — Quantum Random Number Generator

> Animica QRNG Draw — Quantum Random Number Generator is a paid API for AI agents from animica.dev, paid per call via x402, $0.001794/call, status unknown (last checked 2026-09-14).

Returns cryptographically-attested quantum random bytes (1–1024) as a hex string, with entropy health metrics and a digital signature for verification.

## Facts

- Endpoint: GET https://animica.dev/x402/qrng/draw
- Price: $0.001794/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/animica-qrng-draw-quantum-random-number-generator-cf04422f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_87cQBlTuxNNYFW7IqzVSP

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 animica-qrng-draw-quantum-random-number-generator-cf04422f
```

Example prompt: Give me 64 quantum random bytes from Animica's QRNG, with the attestation signature so I can verify the randomness is legit.

## When to prefer this

Choose this endpoint when you need quantum-sourced randomness with cryptographic attestation — not just a PRNG or standard CSPRNG. Ideal for applications requiring third-party verifiable entropy (lotteries, key generation, auditable security systems) where the signature and entropy health report add trust. The pay-per-call x402 model makes it accessible without subscription overhead.

## Known failure modes

- Invalid bytes value (outside 1–1024 range) returns a 400-level error
- Payment not provided or insufficient — returns HTTP 402 Payment Required
- QRNG hardware unavailable causes health check to fail with passed=false
- Network timeout or service downtime returns a 5xx error
- Attestation verification failure if the returned signature does not match the digest

## How this service works

Random bytes from the Animica node's randomness service with a signed digest attestation and an entropy-health report, 1..1024 bytes per draw. Current trust model, stated up front and in every response: the entropy source is a software CSPRNG (os.urandom) and the signer is a software key, so source.is_quantum=false and attestation.attested=false today; those fields flip truthfully if a hardware/quantum provider is ever connected. The free catalog entry carries the same live entropy block, so you can check the source before paying.

## Output

A JSON object containing: a hex-encoded random string of the requested byte length, the byte count, the randomness source name, a health object with a boolean 'passed' flag and minimum entropy-per-byte metric, a cryptographic attestation object (algorithm, public key hex, digest hex, signature hex, and attested boolean), verification rules explaining how to validate the signature, and payment metadata for the x402 microtransaction.

## 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": {
      "bytes": {
       "type": "integer",
       "description": "number of random bytes, 1..1024 (default 32); alias: n"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {}
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "bytes": 32,
  "health": {
   "passed": true,
   "min_entropy_per_byte": 7.8106
  },
  "source": {
   "name": "software-fallback",
   "model": "os.urandom CSPRNG",
   "notes": "non-attested fallback for testing/degraded mode",
   "vendor": "os",
   "attested": false,
   "is_quantum": false,
   "device_path": null,
   "is_hardware": false
  },
  "product": "qrng",
  "encoding": "hex",
  "randomness": "6950d0ba85a3c0a03b193a50e998c6c6b16b53447d0e0ccb68e2a5722ac526ea",
  "attestation": {
   "alg": "ed25519",
   "backend": "software",
   "attested": false,
   "digest_hex": "ae7686343e9459d0ddaabb3b80cbdb9d28599eec501ffefe4736b60355f8bf29",
   "signature_hex": "cb219cdb424f395b664076ee57cae6a1245544b53306d35860de4a689ff410dc79d27ffbcfaa927268db47da2c155e06bf0eaf2d838083f81ad1450c1a7cb904",
   "public_key_hex": "8a2228f4bde8f72964a7ff4aa759f24932ae1cccd9462ad94ca6e508d6b87a64"
  },
  "verification": {
   "rules": [
    "attestation.digest_hex == sha3_256(bytes(randomness))",
    "ed25519_verify(pubkey=attestation.public_key_hex, message=raw_bytes(attestation.digest_hex), signature=attestation.signature_hex)"
   ],
   "method": "signed-digest-attestation",
   "attested": false,
   "verifier": "randomness/beacon_api/static/verify.js in the animica repo (gitlab.com/Animica) — dependency-free Node module exporting sha3_256; pair with any ed25519 verifier",
   "trust_model": "signed by the serving node, not client-recomputable: you trust the node's entropy source, then verify it signed exactly these bytes. Check health.passed and attestation.attested before relying on it."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/animica-qrng-draw-quantum-random-number-generator-cf04422f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from animica.dev](https://www.zero.xyz/host/animica.dev/llms.txt)
