Integration API
Build your own in-app unlock UI. Your script asks for the key, AegisLoader checks it and binds it to the device.
Run this project
Select a project above to fill in its exact loader snippet. Free and Custom loaders are bare. Paid and Ad-supported snippets show where to put the user's license key. A key-system loader starts its uploaded key UI, not its linked scripts.
How your own key UI works
In Custom mode the loader is bare: it never draws a key prompt. Your script owns the unlock — your ScreenGui, your branding, your copy — and hands the key to the loader before running it. A TextBox, a key saved from last session, or an ad unlock you trigger yourself all work.
The loader still does the real check. It computes the device’s HWID, verifies the key with AegisLoader and binds it to that device on first use. Validating from your UI is for a friendly error message, not for security.
- Your UI gets a keyFrom a TextBox, a saved file, or the ad unlock.
- Optional: validate itCall validate so you can say “expired” or “locked to another device” in your own words.
- Set
getgenv().KeyThe loader reads it once when it starts. - Run the loader lineIt checks the key, binds the HWID and runs your protected build. A bad key stops it before any of your code executes.
Endpoints
Base URL https://api.aegisloader.com. These public endpoints do not use your dashboard account key. Never ship that account key. Validation, provider lists and polling return JSON; the gate link opens an HTML page in the user's browser.
Validation accepts any current project ID; a Free project answers that no key is required. Ad gates apply to Ad-supported, Custom or key-system projects. For shared keys, the samples use the key authority ID ; the payload loader keeps its own project ID.
Find the key authority
GET /api/keysource/{scriptId} returns ok, shared, key_system and the stored project mode. For a restricted script with shared: true, use that key-system ID for its key/ad UI. Otherwise use the script ID. Linking a Free project does not make it require a key.
Rate limits
Limits are per IP, so one user hammering a button can’t lock out everyone else. There’s no 429 — over the limit the endpoints fail soft: validate answers 200 with "ok": false and "reason": "key unavailable" (back off — don’t validate on a loop), and /gate/…/wait returns {} — the same as “not ready yet” — so just reconnect.
| Endpoint | Limit | Per | Notes |
|---|---|---|---|
| /api/validate | ~120 / min | IP | Validate once when the user submits a key, not on a loop. |
| /gate/…/wait | ~60 / min | IP | Each call long-polls ~25s, so one covers a long wait — reconnect when it returns {}. |
Errors
A bad key is not an HTTP error: validate answers 200 with "ok": false and a reason. A non-200 means the request itself was wrong or we couldn’t answer it.
| Status | reason | Meaning |
|---|---|---|
| 200 | ok: true | The key is good for this device — see validate for the fields. |
| 200 | key unavailable | Too many validate calls from this IP. Back off — don’t validate on a loop. |
| 400 | bad id | The {id} is malformed. Check you copied it from this page. |
| 404 | unknown project | No key system or Custom script has that {id}. |
| 503 | project unavailable | The current build or policy cannot be read safely. Retry later; do not label the user's key invalid. |
Error bodies vary: a rejected validation uses reason; HTTP failures can use error. Check the HTTP result and parse JSON safely. A successful transport call is not proof that a protected script finished loading.
Site activity and execution geography
Aggregates count accepted loader handshakes, not confirmed client execution. These routes do not expose IPs, project IDs, license keys or account records.
- Public totals. Executions in retained project records, protected projects, and projects with a start in the last 30 days.
GET /api/public/site-overview Accept: application/json
- Public geography. Counts by ISO country since collection began. Supported windows: 24h, 7d, 30d, all.
GET /api/public/execution-countries?range=7d Accept: application/json
- Private geography. Use only your account credential, in a server-side integration or your own signed-in browser. Never place this credential in a player script.
GET /api/account/execution-countries?range=24h Accept: application/json Authorization: Bearer <account-key>
Private results are limited to currently owned projects and never cached by shared caches. Public results are cached and rate-limited.
One key, every script
A key system is a key-free loader for your own key UI and an authority that issues keys. Attach ordinary scripts from Projects and choose System key or Own keys for each restricted script. Free scripts stay keyless. The key UI does not automatically run linked scripts: your UI or user calls each chosen script's loader separately.
Key source, per script
Each attached script chooses which keys it accepts. Change it from the script’s row in Projects.
- System key
- Accepts keys issued by the key system, including ad-earned ones. This is the default when you attach a script.
- Own keys
- Uses this script's own keys. A tracked shared key with a recorded origin for this script may still be honored after switching to Own keys; it does not gain access to other Own-key scripts. Older shared keys without a recorded origin do not inherit that exception. Expiry, bans and device locks still apply.
Running several scripts
getgenv() lives for the whole session, so set getgenv().Key once and every loader you run after it picks the key up. A script on its own keys needs its own key set before its loader runs.
Each connected script decides whether it takes the system key or its own. To check whether this key unlocks a particular script, call validate with that script’s own {id}.
The getgenv().Key convention
The loader reads getgenv().Key once, when it starts (a plain global Key works too). Set it, then run the loader line — in that order, in the same script.
| Value | What the loader does |
|---|---|
| "A3KP9-…" | Trims whitespace, verifies the key and binds it to this device on first use. Runs your script if it’s valid. |
| nil / empty | Free/key-system UI loaders do not need a key. A restricted loader may try an enabled saved resume credential; an Ad-supported loader can offer its configured browser gate. Your Custom UI should collect a key first. |
| invalid key | A restricted loader must not grant access with an invalid, expired, banned or device-mismatched key. Use validation to show a friendly message in your own UI; do not depend on console output or its wording. |
You don’t send the HWID
RbxAnalyticsService:GetClientId(), the same value the loader uses. The browser ad flow mints an unbound key; a device-locked key binds on its first accepted loader use. Floating keys do not bind.Keys bind to the first device that runs them. If a user moves to a new PC, reset the key’s device from Users & Keys — don’t hand out a second key.
Full example: key prompt with a saved key
This example checks a saved key before starting. An expired or temporarily uncheckable key falls back to the prompt without deleting its saved copy. File, JSON and network errors are handled. Its optional file stores a raw license key, not encryption; never store your dashboard account key there.
The example catches transport, compilation and thrown runtime errors. A clean return from a loader is not a public success acknowledgement; do not use it as proof that a session was authorized or a payload finished.
Validate a key
Checks a key for one device without running anything. Doesn’t bind the key — the loader does that on first run.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | path · string | required | Key system or Custom script ID. Yours: |
| key | query · string | required | The license key the user entered, URL-encoded. Format XXXXX-XXXXX-XXXXX-XXXXX. |
| hwid | query · string | optional | RbxAnalyticsService:GetClientId() — the device the loader binds keys to. Omit it and the check can’t evaluate device binding: ok then reflects only the key’s stored state (expiry, ban, activated) and key locked to another device is never returned. Send it to learn whether this key would actually run on this device. |
Request
Responses
| Field | Type | Description |
|---|---|---|
| ok | boolean | Whether this read-only key check passed. The loader still performs live authorization, binding and session checks. |
| mode | string | The mode stored on the key for a keyed success, not necessarily the selected project's current mode. Custom is the dashboard label for wire value api. The example is illustrative, not a prediction about a particular key. |
| expires | number | Unix timestamp in seconds when the key stops working. 0 for keys that never expire. |
| activated | boolean | Whether this check sees an effective stored device binding. Floating keys report false; false does not prove a key was never used. The bound device ID is not returned. |
| rt | string · optional | An opaque resume credential when enabled and a submitted raw key is valid. Request it with the same device HWID the loader uses. Treat it as a bearer secret tied to that key authority and device; live expiry and revocation still apply. Pass it to a compatible loader as getgenv().Key, not to /api/validate as a raw key. Do not delete a saved carrier on a transient failure. |
| reason | string | A rejection reason when false, or no key required on a keyless Free success. That keyless shape omits expires, activated and rt. |
Reasons
| reason | What happened | Tell the user |
|---|---|---|
| key expired | The key's nonzero expiry was reached. An owner can also issue non-expiring keys. | “Your key expired. Get a new one.” |
| key banned | The key record is banned. Device-ban enforcement belongs to live delivery and is not implied by this reason. | “This key is banned.” |
| key locked to another device | The key is bound to a different device. | “This key is locked to another device.” |
| invalid key | No such key for this ID — typo, wrong format, or a key from another script. | “That key doesn’t exist. Check for typos.” |
| key required | The request reached validate with an empty key parameter. | “Enter your key.” |
| key unavailable | Transient server read error, or you hit the ~120/min per-IP rate limit. Retry. | “Try again in a moment.” |
Validate, then run
Wrap the request in pcall — HttpGet throws on network errors and on non-200 responses.
~120 requests a minute per IP. Validate when the user submits, not on a loop.
Set up Ad Rewards
- Copy the Target URL from Ad RewardsSelect your Ad-supported project or key system. Open the provider tab, switch it on, and copy the Target URL. Set up ads once on the key system for its attached Custom scripts.
- Create the link on the provider’s sitePaste the Target URL into the destination field. Save or publish the link there. Copy the published link and paste it back into the provider’s link field in Ad Rewards.
- Set up verificationUse the steps below for your provider. Two or more ads need a verified completion for every ad.
- Choose the ad count and key lifetimeUnder Ads required, pick a number from 1 to 5. For multiple ads, use automatic order, Set custom order, or Free choice. Players can repeat a provider. If users choose in your own UI, that chooses ad 1 only. Set License duration.
- Save, test and shareClick Save, then Preview. Finish the ads in the same browser and check that the last ad gives you a key. The Gate URL is the link you give players.
Verification by provider
Linkvertise: Click Post & earn, then choose Link. In publisher settings, open Anti-Bypassing. Copy its token into Anti-bypass token in Ad Rewards. The setting can affect other Linkvertise links. Linkvertise guide.
LootLabs: Turn on Advanced Anti-Bypass in Ad Rewards and copy the private Postback URL. In the settings for that same LootLabs link, paste it into Postback URL. Select Click ID and Unique ID. Leave IP off. Check that the preview includes click_id={CLICK_ID} and unique_id={UNIQUE_ID}, then save in LootLabs. If you’re still waiting for confirmation, check that both options stayed selected and start a fresh unlock. The separate Anti-Bypass option encrypts the return URL; it does not verify completion. LootLabs guide.
Work.ink: Keep hash={TOKEN} in the destination. Go to For Developers → Key System to set up completion tokens. In Ad Rewards, turn on Anti-Bypass and paste your Work.ink account API key. Work.ink guide.
Keep provider credentials and the Postback URL private. Neither belongs in your script.
Ad unlock from your own UI
Use the configured ad provider for your project, started from your button. You send the user a gate link; they finish the required ad or ads in their browser; your script long-polls until the key is ready. The link, anti-bypass check and key duration come from Ad Rewards — set those up first.
- Make a tokenAny random string, unique to this user this run. It ties their browser unlock to your waiting script.
- Send them the linkExecutors can’t open a browser, so
setclipboardthe gate link…/gate/{id}={token}and tell them to paste it. They pass a human check and the ad step. - Wait for the key
GET …/gate/{id}={token}/waitholds open ~25s and returns{"key":…}the moment they finish — or{}on timeout, so just call it again. - Run with the earned keySet
getgenv().Keyand run the chosen script's loader. The issued key is initially unbound; normal device locking applies on its first accepted use.
The gate link
The URL the user opens in a browser. For a connected script using System key, use the key system ID. For a script using Own keys, keep the script ID, even when its ad settings come from the key system.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | path · string | required | Key system or Custom script ID. Yours: |
| token | path · string | required | Use 1–64 alphanumeric characters, fresh per attempt. The example removes hyphens from a generated GUID. Keep the token private: it connects the browser unlock to your waiting client. |
Offer a provider choice in your UI
With two or more ad providers enabled (Linkvertise, LootLabs, Work.ink), you can let users pick the first ad in your own UI instead of on the gate page. Later ads follow the route set in Ad Rewards. Turn on “Let users choose the ad in your own UI” in Ad Rewards, read the enabled providers, and show a button per provider that opens its gate link.
Public, read-only. Lists the ad providers enabled for this key system. Yours:
{
"providers": [
{ "id": "linkvertise", "name": "Linkvertise" },
{ "id": "lootlabs", "name": "LootLabs" },
{ "id": "workink", "name": "Work.ink" }
],
"gate": "https://api.aegisloader.com/gate/{id}",
"ttl": 86400,
"pick_in_ui": true
}Send the user to the gate link for their choice — the same gate link, with ?provider={id} appended:
When own-UI choice is enabled, a valid selected provider skips the extra chooser. The human check is still required before continuing to the provider. Without a valid selection, the browser gate offers the available providers; one enabled provider needs no chooser. An unconfigured gate cannot unlock keys.
After they finish, poll /gate/{id}={token}/wait for the key exactly as below — the flow from here is identical no matter which provider they chose.
Wait for the key
A request can wait up to about 25 seconds for a key. Timeout, throttling or an unavailable claim can return {}, sometimes immediately. Back off before reconnecting; never tight-loop on an empty or failed response.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | path · string | required | Same ID you built the link with. |
| token | path · string | required | The same {token} you built the link with. |
Luau: “Get key” button
Make a token, copy the gate link for the user, then long-poll /wait with game:HttpGet until the key arrives — no executor request needed, since the whole flow is plain GETs.
Each /wait covers a ~25s wait — loop the reconnect, not a tight poll. The gate link stays valid a few minutes.