Usage
Returns the latest resource measurements for a running sandbox.
AuthorizationBearer <token>Bearer project API key.
Scope: read:sandboxes
sandbox_id*stringThe sandbox ID
The sandbox usage
application/json- response
Current resource use for a sandbox.
sandbox_id*stringThe sandbox ID.
usage*array<>Latest resource measurements for the sandbox.
curl -X GET 'https://example.com/sandboxes/string/usage'{ "sandbox_id": "string", "usage": [ { "cpu_cores": 0.1, "cpu_memory_available": true, "cpu_nanoseconds": 0, "disk_read_bytes": 0, "disk_read_bytes_per_second": 0.1, "disk_total_bytes": 0, "disk_used_bytes": 0, "disk_written_bytes": 0, "disk_written_bytes_per_second": 0.1, "memory_bytes": 0, "network_received_bytes": 0, "network_received_bytes_per_second": 0.1, "network_sent_bytes": 0, "network_sent_bytes_per_second": 0.1, "sampled_at": "2019-08-24T14:15:22Z" } ]}Returns resource usage in minute or hour buckets for the requested half-open time range.
AuthorizationBearer <token>Bearer project API key.
Scope: read:sandboxes
sandbox_id*stringThe sandbox ID
start_at?stringStart of the time range, inclusive. Defaults to 24 hours before end_at.
date-timeend_at?stringEnd of the time range, exclusive. Defaults to now.
date-timeresolution?stringBucket size. Defaults to minute.
"minute""hour"The sandbox usage history
application/json- response
Historical resource usage for a sandbox.
available*booleanWhether usage history is available. When false, periods is empty
and resolution is absent.
periods*array<>Usage buckets in chronological order.
resolution?|Effective bucket size. Omitted when usage history is unavailable.
sandbox_id*stringThe sandbox ID.
curl -X GET 'https://example.com/sandboxes/string/usage/history'{ "available": true, "periods": [ { "cpu_core_seconds": 0.1, "disk_read_bytes": 0, "disk_used_bytes": 0, "disk_written_bytes": 0, "duration_ms": 0, "memory_byte_seconds": 0.1, "memory_peak_bytes": 0, "network_received_bytes": 0, "network_sent_bytes": 0, "start_at": "2019-08-24T14:15:22Z" } ], "resolution": null, "sandbox_id": "string"}Returns the project's monthly spend budget and its current status. A recent change can take up to 30 seconds to appear.
AuthorizationBearer <token>Bearer project API key.
Scope: read:spending
The project's spend budget
application/json- response
A project's monthly spend budget and its current state.
created_at*|When the budget was first set, or null when no budget is set.
date-timeevaluated_at?|When spend was last evaluated in the current period. null until the
first evaluation in the period.
date-timeexceeded_at?|When the project reached its budget this period. null while the
project is under its budget.
date-timemonthly_limit_cents*|The monthly budget, in US cents, or null when no budget is set.
int64period_start_date*|The first day of the current budget period (the calendar month in
UTC), as YYYY-MM-DD.
datespent_cents?|Month-to-date spend at list price, in US cents, from the last
evaluation in the current period. null until the first evaluation in
the period.
int64stop_at?|When running sandboxes are ended: exceeded_at plus the grace period.
On the first sweep after this time, running persistent sandboxes are
stopped and running ephemeral sandboxes are deleted; macOS sandboxes,
which run on a prepaid Mac reservation, keep running. null when
exceeded_at is null, and null when this time falls on or after
the start of the next UTC month: the hold expires at the month
boundary, so no sandbox is ended this period.
date-timeupdated_at*|When a member last set the budget, or null when no budget is set. Spend evaluations do not change it.
date-timecurl -X GET 'https://example.com/usage/budget'{ "created_at": "2019-08-24T14:15:22Z", "evaluated_at": "2019-08-24T14:15:22Z", "exceeded_at": "2019-08-24T14:15:22Z", "monthly_limit_cents": 0, "period_start_date": "2019-08-24", "spent_cents": 0, "stop_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Returns sandbox usage for the project. Changes can take up to 30 seconds to appear.
AuthorizationBearer <token>Bearer project API key.
Scope: read:spending
start_at?stringStart of the time range, inclusive. Defaults to 24 hours before end_at.
date-timeend_at?stringEnd of the time range, exclusive. Defaults to now.
date-timeresolution?stringBucket size. Defaults to hour.
"hour""day"The usage report
application/json- response
Project usage over a time range.
available*booleanWhether usage reporting is available.
end_at?|End of the reported time range, exclusive.
date-timeitems*array<>Usage grouped by sandbox and interval.
resolution?|Effective bucket size. Omitted when usage reporting is unavailable.
start_at?|Start of the reported time range, inclusive.
date-timecurl -X GET 'https://example.com/usage/report'{ "available": true, "end_at": "2019-08-24T14:15:22Z", "items": [ { "interval_start_at": "2019-08-24T14:15:22Z", "resources": { "cpu_core_seconds": 0.1, "disk_read_bytes": 0, "disk_used_bytes": 0, "disk_written_bytes": 0, "memory_byte_seconds": 0.1, "memory_peak_bytes": 0, "network_received_bytes": 0, "network_sent_bytes": 0 }, "sandbox_id": "string" } ], "resolution": null, "start_at": "2019-08-24T14:15:22Z"}