Skip to content
Usage-based billing

Meter usage in exact units, even when the price is a fraction of a cent

Usage pricing produces many small charges, often priced below the smallest currency unit. Choose a precision that fits your pricing, post charges as exact integers and batch them with explicit atomic behaviour.

Custom precisionBulk transfersReferencesPreviews
usage · acct42 · 2026-10-10precision 1000000
  • API calls0.000400 USD
    precise_amount 400
  • Storage0.018250 USD
    precise_amount 18250
total 18650 units atomic batch
Illustration using the values in the API example below.
The problem

Where this usually goes wrong

  • Prices smaller than a cent

    A per-call price of 0.0004 USD doesn't fit in cents, and floating-point arithmetic rounds it differently depending on where the sum happens.

  • Pipelines replay events

    Metering systems retry and replay. Without idempotency enforced at the ledger, a replayed batch bills the customer twice.

  • Credits, holds and settlement disagree

    Prepaid credit, reservations against it and end-of-period settlement need to read from one consistent balance, not three services.

API example

Two metered charges, applied together or not at all

Micro-dollar precision records 0.0004 USD of API calls and 0.01825 USD of storage exactly. atomic: true applies both or neither.
POST /transactions/bulkRequest shape
{  "atomic": true,  "skip_queue": true,  "transactions": [    {      "source": "bln_<customer_credits>",      "destination": "bln_<usage_revenue>",      "currency": "USD",      "precise_amount": 400,      "precision": 1000000,      "reference": "usage-acct42-2026-10-10-api-calls"    },    {      "source": "bln_<customer_credits>",      "destination": "bln_<usage_revenue>",      "currency": "USD",      "precise_amount": 18250,      "precision": 1000000,      "reference": "usage-acct42-2026-10-10-storage"    }  ]}

Request shape from the v1.0.0 API. IDs in angle brackets are placeholders.

Put a provable ledger under your money movement

Start with the open-source core, or let the LedgerForge team run it for you on dedicated infrastructure.