Billing

Summarize billing events

Admin-only endpoint that aggregates billing events by plan, endpoint, and billable flag. Pass group_by=user to instead group by caller (user+plan) with the user's email attached, optionally narrowed with user_id or endpoint. Without an explicit time range, the summary is bounded to the last 30 days. The credits field sums charged credits only.

get/admin/billing/summary

Request

  • Base URL: https://api.crawlora.net/api/v1
  • URL: https://api.crawlora.net/api/v1/admin/billing/summary
  • Auth: API key in header x-api-key

Query parameters

fromstring

Created-at lower bound in RFC3339 format

tostring

Created-at upper bound in RFC3339 format

endpointstring

Normalized endpoint or API path

plan'Free' | 'Starter' | 'Growth' | 'Pro' | 'Business' | 'Enterprise' | 'Admin'

Billing plan

user_idstring

Restrict to a single caller by user id

exclude_user_idstring

Comma-separated caller user ids to drop from every aggregate (e.g. static:kuma-monitor); ignored when user_id is set

group_by'user'

Group by caller instead of plan+endpoint+billable

event_status'reserved' | 'charged' | 'non_billable' | 'failed'

Billing event status

billableboolean

Filter billable or non-billable events

Headers

x-api-keystring required

Admin API key required unless an Admin JWT is already present

Response

Billing summary

codeinteger
msgstring

Example response

{
  "code": 200,
  "data": [
    {
      "billable": true,
      "charged_requests": 1150,
      "credits": 3450,
      "email": "user@example.com",
      "endpoint": "google/search",
      "failed_requests": 5,
      "non_billable_requests": 45,
      "plan": "Pro",
      "requests": 1200,
      "user_id": "8f0b1c2d3e4f5a6b7c8d9e0f"
    }
  ],
  "msg": "OK"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.