Skip to main content
Usage endpoints expose customer-facing spend and activity data for the authenticated organization. Use them to show consumption in your own admin UI, reconcile costs by period, and receive webhook callbacks when usage or balance state changes.

Usage snapshots

Retrieve summary totals or daily buckets for a requested period.

Usage webhooks

Subscribe an HTTPS callback to usage, balance, and billing event types.

Get current usage

Shell
curl "https://api.case.dev/usage/v1?granularity=summary" \
  -H "Authorization: Bearer $CASE_API_KEY"
By default, the endpoint returns the current calendar month through now. Pass periodStart, periodEnd, and granularity=daily to request daily buckets for a custom window.
Shell
curl "https://api.case.dev/usage/v1?periodStart=2026-06-01T00:00:00.000Z&periodEnd=2026-06-09T00:00:00.000Z&granularity=daily" \
  -H "Authorization: Bearer $CASE_API_KEY"
The response includes the requested period, organization balance in cents, service totals, cost-kind totals, optional daily buckets, and total cost in cents.

Create a webhook subscription

Shell
curl -X POST https://api.case.dev/usage/v1/subscriptions \
  -H "Authorization: Bearer $CASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "callbackUrl": "https://example.com/case-usage-webhook",
    "eventTypes": ["usage.recorded", "balance.low"],
    "signingSecret": "replace-with-a-secret"
  }'
Use subscriptions when your application needs to react to usage and balance changes outside the request path. You can list, update, delete, and test subscriptions through the Usage API reference.