pai
    Preparing search index...

    Type Alias BudgetResult

    The answer from GET and PATCH /key/budget: the key's spending cap for a period (a plan is the same cap with its own length) and its per-minute cap.

    type BudgetResult = {
        allowed_so_far_usd?: number | null;
        budget_usd: number | null;
        daily_allowance_usd?: number | null;
        days_left?: number | null;
        exhausted: boolean;
        pace?: "on_pace" | "ahead" | null;
        period_days?: number | null;
        period_ends?: string | null;
        period_started: string | null;
        rate_exceeded: boolean;
        rate_usd_per_min: number | null;
        spent_this_minute_usd: number;
        spent_this_period_usd: number;
    }
    Index
    allowed_so_far_usd?: number | null

    What spending evenly across the period would have used by now, in USD. null when no cap is set.

    budget_usd: number | null

    The most the key may spend in one period, in USD. null means no cap.

    daily_allowance_usd?: number | null

    What is left of the cap, spread over the days left, in USD. null when no cap is set.

    days_left?: number | null

    Whole days until the period ends, counting today, at least 1. null when no cap is set.

    exhausted: boolean

    True when the cap is set, the period is current, and the cap is used up.

    pace?: "on_pace" | "ahead" | null

    ahead when the key has spent more than an even pace allows by now (with a little slack), else on_pace. null when no cap is set.

    period_days?: number | null

    Length of the period in days. null means one calendar month.

    period_ends?: string | null

    When the current period ends. null when no cap is set.

    period_started: string | null

    When the current period began, as an ISO 8601 time. null when no cap is set.

    rate_exceeded: boolean

    True when the per-minute cap is set and used up for the current minute.

    rate_usd_per_min: number | null

    The most the key may spend in one minute, in USD. null means no per-minute cap.

    spent_this_minute_usd: number

    What the key has spent in the current minute, in USD.

    spent_this_period_usd: number

    What the key has spent in the current period, in USD.