The Celesto SDK lets you create sandboxed computers, run commands inside them, and manage the full lifecycle from your code or the command line. You can use it to spin up isolated environments for AI agents, run untrusted code safely, or automate development workflows. The SDK is available for both Python and JavaScript/TypeScript.Documentation Index
Fetch the complete documentation index at: https://docs.celesto.ai/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Authentication
Set your API key as an environment variable or pass it directly:Quick example
Computers API
The Computers API lets you create, manage, and interact with sandboxed virtual machines.Create a computer
Number of virtual CPUs. Range: 1-16.
Memory in MB. Range: 512-32768.
OS image to use for the computer.
Unique identifier for the computer (e.g.,
cmp_abc123).Auto-generated display name for the computer (e.g.,
einstein).Current status. One of:
creating, running, stopping, stopped, starting, deleting, deleted, error.Number of virtual CPUs allocated.
Memory allocated in MB.
OS image used.
ISO 8601 timestamp of when the computer was created.
ISO 8601 timestamp of when the computer was stopped. Only present if the computer has been stopped.
Description of the most recent error, if the computer is in
error status.Connection details for accessing a running computer.
Execute commands
Run a shell command on a computer:Computer ID or name.
Shell command to execute.
Timeout in seconds. Range: 1-300.
Exit code of the command.
0 means success.Standard output from the command.
Standard error output from the command.
Get a computer
Retrieve details of a specific computer:List computers
List of computer objects, each with the same fields as the create response.
Total number of computers in the list.
Lifecycle
Stop, start, and delete computers as needed:Terminal connection (JavaScript only)
The JavaScript SDK provides agetTerminalConnection method that returns the URL, headers, and first message you need to open an interactive WebSocket terminal session. Bring your own WebSocket library — the SDK has zero runtime dependencies, so you can use ws, Node’s built-in WebSocket (Node 22+), or any other client.
cmp_abc123) or a human-readable name. It resolves the name to the canonical ID before the handshake.
The
wss:// URL for the WebSocket connection.Headers to include in the WebSocket handshake, including the
Authorization header.JSON string to send as the first message after connecting.
CLI reference
Thecelesto CLI focuses on computer management. All commands live under celesto computer.
| Command | Description |
|---|---|
celesto computer create [--cpus N] [--memory MB] | Create a computer |
celesto computer list | List all computers |
celesto computer run <name> "command" | Execute a command (auto-resumes stopped computers) |
celesto computer ssh <name> | Interactive terminal (auto-resumes stopped computers) |
celesto computer stop <name> | Stop a computer |
celesto computer start <name> | Start a stopped computer |
celesto computer delete <name> [--force] | Delete a computer |
Auto-resume
Therun and ssh commands automatically resume a stopped computer before executing. If you run a command or open a terminal session on a stopped computer, the CLI starts it, waits for it to become available, and then proceeds. You do not need to call start manually first.
JSON output
All commands support--json (-j) for machine-readable output, which is useful for scripting and AI agent integrations:
Examples
Create a computer and run a command:Deployment API
The Deployment API lets you package and deploy AI agents to Celesto’s managed infrastructure.Deploy an agent
The Deployment API is currently available in the Python SDK only.
Path to the directory containing your agent code.
Unique name for the deployment.
Human-readable description of the deployment.
Environment variables as key-value pairs.
Project name to scope the deployment. Defaults to your first project.
Unique deployment identifier.
Deployment status:
BUILDING, READY, or FAILED.Endpoint URL, available when status is
READY.Additional information about the deployment result.
List deployments
Unique deployment identifier.
Deployment name.
Human-readable description, if provided during deploy.
Deployment status:
READY, BUILDING, FAILED, or STOPPED.ISO 8601 timestamp of when the deployment was created.
ISO 8601 timestamp of the most recent update.
Error handling
Both SDKs provide typed errors so you can handle different failure modes.- Python
- JavaScript
| Exception | When it occurs |
|---|---|
CelestoAuthenticationError | Invalid or missing API key (401/403) |
CelestoValidationError | Invalid parameters (400/422) |
CelestoNotFoundError | Resource not found (404) |
CelestoRateLimitError | Too many requests (429) |
CelestoServerError | Server-side error (5xx) |
CelestoNetworkError | Connection failures or timeouts |
