x402casinos API
HTTP API for AI agents. Authentication is the x402 payment itself — no API keys, no OAuth, no session cookies.
Skip the docs and download the drop-in skill — single file, includes signing code, endpoint specs, error table, and end-to-end examples.
Paying with x402
Every paid endpoint returns HTTP 402 with an X-Payment-Required header describing the required USDC amount, asset, and network. The agent signs an EIP-3009 transferWithAuthorization, encodes it as X-PAYMENT, and retries the request.
POST /api/v1/games/coinflip
Host: x402casinos.com
Content-Type: application/json
X-PAYMENT: <base64url(EIP-3009 signed auth)>
{ "choice": "heads", "client_seed": "abc123", "nonce": 42 }The payer wallet is derived cryptographically from the signed authorization — never from a request-body field. That is the sole identity used for bet ownership, balance lookups, and withdrawals.
Verifying a bet (commit-reveal)
- Before playing,
GET /api/v1/seed/commitreturns{ seed_id, hash }wherehash = sha256(server_seed). - When you bet, include your
client_seedandnonce. Server computesoutcome = HMAC-SHA256(server_seed, "$${client_seed}:${nonce}"). - After seed rotation (24h or 10,000 bets),
GET /api/v1/seed/reveal?seed_id=…returns the raw seed. - You replay the HMAC locally and compare against
bet.outcome. Deterministic, tamper-evident.
Games
Four games, each with three stake tiers selected by ?stake=micro|standard|whale ($0.10 / $1.00 / $10.00):
/api/v1/games/coinflip$0.10 – $10.00{ choice: "heads" | "tails", client_seed, nonce }. Payout 1.96× on win (2% edge)./api/v1/games/dice$0.10 – $10.00{ threshold: 2..99, direction: "over"|"under", client_seed, nonce }. 1% edge./api/v1/games/roulette$0.10 – $10.00{ bet_type: "red"|"black"|"even"|"odd"|"dozen"|"straight", number?, client_seed, nonce }. 2.7% edge./api/v1/games/slots$0.10 – $10.00{ client_seed, nonce }. 3-reel 6-symbol. ~95.5% RTP.Ledger & bet status
/api/v1/balance$0.01/api/v1/bets/{id}$0.01Withdrawals
/api/v1/withdraw$0.05{ amount_micro }. Pays USDC to the payer wallet (never a body field). Caps: min $0.50, per-wallet $100/day, global $1,000/day.Discovery
GET /skill.md — single-file agent skill (LLM-readable).GET /.well-known/skill.json — machine-readable skill manifest.GET /.well-known/ucp — Universal Capability Protocol profile.GET /.well-known/acp.json — Agent Commerce Protocol manifest.GET /api/v1/games — free manifest of all games with current prices and edges.