Create a volume
To create a standalone volume, you must provide a uniquename and specify its size in megabytes (MB). You can also specify optional labels. This volume exists independently of any resource it may later be attached to.
Learn more about authentication on Blaxel
Learn more about authentication on Blaxel
The Blaxel SDK requires two environment variables to authenticate:
You can create an API key from the Blaxel console. Your workspace name is visible in the URL when you log in to the console (e.g. When developing locally, you can also log in to your workspace with Blaxel CLI (as shown above). This allows you to run Blaxel SDK functions that will automatically connect to your workspace without additional setup. When you deploy on Blaxel, authentication is handled automatically — no environment variables needed.
| Variable | Description |
|---|---|
BL_WORKSPACE | Your Blaxel workspace name |
BL_API_KEY | Your Blaxel API key |
app.blaxel.ai/{workspace}).Set them as environment variables or add them to a .env file at the root of your project:Delete a volume
Delete a volume by calling:-
the class-level
delete()method with the volumenameas argument, or -
by calling the instance-level
delete()method:
Resize a volume
Currently, it is only possible to increase the volume size (not decrease it).
-
the class-level
update()method with the volumenameand new size as argument, or -
by calling the instance-level
update()method with the new size as argument:
List volumes
Use volumes with sandboxes and agents
Use volumes with sandboxes
Attach persistent storage to a sandbox at creation time.
Use volumes with agents
Attach persistent storage to a deployed agent via
blaxel.toml.