Skip to content

v4.133.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 12:29
· 14 commits to main since this release

Prepaid metered usage under one cap

A hobby or team organization can now turn its pooled quotas into prepaid metered usage. Storage and vault bytes above the lease's included pools cost a published price per GB-month (prorated by the UTC day), API calls above the included amount a price per million, charged once a day from the organization's allowance and never past one monthly cap you set. A day the allowance or the cap cannot cover is not charged: metering suspends, nothing is deleted, everything keeps serving on the flat pool, and it resumes on the next covered pass. There is no invoice and no post-paid charge.

The same cap bounds a card standing order: save a card once through a setup link, and the card refills the allowance when it falls below a threshold, up to the cap's remaining room for the month. Three declines turn the order off.

SDK (@run402/sdk)

  • r.billing.getMetering(orgId): the metering block (cap, month spent, headroom, suspension, standing order, saved card as brand, last four and expiry).
  • r.billing.setMetering({ organizationId, enabled, capUsdMicros, standingOrder }): enable or disable metering, set the cap, and turn the standing order on or off with its threshold and recharge amounts.
  • r.billing.createCardSetup(orgId, { returnUrl }): a one-time browser link that saves a card for the standing order.
  • TierStatusResult gains metering and pool_usage.*_included; QuoteResult gains metered with the published prices.

CLI (run402)

  • run402 billing metering [<org_id>] [--enable --cap <usd> | --disable] [--standing-order on|off] [--threshold <usd>] [--recharge <usd>]: show or change the setting; dollar flags take whole or decimal dollars.
  • run402 billing card setup [<org_id>] [--return-url <url>]: print the setup link.

MCP (run402-mcp)

  • Reachable through run as the SDK methods above; the setup link is a one-time link, not a secret, so it stays on the sandbox surface.

Platform

  • PATCH /orgs/v1/:org_id/billing/metering and POST /orgs/v1/:org_id/billing/payment-methods/setup; a metering block on GET /tiers/v1/status and GET /orgs/v1/:org_id/billing; metered prices on GET /tiers/v1; metered_usage and standing_order_charge rows in billing history.
  • A quota refusal on a metered organization names the remedy: fund_allowance and raise_metering_cap ahead of renew_tier, with details.metering.
  • Four events: metering_cap_nearing (once a month at 80% of the cap), metering_suspended, metering_resumed, standing_order_failed.