Skip to main content
Use resize to increase a running sandbox’s CPU, memory, or disk without restarting it. Supply the desired total allocation, not the amount to add. To set resources before a sandbox starts, see Create Sandbox. Requires version 2.1.4 or later of whichever SDK (JavaScript/TypeScript or Python) or CLI you use.
Existing processes may need to be restarted or have their configuration adjusted to use the additional resources. For example, a JVM heap limit set with -Xmx or a thread pool with a fixed size configured at startup may not automatically increase after a resize.

Resize a running sandbox

Specify at least one resource. Omitted resources are unchanged. Replace the sandbox ID with an existing, running sandbox and choose targets within your quota.

Resource values and units

  • Values must be positive absolute totals. For example, memoryGiB: 8 means 8 GiB in total, not 8 GiB more.
  • Resources can only grow. A target equal to the current value is skipped; a lower target fails.
  • New memory and disk totals must be whole GiB. An existing non-whole-GiB allocation can be kept unchanged if it represents a whole number of MiB.
  • CPU-to-memory ratios from 1:0.5 (for example, 2c1g) through 1:2 are supported.

Billing after resize

From the time an expansion takes effect, CPU and memory are billed at the new CPU and memory specifications. Disk is not billed while the sandbox is running. After the sandbox is paused, the storage fee is based on the disk capacity.

Handle partial success

Each requested resource can succeed or fail independently. For example, CPU can increase while memory remains unchanged. A failed resource does not roll back successful changes.
Always inspect each resource’s status and current value. A resolved SDK call or CLI exit code of 0 does not mean every resource was resized successfully.

Result fields

The result contains an entry for each requested resource (cpu, memory, or disk). requested, previous, and current are totals in cores for CPU and GiB for memory and disk.

Errors

For failed resources, check that targets meet the value requirements and your quota. Request-level errors can still raise an SDK exception or produce a nonzero CLI exit code.

Check current resources and quotas

Sandbox details report CPU in cores and memory and disk in MiB, unlike resize’s GiB values. Check current resources and quota before choosing a target.

FAQ

Do I need to create a new template to change resources?

No. Set resources when creating a sandbox, or use resize to expand a running sandbox. Fields omitted at creation use the template defaults; fields omitted from a resize request keep their current values.

Why hasn’t memory increased even though the command succeeded?

Check the memory entry’s status. For failed, inspect reason and message; for unknown, query sandbox details again later to confirm the allocation. A CLI exit code of 0 does not mean every resource was resized successfully.

How should I handle a resize request error?

  • 400: The request parameters or resource values are invalid. Check the error message and ensure targets meet the value requirements.
  • 403: The request was denied. Check whether your account or API key has access to the sandbox and follow the returned error message. If the error explicitly indicates insufficient quota, check your quota or request an increase.
  • 404: The sandbox does not exist or is unavailable. Verify the sandbox ID and confirm the sandbox still exists.
  • 409: The request conflicts with another operation. Check the sandbox’s current state and the error message, then retry after the conflict ends; resize requires a running sandbox.
  • 412: A prerequisite state condition is not met. Query the Sandbox’s current status or details, confirm it is in a running state eligible for resize, then retry.

What happens if expansion fails?

A per-resource failed result does not stop the sandbox or roll back successful changes; the failed resource keeps its previous allocation. For request-level errors or an unknown result, query sandbox details to confirm the current sandbox status and resource allocation. See per-resource statuses.

Can I shrink a sandbox or reduce its disk?

No. Resize only expands resources, so lower targets fail and disk cannot be reduced. If you need a smaller disk, create a new sandbox with a suitable disk size that meets the template minimums and your quota.
Last modified on December 1, 2026