usage_events table:
| Column | What |
|---|---|
id | Unique request ID (UUID, propagated to upstream) |
key_id | Which qlk_live_… was used |
user_id | The qlaud account (you) |
model_slug | Customer-facing model id (e.g. claude-sonnet-4-6) |
provider_slug | Where it actually routed (e.g. anthropic) |
input_tokens, output_tokens | From upstream usage field |
cost_micros | What we charged you (input × in_price + output × out_price, with 7% markup) |
latency_ms | End-to-end including upstream |
status | HTTP status code |
created_at | Server time |
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.