> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primeintellect.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Pause & Resume

> Stop a sandbox's compute and pick up exactly where it left off

Pausing a sandbox saves its memory and disk on its node and stops the VM. Its CPU and memory are released, so a paused sandbox is billed only for its disk. Resuming restores it in place: running processes, open files, and in-memory state carry on from the moment of the pause.

A pause also saves the sandbox's disk as a pause checkpoint, which holds its memory too. Unlike a filesystem [checkpoint](https://docs.primeintellect.ai/sandboxes/checkpoints.md), which holds files only, a pause keeps the whole running machine.

## Pause and resume

```bash CLI theme={null}
prime sandbox pause sbx_123
prime sandbox resume sbx_123
```

```python Python theme={null}
client.pause(sandbox_id)
client.resume(sandbox_id)
```

Both calls return once the request is accepted. The status becomes `PAUSED`, or `RUNNING` again after a resume, a few seconds later. Poll `prime sandbox get` or `client.get(sandbox_id).status` before relying on it:

```python theme={null}
import time

client.pause(sandbox_id)
while client.get(sandbox_id).status != "PAUSED":
    time.sleep(1)
```

Commands, file transfers, and SSH need a running sandbox, so resume before using it again.

## What happens while paused

* **Billing**: a paused sandbox is billed at the [disk rate](https://docs.primeintellect.ai/sandboxes/overview.md#pricing) only. CPU and memory charges stop.
* **Timeout**: paused time counts toward `timeout_minutes`. A sandbox that reaches its timeout while paused is terminated.
* **Limits**: a paused sandbox doesn't count against your active sandbox, CPU, or memory [limits](https://docs.primeintellect.ai/sandboxes/overview.md#limits). A resume is checked against them like a create, so it can be refused if you're at a limit.
* **Connections**: live connections don't survive a pause. SSH sessions, running command streams, and open TCP connections to or from the sandbox are dropped, so reconnect after resuming.
* **Network policy**: you can replace a paused sandbox's [egress policy](https://docs.primeintellect.ai/sandboxes/network-isolation.md). It applies on resume.
* **Disk**: the pause saves the sandbox's disk and memory as a pause checkpoint, which appears in `prime sandbox checkpoint list`. `prime sandbox pause` prints the pause checkpoint ID; `client.pause()` returns a `PausedSandbox` whose `checkpoint_id` is that ID. Its storage is billed as checkpoint storage.

## Restore or fork from a pause

Resuming continues the paused sandbox in place. To branch it instead, restore its pause checkpoint into a new sandbox:

```bash theme={null}
prime sandbox checkpoint restore <checkpoint-id> --memory --yes
```

The new sandbox continues the paused sandbox's memory, processes, environment, and secrets. The paused source stays paused, and you can resume it or restore from it again. `prime sandbox fork <sandbox-id> --with-memory` ([Fork](https://docs.primeintellect.ai/sandboxes/checkpoints.md#fork)) pauses the source, forks it, and resumes the source in one step. To capture memory without leaving the source paused, use [`prime sandbox snapshot`](./checkpoints#memory-snapshots).

A pause checkpoint whose memory has not yet been stored can be memory-restored (with `--memory`) only on the pausing node, while the source exists; a disk-only restore needs `DURABLE`. A `DURABLE` checkpoint can still lose its memory claim if the memory upload misses the platform's pause window (currently 6 hours). A pause checkpoint has no TTL, but its disk must become `DURABLE` within about 6 hours of the pause, and its memory within about 6 hours after that.

## If something goes wrong

* A pause that fails leaves the sandbox `RUNNING`, with the reason in its error message.
* A resume that fails leaves it `PAUSED` with an error message, so you can retry. If it can never succeed, the sandbox moves to `ERROR`.
* A paused sandbox stays on the node that paused it. If that node is lost, the sandbox is terminated.

## Limitations

These sandboxes can't be paused:

* Sandboxes with [volumes](https://docs.primeintellect.ai/sandboxes/volumes.md) attached.
* GPU sandboxes.
