METERING · FICTIONAL INVOICE INSPECTION
Agent billing: one invoice from validated usage
Follow individual meter records into invoice lines, one credit application and a separate collection/refund ledger.
Scroll the ledger diagram horizontally to inspect all three columns. Current totals and ledger events also appear as text below.
Your experiment
Follow accepted, duplicate, invalid and late events into the invoice. Check that the invoice gross equals applied credit plus collected cash plus outstanding balance.
Each observed ledger event takes three inspection seconds. The actual fictional event day is shown on the board. Invoice amounts are frozen at finalization even when later usage arrives.
Finalized invoice lines
| Line | Billable units | Amount |
|---|
Recent ledger events
Offline accounting mechanics with synthetic records and fictional CU rates—not a Stripe integration, Gemini price quote, real invoice, tax calculation or financial advice. Rates are integer minor units per 1,000 metered units. Each usage line and seat proration is rounded to the nearest minor unit, ties away from zero. The period is exactly 30 days; proration uses remaining days. Free input/output allowances are separate. Credits offset the finalized gross once; excess carries forward. Late events are held for another invoice, not billed here. Retry delays are fixed exponential days and create no new invoice. Refunds are separate entries bounded by collected cash and do not reopen the original invoice in this model. No tax, currency conversion, discounts, disputes, partial payments, provider fees or legal billing requirements are modeled. Metering concepts · Proration concepts.
Reconcile one invoice to its source events
Begin with the Usage group and compare the accepted events with the finalized invoice lines. Team A accepts evt-1, evt-2 and evt-3: together they contribute 3,000 input and 600 output units. A repeated evt-2 is ignored, the negative event is rejected, and evt-4 arrives after the day-32 cutoff. Team B records have separate ownership even when their identifiers match. The invoice totals 31.60 CU, consisting of 30.00 CU in seat charges and 1.60 CU in usage. Collection then applies 3.00 CU in credit and receives 28.60 CU after a failed attempt. Verify gross = applied credit + collected cash + outstanding balance. A later refund belongs in the cash ledger; subtracting it from gross would erase the original invoice history. Export the ledger to inspect exactly which events affected each stage.
Compute quantities before currency
This experiment follows synthetic meter records into one finalized invoice and a separate cash ledger. Nothing calls ADK, Gemini or a payment provider. Fixture tenant chooses whose records are accepted; the same event identifier in another tenant must not enter this invoice. Usage quantity multiplier changes every fixture quantity, including late and invalid records. Free input units and Free output units are separate allowances. Input rate and Output rate are fictional integer minor units per thousand billable units. One CU contains one hundred minor units. Each usage line rounds separately to the nearest minor unit, with exact ties away from zero. These are accounting mechanics, not current model prices or measured token usage.
Reproduce the default invoice
Seek to the end with the opening settings. Team A has 3,000 accepted input units and 600 output units. Subtracting 1,000 free input and 200 free output leaves charges of 100 and 60 minor units. Two initial seats cost 2,000; adding two halfway through the thirty-day period adds 1,000. Gross is therefore 3,160, or 31.60 CU. Customer credit reduces the amount collected to 28.60 CU. Include duplicate event fixture adds a repeated delivery; Deduplicate tenant + event ID ignores it. Turn deduplication off and gross rises to 32.80 CU. Disabling the duplicate fixture disables its deduplication switch because there is then no repeated delivery to compare.
Compare arrival cutoff and seat proration
Days of grace after day 30 controls finalization. At two grace days, the day-34 arrival is deferred; at four, it is included, giving 4,200 input units and a 32.58 CU gross invoice. Arrival exactly at the cutoff is processed before finalization in this fixture. Usage, Seats and Collection tabs only expose different controls; hidden groups retain their values. Include seat subscription enables Initial seats, Seats after change, Monthly seat price and Change day. The adjustment is the seat difference times price times remaining days divided by thirty. Set Seats after change to zero at day fifteen: the negative adjustment is 1,000 minor units and gross becomes 11.60 CU. With the subscription disabled, default usage alone costs 1.60 CU. This fixed-day rule is a deliberate simplification of production billing periods.
Separate invoices, credits and cash
Customer credit is applied once at invoice finalization. A credit of 5,000 covers the default gross and carries 1,840 forward, with no collection attempt. First N attempts fail and Maximum collection attempts control cash collection, not invoice creation. Three failures with two allowed attempts leaves 28.60 CU outstanding. Allow four attempts to collect it on the fourth. Requested refund is a separate cash entry: requesting 2,860 minor units after that payment succeeds, while 2,870 is rejected in full. A refund does not erase gross charges or restore customer credit. The fixture omits taxes, discounts, exchange rates, partial payments, disputes, provider fees and invoice corrections. Its retries use synthetic exponential day delays, not a payment-provider retry policy.
Inspect playback and retain evidence
Play and Pause advance or hold inspection time; this is not the fictional billing day shown on the board. Each ledger event occupies three inspection seconds. Next ledger event pauses and advances to the next event. Restart returns to the opening state while retaining parameters. Inspection time seeks directly; Speed selects one quarter, one half, normal or double playback. Parameter changes rebuild a paused experiment so its first event can be inspected. Final preview is explicitly the calculated end result, while the board, invoice lines and event trace follow the selected inspection time. Export fictional invoice JSON includes all settings, events and the final ledger for independent arithmetic checks. Capture baseline stores a comparison; Replace baseline updates it and Clear baseline removes it. Notes persist locally and Export notes downloads observations. Expand experiment enlarges the workspace. On a phone, scroll the diagram horizontally to read its native-size labels; totals and event descriptions remain available as text below.