# Animica QRNG — Quantum Random Number Generator

> Animica QRNG — 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-15).

Returns cryptographically-attested quantum random bytes (up to 1024) as hex, with entropy health checks and a verifiable digital signature.

## Facts

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

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-quantum-random-number-generator-cc9b6f8c
```

Example prompt: Can you fetch 64 bytes of quantum random data from Animica's QRNG endpoint — I need the hex output along with the entropy health report and the attestation signature so I can verify it independently?

## When to prefer this

Choose this endpoint when you need quantum-sourced randomness with cryptographic attestation and independent verifiability, rather than pseudo-random or software-based random number generators. Ideal for security-critical applications — key generation, fair draws, nonce creation — where you need a signed proof that the randomness came from a quantum source and passed minimum entropy thresholds. Prefer over standard RNG APIs when auditability and attestation are required.

## Known failure modes

- bytes parameter out of range (must be 1–1024): returns error
- payment not provided or rejected via x402 protocol: HTTP 402 with payment instructions
- service unavailable or quantum source unhealthy: entropy health check fails
- invalid parameter type (non-integer bytes): returns validation error

## How this service works

Animica Python Cloud: deploy a Python function to animica.dev, get a public endpoint, and earn ANM every time someone runs it. Free AI (OpenAI-compatible, no key), free scheduled Workers, and an 80/20 developer split.

## Output

A JSON object containing: a hex-encoded random byte string, the number of bytes generated, the randomness source identifier, a health report (pass/fail flag and minimum entropy per byte), a full attestation object (algorithm, public key hex, digest hex, signature hex, and whether it was attested), verification rules for independent validation, and payment metadata.

## 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-quantum-random-number-generator-cc9b6f8c/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)
