Docs
Account, keys and webhooks ›

Set burst budget

PUT/v1/burst/budget

Set the most your account spends on burst fees in a month, or null for the default.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. await agental.setBurstBudget(20_000_000);
Answer200 OK · Burst
  1. {
  2. "enforced": boolean,
  3. "plan": string | null,
  4. "limitsFrom": "plan" | "hand" | "none",
  5. "limitsPlan": string,
  6. "runningUnits": integer,
  7. "freeBurstUnits": integer,
  8. "runningMb": integer,
  9. "capMb": integer,
  10. "freeMb": integer,
  11. … 13 more
  12. }

The budget is set, and the account is answered as it stands now.

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Body

budgetMicrosrequired
integer 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
enforced
boolean
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.
plan
stringnull
The plan it is on, free included, or null where plans are not enforced on it.
limitsFrom
planhandnone
Whose limits it has: its plan's, a plan's we gave it, or, on no plan, the smallest plan's.
limitsPlan
string
The plan whose limits it has.
runningUnits
integer
Small sandboxes it runs at once at most.
More A medium counts 2, a large 4, a tiny half.
freeBurstUnits
integer
Small sandboxes it starts at once for nothing, counted the same way.
runningMb
integer
The memory of its sandboxes running, being made or being started.
capMb
integer
runningUnits in megabytes: 4096 each.
freeMb
integer
freeBurstUnits in megabytes.
meterMb
integer
What its burst meter reads: the memory of each start it made, halved for every halfLifeMinutes since.
freeNowMb
integer
What it may start now for nothing: freeMb less meterMb, and no more than the room under capMb.
overMb
integer
By how much the meter is over the free burst.
More While it is, every start costs a fee.
halfLifeMinutes
integer
feeMicrosPerGib
integer
See burstFee in GET /v1/billing/plans.
mayStart
boolean
Whether it may start a sandbox at all now.
More A plan out of credit may not: GET /v1/billing says why.
unpaid
boolean
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).
spentMicros
integer
What it has spent on burst fees this month, in millionths of a US dollar.
budgetMicros
integer
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.
budgetSet
boolean
Whether the account set its budget.
More False: it is defaultBudgetMicros.
defaultBudgetMicros
integer
nextStart
BurstQuote[]5 fields
What one sandbox of each size its plan makes would cost to start now.
size
tinysmallmediumlarge
count
integer
feeMicros
integer
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.
freeInSeconds
integernull
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.
overRunningCount
boolean
Whether they would take the account past its running count, which refuses them.
quote
object

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.
403role_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.