usage_events table:
You read this back via two endpoints.
GET /v1/usage — rollup
Default window: month-to-date. Override with from_ms / to_ms.
GET /v1/keys/:keyId/usage — drilldown
Single key. Includes the 100 most recent events.
Pricing & markup
The catalog has the customer-facing price for every model (qlaud.ai/models). Those prices already include our flat 7% markup on top of upstream cost. Socost_micros is what you owe us. Bill your end-users anything you
want on top — the difference is your margin.
Invoicing pattern (Stripe)
End of month, pull/v1/usage, fold each by_key row into a Stripe
InvoiceItem:
InvoiceItems into the customer’s next invoice. Set
their subscription’s billing cycle to monthly and you’re done.
See the full walkthrough in Per-user billing.