Documentation

Lumikey puts a key in front of your project. People earn or buy a key, your software checks it with one HTTPS request, and you manage everything from the dashboard, Discord or an API. It works for anything that can make an HTTPS request: Lua scripts, Windows and Mac apps, game mods, Discord bots, command-line tools, websites and servers.

60-second start

You have a project id (p_…, from the project's Integrate tab) and a key (make a test one under Keys → Generate). This checks it:

python, no libraries
import hashlib, json, urllib.request

PROJECT = "p_yourProjectId"
KEY = "YOUR-KEY"
HWID = hashlib.sha256(b"lumikey:my-device").hexdigest()  # any stable id for this device

req = urllib.request.Request(
    "https://lumikey.cc/api/v1/validate",
    data=json.dumps({"project": PROJECT, "key": KEY, "hwid": HWID}).encode(),
    headers={"Content-Type": "application/json", "User-Agent": "MyApp/1.0"},
)
res = json.load(urllib.request.urlopen(req, timeout=10))
print(res["valid"], res["code"], res["message"])

Expect True KEY_VALID Key is valid.. A wrong key still answers HTTP 200 with valid: false, so always read valid. The same call in eight more languages is under Code examples; every answer is shown under Example responses.

Overview

PartWhat it is
ProjectThe thing you protect: one script, app or game. It has an id (p_…), a key page, its own keys and settings. One account can have several.
KeyA code like NEBULA-7KQ2M-X4PHD-9RT3C-WB6NE. It can be free (earned through checkpoints), paid (sold or generated by you) and can expire or last forever.
Device idAn optional id your software sends so a key works on one device only. You can turn the lock off.
ValidateThe request your software sends to ask "is this key good?". The answer is JSON.
ManageCreate, extend, revoke and look up keys from the dashboard, the Discord bot, SellAuth, or the Management API.

The usual flow:

  1. A user opens your key page, completes your checkpoints (or you sell them a key), and receives a key.
  2. They paste the key into your software.
  3. Your software calls validate with the key. If valid is true, it runs. If not, it shows the message.

Setup checklist

  1. Create an account and confirm your email.
  2. Create a project. Open its Integrate tab and copy the project id (it looks like p_AbC123…).
  3. Optional: connect an ad network under Ad networks and add steps under the project's Checkpoints. With no checkpoints, visitors get a key after one human check.
  4. Add the key check to your software. Pick your language in Code examples, replace p_yourProjectId with your id, and ship it.
  5. Give users your key page link, https://lumikey.cc/k/your-project, or generate keys yourself under the Keys tab.
  6. Test it: generate a key in the dashboard, run your software with that key, and watch it appear as used.

Field glossary

Every field and value used by the API, in one place. The endpoint sections link here instead of repeating this.

NameTypeMeaning
projectstringYour project id, starts with p_. Find it in the project's Integrate tab. Never changes.
keystringA license key such as NEBULA-7KQ2M-X4PHD-9RT3C-WB6NE. Case does not matter. Keys only work in the project that made them. Treat them like passwords.
hwidstring, up to 128The device id your software sends. Same name in every endpoint. Also called device id in the dashboard and docs.
max_devicesinteger, 1 to 50How many different hwid values one key accepts.
noncestring, up to 64A random value you send; it comes back signed so you can detect replays.
sessionstring, 8 to 64Heartbeat only: a random id your script makes once per run.
versionstringYour software version, like 1.4.2.
validbooleanTrue only for KEY_VALID.
codestringMachine-readable result. All values: the Validate code table and the Error reference.
key_typefree | paid | manualWhere the key came from. Keys you make in the dashboard, Discord or the API are manual unless you set a type.
tierstring or nullYour own label on the key, such as premium. Up to 32 lowercase letters, digits, - or _.
metaobject or nullUp to 20 fields of your own on the key: text, numbers or true/false.
expires_at, seconds_leftunix seconds or null; seconds or nullWhen the key ends and how long is left. Null for lifetime keys and for keys that have not started (start on first use).
lifetimebooleanTrue for a key that never expires.
testbooleanTrue for a test key (24 hours at most, not counted towards your plan).
state (key list)unused | active | expired | revoked | frozenunused: never checked yet. active: valid now. expired: out of time. revoked: blocked by you or staff, can be restored. frozen: paused, time kept.
signature, signature_fullhex stringHMAC-SHA256 proofs. See Signatures.

How keys work

Where keys come from

  • Free keys are earned on your key page by finishing your checkpoints. You choose how long they last, from 5 minutes to 90 days.
  • Paid keys come from SellAuth, the dashboard, the Discord bot or the Management API.
  • Manual keys are ones you make yourself, for example for giveaways and staff.

Expiry

  • A key can last a set time (30m, 12h, 7d, 1w, 1mo) or be lifetime.
  • With start on first use, the timer begins at the first valid check, so a buyer never loses time between buying and launching.
  • You can extend a key at any time, including an expired one (it extends from now).

Device lock

With the lock on, the first device that checks a key keeps it. A different device gets HWID_MISMATCH. You can reset it from the dashboard, Discord or the API, and you can let customers do it themselves a few times with Reset device. Turn the lock off under Settings → Security if your project has no way to identify a device, such as a plain website; then no device id is needed.

Revoking

A revoked key fails the next check. You can restore it later. Deleting a key removes it for good.

Code examples

Each example sends the project id, the key and a device id, handles a network failure, and stops when the key is not valid. Pick your language; your choice is remembered across this page. Replace p_yourProjectId and YOUR-KEY.

cURL

shell
curl -s -G "https://lumikey.cc/api/v1/validate" \
  --data-urlencode "project=p_yourProjectId" \
  --data-urlencode "key=YOUR-KEY" \
  --data-urlencode "hwid=my-device-id"

Lua / Luau

script.lua
-- Lua / Luau script. Paste your project id and keep the rest.
local PROJECT = "p_yourProjectId"
local KEY = getgenv().LumikeyKey or "YOUR-KEY"
local API = "https://lumikey.cc/api/v1"

local HttpService = game:GetService("HttpService")

local function deviceId()
    if gethwid then return gethwid() end
    return game:GetService("RbxAnalyticsService"):GetClientId()
end

local function httpGet(url)
    local request = (syn and syn.request) or (http and http.request) or http_request or request
    if request then
        return request({ Url = url, Method = "GET" }).Body
    end
    return game:HttpGet(url)
end

local url = ("%s/validate?project=%s&key=%s&hwid=%s"):format(
    API, PROJECT, HttpService:UrlEncode(KEY), HttpService:UrlEncode(deviceId()))

local ok, result = pcall(function()
    return HttpService:JSONDecode(httpGet(url))
end)

if not ok then
    return warn("[Lumikey] Could not reach the key server. Try again.")
end
if not result.valid then
    return warn("[Lumikey] " .. result.message)
end

-- Key is valid: run your script below.

Python

check.py
import hashlib
import json
import platform
import subprocess
import urllib.error
import urllib.request
import uuid

API = "https://lumikey.cc/api/v1"
PROJECT = "p_yourProjectId"


def device_id() -> str:
    """A stable id for this computer, hashed so the raw machine id is never sent."""
    try:
        system = platform.system()
        if system == "Windows":
            import winreg
            with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Cryptography") as k:
                raw = winreg.QueryValueEx(k, "MachineGuid")[0]
        elif system == "Darwin":
            out = subprocess.check_output(["ioreg", "-rd1", "-c", "IOPlatformExpertDevice"], text=True)
            raw = next(line.split('"')[-2] for line in out.splitlines() if "IOPlatformUUID" in line)
        else:
            raw = open("/etc/machine-id").read().strip()
    except Exception:
        raw = str(uuid.getnode())
    return hashlib.sha256(("lumikey:" + raw).encode()).hexdigest()


def check_key(key: str) -> dict:
    body = json.dumps({"project": PROJECT, "key": key, "hwid": device_id()}).encode()
    req = urllib.request.Request(
        f"{API}/validate",
        data=body,
        headers={"Content-Type": "application/json", "User-Agent": "MyApp/1.0"},
    )
    try:
        with urllib.request.urlopen(req, timeout=10) as res:
            return json.load(res)
    except urllib.error.HTTPError as e:   # for example 429: the body is still JSON
        return json.load(e)


if __name__ == "__main__":
    result = check_key("YOUR-KEY")
    if not result["valid"]:
        raise SystemExit(result["message"])
    print("Key is valid. Expires:", result["expires_at"] or "never")

JavaScript

check.mjs
// Node 18+ (also works in Electron). In a browser, use fetch the same way.
import { createHash } from "node:crypto";
import { execSync } from "node:child_process";
import { readFileSync } from "node:fs";
import os from "node:os";

const API = "https://lumikey.cc/api/v1";
const PROJECT = "p_yourProjectId";

function deviceId() {
  let raw;
  try {
    if (process.platform === "win32") {
      raw = execSync("reg query HKLM\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid").toString().split("REG_SZ")[1].trim();
    } else if (process.platform === "darwin") {
      raw = execSync("ioreg -rd1 -c IOPlatformExpertDevice").toString().match(/"IOPlatformUUID" = "([^"]+)"/)[1];
    } else {
      raw = readFileSync("/etc/machine-id", "utf8").trim();
    }
  } catch {
    raw = os.hostname();
  }
  return createHash("sha256").update("lumikey:" + raw).digest("hex");
}

