Read and write files inside a sandbox viaDocumentation Index
Fetch the complete documentation index at: https://docs.superserve.ai/llms.txt
Use this file to discover all available pages before exploring further.
sandbox.files. Operations route directly to the data plane (boxd-{id}.sandbox.superserve.ai) using a per-sandbox access token. The SDK manages the token transparently, including rotation after resume().
write
Write a file at an absolute path. Parent directories are created automatically.
| Option | Type | Description |
|---|---|---|
path | string / str | Absolute destination path. |
content | FileInput / str | bytes | File contents. See accepted types below. |
timeoutMs / timeout | number / float | Optional request timeout. |
signal | AbortSignal | TypeScript only - abort the request. |
read
Read a file as raw bytes.
readText / read_text
Read a file and decode as UTF-8.
Round-trip example
Path rules
- Paths must start with
/ - Paths must not contain
..segments - Parent directories are created automatically on
write
Errors
Commonly raised:NotFoundError- file does not exist (on read)ValidationError- invalid path (relative, contains.., or malformed)AuthenticationError- access token invalid or sandbox was deletedTimeoutError/SandboxTimeoutError- the optional timeout elapsed