parity

overview

the parity api decompiles lua 5.1–5.5 and luau bytecode back into readable source. it is free while in beta. there are no accounts and no api keys.

base urlhttps://api.useparity.lol
authnone during beta
max upload2 MB per request

endpoints

GET /v1/defaults

returns 200 json with the default option values.

POST /v1/decompile

decompiles one file. send the bytecode as the raw request body (Content-Type: application/octet-stream) or as a multipart file field. accepts raw bytecode, base64, or json-wrapped bytecode from .luac .luauc .txt .bin inputs.

fieldwheredescription
filebodythe bytecode, up to 2 MB
<option>queryany option below, e.g. ?methodSyntax=false

returns 200 with the decompiled lua source.

GET /v1/health

200 with queue depth and uptime.

options

all options are query parameters on /v1/decompile. omit a parameter to use its default.

parametertypedefaultdescription
inferNamesbooltruenames locals from how they're used (local Part = Instance.new("Part"))
debugNamesbooltrueuses variable names stored in debug info when present
identifierCaseenumautocasing for generated names: auto | pascalCase | camelCase | snake_case
generatedNamesenumdescriptivenaming style when nothing better is known: descriptive | typed | simple
inferTypesbooltrueinfers local types from the operations that use them
inferRobloxTypesbooltrueinfers roblox types from calls like Instance.new
typeAnnotationsbooltruewrites : type annotations where the type is known
methodSyntaxbooltruewrites methods as function t:m() instead of t.m(self, ...)
utf8booltrueutf-8 text in strings instead of byte escapes
headerInfobooltrueadds a comment header with the active settings and timing
commentsbooltrueadds informational comments to the output
functionLineInfoenumfunctions-- line: N markers on functions: off | functions | all
functionDebugNamesbooltrueuses function names stored in debug info when present
upvalueCommentsbooltrueadds a comment listing the upvalues each function captures
markInlinedCopiesbooltrueannotates functions the compiler duplicated by inlining
normalizeComparisonsbooltrueputs the variable on the left of comparisons (5 == x becomes x == 5)
compoundAssignmentsbooltruex = x + 1 becomes x += 1 (luau)
removeUselessForStepbooltrueremoves the step from numeric for loops when it's 1
mergeTableLiteralsbooltruerejoins table constructors the compiler split apart
parallelAssignmentsbooltruerebuilds a, b = x, y parallel assignments
inlineTemporariesbooltrueinlines single-use temporaries into the expression that reads them
sugarLocalFunctionsbooltruelocal f = function() becomes local function f()
autoCleanupenumautodead code cleanup level: off | auto | aggressive
removeUnusedLocalsboolfalseremoves locals that are never read
earlyReturnsbooltrueflattens nested ifs into guard clauses
removeUselessReturnbooltrueremoves a trailing bare return
interpolatedStringsbooltruerebuilds `{x}` string interpolations (luau)
loopCompletionDefaultsbooltruehides loop-completion bookkeeping the compiler inserts
mathConstantsbooltruewrites known constants as math.pi, math.huge, etc.
preferConstbooltruemarks never-reassigned locals <const> (lua 5.4+)
indentWidthint4spaces per indent level, 0–16

rate limits

per source ip. exceeding one returns 429 with a Retry-After header.

scopelimit
POST /v1/decompile300 requests / minute
POST /v1/decompile2 concurrent jobs

errors

statuscondition
400missing file or unreadable body
413file over 2 MB
415unsupported content type
429rate limited, see Retry-After
503job queue full, retry shortly