async function checkKey(key) {
  const res = await fetch(`${API}/validate`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ project: PROJECT, key, hwid: deviceId() }),
    signal: AbortSignal.timeout(10_000),
  });
  return res.json(); // the body is JSON for every status, including 429
}

const result = await checkKey("YOUR-KEY");
if (!result.valid) {
  console.error(result.message);
  process.exit(1);
}
console.log("Key is valid. Expires:", result.expires_at ?? "never");

C#

Program.cs
// .NET 6 or newer. Save as Program.cs in a console project.
using System.Net.Http.Json;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using Microsoft.Win32;

const string Api = "https://lumikey.cc/api/v1";
const string Project = "p_yourProjectId";

static string DeviceId()
{
    string raw = Environment.MachineName;
    if (OperatingSystem.IsWindows())
        raw = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid", null) as string ?? raw;
    else if (File.Exists("/etc/machine-id"))
        raw = File.ReadAllText("/etc/machine-id").Trim();
    return Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes("lumikey:" + raw))).ToLowerInvariant();
}

using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(10) };
http.DefaultRequestHeaders.UserAgent.ParseAdd("MyApp/1.0");

try
{
    var response = await http.PostAsJsonAsync($"{Api}/validate", new { project = Project, key = "YOUR-KEY", hwid = DeviceId() });
    using var doc = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
    var result = doc.RootElement;
    if (!result.GetProperty("valid").GetBoolean())
    {
        Console.WriteLine(result.GetProperty("message").GetString());
        return 1;
    }
    Console.WriteLine("Key is valid.");
    return 0;
}
catch (Exception e) when (e is HttpRequestException or TaskCanceledException)
{
    Console.WriteLine("Could not reach the key server. Try again.");
    return 2;
}

C++ (libcurl)

check.cpp
// C++17 with libcurl and nlohmann/json.  g++ check.cpp -lcurl -o check
#include <curl/curl.h>
#include <nlohmann/json.hpp>
#include <iostream>
#include <string>

using json = nlohmann::json;

static size_t onData(char* data, size_t size, size_t count, void* out) {
    static_cast<std::string*>(out)->append(data, size * count);
    return size * count;
}

// Returns the parsed response, or a discarded value if the server could not be reached.
json checkKey(const std::string& key, const std::string& deviceId) {
    const std::string body = json{{"project", "p_yourProjectId"}, {"key", key}, {"hwid", deviceId}}.dump();
    std::string response;

    CURL* curl = curl_easy_init();
    if (!curl) return json(json::value_t::discarded);
    curl_slist* headers = curl_slist_append(nullptr, "Content-Type: application/json");
    curl_easy_setopt(curl, CURLOPT_URL, "https://lumikey.cc/api/v1/validate");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
    curl_easy_setopt(curl, CURLOPT_USERAGENT, "MyApp/1.0");
    curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10L);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, onData);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
    const CURLcode rc = curl_easy_perform(curl);
    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    if (rc != CURLE_OK) return json(json::value_t::discarded);
    return json::parse(response, nullptr, false);
}

int main() {
    // Build deviceId from the Windows MachineGuid or /etc/machine-id, hashed (see "Device id").
    const std::string deviceId = "my-device-id";
    const json result = checkKey("YOUR-KEY", deviceId);
    if (result.is_discarded()) { std::cerr << "Could not reach the key server.\n"; return 2; }
    if (!result.value("valid", false)) { std::cerr << result.value("message", "Invalid key") << "\n"; return 1; }
    std::cout << "Key is valid.\n";
    return 0;
}

C++ (WinHTTP)

check.cpp
// C++17 with WinHTTP (ships with Windows, no libcurl) and nlohmann/json (header-only).
// Link against winhttp.lib (#pragma comment below does this for MSVC).
#include <windows.h>
#include <winhttp.h>
#include <nlohmann/json.hpp>
#include <iostream>
#include <string>
#include <optional>

#pragma comment(lib, "winhttp.lib")
using json = nlohmann::json;

// Splits "https://api.lumikey.cc" (or any base URL) into the pieces WinHttpConnect/OpenRequest want.
struct Url { std::wstring host; INTERNET_PORT port; bool https; };
Url parseUrl(const std::wstring& url) {
    URL_COMPONENTS c{}; c.dwStructSize = sizeof(c);
    wchar_t host[256]{};
    c.lpszHostName = host; c.dwHostNameLength = 256;
    c.dwSchemeLength = (DWORD)-1; c.dwUrlPathLength = (DWORD)-1; c.dwExtraInfoLength = (DWORD)-1;
    WinHttpCrackUrl(url.c_str(), (DWORD)url.size(), 0, &c);
    return { host, c.nPort, c.nScheme == INTERNET_SCHEME_HTTPS };
}

// Posts a JSON body to one path on the API and returns the parsed response, or std::nullopt if the
// request could not be sent or the server could not be reached (a non-2xx HTTP status with a JSON
// body, such as 429, still returns that body here — only a network failure returns nullopt).
std::optional<json> postJson(const std::wstring& baseUrl, const std::wstring& path, const json& body) {
    const Url u = parseUrl(baseUrl);
    const std::string bodyUtf8 = body.dump();

    HINTERNET hSession = WinHttpOpen(L"MyApp/1.0", WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
        WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0);
    if (!hSession) return std::nullopt;
    WinHttpSetTimeouts(hSession, 10000, 10000, 10000, 10000); // resolve, connect, send, receive (ms)

    HINTERNET hConnect = WinHttpConnect(hSession, u.host.c_str(), u.port, 0);
    HINTERNET hRequest = hConnect ? WinHttpOpenRequest(hConnect, L"POST", path.c_str(),
        nullptr, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES,
        u.https ? WINHTTP_FLAG_SECURE : 0) : nullptr;
    if (!hRequest) { WinHttpCloseHandle(hConnect); WinHttpCloseHandle(hSession); return std::nullopt; }

    const std::wstring headers = L"Content-Type: application/json\r\n";
    BOOL ok = WinHttpSendRequest(hRequest, headers.c_str(), (DWORD)headers.size(),
        (LPVOID)bodyUtf8.data(), (DWORD)bodyUtf8.size(), (DWORD)bodyUtf8.size(), 0);
    if (ok) ok = WinHttpReceiveResponse(hRequest, nullptr);

    std::string response;
    if (ok) {
        DWORD avail = 0;
        while (WinHttpQueryDataAvailable(hRequest, &avail) && avail > 0) {
            std::string chunk(avail, '\0');
            DWORD read = 0;
            if (!WinHttpReadData(hRequest, chunk.data(), avail, &read)) break;
            response.append(chunk, 0, read);
        }
    }
    WinHttpCloseHandle(hRequest); WinHttpCloseHandle(hConnect); WinHttpCloseHandle(hSession);
    if (!ok || response.empty()) return std::nullopt;
    const json parsed = json::parse(response, nullptr, false);
    return parsed.is_discarded() ? std::nullopt : std::optional<json>(parsed);
}

