Daytona (client)
The top-level client — sandbox CRUD and service accessors.
Daytona is the top-level client in the rlp module. It owns sandbox create/get/list/delete, delegates lifecycle helpers to Sandbox, and exposes the resource services as attributes. Construct it with an optional DaytonaConfig — configuration and environment-variable fallbacks are covered on the Python SDK page.
Services
| Attribute | Service | Manages |
|---|---|---|
daytona.snapshot | SnapshotService | Image aliases and Dockerfile builds |
daytona.volume | VolumeService | Persistent volumes |
daytona.object_store | ObjectStoreService | S3-compatible bucket mounts |
daytona.secret | SecretService | Project-scoped secrets |
daytona.fn | FunctionService | Managed serverless functions |
create()
Creates a sandbox and blocks until it reaches the started state. Creation is asynchronous server-side, so the client polls the sandbox until it is running (or errors, or the timeout elapses). Exactly one image source is required: snapshot (a snapshot name) or image (a registry ref).
| Parameter | Type | Default | Description |
|---|---|---|---|
params | CreateSandboxFromSnapshotParams | CreateSandboxFromImageParams | None | Sandbox parameters; see the table below. |
timeout | int | 60 | Seconds to wait for started. 0 waits indefinitely. |
Both params dataclasses share these fields (plus snapshot: str or image: str respectively):
| Field | Type | Default | Description |
|---|---|---|---|
name | str | None | Optional sandbox name. |
env_vars | Dict[str, str] | {} | Environment variables injected with their real values. |
labels | Dict[str, str] | {} | Key/value labels (see the note below). |
resources | Resources | None | cpu (fractional floor in burstable, min 0.125; whole cores in dedicated), gpu (number of GPUs to attach — see GPU sandboxes), memory (GiB), disk (GiB). |
mode | str | None | "burstable" (default) or "dedicated". |
ports | List[PortRequest] | None | Ports to expose: PortRequest(vm_port, proto="tcp"). |
docker_data_mib | int | None | Size of a dedicated /var/lib/docker device, in MiB. |
volumes | List[VolumeMount] | None | Persistent volumes to attach. |
object_store_mounts | List[ObjectStoreMount] | None | Object stores to FUSE-mount. |
secrets | List[str] | None | Names of project secrets to attach. |
persistent | bool | None | Persistent write layer — enables warm stop()/start(), pause()/resume(), fork(). |
spot | bool | None | Spot tier: discounted but reclaimable. |
egress_policy | EgressPolicy | None | Outbound network allow-list (since 0.2.0): EgressPolicy(enabled, allow) where allow is a list of IPs, CIDRs, and/or domains. |
cpu_arch | str | None | CPU architecture: "amd64" (default) or "arm64". See Architecture support. |
cpu_type | str | None | Pin to a minimum CPU hardware tier by slug (e.g. "graviton"; list them via GET /cpu-types). Implies its architecture. Placement uses the tier as a floor — it may run on a higher tier of the same architecture, never a lower one. |
network_class | str | None | Pin to a minimum NIC class by slug (e.g. "100g"; list them via GET /network-classes). Runs on that class or higher. Not supported with GPU or Windows sandboxes. |
disk_class | str | None | Pin to a minimum NVMe class by slug (e.g. "nvme-gen5"; list them via GET /disk-classes). Runs on that class or higher. Not supported with GPU or Windows sandboxes. |
Returns: a started Sandbox.
Raises: DaytonaValidationError if neither snapshot nor image is set, or timeout is negative; DaytonaTimeoutError if the sandbox is not started in time; DaytonaError if the sandbox lands in the error state.
Note:
resources.memory,resources.disk, andlabelsare sent by the SDK but not applied by the API yet — onlyresources.cpuandresources.gpumap today. Use the REST API'smem_mib/scratch_mibto size memory and disk;regionis also REST-only. See sandbox parameters.
get()
Fetches a single sandbox by its id or name and returns a hydrated handle.
Returns: a Sandbox. Raises: DaytonaNotFoundError if no sandbox matches.
list()
Lists the project's sandboxes, optionally filtered client-side by id prefix, name prefix, and count.
| Parameter | Type | Default | Description |
|---|---|---|---|
query.id | str | None | Keep sandboxes whose id starts with this prefix. |
query.name | str | None | Keep sandboxes whose name starts with this prefix. |
query.limit | int | None | Truncate the result to at most this many sandboxes. |
Returns: a list of Sandbox handles.
Lifecycle helpers
Each helper simply delegates to the same-named method on the sandbox handle — see Sandbox for full semantics, including which operations require a persistent sandbox.
See stop & start and pause & resume for lifecycle guides.