All guides
Metering · 8 min

Usage events

Events are the only thing your code sends — one shape for tokens, API calls, compute, and seats.

Events are the only thing your code sends. Tokens, API calls, compute seconds, seats — one shape for all of them, aggregated in real time.

The event shape

customer, event, quantity, and an idempotency_key. Optional metadata (model, region, feature) becomes filterable dimensions in pricing and dashboards.

{
  "customer": "acme_labs",
  "event": "agent.run_seconds",
  "quantity": 9860,
  "metadata": { "model": "opus", "region": "eu" },
  "idempotency_key": "run_5521"
}

Delivery guarantees

Ingestion is at-least-once; the idempotency key makes it exactly-once in the ledger. Late events (up to 72h) are folded into the correct billing period automatically.

Batching & SDKs

Send up to 1,000 events per request, or let the SDKs buffer and flush for you.

import { Kribana } from 'kribana';

const kb = new Kribana(process.env.KRIBANA_KEY);
kb.track('acme_labs', 'gpt4o.completion_tokens', 48120);

Node, Python, Go and Ruby SDKs share the same three-line surface.