Game API Platform

A complete white-label game API platform with 10+ provably fair casino games. Integrate crash games, minesweeper, risk games, and more into your platform with just a few API calls.

10+
Games
REST
API
JWT
Auth
97%
Avg RTP

Platform Features

White Label System

Fully customizable branding with your own logo, theme colors, app name, and currency support.

USDT Payment Integration

Accept deposits and process withdrawals via TRC20 and BEP20 networks with automatic confirmation.

Subscription Management

Automated plan upgrades, renewals, and expiry handling with Basic, Pro, and Enterprise tiers.

API Key Management

Secure API key and secret key generation with IP whitelisting and rate limiting per client.

Provably Fair Algorithm

Cryptographically verifiable game outcomes using SHA-512 hashing with client seed verification.

Real-time Webhooks

Instant event notifications for player actions, game results, deposits, and subscription changes.

Technology Stack

ComponentTechnologyVersionDescription
BackendPHP8.2+Core PHP with PDO for database operations
DatabaseMySQL / MariaDB8.0+ / 10.11+Relational database with InnoDB engine
Web ServerApache / Nginx2.4+ / 1.18+With mod_rewrite / URL rewriting enabled
FrontendHTML5, CSS3, Bootstrap 55.3+Responsive admin and client dashboards
ChartsChart.js3.x+Analytics and reporting visualizations
AuthJWT (HS256)-JSON Web Tokens with HMAC-SHA256 signing
PaymentsUSDT (TRC20/BEP20)-Crypto deposits and withdrawals
System Requirements
PHP 8.2+, MySQL 8.0+, Apache/Nginx with mod_rewrite, SSL Certificate, 2GB+ RAM, 20GB+ Storage. Required PHP extensions: pdo_mysql, openssl, mbstring, json, curl.

Authentication

All API requests require authentication using your API key and secret key. You can obtain these from your client dashboard after registration.

The platform supports two authentication methods:

1. API Key Authentication

Include your API key in the request header for all API calls:

// Request Header X-API-Key: your_api_key_here

2. Auth Endpoint (Get JWT Token)

POST /api/auth

Exchange your API key and secret key for a JWT token that can be used to launch game sessions.

Request Body

ParameterTypeRequiredDescription
api_keystringRequiredYour API key (or send via X-API-Key header)
secret_keystringRequiredYour secret key
member_idstringOptionalMember ID from your system
game_uidstringOptionalGame unique identifier
credit_amountnumberOptionalInitial credit amount
currency_codestringOptionalCurrency code (default: INR)
return_urlstringOptionalURL to redirect after game session

Example Request

curl -X POST "https://mtxglobal.buzz/api/auth" \\ -H "Content-Type: application/json" \\ -d '{ "api_key": "94b24496db4ffe1ba594ac01316f0003c1866199", "secret_key": "59281a6760556a22197423cbea0753fe07d7bc95adc5afe4aeb67b5acfc8e4e2", "member_id": "player_001", "currency_code": "USD", "return_url": "https://yourcasino.com/return" }'

Example Response

{ "code": 0, "msg": "Success", "msgCode": 0, "data": { "url": "https://mtxglobal.buzz/api/game/launch.php?token=eyJ0eXAiOiJKV1Qi...", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "returnType": "1" } }
Security Notice
Never expose your secret_key in client-side code. The auth endpoint should only be called from your backend server. JWT tokens expire after 24 hours (configurable via JWT_EXPIRY).

Base URL & Headers

// Production Base URL https://mtxglobal.buzz/api/ // Required Headers for all API requests Content-Type: application/json X-API-Key: your_api_key_here // CORS Support // The API supports CORS for cross-origin requests from allowed domains // Configure allowed_domains in your client settings

Pricing Plans

Basic

$99/month

  • 10,000 API requests/month
  • All 10+ games included
  • Basic webhook support
  • Email support
  • Standard RTP settings

Enterprise

Custom

  • Unlimited API requests
  • All 10+ games + custom
  • Dedicated webhook infrastructure
  • 24/7 dedicated support
  • Fully customizable RTP
  • White-label mobile apps
  • SLA guarantee

Create Player

Create a new player in your platform. Players are unique per client and can be identified by your system's player_id.

POST /api/player/create

Request Body

ParameterTypeRequiredDescription
player_idstringRequiredUnique player ID from your system (max 100 chars)
usernamestringOptionalPlayer display name
initial_balancedecimalOptionalStarting balance (default: 0.00)

Example Request