json checkKey(const std::wstring& api, const std::string& project, const std::string& key, const std::string& deviceId) {
    auto result = postJson(api, L"/validate", { {"project", project}, {"key", key}, {"hwid", deviceId} });
    return result.value_or(json(json::value_t::discarded));
}

int main() {
    // Build deviceId from the Windows MachineGuid, hashed (see "Device id" in the docs).
    const std::string deviceId = "my-device-id";
    const json result = checkKey(L"https://lumikey.cc/api/v1", "p_yourProjectId", "YOUR-KEY", deviceId);
    if (result.is_discarded()) { std::cerr << "Could not reach the key server.\n"; return 2; }
    if (!result.value("valid", false)) { std::cerr << result.value("message", "Invalid key") << "\n"; return 1; }
    std::cout << "Key is valid.\n";
    return 0;
}

Go

main.go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"

	"github.com/denisbrodbeck/machineid" // go get github.com/denisbrodbeck/machineid
)

const (
	api     = "https://lumikey.cc/api/v1"
	project = "p_yourProjectId"
)

type result struct {
	Valid     bool   `json:"valid"`
	Code      string `json:"code"`
	Message   string `json:"message"`
	ExpiresAt *int64 `json:"expires_at"`
}

func checkKey(key string) (*result, error) {
	id, err := machineid.ProtectedID("lumikey") // hashed machine id
	if err != nil {
		id = "unknown-device"
	}
	body, _ := json.Marshal(map[string]string{"project": project, "key": key, "hwid": id})
	req, _ := http.NewRequest("POST", api+"/validate", bytes.NewReader(body))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("User-Agent", "MyApp/1.0")

	res, err := (&http.Client{Timeout: 10 * time.Second}).Do(req)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()
	var r result
	return &r, json.NewDecoder(res.Body).Decode(&r)
}

func main() {
	r, err := checkKey("YOUR-KEY")
	if err != nil {
		fmt.Println("Could not reach the key server:", err)
		os.Exit(2)
	}
	if !r.Valid {
		fmt.Println(r.Message)
		os.Exit(1)
	}
	fmt.Println("Key is valid.")
}

Java

KeyCheck.java
// Java 11+ with Gson (com.google.code.gson:gson).
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;

public class KeyCheck {
    static final String API = "https://lumikey.cc/api/v1";
    static final String PROJECT = "p_yourProjectId";

    public static void main(String[] args) throws Exception {
        String deviceId = "my-device-id"; // see "Device id": hash a stable machine id
        JsonObject body = new JsonObject();
        body.addProperty("project", PROJECT);
        body.addProperty("key", "YOUR-KEY");
        body.addProperty("hwid", deviceId);

        HttpRequest request = HttpRequest.newBuilder(URI.create(API + "/validate"))
                .timeout(Duration.ofSeconds(10))
                .header("Content-Type", "application/json")
                .header("User-Agent", "MyApp/1.0")
                .POST(HttpRequest.BodyPublishers.ofString(body.toString()))
                .build();

        HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
        JsonObject result = JsonParser.parseString(response.body()).getAsJsonObject();
        if (!result.get("valid").getAsBoolean()) {
            System.err.println(result.get("message").getAsString());
            System.exit(1);
        }
        System.out.println("Key is valid.");
    }
}

PHP

check.php
<?php
const API = "https://lumikey.cc/api/v1";
const PROJECT = "p_yourProjectId";

function check_key(string $key, string $deviceId): ?array {
    $context = stream_context_create(["http" => [
        "method" => "POST",
        "header" => "Content-Type: application/json\r\nUser-Agent: MyApp/1.0\r\n",
        "content" => json_encode(["project" => PROJECT, "key" => $key, "hwid" => $deviceId]),
        "timeout" => 10,
        "ignore_errors" => true, // keep the JSON body of 4xx answers
    ]]);
    $raw = @file_get_contents(API . "/validate", false, $context);
    return $raw === false ? null : json_decode($raw, true);
}

// On a website, use the visitor's account id or a cookie as the device id.
$result = check_key("YOUR-KEY", "my-device-id");
if ($result === null) {
    exit("Could not reach the key server.\n");
}
if (!$result["valid"]) {
    exit($result["message"] . "\n");
}
echo "Key is valid.\n";

