Prerequisites
1
Create an API key
In the console, open API Keys and click Create Key. Give it a name such as
sdk-quickstart and leave Expires at its default of No expiration while you are exploring.The key looks like blk_live_... and is shown in full exactly once, at creation. Copy it then — the list view only ever shows a masked form afterwards. A key grants access to the Boxes API: it can create and manage boxes, and shared Linux base images are available to it automatically.For key rotation, per-environment keys, and the CLI credential store, see API keys and authentication.2
Install the SDK or CLI
- Python
- Node
- CLI
- REST (curl)
3
Create a box and run code in it
- Python
- Node
- CLI
- REST (curl)
What just happened
The five calls in that script are the whole Cloud lifecycle. Every language binding and the REST API expose the same five, in the same order:- Authenticate.
Boxlite.rest(...)wraps your key in anApiKeyCredentialand points every later call athttps://api.boxlite.ai. Nothing is sent at construction time — the object is just a configured client. - Create.
rt.create(BoxOptions(image=...), name=...)allocates a box from a shared Linux base image and returns a handle. On Cloud the box is already running by the time this returns —POST /v1/boxesanswers withstatus: running, and reading the box back before any other call reports the same. - Start.
box.start()is what boots the microVM on a self-hosted runtime. On Cloud the box is up already, so the call confirms that state rather than changing it: it is safe to repeat, and returns the box stillrunning. Keeping it in the script is what lets the same five calls run against either runtime. - Exec.
box.exec("echo", args=[...])launches one process inside the VM and hands you an execution handle.execution.wait()blocks until that process exits and returns its exit code. - Remove.
rt.remove(box.id, force=True)destroys the box and its disk. Removal is a runtime method, not a box method — the box handle you hold is a pointer, and the runtime owns the fleet.
finally block, as the script above does, is the difference between an exception costing you a stack trace and an exception costing you a box.
Expected output
Exit code line comes from execution.wait() and is the authoritative success signal. The Hello from BoxLite SDK line is what the box wrote to stdout, collected by iterating execution.stdout().
Troubleshooting
Next steps
Boxes
Pick an image and a size, and learn the three lifecycle controls Cloud applies while a box runs.
Volumes
Storage that outlives a box, so the next box can mount it and read the data back.
Plans, wallet, and usage
What a running box costs against your included quota and wallet, plus the per-box ceilings.
Cloud vs open source
Every difference between a self-hosted box and a Cloud box, in one table.

