Spend Limits

These endpoints are served by the Allternit runtime (the Desktop app, or a paired or hosted computer), not by api.allternit.com. On Allternit Cloud the console hides this page. On Cloud, set the monthly spend cap per project in the Platform API: see Billing and spend caps. The console shows it on the Project billing page.
Spend limits protect against runaway usage by capping monthly organization spend in USD cents. Organization owners and admins can view the current cap and spend, request an increase, and approve or reject pending increase requests.

Base URL

Endpoints

Get spend limit

Response

All monetary values are in USD cents. In this example, the cap is $1,000.00 and the current spend is $423.50.

Request a spend-limit increase

Request body

Response

The amount must be greater than 0 USD cents.

Approve an increase request

Request body

If amount is omitted, the pending request amount is used. The organization’s monthly_usd_cap is increased by the approved amount and the request status becomes approved.

Response

Reject an increase request

Response

Rejection requires a pending request. The monthly cap is unchanged.

Check balance

Response

available_balance is total_balance - current_month_spend.

Behavior when the cap is reached

When current_month_spend reaches monthly_usd_cap, the gateway rejects new requests with 429 Too Many Requests and a budget_exceeded detail. In-flight runs are allowed to finish.

Error codes