Some HTTP libraries (Python's built-in urllib, for example) are blocked by Cloudflare unless they send a User-Agent header, which is why the examples set one. If you get a plain error code: 1010 instead of JSON, add a User-Agent such as MyApp/1.0.

The examples above use a JSON POST. You can also send a GET with the values in the query string, or a POST with a form-encoded body (application/x-www-form-urlencoded); use whatever your language makes easiest.

Lua and Luau hosts

The Luau example works in any Lua host that can make an HTTP request. If you host your script with Lumikey, a one-line loader replaces the check entirely, see Hosted file.

Device id

The hwid value ties a key to one device. It must be stable (the same every run on that computer), unique to the device, and up to 128 characters. Hash it before sending, so the raw machine id never leaves the computer. The examples above do this with SHA-256 and the prefix lumikey:, so Python, Node and C# all produce the same id for the same computer.

Where to read a stable machine id:

Windows

PowerShell
(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Cryptography").MachineGuid

Linux

shell
cat /etc/machine-id

macOS

shell
ioreg -rd1 -c IOPlatformExpertDevice | awk -F'"' '/IOPlatformUUID/{print $4}'
  • Lua and Luau hosts: gethwid() when the host provides it, otherwise RbxAnalyticsService:GetClientId().
  • Browsers and websites: there is no reliable device id. Turn the device lock off, or use your own account id as the hwid so a key belongs to one account.
  • Mobile apps: use the platform's installation id (Android ID, iOS identifierForVendor) and hash it.
  • Servers and bots: use your server's own id, or turn the lock off.

The key page

Your key page is a normal web page at https://lumikey.cc/k/your-project. Anything can link to it: a "Get key" button in your app (open it in the user's default browser), your website, your Discord server. When a visitor finishes the checkpoints, the page shows their key and a copy button.

A common pattern for desktop apps:

  1. On first launch, show a key box and a "Get a key" button that opens your key page.
  2. The user pastes the key. Your app validates it, then saves it (for example in a config file).
  3. On every later launch, validate the saved key. If it is invalid or expired, show the box again.

Best practices

  • Check at startup and again every 5 to 15 minutes while the software runs, so revoked and expired keys stop working.
  • Handle the network failing. Retry a couple of times, then show a clear message. Decide whether to allow a short grace period using the last good answer.
  • Do not trust the client. Anything running on a user's computer can be changed. The strongest protection is to keep the important part on your server or in Hosted file, which is only sent to valid keys.
  • Verify the signature on your own server if the check result unlocks something valuable. See Signatures.
  • Never put the signing secret or the management token inside software you distribute. Both belong on your server only.
  • Obfuscate client-side code to slow people down (Pro plan: the Obfuscate page in the dashboard). It makes copying harder, not impossible.
  • Send a real User-Agent and a timeout of about 10 seconds with every request.

Validate

GET or POST https://lumikey.cc/api/v1/validate

FieldRequiredDescription
projectYesYour project id.
keyYesThe key to check. Case does not matter.
hwidIf the device lock is onThe device id, up to 128 characters.
nonceNoA random string, up to 64 characters. It is returned and signed, so you can detect replayed answers.
versionIf you set an oldest allowed versionYour script's version, like 1.4.2. See Script versions.

Send them as a query string, a JSON body, or a form-encoded body. The answer:

200 OK
{
  "valid": true,
  "code": "KEY_VALID",
  "message": "Key is valid.",
  "expires_at": 1767225600,
  "seconds_left": 86140,
  "lifetime": false,
  "key_type": "free",
  "note": null,
  "tier": "premium",
  "meta": { "level": 3 },
  "test": false,
  "max_devices": 1,
  "latest_version": "1.4.2",
  "update_available": false,
  "nonce": "a1b2c3",
  "signature": "4f9c…",
  "signature_full": "9b02…"
}
FieldMeaning
validTrue only when the key can be used. Always check this field. A wrong key still returns HTTP 200.
codeA stable code for your program to act on. See the table below.
messageA sentence you can show the user.
expires_atWhen the key ends, as a Unix timestamp in seconds. Null for a lifetime key or one that has not started.
seconds_leftSeconds until it ends. Null when there is no end.
lifetimeTrue for a key that never expires.
key_typefree, paid or manual.
noteThe note you saved on the key, when valid.
nonceYour nonce, echoed back.
tierThe key's tier, when valid. Null if none.
metaYour extra fields on the key, when valid.
testTrue for a test key.
max_devicesHow many devices the key works on.
latest_versionThe latest version you set, or null.
update_availableTrue when the version you sent is older than the latest.
signatureHMAC proof the answer came from Lumikey. See Signatures.
signature_fullThe same, also covering tier and meta.
CodeMeaning
KEY_VALIDThe key can be used. The first valid check locks it to this device and starts any "start on first use" timer.
KEY_INVALIDNo such key in this project, or it is not in the right format.
KEY_EXPIREDThe key ran out of time.
KEY_REVOKEDYou or your staff blocked the key.
HWID_MISMATCHThe key is already on as many devices as it allows.
KEY_FROZENThe key is paused. Its time is kept.
BLACKLISTEDThe device, network or key is on your ban list.
GEO_BLOCKEDYour country rules do not allow this country.
NETWORK_BLOCKEDYour network rules refuse this connection: a VPN, proxy, hosting network or Tor, or a network you blocked. The message tells the user to turn their VPN off.
VERSION_BLOCKEDThe version is older than your oldest allowed version, or none was sent.
KEY_IN_USEHeartbeat only: the key runs in more places than it allows (Enforce).
HWID_REQUIREDThe device lock is on and no hwid was sent.
PROJECT_NOT_FOUNDThe project id is wrong.
PROJECT_PAUSEDYou paused the project.
RATE_LIMITEDToo many checks from this IP or for this key. Wait a minute. Returned with HTTP 429.

Cross-origin requests from browsers are allowed, including the preflight for JSON bodies, so web apps can call this endpoint directly.

Example responses

Every answer has the same fields (see the glossary), so one parser handles all of them. Fields that do not apply are null or false. Below, failures after the first show only the fields that differ from it; nonce, signature and signature_full are always present (the signatures are null when the project does not exist). Messages are the exact text; show your own if you prefer, and act on code.

every failure
// Wrong key (HTTP 200). Also a key in the wrong format.
{ "valid": false, "code": "KEY_INVALID", "message": "This key does not exist.", "expires_at": null, "seconds_left": null,
  "lifetime": false, "key_type": null, "note": null, "tier": null, "meta": null, "test": false, "max_devices": null,
  "latest_version": "1.4.2", "update_available": false, "nonce": "a1b2c3", "signature": "4f9c…", "signature_full": "9b02…" }

// Expired key (HTTP 200). The key exists, so its type and end time are filled in.
{ "valid": false, "code": "KEY_EXPIRED", "message": "This key has expired. Get a new one.", "expires_at": 1767225600,
  "seconds_left": 0, "lifetime": false, "key_type": "free", … }

// Revoked key (HTTP 200)
{ "valid": false, "code": "KEY_REVOKED", "message": "This key has been revoked.", "expires_at": 1767225600, "key_type": "paid", … }

// Key locked to other devices (HTTP 200). A reset clears it.
{ "valid": false, "code": "HWID_MISMATCH", "message": "This key is locked to other devices.", "expires_at": 1767225600, "key_type": "paid", … }

// Device id missing while the project's device lock is on (HTTP 200)
{ "valid": false, "code": "HWID_REQUIRED", "message": "A device id (hwid) is required.", … }

// Paused, banned, blocked country or network, old version: same shape, other code and message.
{ "valid": false, "code": "KEY_FROZEN", "message": "This key is paused by the owner for now. Its time is kept.", … }

// Too many requests (HTTP 429, with a Retry-After header)
{ "valid": false, "code": "RATE_LIMITED", "message": "Too many requests. Wait a minute and try again.", … }

// Unknown project id (HTTP 200, signatures null)
{ "valid": false, "code": "PROJECT_NOT_FOUND", "message": "Unknown project.", "nonce": "a1b2c3", "signature": null, "signature_full": null, … }

A body that is not JSON, form or text gets 415, and a body over 64 KB gets 413; both answer {"error": {"code": "…", "message": "…"}} (see the Error reference). A missing project or key is not an HTTP error: it answers PROJECT_NOT_FOUND or KEY_INVALID like any wrong value, so a client that only reads valid never breaks on a malformed request.

Reset device

Lets a customer move their key to a new device without contacting you. Yes, call it directly from your own client the same way you call /validate — it needs no auth token, just the key itself (knowing the key is the proof of ownership, same as the customer key page). POST https://lumikey.cc/api/v1/reset-hwid with project and key (JSON, form or query string). You decide the rules in the project's Security settings under Device resets by buyers: who can reset (nobody, paid keys, some tiers, or every key), how many resets a key gets (for its whole life or every 30 days) and how long to wait between two resets (1 hour to 7 days). Buyers can also reset from the Roblox key window, their delivery page and the key status page. Resets you do from the dashboard, the API or Discord never count.

Every answer is { ok, code, message, … } with HTTP 200, except RATE_LIMITED which is HTTP 429. There is no valid field here (that is only on validate-style endpoints) — check ok.

shell
curl -s -X POST "https://lumikey.cc/api/v1/reset-hwid" -H "Content-Type: application/json" \
  -d '{"project": "p_yourProjectId", "key": "YOUR-KEY"}'

// Reset went through
{ "ok": true, "code": "RESET_OK", "message": "Device lock cleared. The next device that uses this key will be locked in.", "resets_left": 2 }

// Nothing to reset yet (still ok: true — this is not a failure)
{ "ok": true, "code": "NOT_LOCKED", "message": "This key is not locked to a device yet.", "resets_left": 3 }

// Used up this month's allowance
{ "ok": false, "code": "RESET_LIMIT", "message": "This key has used all of its device resets for this month. A reset becomes available again in 4 days.",
  "resets_left": 0, "retry_after": 345600 }

// Reset recently; retry_after is seconds to wait
{ "ok": false, "code": "RESET_COOLDOWN", "message": "This key was reset recently. You can reset it again in 1 hour.", "resets_left": 2, "retry_after": 3187 }
CodeMeaning
RESET_OKEvery device on the key was cleared. The next devices that check it are locked in. (ok: true)
NOT_LOCKEDThe key is not locked yet, so there is nothing to reset. (ok: true, not a failure)
RESET_DISABLEDThe project allows no self-service resets.
RESET_NOT_ALLOWEDThis kind of key cannot reset itself, for example a free key when only paid keys may.
RESET_LIMITThe key used all its resets. With a monthly allowance, retry_after says when one comes back (seconds). The owner can still reset it.
RESET_COOLDOWNThe key was reset too recently. retry_after says how many seconds to wait; also returned if two reset requests race each other.
BLACKLISTEDA banned key or a banned IP cannot free up a device slot for itself. Unlike Validate, network rules (VPN/proxy blocking) and hwid bans are not checked here, only the key and IP ban list.
KEY_INVALID, KEY_REVOKED, KEY_EXPIRED, KEY_FROZENSame meaning as in Validate.
PROJECT_NOT_FOUNDThe project id is wrong.
RATE_LIMITEDToo many requests. HTTP 429.

A reset is allowed to anyone who holds the key, which is the point: it is meant for the key's owner. Keep the limit low if keys get shared.

Tiers, devices and test keys

Tiers and extra fields

Give a key a tier (up to 32 lowercase letters, digits, - or _, such as premium) and up to 20 extra fields of your own in meta (text, numbers or true/false). Both come back in every valid key check, so your script can unlock features per tier without a second request. Set them when you create a key (dashboard, Management API, shop settings, import) and change them later from the key's details.

key check
{ "valid": true, "code": "KEY_VALID", "tier": "premium",
  "meta": { "level": 3, "beta": true, "region": "eu" }, ... }

To trust the tier on your own server, verify signature_full, which also covers the tier and the fields. See Signatures.

Several devices per key

Each key works on max_devices devices (1 to 50). New devices are added on their first check until the limit is reached; after that, a new device gets HWID_MISMATCH. Set a default for new keys in the project's Security settings, and change single keys from their details or with PATCH /keys/:key. A device reset clears all devices of the key. You can also remove one device at a time.

Test keys

Test keys are for trying your own script. They last at most 24 hours, a project can have 25 at a time, they do not count towards your plan, and every check returns test: true, so your script can refuse them in a release build if you want.

Pausing keys

Pause one key, a selection, or every key in a project (for example during an outage on your side). A paused key returns KEY_FROZEN. When you resume it, the paused time is added back, so nobody loses time.

Script versions

Send version (for example 1.4.2) with each key check, loader or heartbeat. In the project's Settings you set a Latest version and an Oldest allowed version.

  • Every answer includes latest_version and update_available, so your script can tell people an update is out.
  • Once an oldest allowed version is set, older versions and scripts that send no version get VERSION_BLOCKED. Use this after you fix a bug that must not stay in the wild.

Versions are compared by their numbers, so 1.10 is newer than 1.9.

Heartbeat and key sharing

POST https://lumikey.cc/api/v1/heartbeat with project, key, hwid, version and a session: a random id your script makes once, when it starts (8 to 64 letters, digits, - or _) — the same session id for the whole run, a new random one the next time your software starts. Call it every couple of minutes while it runs; the answer says exactly how long to wait before the next call, in next_in (seconds, currently always 120).

On success it returns the same fields as a key check (Example responses: valid, code, message, expires_at, seconds_left, tier, meta, …, plus signature and signature_full), with next_in added. The HTTP status is 200 for every validate-style result, including a failed key check — read valid/code, not the status. Three things only heartbeat has, and that are easy to miss:

  • A session id that fails the 8-to-64 pattern gets a different, smaller body and HTTP 400, before your key is even looked at: { "valid": false, "code": "BAD_SESSION", "message": "Send a random session id of 8 to 64 letters, digits, - or _." }. No next_in, no signature. Fix the session id and resend.
  • RATE_LIMITED (HTTP 429) and an unknown project (PROJECT_NOT_FOUND, HTTP 200) both include next_in but no signature fields at all — the request never reached a real project, so there is nothing to sign. Treat a missing signature as "unsigned", not as an error in your parsing.
  • KEY_IN_USE only ever comes from heartbeat (see sharing detection below), never from /validate.
shell
curl -s -X POST "https://lumikey.cc/api/v1/heartbeat" -H "Content-Type: application/json" \
  -d '{"project":"p_yourProjectId","key":"YOUR-KEY","hwid":"DEVICE_ID","version":"1.4.2","session":"6f2c9b1e7a4d"}'

// Success (HTTP 200) — identical shape to /validate, plus next_in
{ "valid": true, "code": "KEY_VALID", "message": "Key is valid.", "expires_at": 1767225600,
  "seconds_left": 86140, "tier": "premium", "meta": null, "next_in": 120,
  "nonce": null, "signature": "4f9c1e…", "signature_full": "7b02aa…" }

// Key runs on too many devices at once, Enforce mode (HTTP 200)
{ "valid": false, "code": "KEY_IN_USE", "message": "This key is already in use on too many devices right now.",
  "expires_at": 1767225600, "next_in": 120, "nonce": null, "signature": "…", "signature_full": "…" }

// Malformed session id (HTTP 400) — the only heartbeat answer with this smaller shape
{ "valid": false, "code": "BAD_SESSION", "message": "Send a random session id of 8 to 64 letters, digits, - or _." }

// Rate limited (HTTP 429) — no signature fields
{ "valid": false, "code": "RATE_LIMITED", "message": "Too many requests. Wait a minute and try again.", "next_in": 120 }

Session ids and two sessions on one device

Generate session once per run (for example a GUID or 16 random bytes as hex) and reuse it for every heartbeat call until your software exits; do not generate a new one per heartbeat, or every call looks like a different device. The server tracks it by key + session, not by hwid — hwid is validated like any other check but is not what sharing detection counts.

A session counts as live for 150 seconds after its last heartbeat, then drops off on its own. Restarting your software makes a new session; the old one is simply still "live" for up to 150 more seconds, so a normal restart can briefly look like two sessions on the same key. This is harmless on Watch. On Enforce it is harmless too in practice: sessions are ranked oldest-first by when each was first seen, and only sessions past the key's max_devices limit in that ranking get KEY_IN_USE — a single extra, about-to-expire session from a restart does not bump a lone legitimate session out unless the key is already over its device limit from other machines.

Turn on Sharing detection in the project's Security settings to pick what happens once more sessions are live at once than max_devices allows:

  • Watch: you get a key.shared webhook and a note in the key's history. The heartbeat still answers KEY_VALID.
  • Enforce: the same webhook and history note, and every session beyond the allowed count gets KEY_IN_USE instead of KEY_VALID — stop your script on that code the same way you would on KEY_REVOKED.

Customer key page

Every project has a page where buyers check their own key: https://lumikey.cc/k/<your-link>/key. They enter the key and see whether it works, the time left, their devices (never the raw device ids) and how many resets they have, and they can reset their devices within your limits. Your key page links to it. Turn it off in the project's Settings.

Your own app can show the same information with POST https://lumikey.cc/api/v1/key-info (project, key). Knowing the key is the proof of ownership, so treat keys like passwords.

Hosted file

On Starter and Pro you can store your script, or any text file, with Lumikey (up to 10 MB, encrypted). It is only sent to a valid key, so there is no key check in your client to patch out: someone without a key never receives the code. Paste it in the project's Integrate tab.

Lua / Luau

script.lua
getgenv().LumikeyKey = "YOUR-KEY"
local hwid = gethwid and gethwid() or game:GetService("RbxAnalyticsService"):GetClientId()
loadstring(game:HttpGet("https://lumikey.cc/api/v1/loader/p_yourProjectId?key="
    .. getgenv().LumikeyKey .. "&hwid=" .. hwid))()

Any language (plain download)

shell
curl -s -G "https://lumikey.cc/api/v1/script/p_yourProjectId" \
  --data-urlencode "key=YOUR-KEY" \
  --data-urlencode "hwid=my-device-id" \
  -A "MyApp/1.0"
  • GET https://lumikey.cc/api/v1/loader/<project>?key=…&hwid=… is for Lua. Failures come back as a Lua error() line with a readable message, so loadstring prints it.
  • GET https://lumikey.cc/api/v1/script/<project>?key=…&hwid=… is for everything else. A valid key gets the file as plain text. Anything else gets a JSON body with valid: false, a code and a message, and a normal HTTP status (403, 404, 429 or 503).

For Roblox script hubs, the project's Script tab has a Roblox key window: a ready script that opens a window with a Get key button (your key page) and a box to paste the key, then runs your hosted script. Hosting a script protects it from people who never had a key, not from a person who runs it with a valid key: anything that reaches a user's computer can be captured. Pro includes an Obfuscate tool in the dashboard that rewrites plain Lua so it is much harder to read; paste the result into your hosted script. Common Luau (continue, +=, type annotations, backtick strings) is converted to plain Lua first; rarer Luau syntax is rejected with a message.

Signatures

Every validate answer includes signature, an HMAC-SHA256 in hex of code:KEY:hwid:expires_at:nonce using your project's signing secret (Integrate tab → Signing secret). KEY is the key in upper case, hwid is trimmed, and expires_at is 0 when it is empty.

Send a new random nonce with every check and verify the answer on your server. This proves the answer came from Lumikey and is not an old answer replayed by someone running a fake server.

signature_full covers more: code:KEY:hwid:expires_at:nonce:tier:meta, where tier is empty when there is none and meta is the meta object written as compact JSON with no spaces, keys in the order they appear in the answer (in Python: json.dumps(meta, separators=(",", ":"))), or empty when there is none.

JavaScript

verify.mjs
import { createHmac, timingSafeEqual, randomBytes } from "node:crypto";

// secret = your project's signing secret (Dashboard > Integrate). Keep it on your server.
export function signatureIsValid(result, { key, hwid, nonce }, secret) {
  const signed = [
    result.code,
    key.trim().toUpperCase(),
    hwid.trim(),
    result.expires_at ?? 0,
    nonce,
  ].join(":");
  const expected = createHmac("sha256", secret).update(signed).digest();
  const given = Buffer.from(result.signature ?? "", "hex");
  return given.length === expected.length && timingSafeEqual(given, expected) && result.nonce === nonce;
}

// Send a fresh random nonce with every check, then verify the answer:
// const nonce = randomBytes(12).toString("hex");

Python

verify.py
import hashlib
import hmac


def signature_is_valid(result: dict, key: str, hwid: str, nonce: str, secret: str) -> bool:
    """secret = your project's signing secret. Keep it on your server."""
    signed = ":".join([
        result["code"],
        key.strip().upper(),
        hwid.strip(),
        str(result.get("expires_at") or 0),
        nonce,
    ])
    expected = hmac.new(secret.encode(), signed.encode(), hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, result.get("signature") or "") and result.get("nonce") == nonce


# Send a fresh random nonce with every check (secrets.token_hex(12)), then verify the answer.

Never put the signing secret inside software you give to users. Anything inside it can be read. Verify on a server you control.

Management API

Create and manage keys from your own backend, bot, store or admin tool. Create a token in the project's Integrate tab (it is shown once), then send it as Authorization: Bearer lkm_…. It is for your servers only. Keep it out of any app you distribute. Each token has scopes: read, create, update and delete. A token without the scope a request needs gets 403 missing_scope, so a bot that only hands out keys never needs a token that can delete them. Tokens can expire, and you can have up to 10.

RequestWhat it does
POST /keyscreate. Create keys. Body: count (1–100), duration (30m, 12h, 7d, 1mo, lifetime), start_on_first_use (default true), type, note, tier, meta, max_devices, test, email, send_email. Returns keys and details.
GET /keysread. List keys, newest first. Query: state (unused, active, expired, revoked, frozen), tier, page, limit (up to 100).
GET /keys/:keyread. Everything about one key, including its devices.
GET /keys/:key/historyread. Checks, new devices, resets and blocks from the last 30 days.
PATCH /keys/:keyupdate. Change note, tier, meta, max_devices or email.
POST /keys/:key/extendupdate. Body: {"duration": "7d"}. Adds time; lifetime makes it permanent.
POST /keys/:key/reset-hwidupdate. Clears every device.
DELETE /keys/:key/devices/:hwidupdate. Removes one device.
POST /keys/:key/freeze, /unfreezeupdate. Pause or resume one key.
POST /freeze-all, /unfreeze-allupdate. Pause or resume every key in the project.
POST /keys/:key/revokeupdate. Blocks the key.
POST /keys/:key/restoreupdate. Unblocks it.
DELETE /keys/:keydelete. Deletes it for good.
GET /blacklistread. Your ban list (all projects).
POST /blacklistupdate. Body: kind (hwid, ip, key), value, reason, duration (optional).
DELETE /blacklist/:iddelete. Removes a ban.

The base URL is https://lumikey.cc/api/v1/manage/<project id>. Wrong tokens and unknown projects both return 401. Errors have the form {"error": {"code": "…", "message": "…"}}. Key limits follow the project's plan.

cURL

shell
# Create 5 keys that last 30 days from first use
curl -s -X POST "https://lumikey.cc/api/v1/manage/p_yourProjectId/keys" \
  -H "Authorization: Bearer lkm_yourToken" \
  -H "Content-Type: application/json" \
  -d '{"count": 5, "duration": "30d", "note": "giveaway"}'

# Look up, extend, reset the device lock, revoke, delete
curl -s    "https://lumikey.cc/api/v1/manage/p_yourProjectId/keys/NEBULA-7KQ2M-X4PHD-9RT3C-WB6NE" -H "Authorization: Bearer lkm_yourToken"
curl -s -X POST "https://lumikey.cc/api/v1/manage/p_yourProjectId/keys/NEBULA-7KQ2M-X4PHD-9RT3C-WB6NE/extend" -H "Authorization: Bearer lkm_yourToken" -d '{"duration": "7d"}'
curl -s -X POST "https://lumikey.cc/api/v1/manage/p_yourProjectId/keys/NEBULA-7KQ2M-X4PHD-9RT3C-WB6NE/reset-hwid" -H "Authorization: Bearer lkm_yourToken"
curl -s -X POST "https://lumikey.cc/api/v1/manage/p_yourProjectId/keys/NEBULA-7KQ2M-X4PHD-9RT3C-WB6NE/revoke" -H "Authorization: Bearer lkm_yourToken"
curl -s -X DELETE "https://lumikey.cc/api/v1/manage/p_yourProjectId/keys/NEBULA-7KQ2M-X4PHD-9RT3C-WB6NE" -H "Authorization: Bearer lkm_yourToken"

Python

manage.py
import json
import urllib.request

BASE = "https://lumikey.cc/api/v1/manage/p_yourProjectId"
TOKEN = "lkm_yourToken"   # keep this on your server


def call(method: str, path: str, body: dict | None = None) -> dict:
    req = urllib.request.Request(
        BASE + path,
        method=method,
        data=json.dumps(body).encode() if body is not None else None,
        headers={"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json", "User-Agent": "MyBackend/1.0"},
    )
    with urllib.request.urlopen(req, timeout=10) as res:
        return json.load(res)


created = call("POST", "/keys", {"count": 1, "duration": "7d", "note": "order #1042"})
key = created["keys"][0]
print(key, call("GET", f"/keys/{key}")["key"]["state"])
call("POST", f"/keys/{key}/extend", {"duration": "3d"})

JavaScript

manage.mjs
const BASE = "https://lumikey.cc/api/v1/manage/p_yourProjectId";
const TOKEN = "lkm_yourToken"; // keep this on your server

async function call(method, path, body) {
  const res = await fetch(BASE + path, {
    method,
    headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
    body: body ? JSON.stringify(body) : undefined,
  });
  const data = await res.json();
  if (!res.ok) throw new Error(data.error?.message ?? res.statusText);
  return data;
}

const { keys } = await call("POST", "/keys", { count: 1, duration: "7d", note: "order #1042" });
console.log(keys[0], (await call("GET", `/keys/${keys[0]}`)).key.state);
await call("POST", `/keys/${keys[0]}/extend`, { duration: "3d" });

Webhooks

In a project's Integrations tab, add up to five webhooks (Starter and Pro). Paste a Discord channel's webhook link to get readable messages in Discord, with keys shortened, or your own https:// address to get signed JSON.

EventWhen
key.createdKeys made in the dashboard or with the API.
key.redeemedA key is used for the first time.
key.claimedSomeone got a free key from your key page.
key.device_addedA key is used on a new device.
key.resetDevices were cleared, by you, the API, Discord or the customer.
key.expiredA key ran out (sent within the hour).
key.revokedA key was revoked.
key.frozenA key, or every key, was paused or resumed.
key.blockedA check was refused because of a ban, a country rule or an old version.
key.sharedHeartbeats show a key running in more places than it allows.
key.suspiciousOne key is used from many countries or reset many times; it may be paused for you.
checkpoint.blockedA bypass attempt was stopped on your key page.
order.deliveredA shop order got its keys.
order.refundedA shop order was refunded or charged back, and its keys were handled.

Payload examples

Every request has this envelope. created_at is Unix seconds; data always includes project_id plus the fields below. Keys appear in full; a bulk action sends events for the first 20 keys only.

envelope
{ "event": "key.created", "project": "p_AbC123", "created_at": 1767225600,
  "data": { "project_id": "p_AbC123", "key": "NEBULA-7KQ2M-X4PHD-9RT3C-WB6NE", "tier": "premium", "source": "api", "test": false, "duration_seconds": 2592000 } }
data per event
key.redeemed       { "key": "…", "tier": "premium", "expires_at": 1769817600, "ip": "203.0.113.7", "country": "SE", "test": false }
key.claimed        { "key": "…", "ip": "203.0.113.7", "duration_seconds": 86400 }
key.device_added   { "key": "…", "devices": 2, "max_devices": 2, "ip": "203.0.113.7", "country": "SE" }
key.reset          { "key": "…", "by": "api" }                      // by: api, dashboard, discord or customer
key.expired        { "key": "…", "tier": "premium", "expired_at": 1767225600 }
key.revoked        { "key": "…", "by": "dashboard" }
key.frozen         { "key": "…", "frozen": true }                   // or { "all": true, "frozen": true, "keys": 120 }
key.blocked        { "code": "BLACKLISTED", "key": "…", "ip": "203.0.113.7", "country": "SE", "detail": "…" }
key.shared         { "key": "…", "live_sessions": 3, "max_devices": 1, "ips": ["203.0.113.7", "198.51.100.4"] }
key.suspicious     { "key": "…", "reason": "…", "paused": true, "signal": "…" }
checkpoint.blocked { "reason": "pasted_link", "step": 0, "ip": "203.0.113.7", "strikes": 1 }
order.delivered    { "shop": "sellauth", "product": "Pro", "order_id": "ORDER-1042", "quantity": 2, "email": "buyer@example.com", "keys": 2 }
order.refunded     { "order_id": "ORDER-1042", "shop": "sellauth", "action": "revoked", "keys": 2, "by": "…" }

Always verify the signature before acting on a webhook: anyone who learns your URL can send fake events otherwise. Use the raw request body exactly as received (not re-serialised JSON) and a constant-time comparison. The header is X-Lumikey-Signature: t=<unix seconds>,v1=<hex>; the algorithm is HMAC-SHA256 over the text <t>.<raw body> with the webhook's signing secret.

Each request is a POST with a JSON body {"event", "project", "created_at", "data": {…}} and these headers: X-Lumikey-Event, X-Lumikey-Timestamp and X-Lumikey-Signature: t=<timestamp>,v1=<hex>, where v1 is HMAC-SHA256 of timestamp + "." + body with the webhook's signing secret (shown once when you add it). Check the signature and that the timestamp is within five minutes, then answer with any 2xx status within five seconds.

verify a webhook (Node.js)
// Node.js
const crypto = require('crypto');
function verifyLumikey(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
  const expected = crypto.createHmac('sha256', secret).update(parts.t + '.' + rawBody).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 || ''));
}
verify a webhook (Python)
# Python (request.get_data() is the raw body in Flask)
import hmac, hashlib, time

