Skip to main content

Runtime enforcement for usage-based products

Decide before billable work runs.

Before an API call, agent run, generation, render, export, or job begins, Valqio checks the customer’s plan, credits, limits, and live usage. It can allow the action, block it, or reserve credits until the outcome is known.

Runtime decisionProduction · 8 ms
Allowed
Product actiongenerateReport
Customerworkspace_acme
runtime-snapshot.42
  1. 01PlanGrowth v7
  2. 02MeterreportExports
  3. 03Usage2,576 / 3,000
  4. 04Mutation+1 report
DecisionAllowed

+1 report

Request req_9K2Evidence ev_9K2Idempotency report-export:req_9K2

Product view 1 of 4: Runtime Decision.

Runtime infrastructure

Stop owning the enforcement layer.

Your billing system turns usage into invoices and collects payment. Valqio decides whether the next product action can run, then records what happened.

Run a live decision
Runtime monetization ownership
ResponsibilityInside your productWith Valqio
Decision logic

Product conditionals spread across application code.

Pre-action decisions for named product actions.

Customer state

Customer quota and credit state in app-owned paths.

Published customer terms, quotas, credits, and usage state.

In-flight work

Reservation, commit, and release handling around uncertain work.

Reserve before work, then commit or release the usage transaction.

Retries and races

Idempotent retry and concurrency behavior in each product service.

Idempotency keys, retry-safe settlement, and lifecycle state for concurrent attempts.

Explanation

Support reconstructs why a product action ran or was blocked.

Decision evidence with inputs, outcome, reason, and settlement trail.

Billing handoff

Outbox and downstream billing synchronization.

Reconciliation-ready usage and evidence for the billing system.

Valqio does not run the product action or collect payment. It decides whether the action should run and manages the usage transaction around it.

Runtime decisions

Decide before the action starts.

Resolve customer terms and live usage state before the product action starts, then return an inspectable outcome.

  • Product actiongenerateReportreq_9K2
    Customerworkspace_acmePublished snapshotruntime-snapshot.42
    1. 01PlanGrowth v7
    2. 02MeterreportExports
    3. 03Usage2,576 / 3,000
    4. 04Mutation+1 report
    Outcome · ProductionAllowedALLOWED

    +1 report

    Decide from current customer state.

    Resolve Growth v7, reportExports usage, and the published snapshot before generateReport runs.

  • Same requestreq_9K2Replayed safely
    Idempotency keyreport-export:req_9K2
    1. 1
      Attempt 1Allowed · +1 report
    2. 2
      RetryReplayed same result
    3. 3
      Failed reserved workRelease with the same key
    Retry mutation0 additional reports

    Retry without spending twice.

    Use the same idempotency key when you retry. Valqio returns the same decision without spending twice, then commits successful usage or releases the reservation if the work fails.

  • Decision tracereq_9K28 ms
    Action
    generateReport
    Plan
    Growth v7
    1. 1Snapshotruntime-snapshot.42
    2. 2MeterreportExports
    3. 3Usage2,576 / 3,000
    ALLOWEDAllowedev_9K2

    The reason stays attached.

    Inspect req_9K2, ALLOWED, ordered checks, and ev_9K2 after the product action finishes.

runtime decisions feature 1 of 3: Decide from current customer state..

Credit lifecycle

Reserve credits before a long-running action.

Hold the 120 credits before renderVideo starts, then commit successful work or release failed work with the same transaction evidence.

  • Hold before the action

    Reserve 120 credits before renderVideo starts.

  • Settle once

    Commit completed work or release failed work with stable idempotency keys.

  • Keep the trace

    Keep reservation, request, settlement, and evidence identifiers available for inspection.

Credit transaction · workspace_acmerenderVideoCommitted
Reserved before work120 credits
Available
2,380 credits
Expires
15 minutes
  1. Reserved120 credits
  2. Product workrender complete
  3. Commit / release120 credits
Reservation
rsv_01J8K8
Idempotency key
video-render:req_9K3
Evidence
ev_9K3

Published runtime model

Publish the model your runtime enforces.

Connect actions, meters, plans, assignments, and customer terms in the published snapshot your runtime reads.

  • Runtime modelPublished · v42
    ActiongenerateReport
    Meterreport-exports
    PlanGrowth v7
    Published snapshotruntime-snapshot.42

    Connect product actions to commercial state.

    Connect generateReport to report-exports, Growth v7, and runtime-snapshot.42.

  • Customer TermsPublished · v42
    Customerworkspace_acme
    AssignmentGrowth v7
    Customer override5,000 reports
    Productionruntime-snapshot.42

    Apply customer overrides without code branches.

    Assign workspace_acme and its 5,000-report customer override in the runtime model.

  • Publish targetPublished · v42
    ActionsgenerateReport
    Metersreport-exports
    Published snapshotruntime-snapshot.42
    Production runtime reads this version

    Version what the runtime serves.

    Publish the snapshot that product requests read instead of scattering conditions across routes and jobs.

published runtime model feature 1 of 3: Connect product actions to commercial state..

Metering and usage

Meter what actually ran.

Record usage with the matching meter operation, while keeping enforcement in the pre-action decision.

  • Operations for work that ranreport-exports
    • Counterincrement discrete units
    • Identitytouch or assign members
    • Gaugeset the current reading
    • Concurrent leaseacquire then release capacity
    Record product facts. Do not turn passive events into allow decisions.

    Record work using the right meter.

    Use counter, identity, gauge, or concurrent-lease operations for the product fact that actually ran.

  • report-exportsRead-only summary
    Current usage2,576of 3,000
    Remaining
    424
    Mutation
    No usage change
    Window
    Current billing period

    Read usage without changing it.

    Read the current report-exports total without mutating usage or making an allow decision.

  • report-exportsReady for reconciliation
    1. 1
      DecisionAllowed before the product action
    2. 2
      Usage+1 report after work ran
    3. 3
      Evidenceev_9K2
    4. 4
      BillingInvoices and collects downstream

    Keep billing downstream.

    Prepare usage and evidence for reconciliation. Billing still invoices and collects.

metering and usage feature 1 of 3: Record work using the right meter..

Decision evidence

Every runtime decision leaves evidence.

See why an action was allowed or blocked, what balance changed, and whether a retry deducted credits twice. Follow a reserved action through success or failure.

  • Find the attempt

    Use req_9K2 to find the decision record for a product attempt.

  • See the reason

    Read ALLOWED and the ordered plan, meter, and usage checks that produced it.

  • Follow settlement

    Follow the request and evidence trail through reservation, commit, or release where work needs settlement.

Request / actionreq_9K2generateReport
Customer
workspace_acme
Plan
Growth v7
Environment
Production
Latency
8 ms
  1. 1Snapshotruntime-snapshot.42
  2. 2MeterreportExports
  3. 3Usage2,576 / 3,000
Result · ALLOWEDAllowed
Evidence
ev_9K2
Settlement
Linked by report-export:req_9K2

Runtime monetization

Stop hardcoding how your product monetizes.

Define the offer once. Apply it before each product action runs. Keep every decision and state change explainable.