curl -X POST "https://mtxglobal.buzz/api/player/create" \\ -H "Content-Type: application/json" \\ -H "X-API-Key: your_api_key" \\ -d '{ "player_id": "player_123", "username": "JohnDoe", "initial_balance": 1000.00 }'

Example Response

{ "success": true, "message": "Player created successfully", "data": { "player_id": "player_123", "username": "JohnDoe", "balance": 1000.00, "status": "active", "created_at": "2026-07-04 10:30:00" } }

Credit Player

Add funds to a player's balance. This is typically used when a player makes a deposit on your platform.

POST /api/player/credit
ParameterTypeRequiredDescription
player_idstringRequiredPlayer ID
amountdecimalRequiredAmount to credit (must be > 0)
referencestringOptionalTransaction reference ID

Debit Player

Deduct funds from a player's balance. This is typically used when a player requests a withdrawal.

POST /api/player/debit
ParameterTypeRequiredDescription
player_idstringRequiredPlayer ID
amountdecimalRequiredAmount to debit (must be > 0)
referencestringOptionalTransaction reference ID
Important
Debit operations will fail if the player has insufficient balance. Always check the player's balance before attempting a debit.

Get Player Balance

Retrieve a player's current balance, total wagered, total won, and game statistics.

GET /api/player/balance?player_id=player_123

Query Parameters

ParameterTypeRequiredDescription
player_idstringRequiredPlayer ID

Example Response

{ "success": true, "data": { "player_id": "player_123", "balance": 850.50, "total_wagered": 500.00, "total_won": 350.50, "total_games": 42, "status": "active", "last_login": "2026-07-04 09:15:00" } }

List Games

Get a list of all available games with their configurations, RTP, house edge, and betting limits.

GET /api/game/list

Example Response

{ "success": true, "data": { "games": [ { "game_code": "aviator", "game_name": "Aviator Game", "display_name": "Aviator Game", "description": "Watch the rocket fly and cash out before it crashes!", "min_bet": 0.10, "max_bet": 1000.00, "rtp": 97.00, "house_edge": 3.00, "status": "active", "maintenance_mode": 0 } ] } }

Launch Game

Generate a game session URL for a player. This creates a JWT-secured game session that the player can access directly.

POST /api/game/launch
ParameterTypeRequiredDescription
game_codestringRequiredGame code (e.g., 'aviator', 'treasure-dig')
player_idstringRequiredPlayer ID
return_urlstringOptionalURL to return after game session ends
tokenstringOptionalJWT token (if already authenticated)

Example Response

{ "success": true, "data": { "game_code": "aviator", "game_name": "Aviator Game", "launch_url": "https://mtxglobal.buzz/games/aviator/?token=eyJ0eXAi...", "session_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", "expires_at": "2026-07-05 11:39:00" } }

Create Game Round

Create a new game round. Some games require this before placing bets (e.g., Treasure Dig, Lava Bridge).

POST /api/game/create
ParameterTypeRequiredDescription
game_codestringRequiredGame code
player_idstringOptionalPlayer ID (required for some games)
bet_amountdecimalOptionalBet amount (required for some games)
grid_sizeintOptionalGrid size (Treasure Dig: 5,10,15,20,25)
mines_countintOptionalNumber of mines (Treasure Dig: 1,3,5,7,10)

Example: Create Treasure Dig Round

curl -X POST "https://mtxglobal.buzz/api/game/create" \\ -H "Content-Type: application/json" \\ -H "X-API-Key: your_api_key" \\ -d '{ "game_code": "treasure-dig", "grid_size": 25, "mines_count": 3 }'

Example Response

{ "success": true, "data": { "round_id": "rnd_1781063501_a3f7b2c9", "game_code": "treasure-dig", "grid_size": 25, "mines_count": 3, "status": "active", "created_at": "2026-07-04 11:39:00" } }

Place Bet

Place a bet in an active game round. The action and parameters vary by game type.

POST /api/game/bet
ParameterTypeRequiredDescription
game_codestringRequiredGame code
round_idstringRequiredRound ID
player_idstringRequiredPlayer ID
amountdecimalRequiredBet amount
actionstringOptionalAction: 'place', 'reveal', 'step', etc.
cell_indexintOptionalCell index (Treasure Dig)
stepintOptionalStep number (Lava Bridge)
auto_cashoutdecimalOptionalAuto cashout multiplier (Aviator)

Example: Place Aviator Bet