def verify_lumikey(raw_body: bytes, header: str, secret: str) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    if abs(time.time() - int(parts["t"])) > 300:
        return False
    expected = hmac.new(secret.encode(), parts["t"].encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts.get("v1", ""))
verify a webhook (PHP)
<?php
// $raw = file_get_contents('php://input'); $header = $_SERVER['HTTP_X_LUMIKEY_SIGNATURE'];
function verify_lumikey(string $raw, string $header, string $secret): bool {
    parse_str(str_replace(',', '&', $header), $parts);
    if (abs(time() - (int)($parts['t'] ?? 0)) > 300) return false;
    $expected = hash_hmac('sha256', $parts['t'] . '.' . $raw, $secret);
    return hash_equals($expected, $parts['v1'] ?? '');
}
verify a webhook (C#)
// C#
using System.Security.Cryptography; using System.Text;
static bool VerifyLumikey(string raw, string header, string secret) {
    var p = header.Split(',').Select(x => x.Split('=', 2)).ToDictionary(a => a[0], a => a[1]);
    if (Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - long.Parse(p["t"])) > 300) return false;
    using var h = new HMACSHA256(Encoding.UTF8.GetBytes(secret));
    var expected = Convert.ToHexString(h.ComputeHash(Encoding.UTF8.GetBytes(p["t"] + "." + raw))).ToLowerInvariant();
    return CryptographicOperations.FixedTimeEquals(Encoding.UTF8.GetBytes(expected), Encoding.UTF8.GetBytes(p.GetValueOrDefault("v1", "")));
}

