# Animica Random Integer Generator

> Animica Random Integer 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).

Generates one or more cryptographically verifiable random integers within a specified inclusive range using a decentralized randomness beacon (DRNG)

## Facts

- Endpoint: POST https://animica.dev/x402/random/int
- 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-random-integer-generator-efca4ba0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lVEJ3baWbIxBe-tFnBTOh

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-random-integer-generator-efca4ba0 -d '<json body>'
```

Example prompt: Give me 5 random integers between 1 and 100 using Animica's verifiable randomness — I want to be able to recompute the draw offline, so tag it with request ID 'draw-2024-abc'.

## When to prefer this

Choose this endpoint when you need cryptographically verifiable random integers with a full audit trail for offline recomputation — ideal for provably fair games, lotteries, or any application where participants must be able to independently verify the randomness. Prefer over standard PRNGs or unverifiable APIs when transparency and reproducibility matter. The request_id seeding feature makes it suitable for deterministic replay scenarios.

## Known failure modes

- min > max — returns error because range is invalid
- count outside 1–1000 — returns error for out-of-range count
- payment failure — x402 payment not confirmed, request rejected
- DRNG beacon unavailable — source health check fails, randomness cannot be fetched
- malformed request body — missing required min or max fields returns validation error

## How this service works

Uniform integers in [min, max] derived from ONE verified randomness draw by rejection sampling (never modulo bias) — up to 1000 per request. The response carries the raw draw, the node's source/health/attestation and the exact rule, so you can recompute every integer offline.

## Output

A JSON object containing: the array of generated random integers (ints), the raw hex randomness draw from the DRNG, the randomness source and health status, an attestation and verification field for authenticity checks, a derivation object with rules, steps, and a recompute guide for offline verification, and payment metadata confirming the x402 micropayment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "max": {
   "type": "integer",
   "description": "upper bound, inclusive (>= min)"
  },
  "min": {
   "type": "integer",
   "description": "lower bound, inclusive"
  },
  "count": {
   "type": "integer",
   "description": "how many integers, 1..1000 (default 1; alias n)"
  },
  "request_id": {
   "type": "string",
   "description": "your own tag; mixed into the DRNG seed so you can recompute this exact draw"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "bytes": 32,
  "health": {
   "passed": true,
   "min_entropy_per_byte": 7.8216
  },
  "result": {
   "max": 6,
   "min": 1,
   "ints": [
    5,
    1,
    2
   ],
   "count": 3
  },
  "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": "random_int",
  "encoding": "hex",
  "derivation": {
   "kind": "range",
   "rules": {
    "seed": "seed = sha3_256(\"animica/qrng/public/v1\" || \"|k:\" || kind || \"|r:\" || request_id || \"|b:\" || bytes(randomness))",
    "stream": "stream = sha3_256(seed || be8(counter)) for counter = 0,1,2,… concatenated; consumed left to right, never reused",
    "uniform_int": "randbelow(n): k = floor((bitlen(n)+7)/8)+1 bytes per attempt, read big-endian as x; limit = 2^(8k); accept when x < limit - (limit mod n); value = x mod n. Rejected attempts still consume their k bytes. n <= 1 consumes nothing and returns 0. This is rejection sampling — plain \"x mod n\" would bias small values."
   },
   "steps": [
    "seed the DRNG with kind=\"range\" and your request_id over the raw randomness above",
    "for i = 0..2: ints[i] = 1 + randbelow(6)"
   ],
   "domain": "animica/qrng/public/v1",
   "seed_hex": "5fb4cc0e8007c201060453ee9b7cacb38444d32d76d423c61e601117fadd3068",
   "verifier": {
    "api": "AnimicaBeacon.drngSeed(entropy, kind, request_id) + AnimicaBeacon.QDRNG reproduce the stream; AnimicaBeacon.verifyResult(derivation.recompute) === true whenever `recompute` is present",
    "file": "randomness/beacon_api/static/verify.js (Animica repo, gitlab.com/Animica) — zero-dependency, runs in Node and the browser",
    "note": "verify.js calls the seed material `beacon` because it was written for beacon rounds. This product is NOT a beacon round: the seed material is the raw `randomness` bytes above, which the node signed (see `verification`)."
   },
   "algorithm": "uniform-int-rejection-sampling",
   "recompute": {
    "kind": "range",
    "output": [
     5,
     1,
     2
    ],
    "params": {
     "hi": 6,
     "lo": 1,
     "count": 3
    },
    "round_id": 0,
    "beacon_hex": "8e8d85d9c03247ffdff7b3db1c917b7a0e97a569e8cf098071dd91cc9121ae55",
    "request_id": ""
   },
   "request_id": "",
   "entropy_hex": "8e8d85d9c03247ffdff7b3db1c917b7a0e97a569e8cf098071dd91cc9121ae55",
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/animica-random-integer-generator-efca4ba0/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)
