Skip to main content
Every sandbox has one payer. With your own provider key (BYOK), the provider bills your account and BoxRouter shows the cost information it can verify. With Credits, BoxRouter bills you the provider’s cost, with no markup, and shows that as the sandbox’s charge. Under BYOK you owe the provider’s invoice and BoxRouter adds no fee. Compare the invoice with cost.total once the sandbox has ended and total is no longer null.

Funding from Your Balance

BoxRouter reserves credit before the sandbox starts. If your available credit can’t cover the reservation, the call fails with 402 insufficient_credit and nothing is created. Extending a running sandbox is refused the same way. How much is reserved depends on how the sandbox is funded:
  • Rolling: leave out lifetime_seconds and set resources.extendable_lifetime. BoxRouter reserves one hour at a time and renews before each hour ends. If your balance can’t cover the next hour, the sandbox ends at funded_until. See run while funded.
  • Fixed: with lifetime_seconds, or on a route that can’t extend a lifetime, BoxRouter reserves the whole lifetime at the start. Buy credits or ask for a shorter lifetime_seconds.
A reservation lowers your available balance but is not a charge. When the sandbox ends, BoxRouter sets the charge from the provider’s records and returns the unused reservation. Until the records arrive the charge is pending and the reservation stays held. Credits explains each state. Set a spend limit for the workspace.

Read a Sandbox’s Cost

A sandbox’s cost is unknown until it ends. While it runs, cost is {"label": "unknown", "total": null}. After it ends, cost stays unknown until the provider reports the usage it measured. Some providers take about 30 minutes, and the charge stays pending with the reservation held until then. The same delay applies to a GitHub Actions job: its cost and charge read unknown until the provider’s usage arrives. Set BOXROUTER_API_KEY and install a client as in the quickstart. The example creates a sandbox, destroys it, and reads its cost. It uses your workspace’s routing and funding order. For BYOK, connect a provider key and prefer an eligible key in routing settings.
One possible BYOK response is: If destruction fails, use the printed sandbox ID to check cleanup. Right after destroy, this provider had not yet reported the sandbox’s size or billed time, so total is null and held_back_by names each gap. unknown never means free. Read the sandbox again later and check held_back_by if the total is still null; the missing evidence or rate might not become available. cost.label says how much to trust the total: When total is known, read these fields: The sandbox schema lists every field. List sandboxes returns only label and total.

Check the Usage Behind It

usage records the sandbox’s size, region, and time in each state. It also records active CPU and egress where they are billed. Each fact includes source, observed_at and how. If a fact cannot be established, its source is unknown and its value is null. BoxRouter does not substitute a default. source is provider, published, measured, recorded, calculated, or unknown. The sandbox schema defines each value.

Total Usage over Time

usage (CLI: boxrouter usage) groups managed and BYOK sandboxes by provider, day, key, or sandbox. It needs a key with credentials:manage and a range of at most 92 UTC days. Select Manage Provider Keys (BYOK) when creating the key; see key permissions.
  • charge_usd: the Credits amount already charged.
  • held_usd: the amount reserved right now, a snapshot that changes as sandboxes renew and end.
  • byok_provider_cost_usd: the provider cost of your BYOK sandboxes. It is null whenever any sandbox in the row has an unknown cost, never a partial sum.
The same report downloads as CSV from /usage.csv. In the dashboard, Usage under Credits shows it by day, key, or sandbox with date filters. boxrouter api credits usage lists the individual charges, corrections and reservations, each with the key_id of the API key that made the request.

Recheck the Rates

List price versions returns rates, sources, meter rules, and exclusions without a key. Filter by provider, or pass at for the version in effect at a time. A live version never changes. Meter rules specify quantities, minimum seconds, and billing increments.

Stop the Meter

Destroy sandboxes when work ends. Volumes stay after compute stops. Their storage is free during launch, up to the workspace limit; delete volumes you no longer need to stay inside it.

Next Steps

Buy and Manage Credits

Buy Credits, read charges, and request a refund.

Cap Your Spend

Set a limit for the workspace or a key.

Check Your Limits

Which limits apply and who can change them.