curl -X POST "https://mtxglobal.buzz/api/game/bet" \\ -H "Content-Type: application/json" \\ -H "X-API-Key: your_api_key" \\ -d '{ "game_code": "aviator", "round_id": "avi_1781063501_2d64a217", "player_id": "player_001", "amount": 10.00, "auto_cashout": 2.50 }'

Example: Reveal Treasure Dig Cell

curl -X POST "https://mtxglobal.buzz/api/game/bet" \\ -H "Content-Type: application/json" \\ -H "X-API-Key: your_api_key" \\ -d '{ "game_code": "treasure-dig", "round_id": "rnd_1781063501_a3f7b2c9", "player_id": "player_001", "action": "reveal", "cell_index": 5 }'

Cash Out

Cash out your bet at the current multiplier or state. Available for games that support mid-round cashout.

POST /api/game/cashout
ParameterTypeRequiredDescription
game_codestringRequiredGame code
round_idstringRequiredRound ID
player_idstringRequiredPlayer ID
cashout_multiplierdecimalOptionalManual cashout multiplier

Example Response

{ "success": true, "data": { "round_id": "avi_1781063501_2d64a217", "cashout_multiplier": 2.37, "bet_amount": 10.00, "payout": 23.70, "profit": 13.70, "new_balance": 1013.70 } }

Game Result

Retrieve the result of a completed game round.

GET /api/game/result?game_code=aviator&round_id=avi_1781063501_2d64a217

Game Config

Get or update game configuration settings for your client. This allows customizing min/max bets, RTP, and game-specific settings.

GET /api/game/config?game_code=aviator
POST /api/game/config
# Continue writing the games section part2 = '''

Aviator (Crash Game)

Aviator Game

Crash RTP 97% House Edge 3%

Watch the rocket fly and cash out before it crashes! The multiplier increases continuously until a random crash point determined by a provably fair algorithm.

Game Mechanics

  • Place a bet before or during the betting phase
  • The rocket takes off with a 1.00x multiplier
  • Multiplier increases until it crashes at a random point
  • Cash out before the crash to win bet x multiplier
  • If you do not cash out before crash, you lose your bet

API Endpoints

POST/api/games/aviator?action=place_bet&token=SESSION_TOKEN
POST/api/games/aviator?action=cashout&token=SESSION_TOKEN
GET/api/games/aviator?action=history&token=SESSION_TOKEN

Config

SettingDefaultRange
crash_interval_min1.001.00 - 100.00
crash_interval_max100.001.00 - 100.00
animation_speed10.5 - 3.0

Treasure Dig (Minesweeper)

Treasure Dig

Minesweeper RTP 96.5% House Edge 3.5%

Dig for treasure but avoid the bombs! Reveal cells on a grid. Each safe cell increases your multiplier. Hit a bomb and lose your bet.

Game Mechanics

  • Create a round with grid_size and mines_count
  • Place your bet
  • Reveal cells one by one
  • Each safe reveal increases the multiplier
  • Hit a bomb and lose everything
  • Cash out anytime to secure your winnings

Config

SettingOptions
grid_sizes5, 10, 15, 20, 25
mine_options1, 3, 5, 7, 10

Lava Bridge (Risk Steps)

Lava Bridge

Risk Steps RTP 96% House Edge 4%

Cross the bridge without falling into lava! Each step forward increases the multiplier, but the risk of falling increases with each step.

Game Mechanics

  • Start at step 0 with a 1.00x multiplier
  • Take a step forward to increase multiplier
  • Each step has increasing risk of falling
  • Fall into lava and lose your bet
  • Cash out anytime to secure winnings

Config

SettingDefault
steps10
risk_increase0.1 per step

Elevator Rush

Elevator Rush

Progressive RTP 96.5% House Edge 3.5%

Ride the elevator to higher floors for bigger multipliers! Each floor you reach increases your potential payout.

Game Mechanics

  • Start at floor 1 with 1.00x multiplier
  • Go up floors to increase multiplier
  • Each floor adds 0.15x to multiplier
  • Maximum 20 floors
  • Cash out anytime or risk the elevator breaking

Config

SettingDefault
max_floors20
floor_multiplier0.15 per floor

Gold Mine Cart

Gold Mine Cart

Mining RTP 96% House Edge 4%

Ride the mine cart deeper for more gold! Progress deeper into the mine for exponentially increasing multipliers.

Game Mechanics

  • Start at progress 0 with 1.00x multiplier
  • Progress deeper to increase multiplier
  • Maximum 15 progress levels
  • Risk curve is exponential - higher risk at deeper levels
  • Cash out anytime or risk a cave-in

