List usage events
Returns a paginated list of usage events, newest first. Filter by contract, metric, date range, or rating status.
API key as Bearer token: Authorization: Bearer luc_live_.... Create keys in the dashboard under Settings > API Keys.
In: header
Query Parameters
Filter by contract external ID.
Filter by metric name.
Start of service period (YYYY-MM-DD).
End of service period (YYYY-MM-DD).
Filter by event status.
Number of items to return (1–100, default: 50).
Event ID to paginate after (cursor-based).
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/billing/usage?contract=acme-corp-2026&metric=revenue_amount_invoiced"{ "object": "list", "data": [ { "object": "usage_event", "id": "evt-2026-03-001", "contract": "acme-corp-2026", "metric": "revenue_amount_invoiced", "quantity": 10000, "fee_amount": 37.5, "applied_rate": 0.00375, "counterparty": "acme-markets", "rated_amount": 37.5, "invoice_number": "C2C-2026-0005", "service_period_start": "2026-03-25", "service_period_end": "2026-03-25", "ingested_at": "2026-03-05T11:21:59.868Z", "status": "rated" } ], "has_more": false, "total_count": 1}{ "error": "Missing API key"}Submit usage events POST
Submit up to 100 usage events in a single request. Each event is validated individually (schema and contract pricing program), persisted, rated immediately, and the corresponding invoice is updated. **Per-event validation:** Only the batch envelope (`events` array of 1–100 items) is validated up front. A malformed event (missing fields, invalid ISO timestamp, negative `quantity`/`fee_amount`, unknown contract or metric) is returned as `status: "rejected"` with its error without dropping valid events in the same batch. Rating priority: `fee_amount` (authoritative USD fee) → `applied_rate × quantity` → the contract usage rule. `applied_rate` is a decimal (0.0001 = 1 bps), not integer bps. `metric` is per contract — use `GET /v1/billing/contracts` → `metrics[]`. If that list is empty, add a usage rule first (`POST /v1/billing/contracts/{id}/pricing-rules`). See the Usage events guide. Events are idempotent — submitting the same `event_id` twice returns success without creating a duplicate.
Get usage summary GET
Returns aggregated usage counts, volumes, submitted fees, and rated totals grouped by day, contract, or both. Use this after daily syncs or backfills to verify ingested event counts and catch dropped days automatically.