AI Monetization Runtime ~10 minutes

Protect AI execution in production
with the AI Monetization Runtime.

Integrate Licenzy as an AI Monetization Runtime. Authorize before compute, meter usage, and synchronize commercial state from TEST to LIVE.

01Before you start

A short checklist, all in test mode.

Complete the checklist in the portal, then run the integration safely in test mode.

prerequisites · test mode
Ready to build
  • have itA verified Licenzy account & Project
    guide
  • have itA runtime API key (test mode)
    guide
  • have itA Stripe connection (test mode)
    guide
  • to doAt least one product defined
    guide
all steps are reversible in test mode
02Integration

Six steps from setup to live.

Verify, configure, checkout, authorize, meter, then switch from TEST to LIVE with a mode-specific API key.

  1. 01

    Verify & create a test key

    READY · ~2 MIN
    terminal
    # Complete account verification in the Licenzy portal first.
    export LICENZY_API_KEY="lz_test_xxx"
    # Keep the key server-side. Its mode comes from the key.
  2. 02

    Configure the tenant Runtime

    CONFIGURED · ~2 MIN
    portal
    # For this Project and TEST mode:
    # 1. Connect your tenant Stripe account.
    # 2. Configure the Stripe inbound webhook.
    # 3. Create a product_code for checkout.
  3. 03

    Create checkout on your server

    CHECKOUT · ~2 MIN
    app.ts
    const response = await fetch("https://api.licenzy.app/v1/checkout/session", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.LICENZY_API_KEY}`,
        "Content-Type": "application/json",
        "Idempotency-Key": checkoutRequestId,
      },
      body: JSON.stringify({
        subject_ref: "customer_123",
        product_code: "workflow.summarize",
      }),
    });
    
    const { checkout_url } = await response.json();
    // Redirect the customer to checkout_url.
    // Reuse checkoutRequestId when retrying this same checkout.
  4. 04

    Verify access after the webhook

    PROTECTED · ~2 MIN
    app.ts
    // Stripe -> Licenzy verified webhook -> entitlement update
    const response = await fetch("https://api.licenzy.app/v1/access/check", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.LICENZY_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ subject_ref: "customer_123" }),
    });
    
    const { allowed } = await response.json();
    if (!allowed) return deny();
  5. 05

    Compute, then consume usage

    METERED · ~2 MIN
    app.ts
    const result = await runModel(input);
    
    await fetch("https://api.licenzy.app/v1/usage/consume", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.LICENZY_API_KEY}`,
        "Content-Type": "application/json",
        "Idempotency-Key": usageRequestId,
      },
      body: JSON.stringify({ subject_ref: "customer_123", units: 1 }),
    });
    // Reuse usageRequestId when retrying this same usage event.
  6. 06

    Go live

    LIVE · ~1 MIN
    terminal
    export LICENZY_API_KEY="lz_live_xxx"
    # A LIVE key selects LIVE mode; request bodies stay the same.
03After integration

Every execution becomes observable.

Once integrated, Licenzy tracks authorization, usage, synchronization, and operational evidence. Runtime Intelligence interprets that evidence in the Portal without changing Runtime or commercial state.

AuthorizedMeteredObservableAudited
runtime · intelligence
Operational
  • access.checkgranted / denied decisions
    observed
  • usage.consumeretry-safe usage recording
    metered
  • entitlement.syncStripe and runtime state
    synced
  • runtime.healthoperational evidence
    observed
health · observability · operational evidence
Runtime connectedCompute protectedUsage meteredRuntime observableCommercial state synchronized
Ready when compute is

Commercially correct AI execution
starts before the model runs.

Put a runtime between payment and compute. Authorize with confidence, meter safely, and keep every execution aligned with commercial state.