Config

SettingDefault
max_progress15
risk_curveexponential

Space Doors

Space Doors

Probability RTP 98.5% House Edge 4.5%

Choose the right door to survive! In each round, pick one of the doors. Some lead to safety, others to danger.

Game Mechanics

  • Multiple rounds (default 5)
  • Each round has 3 doors
  • Pick the safe door to advance
  • Pick the wrong door and lose
  • Multiplier increases with each survived round

Config

SettingDefault
doors3
rounds5

Crypto Pump

Crypto Pump

Trading Sim RTP 97% House Edge 3%

Buy low, sell high in the crypto market! Watch the price chart and decide when to sell before the crash.

Game Mechanics

  • Place bet at buy price
  • Watch the price chart pump
  • Sell before the crash for profit
  • 60-second time limit per round
  • Medium volatility by default

Config

SettingDefault
volatilitymedium
time_limit60 seconds

Treasure Ship

Treasure Ship

Navigation RTP 96% House Edge 4%

Navigate your ship through storms to find treasure! Choose routes wisely to avoid sinking.

Game Mechanics

  • 8 possible routes to navigate
  • Each route has storm probability
  • Navigate safely to increase multiplier
  • Hit a storm and sink (lose bet)
  • Cash out at any port or risk the storm

Config

SettingDefault
routes8
storm_probability0.3 (30%)

Snake Tunnel

Snake Tunnel

Path Finding RTP 96% House Edge 4%

Navigate through the tunnel avoiding snakes! Crawl through segments, each with a chance of encountering a snake.

Game Mechanics

  • 12 segments in the tunnel
  • Each segment has snake probability
  • Survive segments to increase multiplier
  • Get bitten by snake and lose
  • Exit tunnel anytime to cash out

Config

SettingDefault
segments12
snake_probability0.25 (25%)

Meteor Run

Meteor Run

Survival RTP 96.5% House Edge 3.5%

Run from the meteors and survive! The longer you run, the higher your multiplier, but meteor frequency increases.

Game Mechanics

  • Maximum distance: 100 units
  • Meteor frequency increases over time
  • Survive longer for higher multipliers
  • Get hit by meteor and lose
  • Stop running anytime to cash out

Config

SettingDefault
max_distance100
meteor_frequencyincreasing

Wallet Balance

Get the current wallet balance for your client account, including frozen balance and total deposited/withdrawn amounts.

GET /api/wallet/balance

Example Response

{ "success": true, "data": { "balance": 5000.00, "frozen_balance": 0.00, "total_deposited": 5000.00, "total_withdrawn": 0.00, "currency": "USDT" } }

Transaction History

Retrieve transaction history for your client account, including deposits, withdrawals, game credits, and debits.

GET /api/wallet/transactions?limit=50&offset=0

Query Parameters

ParameterTypeRequiredDescription
limitintOptionalNumber of records (default: 50, max: 100)
offsetintOptionalOffset for pagination (default: 0)
typestringOptionalFilter by type: deposit, withdrawal, game_credit, game_debit
statusstringOptionalFilter by status: pending, completed, failed

Webhooks

Configure a webhook URL in your client dashboard to receive real-time event notifications. Webhooks are sent as POST requests with a JSON payload.

Important
Your webhook endpoint must respond with HTTP 200 within 30 seconds. Failed webhooks will be retried up to 3 times automatically by the worker script.

Webhook Configuration

Set your webhook URL in the client dashboard or via the API. The platform will send POST requests to this URL whenever relevant events occur.

Event Types

EventDescriptionPayload
player.createdTriggered when a new player is createdplayer_id, username, balance
player.creditedTriggered when player balance is creditedplayer_id, amount, new_balance
player.debitedTriggered when player balance is debitedplayer_id, amount, new_balance
game.bet_placedTriggered when a bet is placedgame, round_id, player_id, amount
game.cashoutTriggered when player cashes outgame, round_id, player_id, multiplier, profit
game.round_endedTriggered when a round endsgame, round_id, crash_multiplier, total_bets
deposit.confirmedTriggered when a deposit is confirmedamount, tx_hash, network
withdrawal.processedTriggered when withdrawal is processedamount, tx_hash, status
subscription.renewedTriggered on subscription renewalplan, amount, end_date
subscription.expiredTriggered when subscription expiresplan, expired_at

Webhook Payload Format

