Account, keys and webhooks ›
Set burst budget
PUT
/v1/burst/budgetSet the most your account spends on burst fees in a month, or null for the default.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- await agental.setBurstBudget(20_000_000);
Answer200 OK · Burst
- {
- "enforced": boolean,
- "plan": string | null,
- "limitsFrom": "plan" | "hand" | "none",
- "limitsPlan": string,
- "runningUnits": integer,
- "freeBurstUnits": integer,
- "runningMb": integer,
- "capMb": integer,
- "freeMb": integer,
- … 13 more
- }
The budget is set, and the account is answered as it stands now.
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Body
budgetMicrosrequiredinteger or null | The most the account spends on burst fees in a month, in millionths of a US dollar: 0 refuses every start that would cost one. null gives it the default again. e.g. 50000000 |
Returns
200 The budget is set, and the account is answered as it stands now.
Burst22 fields
enforcedboolean
Whether the account is held to its plan: a start past the running count is refused, and a fast one costs a fee.
More
False: what it starts is only measured.planstringnull
The plan it is on, free included, or null where plans are not enforced on it.
limitsFromplanhandnone
Whose limits it has: its plan's, a plan's we gave it, or, on no plan, the smallest plan's.
limitsPlanstring
The plan whose limits it has.
runningUnitsinteger
Small sandboxes it runs at once at most.
More
A medium counts 2, a large 4, a tiny half.freeBurstUnitsinteger
Small sandboxes it starts at once for nothing, counted the same way.
runningMbinteger
The memory of its sandboxes running, being made or being started.
capMbinteger
runningUnits in megabytes: 4096 each.
freeMbinteger
freeBurstUnits in megabytes.
meterMbinteger
What its burst meter reads: the memory of each start it made, halved for every halfLifeMinutes since.
freeNowMbinteger
What it may start now for nothing: freeMb less meterMb, and no more than the room under capMb.
overMbinteger
By how much the meter is over the free burst.
More
While it is, every start costs a fee.halfLifeMinutesinteger
feeMicrosPerGibinteger
See burstFee in GET /v1/billing/plans.
mayStartboolean
Whether it may start a sandbox at all now.
More
A plan out of credit may not: GET /v1/billing says why.unpaidboolean
Whether it is on the free plan and has paid for nothing yet: until it has, it runs and starts at most free.unpaidUnits small sandboxes at once (GET /v1/billing/plans).
spentMicrosinteger
What it has spent on burst fees this month, in millionths of a US dollar.
budgetMicrosinteger
The most it spends on burst fees in a month.
More
A start that would go past it is refused with 429 burst_budget_reached.budgetSetboolean
Whether the account set its budget.
More
False: it is defaultBudgetMicros.defaultBudgetMicrosinteger
nextStartBurstQuote[]5 fields
What one sandbox of each size its plan makes would cost to start now.
sizetinysmallmediumlarge
countinteger
feeMicrosinteger
What starting that many of that size now would cost in burst fees, all told, in millionths of a US dollar.
More
0 where the account is not held to a plan.freeInSecondsintegernull
Seconds until they would cost nothing, as the meter falls: 0 when they cost nothing now, null when they never would, being more than the free burst.
overRunningCountboolean
Whether they would take the account past its running count, which refuses them.
quoteobject
Errors and other answers
| 400 | invalid_request. The budget is not a whole number from 0 to 100000000000, or null, or the key belongs to no account. |
| 403 | role_required in a team, only an owner sets its budget. |
| 404 | The account behind the key is gone. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.