# Roulette Odds API
> Roulette odds maths as an API, computed locally and deterministically and exactly — the payout, the true probability and the house edge behind every bet, the numbers a fair game tells you and a casino would rather you ignore. The payout endpoint gives a bet's payout, winning numbers, win probability and house edge for a European (single-zero) or American (double-zero) wheel: a straight-up number pays 35 to 1 but wins only 1 in 37, an edge of 2.70 % European or 5.26 % American, the same on almost every bet because the payout simply ignores the zeros. The expected-value endpoint turns a stake into its expected value — stake × (win probability × (payout + 1) − 1), always negative and equal to minus the stake times the house edge — so €10 on a single number on a European wheel is worth −€0.27 every spin. The martingale endpoint exposes the doubling system: total risked = base × (2^steps − 1), the bet that explodes after a losing streak, and the bust probability — proof on the maths that no progression beats the zero. Everything is computed locally and deterministically, so it is instant and exact. Ideal for casino-game and odds apps, gambling-education and responsible-play tools, game-design back-ends, and probability teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 compute endpoints. Educational — not betting advice; the house always wins long-run.

## 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/roulette-api/..."
```

## Pricing
- **Free** (Free) — 7,500 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 98,000 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 390,000 calls/Mo, 20 req/s
- **Mega** ($38/Mo) — 1,700,000 calls/Mo, 48 req/s

## Endpoints

### Roulette

#### `GET /v1/expected-value` — Expected value of a stake

**Parameters:**
- `bet_type` (query, required, string) — Bet type Example: `straight`
- `stake` (query, required, string) — Stake amount Example: `10`
- `wheel` (query, optional, string) — european | american Example: `european`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/roulette-api/v1/expected-value?bet_type=straight&stake=10&wheel=european"
```

**Response:**
```json
{
    "data": {
        "note": "Expected value = stake × (win probability × (payout + 1) − 1) — always negative, equal to minus the stake times the house edge (about 2.7 % European, 5.26 % American) no matter the bet. Over many spins you lose that fraction of everything you wager; no betting pattern changes it.",
        "inputs": {
            "stake": 10,
            "wheel": "european",
            "bet_type": "straight"
        },
        "expected_loss": 0.2703,
        "payout_on_win": 350,
        "expected_value": -0.2703,
        "win_probability_pct": 2.7
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:39.373Z",
        "request_id": "43894bd8-004b-4a95-9b83-215b2e348653"
    },
    "status": "ok",
    "message": "Expected value",
    "success": true
}
```

#### `GET /v1/martingale` — Martingale exposure

**Parameters:**
- `base_bet` (query, required, string) — Base bet Example: `5`
- `steps` (query, required, string) — Number of doubling steps Example: `5`
- `wheel` (query, optional, string) — european | american Example: `european`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/roulette-api/v1/martingale?base_bet=5&steps=5&wheel=european"
```

**Response:**
```json
{
    "data": {
        "note": "The martingale doubles your even-money bet after every loss to recover with a one-unit profit — total risked = base × (2^steps − 1), and the bet explodes fast (10 losses on a $5 base risks $5,115). The losing streak that wipes you out is rare but real, and it always comes; table limits and the zero make it a guaranteed loser long-run.",
        "inputs": {
            "steps": 5,
            "wheel": "european",
            "base_bet": 5
        },
        "final_bet": 80,
        "total_risked": 155,
        "profit_if_win": 5,
        "bust_probability_pct": 3.571
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:39.471Z",
        "request_id": "dc25d813-4f77-4669-b15f-8890003e35b6"
    },
    "status": "ok",
    "message": "Martingale",
    "success": true
}
```

#### `GET /v1/payout` — Payout, probability & house edge

**Parameters:**
- `bet_type` (query, required, string) — straight | split | street | corner | sixline | column | dozen | even Example: `straight`
- `wheel` (query, optional, string) — european | american (default european) Example: `european`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/roulette-api/v1/payout?bet_type=straight&wheel=european"
```

**Response:**
```json
{
    "data": {
        "bet": "straight up (1 number)",
        "note": "The payout is fixed but the wheel has one (European) or two (American) zeros that the payout ignores, which is the house edge: 2.70 % on a single-zero wheel, 5.26 % on a double-zero wheel, the same on almost every bet. Always prefer European (single-zero) — it halves the edge.",
        "inputs": {
            "wheel": "european",
            "bet_type": "straight"
        },
        "payout_to_1": 35,
        "total_numbers": 37,
        "house_edge_pct": 2.7,
        "winning_numbers": 1,
        "win_probability_pct": 2.7
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:39.564Z",
        "request_id": "f3819618-a799-4960-ba6b-8395e077f82f"
    },
    "status": "ok",
    "message": "Payout",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "notes": "Bets: straight, split, street, corner, sixline, column, dozen, even. Wheel european (37) or american (38). Edge 2.70 %/5.26 %. Educational — not betting advice; the house always wins long-run.",
        "service": "roulette-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/payout": "Payout, win probability and house edge for a bet type and wheel.",
            "GET /v1/martingale": "Total risked, final bet and bust probability of a martingale progression.",
            "GET /v1/expected-value": "Expected value and loss of a stake on a bet."
        },
        "description": "Roulette maths: payout/probability/house-edge of a bet, the expected value of a stake, and martingale exposure."
    },
    "meta": {
        "timestamp": "2026-06-06T15:30:39.663Z",
        "request_id": "e50998ea-e40f-4cab-8cbc-15c1a538927c"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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