{ "event": "game.cashout", "timestamp": 1704067200, "data": { "game": "aviator", "round_id": "avi_1234567890", "player_id": "player_123", "bet_amount": 10.00, "cashout_multiplier": 2.50, "profit": 15.00, "new_balance": 1015.00 } }

Webhook Retry Logic

The worker script runs every 5 minutes (configurable via cron) and retries failed webhooks up to 3 times. Each retry is logged in the webhook_logs table.

Test Webhook

Send a test webhook to verify your endpoint is configured correctly.

POST /api/webhook/test

Provably Fair Algorithm

All games on the MTX Global platform use a provably fair algorithm based on SHA-512 hashing. This ensures that game outcomes cannot be manipulated by the platform or the client.

How It Works

  1. Server Seed - Generated by the server before each round, hashed and displayed to the player
  2. Client Seed - Provided by the client (or randomly generated)
  3. Nonce - Incremental number for each bet
  4. Result Calculation - HMAC-SHA512(server_seed, client_seed + nonce)

Crash Point Formula (Aviator)

// CrashPoint = (100 - HouseEdge) / (1 - h) / 100 // Where h is derived from the hash function calculateCrashMultiplier($seed, $houseEdge = 3.00) { $hash = hash('sha512', $seed); // Check for instant crash (1.00x) - ~3% chance $checkValue = hexdec(substr($hash, 0, 8)); $instantThreshold = floor(100 / $houseEdge); if ($checkValue % $instantThreshold === 0) { return 1.00; } // Extract first 13 hex chars (52 bits) $hexSlice = substr($hash, 0, 13); $h = hexdec($hexSlice) / pow(2, 52); // Calculate crash point $rtp = 100 - $houseEdge; $crashPoint = ($rtp / (1 - $h)) / 100; // Floor to 2 decimal places return floor($crashPoint * 100) / 100; }
Verification
Players can verify game outcomes by combining the server seed (revealed after the round), client seed, and nonce to reproduce the hash and confirm the result.

Error Codes Reference

CodeHTTP StatusDescription
INVALID_API_KEY401API key is invalid or revoked
CLIENT_SUSPENDED403Client account is suspended
SUBSCRIPTION_EXPIRED403Subscription has expired
MISSING_CREDENTIALS400API key and secret key are required
INVALID_JSON400Invalid JSON payload in request body
MISSING_PARAMS400Required parameters are missing
INVALID_BET_AMOUNT400Bet amount is outside allowed range
INSUFFICIENT_BALANCE400Player has insufficient balance
PLAYER_NOT_FOUND404Player does not exist
GAME_NOT_FOUND404Game code is invalid
ROUND_CLOSED400Round is no longer accepting bets
ALREADY_BET409Player already placed bet in this round
TRANSACTION_FAILED500Internal transaction error
METHOD_NOT_ALLOWED405HTTP method not allowed for this endpoint
NOT_FOUND404Endpoint not found
RATE_LIMIT_EXCEEDED429Too many requests, rate limit exceeded

Installation Guide

System Requirements

Quick Setup

# 1. Upload files to your web server (public_html/) # 2. Create MySQL database and user # 3. Import database/schema.sql # 4. Edit includes/config.php with your settings # Database Configuration define('DB_HOST', 'localhost'); define('DB_NAME', 'your_database'); define('DB_USER', 'your_user'); define('DB_PASS', 'your_password'); # Security Settings (CHANGE THESE!) define('JWT_SECRET', 'your_strong_random_secret_key_here'); # USDT Payment Addresses define('USDT_TRC20_ADDRESS', 'YOUR_TRC20_WALLET_ADDRESS'); define('USDT_BEP20_ADDRESS', 'YOUR_BEP20_WALLET_ADDRESS');

Cron Job Setup

Set up a cron job to run the worker script every 5 minutes:

# Add to crontab */5 * * * * /usr/bin/php /home/username/public_html/scripts/worker.php >> /home/username/logs/worker-cron.log 2>&1

Default Login Credentials

PanelURLUsernamePassword
Admin Panel/admin/login.phpsuperadminpassword
Client Panel/client/login.phpdemo@client.compassword
Security Warning
Change default passwords immediately after installation. Use strong JWT secrets and API keys. Enable HTTPS for all traffic.

Support

Need help integrating the MTX Global Game API Platform? Our support team is available to assist you.

Email Support

support@gameapi.com

Telegram

@gameapi_support

API Version
Current API Version: v1 | Base URL: https://mtxglobal.buzz/api/
Documentation last updated: July 2026