Usage

Get account usage

Changed on

Returns the authenticated account's credit balance (and how much of it comes from the plan, top-ups and bonuses), plan status and price, a forecast of whether the balance lasts until the billing cycle ends at the current spend rate, and credit spend for a window (the current billing cycle unless start_time/end_time say otherwise) broken down by operation, by day, and by the chats and scheduled tasks that spent the most.

get/usage

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Query parameters

period, 'cycle' | 'today' | 'last_7_days' | 'last_30_days' | 'this_month' | 'last_month'

A named spend window in your time zone, instead of start_time and end_time (which it cannot be combined with): cycle (the current billing cycle, the default), today, last_7_days and last_30_days (each ending today), this_month or last_month.

start_time, string date-time

Start of the spend window, inclusive, as an ISO 8601 timestamp. Defaults to the start of the current billing cycle (the calendar month without a subscription).

end_time, string date-time

End of the spend window, exclusive, as an ISO 8601 timestamp. Defaults to the end of the current billing cycle. The window cannot exceed 366 days. credits, plan and forecast always describe the current billing cycle.

Response

Account usage

Usage required
object, string required
plan, union required

ID by default, full object when expanded

credits, union required

ID by default, full object when expanded

spend, union required

ID by default, full object when expanded

forecast, union required

ID by default, full object when expanded

Changes

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    2 more changes in this revision