Install
TypeScript SDK
Install the TypeScript SDK.
Python SDK
Install the Python SDK.
Go SDK
Install the Go SDK.
Prerequisites
To use any Blaxel SDK, you need a Blaxel account and the following environment variables:| Variable | Description |
|---|---|
BL_WORKSPACE | Your Blaxel workspace name |
BL_API_KEY | Your Blaxel API key |
app.blaxel.ai/{workspace}).
Set them as environment variables:
.env file at the root of your project.
Authentication
The Blaxel SDK does not accept credentials as constructor arguments. Credentials must be supplied through one of the following sources, checked in priority order:- when running on Blaxel, authentication is handled automatically
BL_WORKSPACEandBL_API_KEYenvironment variables or.envfile (see this page for other authentication options)- configuration file created locally when you log in through Blaxel CLI (or deploy on Blaxel)
Pagination
List endpoints in the Blaxel SDKs return paginated results. Each call fetches one page of items and a cursor that points to the next page. The SDKs expose two ways to consume these pages: auto-paging, which iterates every item across all pages for you, and manual pagination, which gives you control over each page request. Pagination is cursor-based. Every page carries an opaquecursor to the next page and a flag that tells you whether more pages exist. You never build cursors yourself: pass the page through the auto-pager or call the next-page helper, and the SDK forwards the cursor for you.
Each page also reports the total number of items in the workspace, ignoring any filters applied to the request.
Auto-paging
Auto-paging is the recommended approach. The SDK fetches each page on demand as you iterate, so you can walk an entire result set without tracking cursors.autoPagingToArray({ limit }), which stops once it reaches the requested number of items.
Manual pagination
Use manual pagination when you need control over each request, for example to process one page at a time or to stop early based on the page contents. Read the current page fromdata, check whether more pages exist, then fetch the next page.
Pagination parameters
List endpoints accept the following query parameters:| Parameter | Description |
|---|---|
limit | Maximum number of items per page. Defaults to 50. |
cursor | Opaque token pointing to a page. The SDK sets this for you when you use auto-paging or the next-page helper. |
data), whether more pages exist (hasMore in TypeScript, has_more in Python, Meta.HasMore in Go), and the next cursor.
Supported endpoints
Pagination applies to list endpoints across SDK resources. Agent Drives, volumes, and sandboxes support it in all three SDKs. The TypeScript and Python SDKs also paginate a sandbox’s schedules and schedule executions (sandbox.schedules.list and sandbox.schedules.executions), as well as jobs, functions, and agents (list_jobs, list_functions, and list_agents). The Go SDK additionally exposes cursor pagination on its generated list endpoints, including agents, functions, jobs, models, policies, and sandboxes.
You can also paginate results using the API.
Data collection and privacy
Read more about the data collected by the Blaxel SDKs.Complete SDK reference
Visit the GitHub pages below for detailed documentation on each SDK’s commands and classes.TypeScript SDK
Open the GitHub repository for Blaxel SDK in TypeScript.
Python SDK
Open the GitHub repository for Blaxel SDK in Python.
Go SDK
Open the GitHub repository for Blaxel SDK in Go.
