# Casino Odds API
> Casino game maths as an API, computed locally and deterministically — exact house edge, expected value and return-to-player, never a simulation. The roulette endpoint takes a wheel variant (European single-zero or American double-zero) and a bet type (straight, split, street, corner, six-line, column, dozen, red/black, odd/even, high/low, or the American basket) and returns the win probability, the payout, the expected value per unit staked and the house edge — the famous 2.70 % on every European bet, 5.26 % on American (7.89 % on the basket), and 1.35 % when the European la-partage rule is applied to even-money bets. The craps endpoint gives the exact 36-outcome dice maths for the pass line (1.41 %), don't pass (1.36 %, with its 12-push), the field (2.78 % when 12 pays 3:1) and any seven (16.67 %). The bet endpoint is fully generic: give any win probability and payout and it returns the expected value, house edge, return-to-player and the standard deviation of a unit bet — perfect for keno, slots, scratch cards or a custom wager. Everything is computed locally and deterministically, so it is instant and private. Ideal for gaming-analytics, responsible-gambling, casino-education and odds-comparison app developers, advantage-play and bankroll tools, and probability teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. This is the game-odds maths; for Texas Hold'em hand equity use a poker API and for converting betting prices use an odds API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/casino-api/..."
```

## Pricing
- **Free** (Free) — 4,450 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 47,000 calls/Mo, 6 req/s
- **Pro** ($12/Mo) — 228,000 calls/Mo, 15 req/s
- **Mega** ($39/Mo) — 1,270,000 calls/Mo, 40 req/s

## Endpoints

### Casino

#### `GET /v1/bet` — Generic expected value

**Parameters:**
- `win_probability` (query, required, string) — Win probability (0–1 or %) Example: `0.1`
- `payout` (query, required, string) — Payout to-1 Example: `5`
- `push_probability` (query, optional, string) — Push/tie probability

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/casino-api/v1/bet?win_probability=0.1&payout=5"
```

**Response:**
```json
{
    "data": {
        "note": "EV per unit staked = p_win·payout − p_lose. House edge = −EV; RTP = 1 + EV. Works for keno, slots or any custom bet.",
        "inputs": {
            "payout_to_1": 5,
            "win_probability": 0.1,
            "push_probability": 0
        },
        "rtp_percent": 60,
        "lose_probability": 0.9,
        "house_edge_percent": 40,
        "standard_deviation": 1.8,
        "expected_value_per_unit": -0.4
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:09.117Z",
        "request_id": "7ea4a501-ddc4-4a3c-84d3-1599ac77c328"
    },
    "status": "ok",
    "message": "Generic EV",
    "success": true
}
```

#### `GET /v1/craps` — Craps house edge

**Parameters:**
- `bet` (query, optional, string) — passline, dontpass, field, anyseven Example: `passline`
- `twelve_pays` (query, optional, string) — Field 12 payout (3 or 2) Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/casino-api/v1/craps?bet=passline&twelve_pays=3"
```

**Response:**
```json
{
    "data": {
        "note": "Exact 36-outcome dice maths. Pass line 1.41%, don't pass 1.36%, field (12 pays 3:1) 2.78%, any seven 16.67% house edge.",
        "inputs": {
            "bet": "pass line"
        },
        "payout_to_1": 1,
        "win_probability": 0.492929,
        "lose_probability": 0.507071,
        "push_probability": 0,
        "house_edge_percent": 1.4141,
        "expected_value_per_unit": -0.014141
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:09.282Z",
        "request_id": "70b3674f-aa82-4bfa-bfb9-4ac9158104b7"
    },
    "status": "ok",
    "message": "Craps edge",
    "success": true
}
```

#### `GET /v1/roulette` — Roulette house edge

**Parameters:**
- `variant` (query, optional, string) — european or american (default european) Example: `american`
- `bet` (query, optional, string) — straight, red, dozen, basket, … Example: `straight`
- `la_partage` (query, optional, string) — European even-money half-back rule Example: `true`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/casino-api/v1/roulette?variant=american&bet=straight&la_partage=true"
```

**Response:**
```json
{
    "data": {
        "note": "EV per unit = p·payout − (1−p); house edge = −EV. European single-zero is 2.70% on every bet; American double-zero is 5.26% (7.89% on the basket). La partage halves the even-money edge to 1.35%.",
        "inputs": {
            "bet": "straight",
            "variant": "american"
        },
        "pockets": 38,
        "payout_to_1": 35,
        "rtp_percent": 94.7368,
        "numbers_covered": 1,
        "win_probability": 0.026316,
        "house_edge_percent": 5.2632,
        "expected_value_per_unit": -0.052632,
        "win_probability_percent": 2.6316
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:09.402Z",
        "request_id": "8a2269fc-5db1-4209-a1ff-6caa8b002288"
    },
    "status": "ok",
    "message": "Roulette edge",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/casino-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "Closed-form probability — no simulation. For Texas Hold'em equity use a poker API; for converting betting prices use an odds API.",
        "service": "casino-api",
        "endpoints": {
            "GET /v1/bet": "Generic EV, house edge, RTP and standard deviation from win probability and payout.",
            "GET /v1/meta": "This document.",
            "GET /v1/craps": "Exact house edge for pass line, don't pass, field and any seven.",
            "GET /v1/roulette": "House edge and EV for any roulette bet (European or American, la partage optional)."
        },
        "description": "Casino game maths: house edge, expected value and RTP for roulette, craps and any custom bet — exact, not simulated."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:09.503Z",
        "request_id": "1a189a88-71ec-4c85-9578-18b26347e62d"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/casino-api
OpenAPI spec: https://www.oanor.com/api/casino-api/openapi.json
