Example
A customer is on a plan with 1,000 API calls included per month and $1 per 1,000 additional calls. You set a spend limit of 5,000 on theapi_callsfeature. The customer can use up to 6,000 total API calls (1,000 included + 5,000 overage), and is blocked after that.
Prerequisites
Spend limits apply to usage-based features — features with overage pricing that allow usage beyond the included amount. If a feature doesn’t allow overage, spend limits have no effect. You’ll need a plan with a usage-based price on the feature you want to cap:- CLI
- Dashboard
autumn.config.ts
atmn push. Then configure spend limits per customer via the API (see below).Configuring spend limits
Spend limits are set per-customer (or per-entity) via the API, not at the plan level. Update a customer’sbillingControls to add spend limits:
Spend limit fields
The
overage_limit is measured in the same units as the feature’s balance — not in dollars. For example, if your feature is “API calls”, an overage_limit of 5,000 means 5,000 additional API calls beyond the included amount.Skipping overage billing
Setskip_overage_billing to true on a spend limit to let a customer use overage without being charged for it. Usage tracking, check responses, and end-of-cycle balance resets all behave as normal — the overage line items are simply never added to the customer’s invoice.
enabled and have a feature_id. It can also be set on an entity — resolution is per-feature, and the nearest configuration wins: entity-level spend limit, then customer-level, then plan-level billing controls.
How it works
- The customer uses a usage-based feature and begins accumulating overage beyond their included amount
- On each
checkortrackcall, Autumn computes total overage across all of the customer’s usage-based entitlements for that feature - If the total overage would exceed the
overage_limit, Autumn blocks the usage —checkreturnsallowed: false, andtrackwill not deduct beyond the limit
Spend limits aggregate overage across all of the customer’s entitlements for a given feature. If a customer has the same feature on multiple plans (e.g., a base plan and an add-on), the total overage across both is compared against the spend limit.
Checking access with spend limits
When a spend limit is configured, thecheck endpoint accounts for it in the allowed response:
Entity-level spend limits
You can also set spend limits on individual entities (users, workspaces, etc.) under a customer. Entity-level spend limits override customer-level limits for that entity.workspace_a to 2,000 overage API calls, regardless of the customer-level spend limit.
Disabling a spend limit
To remove a spend limit, setenabled to false or omit the overageLimit:
Interaction with max purchase (usage limits)
Plans can also have a max purchase limit (also called “usage limit”) set on a plan item. This is a per-entitlement cap configured in the plan editor or CLI, and applies globally to all customers on that plan. When both a spend limit and a max purchase are configured for the same feature, the spend limit takes precedence. The per-entitlement max purchase is not enforced while a spend limit is active.ExampleThis lets you use max purchase as a sensible default for all customers, then selectively raise (or lower) the cap for specific customers using spend limits.
A plan item has a max purchase of 1,000 (so customers can use up to 1,000 overage units). But you set a customer-level spend limit of 5,000 on that feature. The customer can use up to 5,000 overage units — the spend limit overrides the plan-level max purchase for that customer.
Spend limits vs max purchase
Usage Alerts
Usage alerts send a webhook when a customer’s usage crosses a threshold you define. You can use this to take an action like sending a warning email, prompting an upgrade, or flagging the account internally.Configuring usage alerts
Usage alerts are set per-customer (or per-entity) via the API, using the samebillingControls field as spend limits. There are two threshold types:
usage— fires when absolute usage reaches a specific countusage_percentage— fires when usage reaches a percentage of the included allowance
threshold_type: "usage_percentage" with a value between 0 and 100:
The
usage_percentage threshold is calculated against the included allowance only. If the customer has overage enabled with a spend limit or max purchase, the percentage still refers to the included balance — not the total available usage.Usage alert fields
How usage alerts work
- On each
trackcall, Autumn compares the customer’s old and new usage against each enabled alert - If the usage crosses the threshold (old usage was below, new usage is at or above), Autumn fires a
balances.usage_alert_triggeredwebhook - The alert fires once per threshold crossing — it won’t re-fire on subsequent track calls unless usage drops below the threshold and crosses it again
Alerts also work at the entity level. If you configure alerts on an entity, they fire based on that entity’s usage independently.