Contact us at info@hyperbrowser.ai or through support chat to enable GPU access for your team.
Before you start
Install and configure the CLI, usinghx 0.1.25 or later. The example below builds an image remotely, so you don’t need Docker installed on your computer.
Build a GPU image
Your image needs the libraries your application will use on the GPU. This example uses PyTorch with CUDA 12.8. Create a folder calledgpu-python and save the following as gpu-python/Dockerfile:
YOUR_BUILD_ID below:
Create a GPU sandbox
Start your image on an L4 GPU:Run code on the GPU
Run a small PyTorch computation inside the sandbox:0.0.0.0.
Stop the sandbox
Stop the sandbox when you’re done:Choose GPUs and resources
Set--gpu to a GPU type from the pricing table. Add --gpu-count when your application needs more than one GPU. You can request 1–8 GPUs of the same type on one host, subject to available capacity and host sizes. Each GPU is reserved for your sandbox; the host may also run other sandboxes.
GPU sandboxes use the
us region by default. GPU, CPU, and system memory are billed while the sandbox is running, including idle time. Provisioning time is not billed. See Pricing for rates and a worked example.
Use the REST API
After building the image, you can also create and manage GPU sandboxes with the API. The Node 1.3.0 and Python 1.13.0 SDKs do not expose GPU creation fields; use the CLI or REST API with those versions.Create, run, and stop with cURL
Create, run, and stop with cURL
Set The response is Check the sandbox’s status:Repeat this request every few seconds until Send a command to the runtime URL using the sandbox token:The command output is in
HYPERBROWSER_API_KEY as described in Install, then create a sandbox from the gpu-python image you built above:202 Accepted with status: "provisioning". Copy its id into SANDBOX_ID:status is active. If it ends or fails instead, check closeReason before creating another sandbox. While provisioning, runtime and token are null.Once active, copy runtime.baseUrl and token from the response:result.stdout. It contains NVIDIA L4 and 14.0, just like the CLI example.Stop the sandbox when you’re finished. This also works while it is still provisioning:Storage and interruptions
GPU sandboxes support files, terminals, exposed ports, and network policies. They do not support memory snapshots, shared volumes, or managed secret injection through secrets, vaults, or 1Password. GPU workloads can be interrupted, and running processes are not automatically resumed or replayed. Save checkpoints and results to external storage so you can recover your work in a new sandbox.Troubleshooting
See the create-sandbox API reference for all request fields.