Automate key generation, balance queries and payment verification via REST API.
All requests require Bearer token authentication.
Get started with the API in 3 steps:
# Check your balance curl -X GET https://keyflux.net/api/balance \ -H "Authorization: Bearer YOUR_API_TOKEN"
{
"success": true,
"balance": 10.00,
"currency": "USD"
}
All API requests require an Authorization header.
Authorization: Bearer YOUR_API_TOKEN
| Header | Value | Description |
|---|---|---|
| Authorization required | string | In Bearer <api_token> format. Obtain your token from the Dashboard. |
| Content-Type | string | Must be application/json for POST requests. |
Generates output keys from input keys. count keys are produced per input key.
Requests are rejected if your balance is insufficient.
| Parameter | Type | Description |
|---|---|---|
| keys required | string[] | Array of input product keys. |
| count optional | integer | How many to generate per key? Default: 1, Max: 512 |
{
"keys": [
"HGNTM-WQQ8B-H86R6-WXKDC-TMT6T",
"ABCDE-12345-FGHIJ-67890-KLMNO"
],
"count": 3
}
{
"success": true,
"keys": [
"XYZAB-99999-CDEFG-11111-HIJKL",
"MNOPQ-55555-RSTUV-33333-WXYZ1",
"AB123-77777-CD456-88888-EF789"
],
"count": 3,
"cost": 0.03,
"new_balance": 9.97
}
{
"success": false,
"error": "Insufficient balance. Required: $0.05, available: $0.02"
}
Returns your current balance and account info. No request body needed.
{
"success": true,
"balance": 10.00,
"currency": "USD",
"email": "user@example.com"
}
Verifies a payment via Binance Pay Order ID or Off-chain Transfer ID and credits your balance. Each ID can only be used once.
| Parameter | Type | Description |
|---|---|---|
| tx_id required | string | Binance Pay Order ID (15+ digits) or Off-chain Transfer ID (9-14 digits). |
{
"success": true,
"method": "Binance Pay",
"amount": 10.00,
"currency": "USDT",
"total_credited": 10.00,
"new_balance": 20.00
}
Verifies on-chain crypto payments. Supports TRC20 (USDT / Tron) and BEP20 (USDT, BUSD, USDC / BSC). TX hash is verified on the blockchain — fake hashes are rejected.
| Parameter | Type | Description |
|---|---|---|
| tx_hash required | string | Blockchain transaction hash. |
| network required | string | trc20 or bep20 |
{
"tx_hash": "7d3c1b2e4f8a9d0c6e2b5f1a3d7e4c8b2f6a0d4e1c8b5a9d3f7e2c6b0a4d8e1",
"network": "trc20"
}
{
"success": true,
"method": "USDT TRC20",
"amount": 25.00,
"currency": "USDT",
"total_credited": 25.00,
"new_balance": 35.00
}
Lists the last 50 key generation transactions. Generated keys are included in each record.
{
"success": true,
"logs": [
{
"id": 42,
"platform": "windows",
"input_count": 2,
"keys_generated": 6,
"cost": 0.06,
"created_at": "2026-09-06 19:30:00"
}
]
}
Regenerates your API token. The old token is immediately invalidated. No request body needed.
{
"success": true,
"api_token": "kf_new_token_here"
}
All error responses follow the format {"success": false, "error": "message"}.
| HTTP Code | Status | Description |
|---|---|---|
| 200 | OK | Operation successful. |
| 400 | Bad Request | Missing or invalid parameter. Check the error field. |
| 401 | Unauthorized | Token missing or invalid. Check your Authorization header. |
| 402 | Payment Required | Insufficient balance. Add funds first. |
| 404 | Not Found | Transaction or resource not found. |
| 409 | Conflict | This TX/Order ID has already been used. |
| 500 | Server Error | Server error. Retry or contact support. |
# pip install requests import requests BASE_URL = "https://keyflux.net" API_TOKEN = "YOUR_API_TOKEN" HEADERS = { "Authorization": f"Bearer {API_TOKEN}", "Content-Type": "application/json", } # ── Check balance ───────────────────────────────────── def get_balance(): r = requests.get(f"{BASE_URL}/api/balance", headers=HEADERS) data = r.json() if data["success"]: print(f"Balance: ${data['balance']}") return data # ── Generate keys ───────────────────────────────────── def generate_keys(keys: list, count: int = 1): payload = {"keys": keys, "count": count} r = requests.post(f"{BASE_URL}/api/generate", json=payload, headers=HEADERS) data = r.json() if data["success"]: print(f"{len(data['keys'])} keys generated. Cost: ${data['cost']}") for k in data["keys"]: print(k) else: print("Error:", data["error"]) return data # ── Verify crypto deposit ────────────────────────────── def verify_onchain(tx_hash: str, network: str = "trc20"): payload = {"tx_hash": tx_hash, "network": network} r = requests.post(f"{BASE_URL}/api/deposit/verify-onchain", json=payload, headers=HEADERS) data = r.json() if data["success"]: print(f"${data['amount']} {data['currency']} credited. New balance: ${data['new_balance']}") return data # Usage if __name__ == "__main__": get_balance() generate_keys(["HGNTM-WQQ8B-H86R6-WXKDC-TMT6T"], count=5)
// npm install node-fetch (Node 18+ has fetch built-in) const BASE_URL = "https://keyflux.net"; const API_TOKEN = "YOUR_API_TOKEN"; const HEADERS = { "Authorization": `Bearer ${API_TOKEN}`, "Content-Type": "application/json", }; // Check balance async function getBalance() { const res = await fetch(`${BASE_URL}/api/balance`, { headers: HEADERS }); const data = await res.json(); console.log(`Balance: $${data.balance}`); return data; } // Generate keys async function generateKeys(keys, count = 1) { const res = await fetch(`${BASE_URL}/api/generate`, { method: "POST", headers: HEADERS, body: JSON.stringify({ keys, count }), }); const data = await res.json(); if (data.success) { console.log(`${data.keys.length} keys generated:`, data.keys); } else { console.error("Error:", data.error); } return data; } // Usage getBalance(); generateKeys(["HGNTM-WQQ8B-H86R6-WXKDC-TMT6T"], 3);