# x402casinos Dice Game

> x402casinos Dice Game is a paid API for AI agents from x402casinos.com, paid per call via x402, $0.1/call, status unknown (last checked 2026-10-27).

Place a provably-fair dice bet (roll under or over a threshold) on-chain via USDC micropayment, receiving a verifiable outcome with commit-reveal fairness proof.

## Facts

- Endpoint: POST https://x402casinos.com/api/v1/games/dice?utm_source=zero.xyz
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-27
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402casinos-dice-game-4fb8c085
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yFq-vg7rxtcxpEOiBUAQQ

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 x402casinos-dice-game-4fb8c085 -d '<json body>'
```

Example prompt: Roll the dice on x402casinos — bet under 50, use client seed 'lucky-agent-42', nonce 1, and let me know the outcome and payout.

## When to prefer this

Use this endpoint when an AI agent needs to place a provably-fair, on-chain dice bet with USDC micropayments, particularly when commit-reveal fairness verification and blockchain auditability are required. Prefer this over generic random number APIs when a financial wager with cryptographic fairness proof and on-chain settlement is needed.

## Known failure modes

- 409 Conflict — nonce already used for this wallet/server_seed_id/client_seed combination (replay protection)
- Payment failure — insufficient USDC balance or x402 payment not accepted
- Invalid threshold — value outside 2–99 range
- Invalid client_seed — exceeds 128 characters or empty
- Invalid direction — not a recognized enum value
- Game voided — server-side issue causing rollback with no payout

## How this service works

A casino built for autonomous AI agents. Pay per play with x402 (USDC on Base), verify every roll with commit-reveal fairness, withdraw on-chain.

## Output

Returns a UUID bet ID, settlement status (settling/settled/voided), dice outcome value, stake in micros, payout in micros, stake tier (micro/standard/whale), and a full verification object containing nonce, client seed, server seed ID and hash for independent fairness verification.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "nonce",
  "direction",
  "threshold",
  "client_seed"
 ],
 "properties": {
  "nonce": {
   "type": "integer",
   "description": "Monotonic per (wallet, server_seed_id, client_seed). Replays return 409."
  },
  "direction": {
   "enum": [
    "over",
    "under"
   ],
   "type": "string"
  },
  "threshold": {
   "type": "integer",
   "description": "Roll boundary 2â99 (the rolled value is 1â100)."
  },
  "client_seed": {
   "type": "string",
   "description": "Caller-chosen seed (1â128 chars). Combined with the server seed via HMAC-SHA256 to derive the outcome."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "game": {
   "type": "string"
  },
  "bet_id": {
   "type": "string",
   "format": "uuid"
  },
  "status": {
   "enum": [
    "settling",
    "settled",
    "voided"
   ],
   "type": "string"
  },
  "outcome": {},
  "stake_tier": {
   "enum": [
    "micro",
    "standard",
    "whale"
   ],
   "type": "string"
  },
  "stake_micro": {
   "type": "integer"
  },
  "payout_micro": {
   "type": "integer"
  },
  "verification": {
   "type": "object",
   "properties": {
    "nonce": {
     "type": "integer"
    },
    "client_seed": {
     "type": "string"
    },
    "server_seed_id": {
     "type": "string"
    },
    "server_seed_hash": {
     "type": "string"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402casinos-dice-game-4fb8c085/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402casinos.com](https://www.zero.xyz/host/x402casinos.com/llms.txt)
