Reference

The Cua SDK reference: every object with its signature in Python, TypeScript, Swift, Kotlin and Rust.

The Cua SDK in Python, TypeScript, Swift, Kotlin and Rust, all generated from the Rust cua-sdk crate. Each page covers one module, with signatures in every language.

LanguagePackageImport
Pythonpip install cua (cua[sandbox] adds the high-level API; --no-deps skips the cua CLI)import cua
TypeScript (Node)npm install @trycua/cuaimport { embedded } from '@trycua/cua'
Browser@trycua/cua/browser (a WebAssembly subset)import { Cua } from '@trycua/cua/browser'
SwiftCua (macOS 12+, iOS 15+; not yet released)import Cua
Kotlinai.cua.sdk (JNA; not yet released)import ai.cua.sdk.*
Rustcua-sdk from git (see Rust crates)use cua_sdk::*;

Sandboxes#

PageCovers
Cua client and local runtimesThe Cua handle (embedded or daemon client, configuration, SDK version) and the local container and VM runtimes.
Runtime per kindWhich program runs containers, virtual machines and microVMs on this machine, and what a given binary is.
Repo cacheWhat the repo cache holds and what it saved, and clearing it.
SandboxCreate, find, connect to and control sandboxes, and their lifecycle: wait, suspend, resume, restart, detach and delete.
LifecycleWait for, keep alive, give a lifetime to, suspend, resume, restart, resize, detach and delete a sandbox.
Checkpoints and forksSave a local sandbox's state as a named checkpoint and start new sandboxes from it.
Batched forksFork checkpoints many times at once, on this machine or across your machines, each fork streamed as it is ready.
Bake a Compose stackSave a running Docker Compose stack as a checkpoint that forks start from with their containers already up.
SharesLinks to a port, a file or a folder that open on your other signed-in devices.
Images and create optionsCanonical images, image references, build layers, registry credentials, and the options Sandboxes.create takes.
Image catalog detailsThe canonical images, their variants per backend and architecture.
What's installedThe apps, tools and simulator runtimes in each image tier, as the strict doctor measured them.
ServicesNamed services, port forwards, public URLs and MCP clients of a sandbox.
Runtime supportWhich images run on which local runtime and in the cloud.

Inside a sandbox#

PageCovers
Spacesd client and processesSpacesdClient: the cua-spacesd client, running processes in a sandbox, and sandboxes without cua-spacesd.
ProcessesRun, spawn and attach to processes in a sandbox through cua-spacesd.
FilesUpload, download, list and remove files in a sandbox through cua-spacesd.
Computer and mediaScreenshots, pointer, keyboard, clipboard and displays of a sandbox desktop, and its video and audio streams.
Coding agents and setupRun coding agents (Claude Code, Codex, Gemini CLI, OpenCode, ...) inside any sandbox, and set them up on this machine.
Agent setupDetect coding agents, install cua skills and configure their MCP servers.

Spaces#

PageCovers
SpacesThe Spaces registry: create, add, resolve, delete and remove Spaces, their create options, and agent runs in a Space.
Space recordsWhat a Space listing returns, and the Spaces tools cua mcp serves with the typed method that covers each.
Network settingsWhat a Space can reach: its network preset, the allow and deny lists, and deleting a Space together with its children.
Child SpacesLet a Space make Spaces of its own, set the budget of its tree and list orphans.
Kept commandsKeep a command running in a Space: restarts, health checks, start on boot and logs.
Power and resizeStop, suspend and start a Space, and change a local VM's CPU, memory or disk while keeping its files.
Lifetime and egressHow long a Space lives and which destinations it may reach, set after it exists.
SpaceA connected Space: shell, files, tools, windows, icons, displays, the hotspot and teleport.
Sharing, leaving and bulk deleteGive another person access to a Space, see who owns a Space and who else has it, leave Spaces shared with you, and delete several at once.
Relay registrationRegister a Space with the relay so other devices reach it, and unregister it.
Elastic pool and prewarmPlan where Spaces go and what it costs, add and remove cloud hosts, set the budget, and keep Spaces ready.
Build an imageBuild a Dockerfile or steps in a Space as pinned checkpoints that Spaces fork from, with a content-hash layer cache.
ChannelWhich way a Space's calls go, and port forwards over its own connection.
Cua VolumeThe versioned volume every Space and agent shares: files, history, grants, requests, audit, storage and sync.
Joining presenceJoin a Space's presence, or the presence of a window another Space shows, so each viewer is one avatar and one cursor.
Streams and presenceMedia sessions of a Space and presence (who is connected, and their cursors).
Processor, memory and diskWhat this Mac, its extra Spaces and your other computers use: one snapshot, a stream of changes and the low-disk warning.
The list and its changesThe Space list Spaces.list reads, and hearing when it changed so it is read again then instead of on a timer.
Agents in a SpaceStart, follow, message and stop coding-agent runs inside a Space.
Persistent agents and your cloudNamed agents whose memory outlives their Space: homes in the Cua Volume, routines, notifications, pause and resume, access to your computers, and Spaces in your own AWS, Google Cloud or Modal account.
Default SpaceThe account's default Space, the order to try when it is offline, and where a new task runs now.
Host, relay and devicesUnattended host setup, the cua-relay directory client, and this device's enrollment on the relay.

Account#

PageCovers
Auth and telemetrySign-in, the credential store the SDK, the CLI and the daemon share, and the telemetry switches.

Errors and types#

PageCovers
ErrorsEvery CuaError variant: message, cause and fix.
TypesThe type notation in each language, and every item in one list.

Language packages#

PageCovers
Python high-level APIcua_sandbox: Sandbox, Image, the computer interfaces, runtimes and configuration.
TypeScript additionsWhat @trycua/cua adds in TypeScript: embedded(), Image, helpers, and the Spaces modules.
Rust cratesThe public crates (cua-sdk, cua-spacesd-client, cua-sandbox-core, cua-spaces), with stability tiers.

Protocol#

PageCovers
ProtocolThe gRPC contracts of cua-spacesd (cua.env.v1) and the cua daemon (cua.daemon.v1).

372 items, 466 methods. The Types page lists them.