AiQuotaSnapshot class

Current AI usage snapshot for the authenticated user.

The daily/weekly/total caps come from the entitlement (plan_catalog() + any active usage_boost grants). The counts come from the rate_limits table which the ai-proxy Edge Function writes to on every request.

Constructors

AiQuotaSnapshot({int? dailyCap, int? weeklyCap, int? totalCap, required int dayCount, required int weekCount, int totalCount = 0})
const

Properties

dailyCap → int?
Null = unlimited for that window.
final
dayCount → int
Requests used in the current local day (midnight-aligned, matches the window truncation in ai-proxy/rate_limit.ts).
final
hashCode → int
The hash code for this object.
no setterinherited
isExhausted → bool
True when the user has hit any cap.
no setter
isNearCap → bool
True when the user is within 10% of their cap (warning zone).
no setter
remaining → int?
The more-restrictive window's remaining budget. Returns null if all caps are unlimited.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
totalCap → int?
Non-null only for trial users: total AI messages allowed for the entire trial period. Null = no total cap (paid plans).
final
totalCount → int
All-time requests made by this user. Only meaningful when totalCap is non-null (trial users).
final
weekCount → int
Requests used in the rolling 7-day window.
final
weeklyCap → int?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited