# x402casinos Coinflip Game

> x402casinos Coinflip 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-29).

Place a provably-fair coin flip bet using USDC on Base via x402 payment, with commit-reveal randomness and on-chain verifiability.

## Facts

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

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-coinflip-game-ab8136d3 -d '<json body>'
```

Example prompt: Flip a coin for me on x402casinos — I'll bet on heads, use client seed 'myagent-lucky-seed-42', and this is nonce 1 for this session.

## When to prefer this

Use this endpoint when an AI agent needs to place a provably-fair coin flip wager using micropayments in USDC on Base via the x402 protocol. Ideal for autonomous agent workflows that require verifiable randomness with commit-reveal auditability, on-chain settlement, and per-play micropayment billing. Choose this over generic RNG APIs when you need cryptographic fairness proofs and blockchain-native payouts.

## Known failure modes

- 409 Conflict if nonce is replayed for the same wallet+server_seed_id+client_seed combination
- Payment failure if x402 USDC payment on Base is not attached or insufficient
- Invalid choice value returns 400 validation error
- client_seed too long (over 128 chars) or empty returns 400
- Status may be 'settling' if blockchain confirmation is pending
- Voided outcome if server-side error occurs during randomness derivation

## 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 bet result object including a UUID bet_id, the game outcome (win/loss), stake and payout amounts in microdollars, a stake tier (micro/standard/whale), current status (settling/settled/voided), and a full verification bundle containing the nonce, client_seed, server_seed_id, and server_seed_hash for independent commit-reveal fairness verification.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "nonce",
  "choice",
  "client_seed"
 ],
 "properties": {
  "nonce": {
   "type": "integer",
   "description": "Monotonic per (wallet, server_seed_id, client_seed). Replays return 409."
  },
  "choice": {
   "enum": [
    "heads",
    "tails"
   ],
   "type": "string",
   "description": "Side to bet on."
  },
  "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-coinflip-game-ab8136d3/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)
