API reference · Sandboxes
Sandbox sizes with their prices, and the limits that apply to sandboxes and runs
/v1/sandboxes/sizes- TypeScript
client.sandboxes.listSizes()- Python
client.sandboxes.list_sizes()- CLI
hayonix sandboxes sizes
Everything needed to choose a size and stay within limits, in one response: every size with its current price, the defaults and ranges of lifetimes, idle timeouts and run settings, and the languages a run can use.
Project API key (Authorization: Bearer sk_…), or a console session. Requires the sandbox:read permission (a key's scope, or a role that includes it).
Examples
The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.
curl -sS "$API_BASE_URL/sandboxes/sizes" \
-H "Authorization: Bearer $API_KEY"Request
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
X-Project-Id | session only | The project to act in, for console sessions. Requests with an API key leave it out. |
Response
200 SandboxSizes — Sizes, limits and languages
The items
ShowHide 8 fields of
dataobjectstringrequiredAlways `sandbox_size`: the type of this object
One of
sandbox_sizecodestringrequiredMachine-readable code
display_namestringrequiredName to show people
vcpusintegerrequiredVirtual CPUs
memory_gbintegerrequiredMemory in GB
disk_gbintegerrequiredDisk space for the workspace and everything else written, in GB
priceobjectrequiredCurrent price of this size
ShowHide 2 fields of
priceper_secondstringrequiredPrice per second of running, nano-USD (what is billed)
pattern ^-?[0-9]+$
per_hourstringrequiredThe same price per hour (per_second × 3600), nano-USD
pattern ^-?[0-9]+$
defaultbooleanrequiredUsed when a sandbox is created without `size`
next_cursorany JSON | nullrequiredAlways null: every size is listed
ShowHide 11 fields of
limitslifetime_secondsobjectrequiredHow long a sandbox lives unless extended
ShowHide 3 fields of
lifetime_secondsdefaultnumberrequiredUsed when you do not set it, in seconds
minnumberrequiredSmallest allowed, in seconds
maxnumberrequiredLargest allowed, in seconds
idle_timeout_secondsobjectrequiredHow long a sandbox may go without a run or a file operation before it ends
ShowHide 3 fields of
idle_timeout_secondsdefaultnumberrequiredUsed when you do not set it, in seconds
minnumberrequiredSmallest allowed, in seconds
maxnumberrequiredLargest allowed, in seconds
run_timeout_secondsobjectrequiredTime limit of one run
ShowHide 3 fields of
run_timeout_secondsdefaultnumberrequiredUsed when you do not set it, in seconds
minnumberrequiredSmallest allowed, in seconds
maxnumberrequiredLargest allowed, in seconds
run_max_output_bytesobjectrequiredCap on one run’s stdout plus stderr; the run is cut off past it
ShowHide 3 fields of
run_max_output_bytesdefaultnumberrequiredUsed when you do not set it, in bytes
minnumberrequiredSmallest allowed, in bytes
maxnumberrequiredLargest allowed, in bytes
max_code_bytesnumberrequiredLargest `code` of one run, in bytes
max_stdin_bytesnumberrequiredLargest `stdin` of one run, in bytes
max_concurrent_runsnumberrequiredRuns one sandbox accepts at once (Python runs queue for its one interpreter)
recorded_output_bytesnumberrequiredBytes of each of stdout and stderr kept with a run’s record (the response to the run itself has all of it)
run_retention_daysnumberrequiredDays run records are kept after their sandbox ends
max_file_bytesnumberrequiredLargest file you can upload, in bytes
max_live_per_projectnumberrequiredSandboxes one project can have at once that have not ended (the organization’s `sandboxes` quota applies too)
languagesarray of stringrequiredValues accepted as a run’s `language`
Example response
{
"data": [
{
"object": "sandbox_size",
"code": "string",
"display_name": "string",
"vcpus": 1,
"memory_gb": 1,
"disk_gb": 1,
"price": {
"per_second": "1500000000",
"per_hour": "1500000000"
},
"default": true
}
],
"next_cursor": {},
"limits": {
"lifetime_seconds": {
"default": 1.5,
"min": 1.5,
"max": 1.5
},
"idle_timeout_seconds": {
"default": 1.5,
"min": 1.5,
"max": 1.5
},
"run_timeout_seconds": {
"default": 1.5,
"min": 1.5,
"max": 1.5
},
"run_max_output_bytes": {
"default": 1.5,
"min": 1.5,
"max": 1.5
},
"max_code_bytes": 1.5,
"max_stdin_bytes": 1.5,
"max_concurrent_runs": 1.5,
"recorded_output_bytes": 1.5,
"run_retention_days": 1.5,
"max_file_bytes": 1.5,
"max_live_per_project": 1.5
},
"languages": [
"string"
]
}Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |