Spaces

The Spaces registry: create, add, resolve, delete and remove Spaces, their create options, and agent runs in a Space.

cua.spaces() returns the Spaces registry. Create a Space where on says (local or cloud), or add an existing machine by URL, then open a Space. See resize to change a local VM's shape.

Spaces#

The Spaces registry: add a machine by URL, provision a local one, and get Space handles.

Returned by Cua.spaces.

MethodDescription
addAdds a Space by URL (http(s)://host:port, host:port, or a Space id such as local:<name>) after a GetCapabilities handshake.
add_with_serviceSpaces.add, naming the service a plain MCP endpoint is registered under (default mcp).
call_tool_jsonCalls any Spaces MCP tool with JSON arguments (the implementation cua daemon mcp serves).
cancel_createCancels a create that is still running: space is the create's create_id, the id the Space will have (local:<name>, carried by every progress report) or its name.
createCreates a Space where options.on says (the user default when unset): a new sandbox registered as a Space.
create_with_progressSpaces.create, reporting what it does to listener (pulling the image, booting, waiting for cua-spacesd, connecting) until the Space is ready.
deleteDeletes a Space's sandbox and forgets it (a Space added by address is only forgotten).
gpu_supportThe GPU options each runtime of on (local by default, or cloud) offers on this host: Lume's "GPU acceleration" for macOS VMs (experimental, Apple silicon), QEMU's virgl and containers' NVIDIA GPUs on Linux.
hostsYour machines that provide Spaces (the account's relay hosts, then the hosts added by their Tailscale or LAN address), each asked for its limits: what create takes as on="host:<id>".
listRegistered Spaces.
list_knownThe Spaces known now: this machine's at once, and the account's other computers as far as they answered within a moment (SpaceList says how far the read got).
list_tools_jsonThe Spaces MCP tools/list result as JSON (the contract).
network_logWhat a Space on the daemon's computer tried to reach and its network refused, most recent first (cua network log).
removeUnregisters a Space (the sandbox is not touched).
renameGives a Space a new name; its id stays the same.
resolveResolves an id, legacy id, URL or display name.
set_clipboard
set_volumeSets when a Space's viewers may move the clipboard between this computer and the Space: viewing (only while you're viewing, the default), ask or off.
spaceA connected handle to a registered Space.
startTurns a Space on again: resumes a suspended one, boots a stopped one (a Space one of your machines provides joins the relay again), and leaves a running one as it is.
stopTurns a Space off the way its provider can (SpaceInfo.power): stops it, keeping its disk and freeing its memory (a local VM; a Space one of your machines provides, which that machine stops), or suspends it, keeping its memory (a local container that cannot stop). Spaces.suspend suspends a local container or QEMU VM on purpose.
suspendSuspends a local Space (a container or a QEMU VM), keeping its memory: it resumes where it was, and its memory stays in use until then. Spaces.stop stops it instead and frees its memory.
ack_network_noticeMarks the one-time notice about the new network defaults as shown for space (SpaceNetworkInfo.notice_pending).
agent_capabilitiesWhat every agent harness is and cannot do (agent_capabilities), as JSON.
agent_pausePauses a persistent agent: run, routines and (local) Space.
agent_resumeResumes a paused persistent agent; with prompt, starts a run.
buildBuilds an image from a Dockerfile or steps in a Space, as pinned layer checkpoints on this machine.
build_with_progressSpaces.build, reporting each step and the lines it prints to listener as they happen.
buildsThe builds on this machine, oldest first, with their tags.
cloud_add_hostAdds count hosts of instance_type in a linked cloud by hand (the scaler never removes them); each ends at its TTL.
cloud_approveApproves what an agent asked for on provider (its link, or a raise of its limits), or with deny declines it.
cloud_auditWhat Cua did in your clouds, newest last (default the newest 50).
cloud_budgetThe elastic pool's budget and autoscale switch, after setting the fields update gives.
cloud_connectConnects a cloud account (after the checks cloud_test runs).
cloud_costWhat the machines Cua created cost (an estimate: list price times runtime), grouped by space, agent, day or cloud, since since (YYYY-MM-DD; default the first of this month), for one provider or every cloud.
cloud_disconnectForgets a connected cloud.
cloud_hostsThe hosts the elastic pool added in your clouds, with their cost.
cloud_planWhat the elastic pool would do for some Spaces: where each goes (your devices first, then hosts with room, then new cloud machines at the least cost) and what that costs.
cloud_reconcileOne scale-in pass now: idle hosts go at the end of their paid time, the least-used one is cordoned when the others have room.
cloud_remove_hostRemoves hosts this home added to the pool.
cloud_statusYour clouds: found credentials, the connected account and region, what each can run at what hourly cost, and what Cua created there.
cloud_sweepWhat Cua left in your clouds (expired Spaces, resources whose Space is gone; with all, everything Cua created there).
cloud_testChecks a cloud account without creating anything.
computer_accessPer-agent computer grants (of one agent, or all).
computer_access_grantLets one persistent agent use one of the user's computers (asks for presence).
computer_access_revokeTakes a persistent agent's computer access back (every machine when machine is empty).
create_volumeCreates the empty named volume name (1 to 63 of a-z, 0-9, ., _, -).
delete_buildDeletes a build: its tags and the layer checkpoints no other build uses.
delete_manyDeletes several Spaces (Spaces.delete each), at most three at a time, turning running ones off first.
delete_treeSpaces.delete, with keep_children: its child Spaces become top-level Spaces and keep running instead of being deleted first.
delete_volumeDeletes the named volume name and its files (their history stays in the Cua Volume).
forkStarts Space name from source (a Space id such as local:<name>, a sandbox name, a checkpoint name, or the tag of a build (Spaces.build) or its checkpoint; a sandbox wins) and returns it connected.
leave_manyTakes this account off Spaces shared with it (through the relay): a direct share ends, a team's Space leaves this account's list.
machine_healthA machine's health as its own cua daemon checks it: Local Network access (and which app macOS holds responsible), free disk, virtualization, memory left by running Spaces, the permissions sharing its desktop needs.
networkA Space's network: its settings, what they open, where they are enforced (or why its network is cut), and what is always blocked.
notificationsThe notifications feed, newest first.
notifications_ackMarks notifications read (every one when ids is empty).
notify_userPosts a notification to the Cua app.
orphansChild Spaces whose parent is gone or out of reach.
persistent_agent_createCreates a persistent agent: harness working in space, its home at agents/<name>/ in the Cua Volume.
persistent_agent_removeForgets a persistent agent (its home stays in the drive).
persistent_agent_saveSaves a persistent agent's home into the drive now.
persistent_agent_sendGives a persistent agent a turn: a follow-up to its idle run, or a new run with its home restored.
persistent_agentsEvery persistent agent.
prewarmKeeps Spaces of image ready where the elastic pool puts them (the same solve as on auto, under the budget and pins), so the next creates of that shape start in a fraction of a second.
prewarmsThe prewarms, with how many each keeps ready now.
relay_registerPublishes space on the cua.ai relay as a machine of the signed-in account, the way cua host setup publishes this computer: the Space's own driver dials out, so the account's other devices (a phone off this network) reach it as relay:<machine>, and nobody else until it is shared.
relay_unregisterTakes space off the relay (its driver leaves; every share goes).
relay_unregister_computerSpaces.relay_unregister for one of your computers (relay:<machine>), choosing what happens to the Spaces it provides: with delete_spaces false they stay on the account, detached (they come back when the computer registers again); with true they are deleted too, files first (through the computer while it answers), then their records.
remove_prewarmEnds prewarm id (its ready Spaces go).
resizeGives a local VM Space another shape: cpus vCPUs, memory_mb MiB of memory, a disk grown to disk_gb GiB (each None keeps it).
resourcesWhat this Mac, its extra Spaces and your other computers use now: processor, memory and disk, as one snapshot (a few seconds old at most).
routine_addAdds a routine.
routine_removeDeletes a routine.
routine_set_enabledTurns a routine on or off.
routinesRoutines (of one agent, or all).
set_childrenLets a Space make child Spaces of its own, or stops it.
set_egressReplaces a Space's egress policy; an empty one removes it (see EgressPolicy).
set_lifetimeGives a Space a lifetime of seconds from now, replacing any earlier one: when it passes, the cua daemon deletes the Space (on_expire "delete", the default) or turns it off ("suspend"), whether or not this process is still running.
set_networkReplaces a Space's network settings (see NetworkSettings).
set_tree_budgetSets the budget of space's tree: how many child Spaces, vCPUs and memory its children may hold at once, and what they may cost.
tree_budgetThe budget of space's tree (any Space of it) and what its children use now.
volume_approvevolume_approve: the request becomes a grant (with presence).
volume_auditvolume_audit: the newest events (default 50) and whether the log verified.
volume_cache_clearvolume_cache_clear: drops every cached block.
volume_cache_setvolume_cache_set: the cache's size cap (at least 256 MiB).
volume_cache_statsvolume_cache_stats: the block cache's size, cap and hit rate.
volume_deletevolume_delete: a delete marker (history stays).
volume_denyvolume_deny.
volume_grantvolume_grant: widens principal's access (agent:<name> or space:<id>, mode r or rw).
volume_grantsvolume_grants: live grants (every grant with all).
volume_historyvolume_history: a file's versions, newest first.
volume_lsvolume_ls: a folder's immediate children (default the root).
volume_mountvolume_mount: turns the mount on (kept across restarts) and mounts.
volume_mount_statusvolume_mount_status: whether the drive is mounted as a volume.
volume_readvolume_read: a file (or one of its versions).
volume_request_accessvolume_request_access: agent asks the user for more access.
volume_requestsvolume_requests: requests waiting for the user.
volume_restorevolume_restore: makes an old version current again.
volume_revokevolume_revoke.
volume_storagevolume_storage: where the drive keeps its bytes.
volume_storage_setvolume_storage_set: tests, and unless dry_run saves and switches to, a storage backend (live, no restart).
volume_sync_eventsvolume_sync_events: events after since_seq, waiting up to wait_ms (at most 30000) for one.
volume_sync_resolvevolume_sync_resolve: clears a conflict from the list (files stay).
volume_sync_statusvolume_sync_status: devices, pending uploads and conflicts.
volume_unmountvolume_unmount: turns the mount off; pending uploads land first.
volume_writevolume_write: a new version of a file.
volumesThe named volumes of Cua Volume, by name, with the Spaces that mount each.
watch_listTells listener when the Space list changed: once at the start, then on every change.
watch_resourcesThe same numbers as events for listener: a snapshot first, then an update with only the entries that changed by more than 1 point or 256 MB, and LowDisk whenever the warning level changes.

Spaces.add#

Adds a Space by URL (http(s)://host:port, host:port, or a Space id such as local:<name>) after a GetCapabilities handshake. Any other MCP endpoint (http://host:8765/mcp) becomes a Space with one MCP service, mcp, and no spacesd capabilities.

async def add(self, url: str, token: Optional[str], name: Optional[str]) -> SpaceInfo
ParameterTypeDefault
urlStringrequired
tokenOption<String>required
nameOption<String>required

Returns SpaceInfo · Async · Raises CuaError

Example

import asyncio
 
import cua
 
async def main():
    spaces = cua.embedded().spaces()
    info = await spaces.add("http://10.0.0.5:3211", "TOKEN", "lab")  # a computer running cua-spacesd
    space = await spaces.space(info.id)
    out = await space.bash("echo hi", None)
    print([info.provider, out.stdout, out.exit_code])
 
asyncio.run(main())

Spaces.add_with_service#

Spaces.add, naming the service a plain MCP endpoint is registered under (default mcp).

async def add_with_service(self, url: str, token: Optional[str], name: Optional[str], service: Optional[str]) -> SpaceInfo
ParameterTypeDefault
urlStringrequired
tokenOption<String>required
nameOption<String>required
serviceOption<String>required

Returns SpaceInfo · Async · Raises CuaError

Spaces.call_tool_json#

Calls any Spaces MCP tool with JSON arguments (the implementation cua daemon mcp serves). Tool errors are returned, not raised.

async def call_tool_json(self, tool: str, arguments_json: Optional[str]) -> SpaceToolResult
ParameterTypeDefault
toolStringrequired
arguments_jsonOption<String>required

Returns SpaceToolResult · Async · Raises CuaError

Spaces.cancel_create#

Cancels a create that is still running: space is the create's create_id, the id the Space will have (local:<name>, carried by every progress report) or its name. The work in flight stops (an image download, a boot, a relay registration) and what the create made is removed (its VM or container and disks, its relay machine); nothing that existed before is touched. Finished image downloads stay cached, so the next create resumes. Returns once the clean-up is done; the create itself fails with Cancelled. Idempotent: a second call says not_creating. Works for a create another process runs, and one a daemon restart cut off.

async def cancel_create(self, space: str) -> SpaceCancelOutcome
ParameterTypeDefault
spaceStringrequired

Returns SpaceCancelOutcome · Async · Raises CuaError (Cancelled)

Spaces.create#

Creates a Space where options.on says (the user default when unset): a new sandbox registered as a Space. An existing machine is added with Spaces.add.

async def create(self, options: SpaceCreateOptions) -> SpaceCreateResult
ParameterTypeDefault
optionsSpaceCreateOptionsrequired

Returns SpaceCreateResult · Async · Raises CuaError

Spaces.create_with_progress#

Spaces.create, reporting what it does to listener (pulling the image, booting, waiting for cua-spacesd, connecting) until the Space is ready. Always waits (options.wait is ignored). Through a daemon that predates progress, the listener hears only ready.

async def create_with_progress(self, options: SpaceCreateOptions, listener: SpaceCreateListener) -> SpaceCreateResult
ParameterTypeDefault
optionsSpaceCreateOptionsrequired
listenerSpaceCreateListenerrequired

Returns SpaceCreateResult · Async · Raises CuaError

Spaces.delete#

Deletes a Space's sandbox and forgets it (a Space added by address is only forgotten). Its child Spaces are deleted first. Returns what happened.

async def delete(self, space: str) -> str
ParameterTypeDefault
spaceStringrequired

Returns String · Async · Raises CuaError

Spaces.gpu_support#

The GPU options each runtime of on (local by default, or cloud) offers on this host: Lume's "GPU acceleration" for macOS VMs (experimental, Apple silicon), QEMU's virgl and containers' NVIDIA GPUs on Linux. A runtime with no option says why.

async def gpu_support(self, on: Optional[str]) -> List[GpuSupport]
ParameterTypeDefault
onOption<String>required

Returns Vec<GpuSupport> · Async · Raises CuaError

Spaces.hosts#

Your machines that provide Spaces (the account's relay hosts, then the hosts added by their Tailscale or LAN address), each asked for its limits: what create takes as on="host:<id>". One that does not answer is listed offline when it provided a Space before.

async def hosts(self) -> List[SpacesHost]

Returns Vec<SpacesHost> · Async · Raises CuaError

Spaces.list#

Registered Spaces.

async def list(self) -> List[SpaceInfo]

Returns Vec<SpaceInfo> · Async · Raises CuaError

Spaces.list_known#

The Spaces known now: this machine's at once, and the account's other computers as far as they answered within a moment (SpaceList says how far the read got). A slow or unreachable relay never holds up or fails this machine's own Spaces, so an app shows them right away and reads again while the list is incomplete. Spaces.list waits for every computer instead.

async def list_known(self) -> SpaceList

Returns SpaceList · Async · Raises CuaError

Spaces.list_tools_json#

The Spaces MCP tools/list result as JSON (the contract).

async def list_tools_json(self) -> str

Returns String · Async · Raises CuaError

Spaces.network_log#

What a Space on the daemon's computer tried to reach and its network refused, most recent first (cua network log).

async def network_log(self, space: str) -> List[NetworkEvent]
ParameterTypeDefault
spaceStringrequired

Returns Vec<NetworkEvent> · Async · Raises CuaError

Spaces.remove#

Unregisters a Space (the sandbox is not touched).

async def remove(self, space: str) -> None
ParameterTypeDefault
spaceStringrequired

Async · Raises CuaError

Spaces.rename#

Gives a Space a new name; its id stays the same. Returns the Space as it is listed now (display_name, or name for a Space that is a machine on the relay).

The name follows the rule a create's does (lowercase letters, digits and dashes, starting and ending with a letter or digit, at most 63) and may not be another of your Spaces' names (InvalidArgument). Only its owner renames a Space: one shared with you is refused (PermissionDenied). A Space you shared, or one of your computers provides, is renamed on the relay too, so your other devices and the people it is shared with see the new name.

async def rename(self, space: str, name: str) -> SpaceInfo
ParameterTypeDefault
spaceStringrequired
nameStringrequired

Returns SpaceInfo · Async · Raises CuaError (InvalidArgument, PermissionDenied)

Spaces.resolve#

Resolves an id, legacy id, URL or display name.

async def resolve(self, space: str) -> SpaceInfo
ParameterTypeDefault
spaceStringrequired

Returns SpaceInfo · Async · Raises CuaError

Spaces.set_clipboard#

async def set_clipboard(self, space: str, clipboard: str) -> None
ParameterTypeDefault
spaceStringrequired
clipboardStringrequired

Async · Raises CuaError

Spaces.set_volume#

Sets when a Space's viewers may move the clipboard between this computer and the Space: viewing (only while you're viewing, the default), ask or off. It applies to viewers opened afterwards. The agent tools computer_clipboard_* act inside the Space and are not affected. Another word is InvalidArgument. Sets what a Space sees of the Cua Volume: own (its own folder) or off. Applies now: off unmounts the Volume (named volumes it mounted stay).

async def set_volume(self, space: str, volume: str) -> None
ParameterTypeDefault
spaceStringrequired
volumeStringrequired

Async · Raises CuaError (InvalidArgument)

Spaces.space#

A connected handle to a registered Space.

async def space(self, space: str) -> Space
ParameterTypeDefault
spaceStringrequired

Returns Space · Async · Raises CuaError

Spaces.start#

Turns a Space on again: resumes a suspended one, boots a stopped one (a Space one of your machines provides joins the relay again), and leaves a running one as it is. Returns once it answers (bounded).

async def start(self, space: str) -> SpacePowerReport
ParameterTypeDefault
spaceStringrequired

Returns SpacePowerReport · Async · Raises CuaError

Spaces.stop#

Turns a Space off the way its provider can (SpaceInfo.power): stops it, keeping its disk and freeing its memory (a local VM; a Space one of your machines provides, which that machine stops), or suspends it, keeping its memory (a local container that cannot stop). Spaces.suspend suspends a local container or QEMU VM on purpose. A Space added by address and your own computers cannot be turned off.

async def stop(self, space: str) -> SpacePowerReport
ParameterTypeDefault
spaceStringrequired

Returns SpacePowerReport · Async · Raises CuaError

Spaces.suspend#

Suspends a local Space (a container or a QEMU VM), keeping its memory: it resumes where it was, and its memory stays in use until then. Spaces.stop stops it instead and frees its memory.

async def suspend(self, space: str) -> SpacePowerReport
ParameterTypeDefault
spaceStringrequired

Returns SpacePowerReport · Async · Raises CuaError

Create options#

Spaces.create takes SpaceCreateOptions (with an EgressPolicy for the destinations a Linux Space may reach) and returns a SpaceCreateResult. A SpaceCreateListener receives SpaceCreateProgress while it runs; Spaces.cancel_create stops it. GpuSupport says whether a location offers GPU acceleration.

SpaceCreateOptions record#

Options for Spaces.create: the same location / kind / runtime model as sandboxes.

FieldTypeDefaultDescription
imageOption<String>NoneImage (default: the canonical Linux image). checkpoint:<name> starts a fork of that checkpoint, on whichever of your machines holds it (CheckpointSummary.host): its disk, memory and processes, so no command, environment, services, GPU or disk size.
onOption<String>NoneWhere: local (free), a connected cloud account (aws, gcp, modal) or host:<name>. None: the user default (default.on, CUA_DEFAULT_ON, else local); for a checkpoint: image, where the checkpoint is. A checkpoint also starts on host:<machine> or auto, copied there first when that machine lacks it.
kindOption<String>Noneauto (default), container, vm or microvm.
runtimeOption<String>Noneauto (default) or an engine the location offers for the kind.
nameOption<String>NoneName (default space-<hex>).
cpusOption<u32>NonevCPUs. Local default 2.
memory_mb / memoryMbOption<u64>NoneMemory in MiB. Local default 4096.
disk_gb / diskGbOption<u32>NoneGrow the VM's disk to this many GiB (local VMs; default: the image's size, never smaller). Lume grows the macOS APFS container before the first boot; Linux images grow their root partition at boot. Containers and cloud Spaces refuse it.
timeout_ms / timeoutMsOption<u64>NoneReadiness budget (local; default 600 s).
waitOption<bool>NoneWait until ready (default true).
reuseboolfalseReturn a reachable registered Space in the same location with the requested services instead of creating one.
commandOption<Vec<String>>NoneEntrypoint override.
envHashMap<String, String>[:]Guest environment.
servicesHashMap<String, u16>[:]Named services (name → guest port), for example {"mcp": 8765}.
spacesdOption<bool>NoneWhether the image runs cua-spacesd (default: yes for the canonical images; any other image gets a static one injected on a local container or microVM, so it is a full Space; false runs the image as it is).
gpuOption<String>NoneA GPU option of the runtime the Space runs on (Spaces.gpu_support): paravirtual for a macOS VM on Lume (GPU acceleration, experimental), virgl (QEMU on Linux), nvidia (a runc container on Linux); auto picks the runtime's own. None (the default): no GPU. Kept with the Space.
create_id / createIdOption<String>NoneYour own key for this create (an app's pending row), for Spaces.cancel_create before the Space's id is known.
durableboolfalseKeep the Space on your machines (on "auto"): when its machine goes away it is created again on another one, with the same name (its disk starts fresh). Needs the cua daemon of Cua Spaces and an account with machines that provide Spaces.
profileOption<String>NoneA size profile: defaults for what is left unset. "rollout": 1 vCPU, 1024 MiB and headless (a local VM gets no display hardware, so many more fit on one machine), for RL rollouts and agent episodes that mostly wait. None or "default": 2 vCPUs, 4096 MiB.
headlessOption<bool>NoneA Space without a desktop: only cua-spacesd runs (exec, files, processes, MCP), with no display, window manager or audio. For shell and RL workloads it starts several times faster and fits many more per machine. None: what profile says (a desktop by default).
forkableOption<bool>NoneA fork source (a "bake" Space): a local QEMU VM's guest RAM is a shared file, so its checkpoints (Space.checkpoint) take milliseconds and forks of them (Space.fork, Spaces.fork) share its pages. Other kinds ignore it. None (the default): not one.
buildOption<BuildOptions>NoneBuild an image first (cached when unchanged), then fork the result. image must be unset.
volumesVec<VolumeMount>[]Named volumes of Cua Volume to mount in the Space (Spaces.create_volume): each appears at its path, read-write or read-only; the Space sees no other volume. Needs the Cua Volume (Cua Spaces) and a guest that can mount it; the create fails otherwise, naming what is missing. A fork mounts the same volumes.
networkOption<String>NoneGuest network: default (unset) gives outbound network; none gives none (QEMU VMs, here or on one of your machines; published ports and cua-spacesd still reach the guest). Not with durable or reuse. A daemon or machine whose cua is too old to enforce none is refused (CapabilityMissing) and the Space it made is deleted.
labelsHashMap<String, String>[:]Labels kept with the Space and returned in SpaceInfo.labels: at most 64; keys and values are not empty (UTF-8); keys up to 63 bytes, values up to 256. Not with durable or reuse. The device that creates the Space keeps them (also for host: and auto).
egressOption<EgressPolicy>NoneEgress policy (see EgressPolicy), enforced by the host the Space runs on from the guest's first instruction. A kind or location with no host-side point refuses it (Unsupported) before anything is created. Not with durable, reuse or wait = false; a daemon too old to enforce it makes the create fail.
network_settings / networkSettingsOption<NetworkSettings>NoneNetwork settings (see NetworkSettings). None: what network and egress say (internet when neither says anything). A daemon too old to keep them makes the create fail.
parentOption<String>NoneCreate it as a child of this Space (id or name): its network is no more open than its parent's, and it joins the parent's tree.
widenOption<bool>NoneWith parent: let its network be more open than its parent's (recorded on the Space).
instance_type / instanceTypeOption<String>NoneWith on a linked cloud (aws, hetzner, ...): the machine type its host must be (c7g.xlarge, cax41), a pin of the elastic pool's solve. None: the pool picks the cheapest that fits.
regionOption<String>NoneWith on a linked cloud: the region its host must be in.
childrenOption<bool>NoneLets the Space make child Spaces of its own (Spaces.set_children). None: off. Only a Space the machine of the runtime runs itself.

EgressPolicy record#

Which destinations a Space may open connections to. Everything is allowed unless a rule says otherwise: every deny entry blocks that destination, every allow entry is an exception that wins over deny (deny: ["all"] with allow: ["1.1.1.1"] leaves only 1.1.1.1 reachable), and an allow list with no deny blocks nothing. Entries are IPv4/IPv6 addresses or CIDRs (all is 0.0.0.0/0 and ::/0); a hostname is refused (rules are by IP/CIDR). DNS works only while the resolver the guest uses is not blocked (or is allowed): there is no special case. Loopback, replies to connections made to the guest and IPv6 neighbor discovery are never filtered.

The host the Space runs on enforces it, outside the guest, from the guest's first instruction (SpaceInfo.egress_enforced): containers (runc and gVisor) on the container engine's host, Firecracker and QEMU VMs on Linux in a network namespace around the VM. Nothing in the guest, root included, can change it. macOS VMs, Apple Containerization, QEMU on macOS or Windows, Cua Cloud and your own cloud accounts refuse a policy (Unsupported, saying why).

FieldTypeDefaultDescription
allowVec<String>[]Destinations that stay reachable where deny blocks them.
denyVec<String>[]Destinations that are blocked.

SpaceCreateResult record#

Result of Spaces.create.

Returned by Spaces.create, Spaces.create_with_progress.

FieldTypeDefaultDescription
spaceOption<SpaceInfo>The Space, once ready.
pending_id / pendingIdOption<String>With wait = false: the id the Space will have.
reusedboolreuse returned an existing Space.

SpaceCreateProgress record#

What a Space create is doing (see Spaces.create_with_progress).

FieldTypeDefaultDescription
phaseStringpreparing, pulling, creating, booting, waiting_for_services, connecting or ready, in that order.
fractionOption<f64>How far through the phase, 0.0 to 1.0, when its size is known (an image pull).
detailStringOne short line, for example the image being pulled.
bytes_done / bytesDoneOption<u64>NoneBytes downloaded so far, when the step counts them (an image pull).
bytes_total / bytesTotalOption<u64>NoneBytes the download has in all.
bytes_per_second / bytesPerSecondOption<f64>NoneSmoothed download rate, bytes per second (time left: the bytes to go over it).
spaceString""The id the Space will have (local:<name>), for Spaces.cancel_create.

SpaceCreateListener#

Receives SpaceCreateProgress while Spaces.create_with_progress runs, in order, ending with ready. Called on an SDK worker thread; return quickly.

You implement SpaceCreateListener and pass it to the SDK (a callback interface): subclass it in Python, implement the interface in TypeScript, the SpaceCreateListener protocol in Swift, the interface in Kotlin and the trait in Rust.

MethodDescription
on_progressThe create moved on.

SpaceCreateListener.on_progress#

The create moved on.

def on_progress(self, progress: SpaceCreateProgress) -> None
ParameterTypeDefault
progressSpaceCreateProgressrequired

SpaceCancelOutcome record#

What Spaces.cancel_create did.

Returned by Spaces.cancel_create.

FieldTypeDefaultDescription
idStringThe Space id the create had (local:<name>), when known.
stateStringcancelled, not_creating (nothing by that key is running) or already_created (it finished: delete it instead).
messageStringWhat was removed and what stays, for people.

GpuSupport record#

The GPU options of one runtime: empty, with the reason, when it has none.

Returned by Spaces.gpu_support.

FieldTypeDefaultDescription
runtimeStringlume, qemu, container, gvisor, a provider's name.
optionsVec<GpuOption>Its options.
reasonStringWhy it has none.

GpuOption record#

One GPU option of a runtime (see Spaces.gpu_support).

FieldTypeDefaultDescription
idStringWhat to pass as gpu.
labelStringHow a person names it ("GPU acceleration").
experimentalboolExperimental.
supportedboolWorks on this host now.
reasonStringWhy not, one short line (empty when supported).
learn_more / learnMoreOption<String>A page that explains it.
usd_per_hour / usdPerHourOption<f64>Estimated cost per hour while it runs (cloud GPU types).