Spend limits

Cap what your organization and each workspace can spend per period - what counts, when limits reset, and what an enforced limit refuses.

Your balance is the outer limit on what your organization can spend. A spend limit stops spending earlier: set one on the organization, on any workspace, or both, and Aivene refuses new requests once it is reached, instead of running up a surprise bill.

Set them on the Spend limits page of the Console, or from code with the Admin API.

Two kinds of limit

Organization limitWorkspace limit
CoversSpend in every workspace of the organizationSpend in that workspace only
PeriodMonthlyDaily, weekly or monthly
How manyOneOne per workspace

Both are optional. When both apply, each is checked on its own: a request is refused as soon as any enforced limit that covers it is reached. A workspace limit may be larger than the organization's; the organization limit still stops it.

API keys have no spend limit of their own. To cap what a set of keys can spend, put them in a workspace and give that workspace a limit.

Periods

Every period is in UTC and starts over on its own:

PeriodResets
dailyEvery day at 00:00 UTC
weeklyEvery Monday at 00:00 UTC
monthlyOn the 1st of every month at 00:00 UTC

A limit counts spend from the start of its current period, even when you set it partway through. Changes take effect right away.

Settings

SettingMeaning
AmountThe limit in US dollars, such as 100 or 2.50.
Periodmonthly for the organization; daily, weekly or monthly for a workspace.
EnforceOn: requests are refused once the limit is reached. Off: nothing is refused, and the limit only shows how close you are.
Include perksOn: usage paid by perks counts toward the limit. Off: only what your balance paid counts.

A new limit is monthly, enforced and includes perks unless you choose otherwise.

What counts as spend

  • Model and tool usage: the cost of each request, as shown on the Logs page. With Include perks off, the part paid by perks is left out.
  • Launchpad: what your apps are charged (deploys, renewals, upgrades), minus refunds. An app's charges count toward its workspace's limit and the organization's.

Each request counts in the workspace of the API key that made it, and so in the organization.

When a limit is reached

With Enforce on, once spend in the current period reaches the amount:

  • New model and tool requests in that scope return 402, before they reach the model, and nothing is charged:

    HTTP/1.1 402 Payment Required
    
    {
      "error": {
        "message": "Organization spend limit reached: $100.00 per month. It resets at 2026-12-01 00:00 UTC.",
        "type": "invalid_request_error"
      }
    }

    A workspace limit says Workspace spend limit reached: ... instead.

  • With Include perks off, perk usage is not limited: a request your perks pay for (perks that cover its model or tool) still goes through, and only requests your balance would pay are refused. If a perk runs out during such a request, the rest is charged to your balance as usual.

  • Launchpad refuses deploys, new apps, package upgrades and renewals of apps in that scope with 402, and charges nothing. Launchpad is always paid from your balance, so this holds with Include perks on or off. An app whose automatic renewal is refused expires, as when the balance is too low.

Requests already running when the limit is reached finish and are billed normally, so spend can end slightly above the amount. Everything works again when the period resets, or as soon as you raise the amount, remove the limit or turn Enforce off.

With Enforce off, nothing is refused: the limit shows its status, so you can watch spend without stopping traffic.

Email notifications

A monthly limit (the organization's, or a workspace's with the monthly period) can email you before it is reached. Add up to 5 thresholds per limit, each at its own percent of the amount, such as 50%, 80% and 100%:

SettingMeaning
ThresholdA whole percent of the amount, from 1 to 200. Above 100 is useful for a limit that is not enforced.
On or offPer threshold: switched off, it sends nothing until you switch it back on.
  • The email goes to the organization's owners, admins and billing members, for organization and workspace limits alike. Each person gets it once, within a few minutes of spend reaching the threshold. It names the current spend, the amount, when the month resets and whether the limit is enforced. To change who receives it, change their role.
  • Each threshold is sent at most once a month, the first time spend in the month reaches it, counted as the limit counts it (with or without perks). It is sent again from the 1st of the next month.
  • Notifications work whether or not the limit is enforced.
  • Raising the amount later in the month does not send again a threshold that was already sent that month. A threshold added when spend is already past it is sent once.
  • Daily and weekly workspace limits have no notifications. Changing a workspace limit to daily or weekly removes its notifications, and removing a limit removes them too.

In the Admin API, notifications are the alerts of the spend limit object.

Who can change limits

Organization owners, admins, billing members and developers can set, change and remove limits and their notifications. Every other member can see them. An Admin key can change them too.

FAQ