1. Provably Fair
[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
            POST
          • Verify Result
            POST
          • Get Revealed Server Seed
            GET
        • Check Session
          GET
        • Get Balance
          GET
        • Get Provably-Fair State
          GET
      • Lobby Game List
        GET
  • 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. Provably Fair

Set Client Seed

POST
/gapi/v1/c/g/{gameCode}/provably-fair/client-seed
Sets the player's client seed for the game and resets the nonce to 0. FE calls it when the player changes the client seed in the provably-fair panel.
Auth: Player session — Authorization: Bearer {token}
Rate limit: 100 requests per 60 s per IP (GAME_SET_CLIENT_SEED)
Games: THAI-HILO, LOTTO
Rules
clientSeed is any non-empty string, stored as sent (no trimming, no length or character rules).
The server seed is not rotated: its hash stays the same, so earlier bets remain under the same commitment.
THAI-HILO: the next single-player bet uses the new clientSeed with nonce 0, and that bet's response has no nonce key.
Both games: the next bet that claims a slot in a MULTI_CSEED room contributes this clientSeed and nonce; rounds already bet in are not affected.
LOTTO: serverSeedHash is always "" (key present) — LOTTO has no per-player server seed.
The response nonce is always 0. For reference, the nonce is 1 on a new or rotated seed and 0 after a client-seed change.
Demo and real play keep separate client seeds.
Flow
1.
Validates the token, checks system maintenance and resolves gameCode.
2.
Rejects an empty clientSeed.
3.
Loads or creates the player's state for this game, sets the clientSeed and resets the nonce to 0.
4.
Returns the (unchanged) server seed hash, the clientSeed and nonce 0.

Request

Path Params

Header Params

Body Params application/json

Examples

Responses

🟢200OK
application/json
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠404Not Found
🟠429Too Many Requests
🔴500Internal Server Error
🔴503Service Unavailable
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://dev-api.ambfairgame.com/gapi/v1/gapi/v1/c/g/THAI-HILO/provably-fair/client-seed' \
--header 'Authorization: Bearer 3f9a1c7e5b2d4f6081a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7' \
--header 'Accept-Language: th' \
--header 'Content-Type: application/json' \
--data '{
    "clientSeed": "my-lucky-seed"
}'
Response Response Example
200 - THAI-HILO
Server seed hash unchanged, nonce reset.
{
    "code": "0",
    "description": "Success.",
    "traceID": "0f8e2c1a-6b3d-4e5f-9a7b-1c2d3e4f5a6b",
    "data": {
        "serverSeedHash": "cecfc34e5de06b8028c4cadba0675e8afc6c4f4bf531327c5697c6f3cfa943c0",
        "clientSeed": "my-lucky-seed",
        "nonce": 0
    }
}
Modified at 2026-09-30 13:23:45
Previous
Player Bet History
Next
Verify Result
Built with