Ruba product infrastructure

Carry one usage event all the way to invoice

Record activity, turn it into a customer quantity, and price that quantity at renewal.

Read the technical guide

Your application reports what happened. A meter decides what counts and how it aggregates. A metered price turns the result into an invoice line.

Live ledger engine

One event, one billing path

The event remains the immutable source record while the meter and price define its commercial meaning.

TRANSACTION RECORD● VERIFIED
Eventcustomer + name + metadata
Meterfilter + aggregation
Customer quantitycurrent measured value
Invoicequantity × metered price

Capability matrix

Select the number the meter should produce

Several meters can read the same event stream, so pricing can evolve without new instrumentation.

Count

Number of matching events

Useful for requests, jobs, generated items, or other per-action billing.

Sum

Total of one metadata value

Add tokens, bytes, seconds, or another numeric property.

Average, minimum, maximum

Derived numeric measure

Measure values such as typical size, minimum use, or peak concurrency.

Unique

Distinct metadata values

Charge by unique user, project, repository, document, or another key.

Execution workflow

Billing happens without a parallel system

  1. 01

    Ingest

    Send an immutable event with the customer ID and relevant metadata.

  2. 02

    Aggregate

    The matching customer meter updates as qualifying events arrive.

  3. 03

    Close the period

    Ruba reads the final quantity for the subscription billing cycle.

  4. 04

    Create the line item

    The metered price converts usage into the next invoice amount.

  5. 05

    Apply commerce rules

    Tax, discount, renewal, and payment behavior continue through the normal order flow.

Deep dive specifications

Send usage from the source that has it

  1. 01

    LLM clients

    Capture prompt and completion usage from compatible model responses, including Vercel AI SDK flows.

  2. 02

    Streams

    Measure chunks, bytes, or elapsed duration from a streaming response.

  3. 03

    S3-compatible storage

    Record transferred bytes or object operations for uploads and downloads.

  4. 04

    Timed work

    Measure wall-clock time spent inside a function, job, or session.

  5. 05

    Direct events

    Post through the SDK when a specialized helper does not fit the source.

01

Event ingestion

Accept usage records from direct SDK calls or supported strategies.

02

Customer meters

Maintain a current per-customer value as activity arrives.

03

Invoice connection

Bill the measured quantity through a product’s metered price.

04

Customer state

Read active meters and balances together through the API.

The meter supplies the signal, not the product rule

Ruba exposes current usage through the API and Customer Portal, but it does not block product access when a quota is crossed. Your application decides whether to stop, prompt for an upgrade, draw prepaid credits, or let the amount become billable overage.

Build with Ruba

Ingest the first billable event

Define its meter, connect a price, and use the measured result at renewal.