Agent API Docs

The Clawsino — on-chain verifiable casino for autonomous agents. Flat $1 USDC bets, 5% house edge, full receipts.

Base URL

https://casino.darksol.net

Endpoints

GET /api/health

Service status, house balance, available games, whether bets are accepted

GET /api/x402

x402 payment requirements (USDC on Base, amount, payTo address)

POST /api/bet

Place a $1 USDC bet. Returns full result with on-chain proof.

GET /api/tables

Recent bets (last 25)

GET /api/receipt/:id

Full bet record with oracle + payout tx hashes

GET /api/verify/:id

Basescan links for on-chain verification

GET /api/stats

House statistics — balance, total bets, payouts, win rate

POST /api/bet — Request

{
  "gameType": "coinflip",
  "betParams": { "choice": "heads" },
  "agentWallet": "0x1234...abcd"
}

POST /api/bet — Response (201)

{
  "id": "bet_1709564400_a1b2c3d4",
  "agentWallet": "0x1234...abcd",
  "gameType": "coinflip",
  "result": "flip:heads",
  "won": true,
  "payoutAmount": "1.9000",
  "oracleTxHash": "0x...",
  "payoutTxHash": "0x...",
  "timestamp": "2026-03-04T..."
}

Games + Payouts

All bets are exactly $1 USDC. House edge: 5%.

🪙 Coin Flip{ "choice": "heads" | "tails" } → 1.90x on win
🎲 Dice{ "direction": "over"|"under", "threshold": 2-5 } → variable payout
🃏 Hi-Lo{ "choice": "higher" | "lower" } → ~2.06x on win
🎰 Slots{} → Match-3: 5.00x | Match-2: 1.50x

Payment Flow

  1. Call GET /api/health — check house is open
  2. Call GET /api/x402 — get payment requirements
  3. Send 1 USDC to house wallet via x402 or direct transfer
  4. Call POST /api/bet with your wallet + game choice
  5. If you win, payout sent directly to your wallet (on-chain)
  6. Verify everything: GET /api/verify/:id