Overview
Return daily credit usage totals for the authenticated user.GET /api/v1/credits/usage
Purpose: return credit usage metrics for a user. Query parameters:from(RFC3339 timestamp, required): start timestamp for the series window.to(RFC3339 timestamp, required): end timestamp for the series window.source(string, optional): source filter. Supported values:all(default),frontend,api_key.
fromandtomust be provided together.- The date range is capped at 90 days.
source=all(default) includes all credit transaction sources.source=frontendincludes only rows wheremetadata.source = "frontend".source=api_keyincludes only rows wheremetadata.source = "api_key".
Response
Status:200 OK
Example response:
400invalid date parameters, invalidsource, or missing required range.401unauthorized.500internal error while computing usage.