Each webhook sends at most 30 messages a minute, and repeated blocked attempts from one network are grouped. After 50 failed deliveries in a row a webhook switches off; sending a test turns it back on.

Ban list

One ban list covers all of your projects (dashboard → Ban list). Ban a device id, an IP address or a key, with a reason and an optional end date. Banned devices and networks get BLACKLISTED from key checks and loaders, and banned networks cannot get free keys from your key pages. Ban a device or IP straight from a key's details. Bans reach every server within a minute. With the API: GET, POST and DELETE /blacklist (see below).

SDKs and OpenAPI

Two single-file libraries with no dependencies. Download one and put it next to your code.

  • lumikey.mjs for JavaScript: Node 18 or newer, Deno, Bun, Electron and browsers.
  • lumikey.py for Python 3.8 or newer, standard library only.
  • openapi.json: the API described in OpenAPI 3.1, to generate a client for any other language or to import into Postman or Insomnia.

Each library has Lumikey for your app (key checks, heartbeat, device reset, key info), LumikeyAdmin for the Management API, and helpers to check signatures and webhooks.LumikeyAdmin and the signature helper need secrets, so use them on your own server only.

sdk
// JavaScript
import { Lumikey } from './lumikey.mjs';
const lk = new Lumikey({ project: 'p_yourProjectId', version: '1.4.2' });
const res = await lk.validate(key, hwid);
if (!res.valid) throw new Error(res.message);
lk.startHeartbeat(key, hwid, (r) => { console.log(r.message); process.exit(1); });

