Skip to main content

get_usage_stats

Function get_usage_stats 

Source
pub async fn get_usage_stats(
    configuration: &Configuration,
    reconcile: Option<bool>,
) -> Result<UsageStats, Error<GetUsageStatsError>>
Expand description

Returns the current plan name, billing period, plan limits, and usage counts. The response shape depends on the account’s billingSystem: * Stripe users: per-period usage.uploads / usage.profiles counters. * Metronome (usage-based) users: usage.connectedAccounts, usage.xApiCallsByOperation (per-operation X API call counts — resolve keys via GET /v1/billing/x-pricing), plus a spend block with currentPeriodCents, xSpendCents, and xSpendLimitCents. The legacy usage.xApiCalls 3-tier aggregate is still emitted for back-compat but excludes the $0.200 URL tier and any future tiers — new clients should consume xApiCallsByOperation only.