# Animica Random Shuffle (DRNG)

> Animica Random Shuffle (DRNG) 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).

Shuffles a list or generates a random permutation of 1..n using a Decentralized Random Number Generator (DRNG) with cryptographic attestation

## Facts

- Endpoint: POST https://animica.dev/x402/random/shuffle
- 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-random-shuffle-drng-dd6cd137
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tYZ23e8-n9TkYw52WEk30

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-shuffle-drng-dd6cd137 -d '<json body>'
```

Example prompt: Can you shuffle this list — ['Alice','Bob','Carol','Dave','Eve'] — using Animica's verifiable DRNG and tag the request with 'my-raffle-001' so I can audit it later?

## When to prefer this

Choose this endpoint when you need a cryptographically attested, auditable random shuffle — e.g. for lotteries, card games, A/B test assignments, or any scenario where fairness must be verifiable. The attestation and derivation steps distinguish it from simple pseudo-random shuffles. Prefer it over generic randomization when an independent party needs to verify the shuffle was not manipulated.

## Known failure modes

- Both 'items' and 'n' supplied simultaneously — endpoint requires exactly one
- n out of range (must be 1–10000) — returns validation error
- items list exceeds 10000 entries — rejected with size error
- Payment not provided or insufficient — x402 payment required ($0.006731 USDC)
- Invalid JSON body — parse error returned
- DRNG source unavailability — health field indicates degraded state

## How this service works

Fisher-Yates permutation of your list (or of 1..N), up to 10000 items, derived from ONE verified randomness draw. Returns the permutation of 0-based indices plus the shuffled items, with the exact swap-and-byte-consumption rule so you can recompute it offline.

## Output

Returns a JSON object containing: the shuffled items array, 0-based permutation indices, item count, randomness source details, DRNG attestation and verification proof, step-by-step derivation rules for recomputation, and payment metadata. The attestation allows anyone to independently verify the shuffle was fair and untampered.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "n": {
   "type": "integer",
   "description": "shuffle 1..n instead of a supplied list (1..10000); supply exactly one of items or n"
  },
  "items": {
   "type": "array",
   "description": "the list to shuffle, 1..10000 entries (any JSON values)"
  },
  "request_id": {
   "type": "string",
   "description": "your own tag; mixed into the DRNG seed"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

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