Programmatic API Usage

May 30, 2026 | 5 min read

ThinCompileClient

from pyvorin_thin.client import ThinCompileClient

client = ThinCompileClient()
result = client.compile(
    source=source_code,
    function_name="main",
    backend="native",
    opt_level=3,
)

if result.success:
    print(f"Job ID: {result.job_id}")
else:
    print(f"Error: {result.error_message}")

compile_and_wait

result = client.compile_and_wait(
    source=source_code,
    function_name="main",
    timeout_seconds=120.0,
)
# result.artifact_bytes contains the compiled binary

Executing Compiled Artifacts

from pyvorin_thin.runner import ThinRunner

runner = ThinRunner()
output = runner.run_artifact(result.artifact_bytes, args=[])

LicenseClient

from pyvorin_thin.license_client import ThinLicenseClient

lic = ThinLicenseClient()
summary = lic.get_license_summary(license_key="PYV-XXXX")
print(summary['valid'], summary['tier'])

UsageClient

from pyvorin_thin.usage_client import ThinUsageClient
from pyvorin_thin.usage import build_usage_event

usage = ThinUsageClient()
event = build_usage_event(
    license_key="PYV-XXXX",
    workload_source=source_code,
    backend_used="native",
)
usage.send_usage_event(event)