# Python
from lumikey import Lumikey
lk = Lumikey(project="p_yourProjectId", version="1.4.2")
res = lk.validate(key, hwid)
if not res["valid"]:
    raise SystemExit(res["message"])

Limits and errors

LimitValue
Key checks (validate, reset, key-info)120 requests a minute per IP address, and 120 a minute per key. Over that you get RATE_LIMITED (HTTP 429). Heartbeat: one call every couple of minutes per session is plenty.
Request bodyUp to 64 KB.
hwidUp to 128 characters.
nonce, keyUp to 64 characters.
Hosted fileUp to 10 MB, on Starter and Pro.
Keys per project1,000 on Free, 25,000 on Starter, 250,000 on Pro. Test keys do not count (25 at a time).
Devices per keyUp to 50.
Webhooks5 per project, 30 messages a minute each.
Import5,000 keys per file, 10 imports an hour.
Emailed keys200 emails a day per project, 5 a day per address.
Shop orders300 new orders an hour per project (Payhip and signed webhooks). Retries of an order already delivered do not count.
HTTP statusWhen
200Validate and reset answers, including invalid keys. Read valid / ok.
401Management API: missing or wrong token.
403, 404Hosted file: not a valid key, or no file uploaded.
413 / 415The body is too large, or its content type is not JSON, form or text.
429Rate limited. The body is still JSON, and Retry-After says how many seconds to wait. Every key API answer also has X-RateLimit-Limit and X-RateLimit-Window.
403 missing_scopeManagement API: the token does not have the permission this request needs.
5xxA problem on our side. Retry after a few seconds.

