Volumes.create(...) and attach it to any number of sandboxes at create time via Sandbox.create({ volumes: [...] }). On boot, Declaw streams the blob from object storage and materializes its regular-file entries under the attachment’s mountPath before the first command runs.
Phase 1 contract
- Format: only gzip-compressed tar archives (
application/gzip). Symlinks, hardlinks, device nodes, and entries containing..are dropped on the server. - Size: upload body is capped at 4 GiB.
- Semantics: read-at-boot. A volume is materialized into each sandbox’s overlay filesystem when it attaches. Writes inside the sandbox are private to that sandbox and never flow back to the volume.
- Ownership: a volume is strictly owner-scoped. You can attach only your own volumes.
Volumes.create()
Upload a tar.gz and register it. The body is a Uint8Array or ArrayBuffer; pass a streaming body from disk by reading with fs.readFile, or build it in-memory (see the cookbook for a zero-dep tar writer).
Human-readable name. Not used for addressing — the server returns a stable
volumeId.The raw tar.gz bytes to upload.
Content-Type header sent with the upload. Leave as default for Phase 1.
Override the API key from environment.
Override the API domain (e.g.
api.declaw.ai).Per-request timeout in milliseconds. Raise this for multi-GiB uploads.
Volumes.list()
List all volumes owned by the caller, newest first.
Volumes.get()
Fetch metadata for a single volume.
NotFoundError if the volume does not exist or is owned by a different tenant.
Volumes.delete()
Delete the blob and the metadata row.
Attaching to a sandbox
Passvolumes: [...] to Sandbox.create:
One or more attachments. Each is
{ volumeId: string, mountPath: string }. mountPath must be an absolute path and must not target a system directory (/, /etc, /usr, /proc, /sys, /dev, /bin, /sbin, /lib, /lib64, /var, /run, /boot).volumeId can appear in many sandbox-create calls in parallel; each sandbox gets its own materialized copy on its overlay.
VolumeInfo shape
Errors
| Situation | Error class | HTTP |
|---|---|---|
| Volume not found or not owned by caller | NotFoundError | 404 |
mountPath is a system directory or relative | InvalidArgumentError | 400 |
Referenced volumeId doesn’t belong to caller at attach time | AuthenticationError | 403 |
| Upload body exceeds 4 GiB | InvalidArgumentError | 413 |