# Anchor X402 Verifiable RNG — Signed Random Integer Roll

> Anchor X402 Verifiable RNG — Signed Random Integer Roll is a paid API for AI agents from api.anchor-x402.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Returns one or more cryptographically-random integers signed by a treasury key, providing a drop-in verifiable random function (VRF) for games and applications.

## Facts

- Endpoint: POST https://api.anchor-x402.com/v1/roll
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-anchor-x402-com-6e181fb3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_g7K3BqrGbv696EyB5OkNC

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 api-anchor-x402-com-6e181fb3 -d '<json body>'
```

Example prompt: Roll 3 random integers between 1 and 100 for my on-chain game round — I need each result cryptographically signed by the treasury key so players can verify the roll wasn't tampered with.

## When to prefer this

Choose this endpoint when you need provably fair, verifiable randomness where players, users, or auditors must be able to independently confirm the result was not predetermined or manipulated. Ideal for game studios needing a drop-in VRF without running their own beacon, NFT trait generation requiring on-chain verifiability, or any application where cryptographic proof of randomness integrity is required. At $0.001 USDC per call it is cost-effective for high-frequency gaming scenarios.

## Known failure modes

- Payment not included or insufficient — 402 response requiring $0.001 USDC via x402 protocol
- Invalid range parameters (e.g. min >= max) — 400 bad request
- Request for zero or negative count of integers — 400 validation error
- Treasury key signing service unavailable — 503 service unavailable
- Rate limiting exceeded — 429 too many requests

## How this service works

Verifiable RNG — cryptographically-random integer(s) signed by the treasury key. Drop-in VRF for game studios. $0.001 USDC.

## Output

Returns one or more random integers accompanied by a cryptographic signature from the treasury key, allowing callers to independently verify the randomness was not manipulated. The signed payload binds the output to the specific request.

## Example request

```json
{
 "input": {
  "body": {
   "low": 1,
   "high": 100,
   "count": 3,
   "label": "qa-test-game-round"
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "properties": {
      "low": {
       "type": "integer",
       "description": "Inclusive low bound of the integer range."
      },
      "high": {
       "type": "integer",
       "description": "Inclusive high bound. Must be >= low."
      },
      "count": {
       "type": "integer",
       "description": "How many integers to sample. 1-100.",
       "minimum": 1,
       "maximum": 100,
       "default": 1
      },
      "commitment": {
       "type": "string",
       "description": "Optional 32-byte hex pre-commitment from the caller."
      },
      "label": {
       "type": "string",
       "description": "Optional caller tag, included in the signed payload.",
       "maxLength": 200
      }
     },
     "required": [
      "low",
      "high"
     ]
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   },
   "required": [
    "type"
   ]
  }
 },
 "required": [
  "input"
 ]
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "label": "treasure_drop_42",
  "range": [
   1,
   100
  ],
  "domain": "anchor-x402/roll/v1",
  "result": [
   47
  ],
  "scheme": "eip191",
  "signer": "0x127462e296fAc1A7F5cF33bA57bB2f0FFf5cD0B6",
  "signature": "0x6b3e2a7c…",
  "commitment": null,
  "input_hash": "f4a1c5e3b9d8a2e0c7b4f6d9e1a3c8b5f7d2e4a9c1b6e8f3d5a7c2b4e9f1d6a8",
  "result_hash": "8a6d1f9e4b2c7a3e5f0c9b8a4d2f6e1c3b7a5f9d2e8c4b6a1f3e7d5c9b2a4f6e"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-anchor-x402-com-6e181fb3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.anchor-x402.com](https://www.zero.xyz/host/api.anchor-x402.com/llms.txt)
