Usage Tracking API
Get usage summary
Returns a high-level usage summary for a period: total event count plus per-metric totals. Call it with a GET request to /usage/summary, authenticated with a restricted API key and the "usage:read" scope.
GET https://api.bearlumen.com/v1/usage/summary
Returns a high-level usage summary for a period: total event count plus per-metric totals. For cost totals, use GET /cost-data/summary. Requests count toward your per-API-key rate limit; sustained overruns return 429 with the standard error envelope.
Authentication and scopes
Authenticate with a restricted API key in the Authorization: Bearer <key> header. This endpoint requires the usage:read scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
start_date | query | string | Yes | Start of the summary period. ISO 8601 date or datetime (e.g. 2026-01-01 or 2026-01-01T00:00:00Z). Include an explicit UTC offset; date-only values are interpreted as UTC midnight. Must be strictly before end_date. |
end_date | query | string | Yes | End of the summary period. ISO 8601 date or datetime. Must be strictly after start_date. |
Response example
Success response (200):
{
"metrics": [
{
"event_count": 8,
"metric_name": "tokens",
"total_quantity": 31226000
}
],
"period_end": "2026-01-31T23:59:59.000Z",
"period_start": "2026-01-01T00:00:00.000Z",
"total_events": 8,
"user_id": "4f2a9c81-7d3e-4b6a-8c1f-5e9d2b7a3c14"
}
Error codes
Errors return the standard error envelope with a code, message, and a correlationId you can quote to support.
| Status | When it happens |
|---|---|
400 | Invalid request parameters. Check that start_date and end_date are valid ISO 8601 dates and start_date is strictly before end_date. |
401 | Missing or invalid API key. Send your key as Authorization: Bearer YOUR_API_KEY. |
403 | Forbidden. The API key is missing the usage:read scope; create or update a key with that scope. |
429 | Rate limit or plan quota exceeded. Slow down and retry after the current window resets. |
Rate limits and retries
Rate limit or plan quota exceeded. Slow down and retry after the current window resets.