21 Games

Agent Casino Games

21 provably fair games accessible via REST API. Every game uses HMAC-SHA256 commit-reveal verification. Kelly criterion enforced on every bet. No frontend. Pure API.

Quick start: Register with POST /api/v1/auth/register (no auth), then play any game below. All endpoints require Authorization: Bearer sk_live_...

# Quick Start Example

# Register (free, instant, no auth)
curl -X POST https://casino.purpleflea.com/api/v1/auth/register \
  -H "Content-Type: application/json" -d '{}'

# Play a coin flip
curl -X POST https://casino.purpleflea.com/api/v1/games/coin-flip \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"side": "heads", "amount": 1.00}'

# List all games with current odds
curl https://casino.purpleflea.com/api/v1/games

# Core Games — 0.5% House Edge

The lowest house edge in crypto gambling. Six games with near-optimal odds, ideal for AI agents running Kelly-optimal strategies.

GameEdgePayoutEndpointKey Parameters
Coin Flip 0.5% 1.96x POST /api/v1/games/coin-flip side: heads|tails, amount
Dice Roll 0.5% Variable (over 50 = 1.96x, over 90 = 9.8x) POST /api/v1/games/dice direction: over|under, threshold: 1-99, amount
Multiplier 0.5% 1.01x - 1000x POST /api/v1/games/multiplier target_multiplier: 1.01-1000, amount
Roulette 0.5% Varies by bet type POST /api/v1/games/roulette bet_type: number|red|black|odd|even|high|low|dozen|column, amount
Custom Odds 0.5% (100/probability) * 0.995 POST /api/v1/games/custom win_probability: 1-99, amount
Crash 0.5% 1.01x - 100x POST /api/v1/games/crash cash_out_at: 1.01-100, amount

Example: Dice Roll

curl -X POST https://casino.purpleflea.com/api/v1/games/dice \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"direction": "over", "threshold": 50, "amount": 2.00}'
# Win probability: 50%, Payout: 1.96x, Edge: 0.5%

# Card and Table Games

Classic card and table games with competitive edges. Blackjack supports hit, stand, and double actions.

GameHouse EdgePayoutEndpointKey Parameters
Blackjack ~2% 1x / 1.5x (blackjack) / 2x (double) POST /api/v1/games/blackjack amount, action: hit|stand|double
Baccarat 1.06 - 14.4% Player 1:1, Banker 0.95:1, Tie 8:1 POST /api/v1/games/baccarat bet_on: player|banker|tie, amount
Video Poker ~1.5% 1x - 800x (Royal Flush) POST /api/v1/games/video-poker/deal + /draw amount (deal), hold: [card indices] (draw)
Hi-Lo ~4% 1.05x - 12x POST /api/v1/games/hilo prediction: higher|lower, amount

Example: Blackjack

# Deal a hand
curl -X POST https://casino.purpleflea.com/api/v1/games/blackjack \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"amount": 5.00}'
# Returns: hand_id, player_cards, dealer_up_card, available_actions

# Casual Games

Higher variance games with bigger max payouts. Good for agents optimizing for entertainment value or exploring different risk profiles.

GameHouse EdgeMax PayoutEndpointKey Parameters
Plinko ~3% 1000x POST /api/v1/games/plinko rows: 8-16, risk: low|medium|high, amount
Slots ~4% 250x POST /api/v1/games/slots amount
Simple Dice 8.3% 5.5x POST /api/v1/games/simple-dice pick: 1-6, amount
Keno ~8% 250,000x POST /api/v1/games/keno picks: [1-80] (up to 10 numbers), amount
Wheel ~9.5% 10x POST /api/v1/games/wheel amount
Mines 2.5% 130x+ POST /api/v1/games/mines mines_count: 1-24, picks: [0-24], amount
Scratch Card ~10% 50x POST /api/v1/games/scratch-card amount

# Multi-Bet Options

Combine multiple bets for efficiency or compounded payouts.

TypeDescriptionEndpointKey Parameters
Batch Bet Up to 20 independent bets in one API call POST /api/v1/bets/batch bets: [{game, params, amount}, ...] (max 20)
Parlay 2-5 linked bets, all must win. Multiplied payouts. Max $10 wager. POST /api/v1/games/parlay legs: [{game, params}, ...] (2-5), amount (max $10)

Example: Batch Bet

curl -X POST https://casino.purpleflea.com/api/v1/bets/batch \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "bets": [
      {"game": "coin-flip", "params": {"side": "heads"}, "amount": 1.00},
      {"game": "dice", "params": {"direction": "over", "threshold": 75}, "amount": 0.50},
      {"game": "crash", "params": {"cash_out_at": 2.0}, "amount": 1.00}
    ]
  }'

# Fairness and Verification

Every game uses HMAC-SHA256 commit-reveal. The server seed hash is committed before your bet, so outcomes cannot be manipulated after the fact.

Verify Any Bet

curl https://casino.purpleflea.com/api/v1/fairness/verify/bet_abc123 \
  -H "Authorization: Bearer sk_live_..."
# Returns: server_seed, client_seed, nonce, outcome, hash verification

Learn more: Provably Fair mechanism explained


# Kelly Criterion Protection

Every bet is capped by the Kelly criterion to prevent bankroll ruin. The max bet varies per game based on house edge and your current balance.

# Check your Kelly limits for all games
curl https://casino.purpleflea.com/api/v1/kelly/limits \
  -H "Authorization: Bearer sk_live_..."

Learn more: Kelly Criterion bankroll protection explained


# Choosing the Right Game

For maximum EV: Core games (0.5% edge) — coin-flip, dice, multiplier, roulette, custom, crash.
For high variance: Keno (250,000x max), Plinko (1000x), Video Poker (800x Royal Flush).
For strategy: Blackjack (decisions matter), Video Poker (hold optimization), Mines (progressive risk).
For simplicity: Coin flip (one param), Wheel (no params), Scratch card (no params).

# Resources

https://casino.purpleflea.com/for-agents     — Full integration guide
https://casino.purpleflea.com/games           — This page
https://casino.purpleflea.com/provably-fair   — Fairness mechanism
https://casino.purpleflea.com/kelly           — Kelly criterion details
https://casino.purpleflea.com/earn            — Referral program (10/5/2.5%)
https://casino.purpleflea.com/llms.txt        — LLM-optimized summary
https://casino.purpleflea.com/llms-full.txt   — Full API reference
https://casino.purpleflea.com/api/v1/docs     — Interactive API docs
https://casino.purpleflea.com/api/v1/games    — Live game list (JSON)

Page: https://casino.purpleflea.com/games | Format: JSON-LD ItemList + HTML

Related: For Agents | Provably Fair | Kelly Criterion | Earn | llms.txt

purpleflea.com — AI Agent Financial Infrastructure