Error reference

Two kinds of failure exist. Key answers (validate, reset, key-info, heartbeat) are JSON with valid or ok and a code; see Example responses and the code table in each section. Everything else (Management API, request problems) answers an HTTP error in this form:

error body
{ "error": { "code": "missing_scope", "message": "This token cannot do that. It needs the \"update\" scope.", "requestId": "8a1f2c3d4e5f" } }
HTTPerror.codeMeaning and what to do
400validation, bad_requestA field is missing or wrong. The message names the field. Fix the request; do not retry unchanged.
401unauthorizedManagement API: missing or wrong token, or an unknown project (both look the same on purpose).
403missing_scopeThe token lacks read, create, update or delete for this request.
404not_foundNo such key, device or ban in this project.
413payload_too_largeBody over 64 KB.
415unsupported_media_typeSend JSON, form or text.
429rate_limitedToo many requests. Wait Retry-After seconds.
500, 502, 503server_errorA problem on our side. Retry after a few seconds. Quote requestId to support.

Every error response also has an X-Request-Id header with the same requestId.

Ad networks

Checkpoints are optional. Connect your own ad-network accounts under Ad networks, then add steps in the project's Checkpoints tab. You earn the ad revenue directly.

Linkvertise

In your Linkvertise publisher settings, turn on Anti-Bypassing and copy the 64-character token. Your publisher id is the number in your Full Script API snippet, for example linkvertise(123456, …). Lumikey creates a fresh dynamic link for every visitor and verifies the hash Linkvertise returns, which works only once and only for about 10 seconds.

Lootlabs

Copy your API token from the Lootlabs Advanced tab, then create a normal Lootlabs link with any destination and paste it into the checkpoint. For every visitor, Lumikey asks Lootlabs to encrypt a one-time destination and attaches it to your link, so the real destination never appears. Lootlabs has no server-side completion check, so for the strongest protection mix it with Linkvertise or Work.ink.

Work.ink

Create a Work.ink link with the key system turned on and set its destination to https://lumikey.cc/v/your-project?token={TOKEN}. Enter the link and its numeric link id in the checkpoint. Lumikey checks every token with Work.ink, deletes it after one use, and confirms it came from your link, from the same visitor, after the checkpoint opened.

Each step has a minimum time, so a visitor who finishes faster than a human could is blocked. Blocked attempts and the reason for each are listed on the project overview.

Discord bot

Link your Discord account under Account in the dashboard. Commands work in any server where the bot is added, in DMs, and as a user-installed app. Every reply is only visible to you. The bot can show information by default. To let it create, change or delete keys, turn on Manage keys from Discord under Account; this needs two-factor authentication on your account.

CommandWhat it does
/key generateCreate 1–50 keys with a duration such as 12h, 7d, 1mo or lifetime.
/key infoShow a key's state, expiry and device lock.
/key extendAdd time to a key.
/key resethwidClear the device lock.
/key revoke, /key deleteBlock or remove a key.
/project list, /project statsYour projects and their last 7 days.
/project purgeDelete expired and revoked keys.
/lumikey setupIn your own server: give a role to members who redeem a key (needs Manage Server). /lumikey unlink stops it.
/redeemFor your buyers, in your server: link their key to their Discord account and get the role. It is taken back when the key expires or is revoked.

SellAuth

  1. In SellAuth, open your product, set the deliverable to Dynamic, and paste the webhook URL from your project's Integrations tab.
  2. Copy your webhook secret from SellAuth into the same tab and choose how long purchased keys last.
  3. Each order is checked against its signature. Lumikey returns one key per item, and retries of the same order receive the same keys. Purchased keys start their timer on first use.

Purchased keys use the project's default devices per key, and the tier you set under Other shops.

Other shops

Payhip

In the project's Integrations tab, pick Payhip and paste your Payhip API key (Payhip → Settings → Developer). Add the webhook URL shown there to Payhip's webhooks. Lumikey checks Payhip's signature, creates one key per item and emails it to the buyer, because Payhip cannot show keys from a webhook. Each Payhip transaction gets its keys once.

Any shop (signed webhook)

For any shop or automation tool that can send a signed request. Set a signing secret in the Integrations tab, then send POST https://lumikey.cc/api/shop/<project id>/generic with a JSON body and the header X-Lumikey-Signature: sha256=<hex>, the HMAC-SHA256 of the raw body with your secret.

request and reply
{ "order_id": "ORDER-1042", "quantity": 2, "email": "buyer@example.com" }

200 OK
{ "ok": true, "order_id": "ORDER-1042", "keys": ["NOVA-…", "NOVA-…"] }

Add ?format=text to get the keys as plain text, one per line, for shops that show the reply to the buyer. A repeated order_id returns the same keys. Turn on Email keys to buyers to also email them when an email is sent.

Selling somewhere else entirely? Use the Management API to create a key when your own store takes a payment.

Plans and billing

Plans are paid with crypto. When you choose a method, Lumikey shows an exact amount and address; the unique amount identifies your payment, so send exactly that amount in one transaction. Payments are detected on chain and usually activate within a few minutes after the required confirmations. If you send from an exchange, add the withdrawal fee so the amount that arrives is exact.

You receive reminders 7 days and 3 days before your plan ends, by email and by Discord DM if your account is linked.

Troubleshooting

ProblemFix
KEY_INVALIDCheck the project id and the key. A key only works in the project that made it. Keys from the key page are shown exactly as they should be pasted.
HWID_MISMATCHThe key is locked to another device. Reset it in the dashboard, with /key resethwid, with the Management API, or let the user call Reset device.
HWID_REQUIREDSend a hwid, or turn the device lock off in Settings → Security.
error code: 1010Your HTTP library sent no User-Agent. Set one, for example MyApp/1.0.
RATE_LIMITEDYou are checking too often. Check at startup and every 5 to 15 minutes, not on every action. Cache the last good answer.
The browser blocks the request (CORS)Validate and reset allow browsers. The Management API does not: call it from your server.
The answer says valid but the key was revoked a minute agoAnswers are live. If you cache results in your app, shorten the cache.
A free key expired too soonFree keys last as long as your "free key length" setting. Change it under Settings. Paid keys can start their timer on first use.
Nothing happens after a checkpointThe same browser and network must finish every step, and each step has a minimum time. Blocked attempts and their reasons are on the project overview.
Still stuckEmail support@lumikey.cc with your project id and the request id from the error response (requestId).