Account, keys and webhooks ›
Get sandbox usage
GET
/v1/sandboxes/{id}/usageThe same for one sandbox.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
- const usage = await sandbox.usage();
Answer200 OK · SandboxUsage
- {
- "sandboxId": string,
- "durationMs": integer,
- "since": string | null,
- "until": string,
- "seconds": integer,
- "listCostMicros": integer,
- "stopped": {
- "seconds": integer,
- "listCostMicros": integer,
- },
- "mail": {
- "received": integer,
- "sent": integer,
- "costMicros": integer,
- },
- "currency": "usd",
- … 2 more
- }
Running time of one sandbox and what it comes to at the list price, and its stopped time apart, at the stopped price.
Path
idrequiredstring | e.g. "sbx_0123456789abcdef" |
Query
sincestring | Count running time from this moment. An ISO 8601 date and time. e.g. "2026-10-01T00:00:00Z" |
untilstring | Count running time up to this moment. Now when omitted, and never later than now. |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Returns
200 Running time of one sandbox and what it comes to at the list price, and its stopped time apart, at the stopped price. Without since, its whole life.
SandboxUsage11 fields
sandboxIdstring
durationMsinteger
Every millisecond the sandbox has run in its life, whatever the window.
sincestringnull
Start of the window.
More
Null means the sandbox's whole life.untilstring
secondsinteger
Whole seconds run inside the window, counted by the meter.
More
A sandbox that is running is counted up to now.listCostMicrosinteger
What those seconds come to at the list price, in millionths of a US dollar.
More
27000 is $0.027. Not a charge.stoppedobject2 fields
Stopped time, apart from the running time in seconds and listCostMicros.
secondsinteger
Whole seconds stopped inside the window, with the disk kept.
More
A sandbox deleted while its snapshots kept its machine counts as stopped until the last of them goes.listCostMicrosinteger
What those seconds come to at the stopped price, 5% of the running one, in millionths of a US dollar.
More
Not a charge here: GET /v1/billing says what is.mailobject3 fields
Mail in the window.
More
It is counted by UTC day, so a window takes the whole of every day it touches. Deleting a message, or a sandbox, takes nothing away from it.receivedinteger
Messages taken for a sandbox.
sentinteger
Messages a sandbox sent.
costMicrosinteger
What they come to at 500 a message, in millionths of a US dollar: $0.50 a thousand.
More
It is paid from what the plan includes, as machine time is.currencyusd
costnull
What was charged.
More
Null: nothing is charged here.billingnot_configured
Errors and other answers
| 400 | since is not before until. |
| 404 | Not found. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.