---
title: "Capture a running sandbox as a new forkable snapshot [rate class: sandbox_api_rps]"
method: POST
path: "/preview/sandboxes/{id}/snapshot"
tags: ["sandboxes"]
---

# Capture a running sandbox as a new forkable snapshot \[rate class: sandbox_api_rps\]

`POST /preview/sandboxes/{id}/snapshot`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/sandboxes/{id}/snapshot`
- Auth: HTTP bearer

Capture a running sandbox's CURRENT state - memory, processes, disk - as a new forkable snapshot, without stopping the sandbox. This is how a computed prefix gets shared instead of recomputed: run the common steps once in one sandbox, snapshot_sandbox, then fork_sandbox that snapshot so every branch starts from the finished work. Use it at branch points (explore K continuations of one trajectory), before risky steps (retry from the checkpoint instead of from scratch), and to compare approaches from a truly identical starting state. Snapshots are content-addressed against their parent, so capturing one is cheap and far faster than re-running the steps it contains.

## Path parameters

- `id` string, required: The running sandbox whose current state to capture.

## Query parameters

- `workspace` string

## Request body

- object
  - `expires_after` string, nullable: Self-cleaning expiry for the captured snapshot: a duration from now ("24h", "7d"; minimum 1h), or "never". The default is forever; snapshots never expire unless YOU schedule it (set_sandbox_snapshot_expiry changes it later).

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
