Skip to content

[Feature]: Configurable Spending Cap Period for PAYG API Keys (Daily / Weekly / Monthly) #204

Description

@abnershang

Hi ZenMux team,

Currently, PAYG API keys support a spending cap, but it's a single lifetime/total limit. For production use, this isn't granular enough to control burn rate or contain runaway usage from bugs, loops, or compromised keys.

Request

Add a cap period selector alongside the spending cap amount, with options:

  • Daily — resets every 24h (UTC or user tz)
  • Weekly — resets every 7 days
  • Monthly — resets on calendar month or rolling 30d

Why it matters

  1. Blast radius control — a leaked or misbehaving key can't drain more than one period's budget before auto-cutoff.
  2. Budget predictability — teams can align API spend with monthly finance cycles without manual top-ups.
  3. Per-key experimentation — devs can issue short-lived daily-capped keys for tests/agents without risking the master budget.

Ideal UX

  • Dropdown: Cap period: [None | Daily | Weekly | Monthly]
  • Numeric field: Cap amount: $___
  • Display: Spent this period: $X.XX / $Y.YY · resets in Nd Nh

Nice-to-haves

  • Webhook/email alert at 80% of period cap
  • Per-key override of account-level defaults

Thanks — this would make PAYG keys much safer to hand to autonomous agents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions