1. Getting Started
[Game] FairPlay API
  • Getting Started
    • Introduction
    • Session and Token
    • Request and Response
    • Real-time Events (SSE)
    • Lotto Rules — หวยเฮงเฮง
    • Provably Fair
  • Player
    • Demo
      • Demo Login
    • Player Bet History
      GET
  • Common
    • Game
      • By Game Code
        • Provably Fair
          • Set Client Seed
          • Verify Result
          • Get Revealed Server Seed
        • Check Session
        • Get Balance
        • Get Provably-Fair State
      • Lobby Game List
  • Wallet
    • Wallet Status
      GET
  • Game
    • Lotto (หวยเฮงเฮง)
      • Lotto Rules
      • Rooms
        • By Room
          • Join Round
          • Place Multi-player Bet
          • Get Round Result
          • Room Event Stream
      • Tickets
        • Create Ticket
        • Inquiry My Tickets
        • Get Ticket
      • Round
        • Get My Bets
        • Get My Result
        • Get Round Provably Fair
      • Results
        • Inquiry Results
      • Get Rooms
      • Get Current Round
      • Get Pay Table
  • Appendix
    • Game List
    • Error Codes
    • Rate Limits
  • Language List
    GET
  • Ping
    GET
  • Schemas
    • DemoLoginRequest
    • DemoLoginResponse
    • DemoProfileResponse
    • ProfileResponse
    • GetHistoryResponse
    • BetRecord
    • GameInfo
    • Room
    • GetGameResponse
    • BetRequest
    • Bet
    • BetResponse
    • BetResult
    • GetProvablyFairResponse
    • SetClientSeedRequest
    • SetClientSeedResponse
    • RotateServerSeedResponse
    • VerifyResultRequest
    • VerifyResultResponse
    • GetServerSeedResponse
    • GetStatusResponse
    • JoinRoundResponse
    • PlaceMultiPlayerBetRequest
    • PlaceBetResponse
    • RoundResultResponse
    • SuccessResponse
    • ErrorResponse
  1. Getting Started

Introduction

The Game API serves the AMB Fair Play game client: session, balance, lobby, rooms, betting, results, history and provably-fair checks for Thai Hilo (THAI-HILO) and Lotto — หวยเฮงเฮง (LOTTO).

Base URL#

https://{game-api-domain}/gapi/v1 — the domain for each environment is provided by the relevant personnel. Every path in this collection already includes /gapi/v1.

How a player arrives#

A real player never logs in on the game client. The agent calls the Open API Start Game, and AMB Fair Play returns a launch URL the agent redirects the player to:
{gameDomain}/{gameCode}/?currency=THB&language=th&reurl=https%3A%2F%2Fagent.example.com%2Flobby&token=3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7
QueryUse
tokenThe player's session token. Send it on every call as Authorization: Bearer {token}
currencyThe player's currency (upper case). Balances and rooms are per currency
languageThe language the agent asked for (ISO 639-1). Send it back as Accept-Language
reurlOptional. Where "back to lobby" should go. Absent when the agent sent none
A demo player has no launch URL: the client calls Player → Demo → Demo Login and uses the token it returns. Demo players play with a demo balance and never see real rounds, tickets or results — every read and write is kept apart.

Typical flow#

Games#

GamegameCodegameIDRound style
Thai HiloTHAI-HILO1Dice. Rooms in SINGLE mode play one bet at a time; MULTI and MULTI_CSEED rooms share rounds
Lotto — หวยเฮงเฮงLOTTO26-digit draw per room and currency, shared rounds, tickets of up to 20 lines
{gameCode} in a path is case-insensitive; send it upper case as listed.

Where a route lives#

PrefixHolds
/c/g/…Routes every game shares — the lobby (/c/g/), and per game code: session, balance, provably fair
/g/lotto/…Lotto's own routes — its rooms (rooms/{roomId}/… and the room stream) and the หวยเฮงเฮง room list, round, pay table, tickets and results
/g/thai-hilo/…Thai Hilo's own routes — its room list (rooms), its rooms (rooms/{roomId}/… and the room stream), the single-player bet and server-seed rotation
{game} in a /g/… path is the game code in lower case: lotto, thai-hilo. Rooms are per game because not every game has rooms.
Modified at 2026-09-30 13:23:45
Next
Session and Token
Built with