Provides API usage for a given month.

Constructors

Properties

Methods

Constructors

  • Creates a new usage.

    Parameters

    • options: Partial<UsageOptions> = {}

      An object providing values to initialize this instance.

    Returns Usage

Properties

limit: number

The number of monthly API calls your plan entitles you to.

percentage: number

The percentage of the limit used since the beginning of the month.

throttled: boolean

Value indicating whether the requests are being throttled for having consistently gone over the limit.

usage: number

The number of calls (spam + ham) since the beginning of the month.

Methods

  • Creates a new usage from the specified JSON object.

    Parameters

    • json: Record<string, any>

      A JSON object representing a usage.

    Returns Usage

    The instance corresponding to the specified JSON object.