# Files

Read and list files for free; a write counts as one command and ends in a checkpoint. Relative paths are under `/workspace`; writes are allowed under `/workspace`, `/tmp` and `/home/user`.

```sh
# list a directory
GET /v1/sandboxes/:id/files?path=/workspace

# read a file (raw bytes)
GET /v1/sandboxes/:id/files/content?path=notes.md

# write a file (raw bytes in the body; mode optional)
PUT /v1/sandboxes/:id/files/content?path=bin/run.sh&mode=755
```

Files are at most 32 MiB. To take the whole workspace away, `GET /v1/sandboxes/:id/workspace.tar.zst` returns it as a zstd-compressed tar.
