feat(grok): improve free quota probing and usage

This commit is contained in:
superman2003
2026-07-13 19:49:56 +08:00
parent 7d239d62e8
commit c896cacf6d
27 changed files with 2140 additions and 104 deletions
+37 -4
View File
@@ -1020,10 +1020,38 @@ export interface AntigravityModelQuota {
}
export interface GrokQuotaWindow {
limit?: number
remaining?: number
reset_unix?: number
reset_at?: string
limit?: number | null
remaining?: number | null
reset_unix?: number | null
reset_at?: string | null
}
export interface GrokBillingProductUsage {
product: string
usage_percent?: number | null
}
export interface GrokBillingSummary {
period_type?: string
usage_percent?: number | null
period_start?: string
period_end?: string
product_usage?: GrokBillingProductUsage[]
monthly_limit_cents?: number | null
used_cents?: number | null
included_used_cents?: number | null
billing_period_start?: string
billing_period_end?: string
used_percent?: number | null
plan?: string
status_code?: number
source?: string
fetched_at?: string
updated_at?: string
weekly_updated_at?: string
monthly_updated_at?: string
partial?: boolean
failed_windows?: string[]
}
export interface AccountUsageInfo {
@@ -1049,6 +1077,11 @@ export interface AccountUsageInfo {
grok_last_headers_seen_at?: string
grok_last_status_code?: number
grok_local_usage?: WindowStats | null
grok_local_usage_7d?: WindowStats | null
grok_local_usage_monthly?: WindowStats | null
grok_billing?: GrokBillingSummary | null
subscription_tier?: string
subscription_tier_raw?: string
ai_credits?: Array<{
credit_type?: string
amount?: number