# What is a sandbox snapshot? A sandbox snapshot is a saved copy of a sandbox's machine that you can start new sandboxes from later, as many times as you like. **On Runtime a snapshot keeps the whole machine, is copied off its server as soon as it is taken, and costs $0.08 per decimal GB per 30-day month on the bytes it alone stores** (rate in force since 23 September 2026). Blocks two of your snapshots share count once ([pricing](/docs/pricing#snapshots-images-and-volumes)). ## Why AI agents use snapshots Setting a machine up is often the slowest part of an agent's task: cloning a repository, installing its dependencies, building it, starting a database. A snapshot lets you do that once. Every later task starts from the prepared machine instead of repeating the setup, which suits evaluation runs, reinforcement learning environments and per-user workspaces that should all begin from the same known state. ## Snapshot, pause, fork and image | Mechanism | What it keeps | What you do with it | | ------------------------------------------- | ---------------------------------------------- | ----------------------------------------------- | | [Pause](/how-to/pause-and-resume-a-sandbox) | Files, memory and processes of one sandbox | Wake the same sandbox later, on the same host | | Snapshot | A saved copy of a sandbox | Start new sandboxes from it, any time later | | [Fork](/glossary/sandbox-fork) | Files, memory and running processes | Running copies now, 1 to 10 at a time | | [Custom image](/docs/images) | A filesystem built from a recipe or Dockerfile | Start every sandbox with dependencies installed | ## Runtime's snapshots in facts | Fact | Value | | -------------- | ---------------------------------------------------------------------------- | | Price | $0.08 per decimal GB per 30-day month, 119 microdollars per GiB-hour | | Charged on | The bytes the snapshot alone stores | | Retention | 7 days by default; 1 to 365 days with `retentionDays` | | Durability | Copied off its server, encrypted, as soon as it is ready, at no extra charge | | Taking one | Pauses a running sandbox for about a second when fresh, then wakes it | | Where it lives | On its source's server, where sandboxes started from it run | | Volumes | A sandbox with volumes cannot be snapshotted | A snapshot's rate is fixed when you make it and never changes. If its server is lost, the snapshot is restored from its copy onto another ([storage and backups](/docs/storage#snapshots-survive-their-server)). ## Take one and start from it ```ts check import { Runtime, Sandbox } from "withruntime"; const runtime = new Runtime(); await using base = await Sandbox.create(); await base.exec("pip install --quiet requests"); const snapshot = await base.snapshot({ name: "with-requests", retentionDays: 7 }); await using later = await runtime.sandboxes.create({ snapshot: snapshot.id }); await runtime.snapshots.delete(snapshot.id); ``` ```python check from withruntime import Runtime runtime = Runtime() with runtime.sandboxes.create() as base: base.exec("pip install --quiet requests") snapshot = base.snapshot(name="with-requests", retention_days=7) with runtime.sandboxes.create(snapshot=snapshot["id"]): pass runtime.snapshots.delete(snapshot["id"]) ``` From the CLI, `runtime sandbox snapshot --name ready` takes one and `runtime sandbox create --snapshot ` starts from it ([CLI](/docs/cli#images-volumes-and-snapshots)). The full reference is in [snapshots and forks](/docs/javascript#snapshots-and-forks). ## Related - [What is a sandbox fork?](/glossary/sandbox-fork) - [What is a cold start?](/glossary/cold-start) - [How to pause and resume a sandbox](/how-to/pause-and-resume-a-sandbox) - [Agent evals and SWE-bench](/use-cases/agent-evals-and-swe-bench) - [RL environments](/use-cases/rl-environments) Facts on this page were checked on 25 September 2026.