📖 API Reference

ShadowKey API

Automate key generation, balance queries and payment verification via REST API. All requests require Bearer token authentication.

● API Online
Base URL: https://keyflux.net

🚀 Quick Start

Get started with the API in 3 steps:

1. Get your API Token

Dashboard → API Token section, click copy.

🔐 Sign in to view your API token
bash — your first request
# Check your balance
curl -X GET https://keyflux.net/api/balance \
  -H "Authorization: Bearer YOUR_API_TOKEN"
json — örnek yanıt
{
  "success": true,
  "balance": 10.00,
  "currency": "USD"
}

🔐 Authentication

All API requests require an Authorization header.

⚠️  Keep your API token secure. If it is leaked, regenerate it from the Dashboard.
http header
Authorization: Bearer YOUR_API_TOKEN
HeaderValueDescription
Authorization required string In Bearer <api_token> format. Obtain your token from the Dashboard.
Content-Type string Must be application/json for POST requests.

📡 ENDPOINT REFERENCE
POST https://keyflux.net/api/generate

Generates output keys from input keys. count keys are produced per input key. Requests are rejected if your balance is insufficient.

Request Body
ParameterTypeDescription
keys requiredstring[]Array of input product keys.
count optionalintegerHow many to generate per key? Default: 1, Max: 512
json
{
  "keys": [
    "HGNTM-WQQ8B-H86R6-WXKDC-TMT6T",
    "ABCDE-12345-FGHIJ-67890-KLMNO"
  ],
  "count": 3
}
json — 200 OK
{
  "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
}
json — 402 Insufficient Balance
{
  "success": false,
  "error": "Insufficient balance. Required: $0.05, available: $0.02"
}
GET https://keyflux.net/api/balance

Returns your current balance and account info. No request body needed.

json — 200 OK
{
  "success": true,
  "balance": 10.00,
  "currency": "USD",
  "email": "user@example.com"
}
POST https://keyflux.net/api/deposit/verify

Verifies a payment via Binance Pay Order ID or Off-chain Transfer ID and credits your balance. Each ID can only be used once.

ParameterTypeDescription
tx_id requiredstringBinance Pay Order ID (15+ digits) or Off-chain Transfer ID (9-14 digits).
json — 200 OK
{
  "success": true,
  "method": "Binance Pay",
  "amount": 10.00,
  "currency": "USDT",
  "total_credited": 10.00,
  "new_balance": 20.00
}
POST https://keyflux.net/api/deposit/verify-onchain

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.

ParameterTypeDescription
tx_hash requiredstringBlockchain transaction hash.
network requiredstringtrc20 or bep20
json — request
{
  "tx_hash": "7d3c1b2e4f8a9d0c6e2b5f1a3d7e4c8b2f6a0d4e1c8b5a9d3f7e2c6b0a4d8e1",
  "network": "trc20"
}
json — 200 OK
{
  "success": true,
  "method": "USDT TRC20",
  "amount": 25.00,
  "currency": "USDT",
  "total_credited": 25.00,
  "new_balance": 35.00
}
GET https://keyflux.net/api/logs

Lists the last 50 key generation transactions. Generated keys are included in each record.

json — 200 OK
{
  "success": true,
  "logs": [
    {
      "id": 42,
      "platform": "windows",
      "input_count": 2,
      "keys_generated": 6,
      "cost": 0.06,
      "created_at": "2026-09-06 19:30:00"
    }
  ]
}
POST https://keyflux.net/api/token/regenerate

Regenerates your API token. The old token is immediately invalidated. No request body needed.

json — 200 OK
{
  "success": true,
  "api_token": "kf_new_token_here"
}

⚠️ Error Codes

All error responses follow the format {"success": false, "error": "message"}.

HTTP CodeStatusDescription
200OKOperation successful.
400Bad RequestMissing or invalid parameter. Check the error field.
401UnauthorizedToken missing or invalid. Check your Authorization header.
402Payment RequiredInsufficient balance. Add funds first.
404Not FoundTransaction or resource not found.
409ConflictThis TX/Order ID has already been used.
500Server ErrorServer error. Retry or contact support.

🐍 Python Full Example

python
# 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)

🟨 Node.js Full Example

javascript
// 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);