Skip to main content

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.
Notes:
  • from and to must be provided together.
  • The date range is capped at 90 days.
  • source=all (default) includes all credit transaction sources.
  • source=frontend includes only rows where metadata.source = "frontend".
  • source=api_key includes only rows where metadata.source = "api_key".
Example request:

Response

Status: 200 OK Example response:
Errors:
  • 400 invalid date parameters, invalid source, or missing required range.
  • 401 unauthorized.
  • 500 internal error while computing usage.