Documentation

Python quickstart

Create a sandbox and run code from Python.

1. Install

Terminal shell
pip install git+https://github.com/boltzlabs/python-sdk.git

2. Add your API key

Create an API key in your dashboard. Add it to your environment or a .env file:

.env shell
BOLTZLABS_API_KEY=ak_your_key_here

3. Run your first task

main.py
from boltzlabs import Sandbox

sandbox = Sandbox.create(environment="python")
result = sandbox.exec("python -c 'print(1 + 1)'")
print(result)
sandbox.delete()

Call sandbox.delete() when you are done to stop compute billing.

All guides