LuaSecureDocumentationDashboard ↗
For script owners / Documentation

Auth API reference (owners)

The two-request contract the loader uses.

Endpoint

POST https://luasecure.xyz/files/v4/auth
Content-Type: application/json
Accept: application/json

This endpoint validates script access. It is not an API for creating projects or licenses. Never send Supabase service-role credentials to clients.

FieldValue
script32-character lowercase hex file ID.
keyLicense key; empty string for keyless scripts. Maximum 256 characters.
hwidNonempty client hardware ID, maximum 256 characters. UNKNOWN-HWID is rejected.
ticketOmit for the first request. Include the returned ticket for the second.

1. Request a ticket

{
  "script": "YOUR_SCRIPT_FILE_ID",
  "key": "YOUR_LICENSE_KEY",
  "hwid": "YOUR_DEVICE_ID"
}

A successful HTTP 200 response:

{
  "success": true,
  "ticket": "ONE_TIME_TICKET",
  "code": "OK"
}

2. Exchange the ticket

Repeat the same fields and add ticket. Preserve the exact key and HWID strings. The ticket is bound to those strings and the script ID, expires after two minutes, and is consumed once. Access is checked again before delivery.

{
  "success": true,
  "payload": "ENCODED_PAYLOAD",
  "nonce": "RANDOM_NONCE",
  "sha256": "SHA256_OF_DECODED_SOURCE",
  "enc": "x1",
  "code": "OK"
}

The standard loader handles the x1 payload format. A server with LOADER_ENC=0 returns plain source in payload. Do not evaluate an API response as code.

Failures & limits

{
  "success": false,
  "message": "invalid license key",
  "code": "INVALID_KEY"
}

400 = malformed input, 403 = denied, 429 = rate-limited, 503 = unavailable. Inspect the JSON code even when HTTP is not 200. The limiter allows 60 auth requests per IP per minute per process; both exchange phases count, and a 429 includes Retry-After: 60.

See a request example or download the Postman collection.