Skip to main content
Standalone class — not a property on Sandbox.

Constructor

from opencomputer import Snapshots

snapshots = Snapshots()
# or with explicit config:
snapshots = Snapshots(api_key="...", api_url="...")
api_key
str
API key (falls back to OPENCOMPUTER_API_KEY env var)
api_url
str
API URL (falls back to OPENCOMPUTER_API_URL env var)

await snapshots.create(name, image, on_build_logs=None)

Create a pre-built snapshot. HTTP API →
name
str
required
Unique snapshot name
image
Image
required
Declarative image definition
on_build_logs
Callable[[str], None]
Build log streaming callback
Returns: dict

await snapshots.list()

HTTP API →Returns: list[dict]

await snapshots.get(name)

HTTP API →
name
str
required
Snapshot name
Returns: dict

await snapshots.delete(name)

Delete a snapshot. Existing sandboxes are not affected. HTTP API → Returns: None

SnapshotInfo

Snapshot methods return dicts with these fields:
{
    "id": str,           # Unique snapshot identifier
    "name": str,         # Snapshot name
    "status": str,       # "building" | "ready" | "failed"
    "contentHash": str,  # SHA-256 hash of the image manifest
    "checkpointId": str, # Linked checkpoint ID
    "manifest": dict,    # The declarative image manifest
    "createdAt": str,    # ISO 8601 creation timestamp
    "lastUsedAt": str,   # ISO 8601 last usage timestamp
}