To call it, use an API key with the
billing.read scope. A key from the dashboard has it already.
How much am I spending?
The summary gives you your spending so far today, this week and this month, and an estimate for the whole month:Response
Response
response
projected_month estimates the whole month by assuming you keep spending at this
month’s pace so far.
What is awake right now?
Only awake sandboxes cost money for compute. This call lists every sandbox that is awake, and being charged, right now:Response
Response
response
idle_timeout_sec: 0, or
for programs that keep them busy. See what keeps a sandbox awake.
My plan, credit and limits
The billing account shows your plan, how much credit and balance you have left, and how close you are to your plan’s limits today:Response
Response
response
Breakdown and ledger
Two more calls give you the detail behind the totals:GET /v1/billing/usageadds up awake hours and cost for a period. It covers this month unless you passfromandto.GET /v1/billing/ledgerlists every charge and payment, newest first. Each entry shows how much was paid from plan credit and how much from your balance.
Response
Response
response
entry
Paying
You can change your plan, update your card, download invoices and add money in the dashboard, under billing. If you would rather build these into your own app, the same actions are available in the API:Related
Pricing and limits
The price of each size, the plans and the free trial.
Sleep and wake
Sleep is the biggest factor in what you spend.