API

Aggregator
API Reference

OpenAPI 3.1 specification. 14 endpoints, 30 schemas, two wallet modes. Everything you need to integrate 180+ games.

14
Endpoints
30
Schemas
180+
Games
2
Wallet Modes
99.9%
Uptime SLA
Quick Start

Integrate in Minutes

$ lmgame-api --quickstart

01

Authenticate

Send your API key in the x-api-key header. All endpoints require tenant authentication.

$x-api-key: "sk_live_..."
02

Launch Session

POST /launch with playerId, gameCode, and currency. Get back a game URL.

$POST /api/v1/aggregator/launch
03

Process Bets

Use /play for instant games or /bet + /win for granular wallet control.

$POST /api/v1/aggregator/play

Two Wallet Modes

Internal wallet (we manage balances) or Seamless wallet (we callback to your endpoints).

Idempotent

All transactional endpoints are idempotent on transactionId. Safe to retry.

Instant + Session

Single-call /play for instant games. Multi-step /session-game/* for blackjack, mines, etc.

API Key Auth

Simple x-api-key header authentication. One key per tenant, rotatable from admin.

Endpoints

14 API Endpoints

$ lmgame-api --list-routes

GET
/api/v1/aggregator/games

List available games

GET
/api/v1/agent/games

Smart game discovery

POST
/api/v1/agent/play

Play instant game

POST
/api/v1/agent/batch

Batch play with strategy

POST
/api/v1/agent/session/start

Start session game

POST
/api/v1/agent/session/action

Session action

GET
/api/v1/agent/balance

Check balance

GET
/api/v1/agent/history

Bet history + analytics

POST
/api/v1/agent/strategy/set

Save strategy

GET
/mcp/manifest

MCP manifest

POST
/mcp/tools/list

List MCP tools

POST
/mcp/tools/call

Execute MCP tool

POST
/api/v1/aggregator/launch

Create a game session

GET
/api/v1/aggregator/sessions

List active sessions

POST
/api/v1/aggregator/session/close

Close a session

POST
/api/v1/aggregator/balance

Get player balance

POST
/api/v1/aggregator/bet

Place a bet (debit)

POST
/api/v1/aggregator/win

Record a win (credit)

POST
/api/v1/aggregator/rollback

Rollback a bet

POST
/api/v1/aggregator/play

Play instant game

POST
/api/v1/aggregator/session-game/start

Start session game

POST
/api/v1/aggregator/session-game/action

Session game action

POST
/api/v1/aggregator/session-game/cashout

Cashout session game

GET
/api/v1/aggregator/session-game/state

Get session game state

GET
/api/v1/aggregator/rounds/{roundId}

Get round details

Examples

Code Samples

$ curl --help lmgame

Launch Session
POST
curl -X POST https://play.lmgamelabs.com/api/v1/aggregator/launch \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "playerId": "player_abc123",
    "gameCode": "dice",
    "currency": "USD",
    "language": "en",
    "mode": "real",
    "returnUrl": "https://your-site.com/lobby"
  }'
Play Instant Game
POST
curl -X POST https://play.lmgamelabs.com/api/v1/aggregator/play \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sessionToken": "your_session_token",
    "gameCode": "dice",
    "stake": 10.00,
    "options": {
      "target": 50,
      "direction": "over"
    }
  }'
Response
200 OK
{
  "status": "ok",
  "roundId": "r_abc123",
  "result": {
    "outcome": 67.23,
    "target": 50,
    "direction": "over",
    "win": true,
    "multiplier": 2.02,
    "payout": 20.20
  },
  "balance": 1510.20,
  "transactionId": "tx_play_001"
}
Schemas

Type Definitions

$ lmgame-api --describe-schemas

Wallet Integration

Two Wallet Modes

$ lmgame-api --wallet-modes

Internal Wallet

Zero Integration

We manage player balances via an internal ledger. Players are auto-created on first game launch. Zero wallet integration required.

Zero integration complexity
Auto player creation
Built-in balance management
Instant deposits & withdrawals

Seamless Wallet

Full Control

We call back to your webhook endpoints for every balance check, debit, credit, and rollback. Full control over player funds.

Operator controls all funds
Webhook callbacks for every tx
Idempotent transaction handling
Automatic rollback on failures
Seamless Wallet Flow
SEQUENCE
1. Player --- places bet ---> LM Game Labs
2. LM Game Labs --- POST /wallet/debit ---> Your Server
3. Your Server --- responds balance ---> LM Game Labs
4. LM Game Labs --- runs game engine ---> Result
5. LM Game Labs --- POST /wallet/credit ---> Your Server
Authentication

API Key Security

$ lmgame-api --auth-info

Request Headers
REQUIRED
// Every request must include:
x-api-key: "sk_live_your_tenant_api_key"
Content-Type: "application/json"
// Error response (401):
{ "error": "Invalid or missing API key" }

Security Best Practices

1

Keep keys server-side only

Never expose API keys in client-side code or mobile apps.

2

Rotate keys periodically

Generate new keys from the admin panel. Old keys are revoked instantly.

3

Use IP allowlisting

Restrict API access to your server IPs for production environments.

4

Monitor usage

Track API calls in the admin dashboard. Anomalies trigger alerts.

Ready to Integrate?

Get your API key and start integrating 180+ provably fair games today.

$ Full OpenAPI 3.1 spec available on request