Customers
September so far, read from the meter as reports arrive. The quota bar is the monthly_tokens view, which the gateways read once a minute.
Requests an hour, by gateway
From the meter's 1-hour windows. A late report lands in the hour its request happened, so a gap fills in when a link comes back.
Each gateway on its own scale. Times are UTC. Hover or use the arrow keys for an hour's count.
What happened
Newest first.
Gateways
Each gateway serves its customers and reports every request to the meter. A client may retry through either one.
| Gateway | Link to the meter | Delivered | Waiting | Retries |
|---|
Delivered and waiting count reports to the meter. A client that gets no answer in time sends the same request again, with the same request id, and the retry may land on the other gateway. eu serves Juniper, Northgate and Harbor; us serves Quarry, Maple and Sundial.
What the meter refused
Every refused report is counted in usage_refused, by reason, customer, model and gateway.
| Reason | What it means | Reports |
|---|
September invoices, so far
Read from the meter's precomputes and the price list with one SQL view, in billionths of a dollar, and rounded to the cent only here.
| Customer | Plan | Requests | Tokens in | Tokens out | List price | Discount | Due | Model cost | Margin |
|---|
Example list prices per million tokens, in and out: small $0.30 and $1.20, medium $2.50 and $10, large $12 and $48. Pro pays list, Enterprise 25% less, Free nothing. Model cost is half of list. Customers and prices are invented.
The policy
A short policy says what to count and when a month closes. The compiler turns it into the SQL this page runs; the billing tables sit next to it in the same file.
Change the policy and compile it with the real compiler, built for the browser (about 1.3 MB to download). The running demo keeps its own policy.
Results
Finishing the month at full speed, then checking every invoice.
Every invoice, checked
The meter against a recount: separate code that takes the gateways' reports in the order they were sent and applies the policy's three rules itself. It never reads the meter.
After the dispute window
The policy keeps every September request until 90 days after the close, so any invoice line can be disputed and checked request by request. Here is a copy of the file fast-forwarded to that day and distilled.
What is in the file
Ask the meter
The meter is a plain SQLite file, with the billing tables beside it. Pick a question or write your own, then press Run (or Ctrl+Enter, ⌘+Enter on a Mac). It reads while the month is paused or finished.