Skip to main content
The SDK ships a REST client. Point it at a host running boxlite serve and your create / exec / list_info / remove calls become HTTP and WebSocket requests served by real microVMs elsewhere. Swapping Boxlite.default() for Boxlite.rest(...) leaves your call sites almost unchanged.

Prerequisites

  • A working BoxLite install (Python boxlite or Node @boxlite-ai/boxlite) and a machine with hardware virtualization — see Installation.
Start a local server for integration testing (on a host with virtualization):
By default the client reaches the server on the same host at http://localhost:8100.

Quick Example

Minimal happy path: connect to a remote endpoint and list existing boxes. Runs as-is (start boxlite serve in another terminal first).
Key point: Boxlite.rest(...) / JsBoxlite.rest(...) is a synchronous constructor, but the runtime operations under the REST client (create / get / get_info/getInfo / list_info/listInfo / metrics / remove) must be awaited. The local runtime handle behaves the same way: synchronous construction, async methods.

Create, Execute, Reclaim (End to End)

Parameters and Returns

BoxliteRestOptions(...) Constructor Parameters

Node equivalent: new BoxliteRestOptions({ url, credential, pathPrefix }) (the Node field is pathPrefix).
BoxliteRestOptions.from_env() reads the following environment variables and automatically wraps BOXLITE_API_KEY into an ApiKeyCredential:
Run:

REST Client Runtime Methods (All Require await)

Metrics fields are authoritative in the source: RuntimeMetrics uses num_running_boxes / boxes_created_total / boxes_failed_total / total_commands_executed / total_exec_errors; BoxMetrics uses memory_bytes / cpu_percent (not memory_usage_bytes / cpu_time_ms).

Accessing State (Common Pitfall)

The outer object is BoxInfo.state (a BoxStateInfo), and the inner field is status (a string). Both .state and .status must be chained correctly — the Node equivalent, info.state.status, is already shown in the Quick Example above.

Troubleshooting

Real Error Example (Passing a String for a Volume)