Computer lifecycle
1
Create
Create a new computer from
scratch or a template such as coding-agent.2
Run
Execute shell commands, inspect output, and publish ports when a service needs a public URL.
3
Manage
Get details, list computers, stop and start long-lived computers, or delete temporary computers.
Celesto accepts Nano (1 vCPU, 512 MB), Small (1 vCPU, 1 GB), Standard (2 vCPU, 4 GB), and Large (4 vCPU, 12 GB). Free and Nano plans can create Nano computers. Builder and Growth can create every named size. See Choose computer size.
Create a computer
UseComputer() with no arguments to get a fresh scratch computer, which is a minimal Ubuntu sandbox.create_computer.py
create_sized_computer.py
integer
CPU value from a named size. Use together with the matching
memory value. Defaults to the template’s value.integer
Memory in MB from a named size. Use together with the matching
cpus value. Defaults to the template’s value.integer | string
Disk size as MB or a string such as
"15gb". Alias for disk_size_mb.integer
Disk size in MB. Range: 512-20480. Defaults to the template’s value.
string
default:"scratch"
Sandbox template ID. Pass
coding-agent when your agent needs common coding tools already installed.string
Optional immutable template version. Pin this when you want repeatable builds as a template changes over time.
Use a template
A template is a ready-made computer image with extra tools and default CPU, memory, and disk settings. Usecoding-agent for common coding workflows:create_from_template.py
List templates
list_templates.py
Run commands
run_command.py
integer
required
Exit code of the command.
0 means success.string
required
Standard output from the command.
string
required
Standard error output from the command.
Stream command output
Userun_stream() when you want to see output as it is produced instead of waiting for the command to finish. It returns an iterator of event dicts that arrive over a server-sent events stream, which is useful for long-running builds, test suites, or agent tool calls that print progress.stream_command.py
type field:started— the command has been accepted. Includescommand_idandtimeout_seconds.stdoutandstderr— a chunk of output. The bytes are indata.exit— the command finished. Includesexit_code,duration_ms, andtimed_out.
exit event, even when the command times out or is interrupted. Break out of the loop early to stop consuming; the remote command still runs to completion.Get and list computers
list_computers.py
Publish a port
Publishing a port gives your computer a public HTTPS URL. Use it when an app, API server, or notebook running inside the computer needs to be reachable from outside the sandbox.publish_port.py
Open a terminal connection
Usecreate_terminal_session() when your application needs an interactive shell against a running computer, for example to power a web terminal in your own product. It calls POST /computers/{id}/terminals and returns a short-lived, direct connection to Celesto’s fast terminal gateway. Your account must have write access to the computer.terminal.py
string
required
Durable terminal session ID.
string
required
Base gateway URL without credentials. Combine with
token yourself only when you cannot use url directly.string
required
Short-lived terminal token. Treat this as a secret.
string
required
ISO 8601 timestamp after which the token stops working. Create a new session before this time.
string
required
Authenticated
wss:// URL ready to pass to a WebSocket client.Stop, start, and delete
lifecycle.py
Computer response fields
string
required
Unique identifier for the computer, such as
cmp_abc123.string
required
Auto-generated display name for the computer, such as
einstein.string
required
Current status. One of:
creating, running, stopping, stopped, starting, restoring, restorable, deleting, deleted, or error.integer
required
Number of virtual CPUs allocated.
integer
required
Memory allocated in MB. TypeScript exposes this as
ramMb.integer
required
Disk allocated in MB. TypeScript exposes this as
diskSizeMb.string
required
Sandbox template the computer was created from. TypeScript exposes this as
templateId.string
Pinned template version, if one was provided at create time. TypeScript exposes this as
templateVersion.object
Connection details for accessing a running computer.
