BoltzPlatformClient
The main client class for interacting with the Boltz Lab API.Initialization
Parameters
| Parameter | Type | Default | Description | |
|---|---|---|---|---|
api_key | `str | None` | None | API key for authentication. If not provided, uses config/env var (BOLTZ_API_KEY) |
base_url | `str | None` | None | API base URL. If not provided, uses config/env var (BOLTZ_API_ENDPOINT) or https://app.boltz.bio |
signup_url | `str | None` | None | Signup URL used in interactive prompts (config/env var: BOLTZ_SIGNUP_URL) |
timeout | float | 30.0 | Default request timeout in seconds |
Context Manager
Use the client as an async context manager to ensure the underlying HTTP connection pool is cleaned up:await client.close() when you’re done.
Job Submission
submit_job_from_yaml()
Submit a prediction job from a YAML file path or URL.Parameters
| Parameter | Type | Default | Description | |
|---|---|---|---|---|
yaml_path | str | Required | Path to YAML file or URL | |
prediction_name | `str | None` | None | Human-readable name for the prediction |
priority | str | "low" | Priority level: "low" or "high" | |
flags | `dict | None` | None | Optional prediction flags (see below) |
Returns
PredictionJob
submit_job_from_dict()
Submit a prediction job from a Python dictionary (already-parsed YAML/JSON).Parameters
| Parameter | Type | Default | Description | |
|---|---|---|---|---|
job_data | dict | Required | Job specification as a Python dictionary | |
prediction_name | `str | None` | None | Human-readable name for the prediction |
priority | str | "low" | Priority level: "low" or "high" | |
flags | `dict | None` | None | Optional prediction flags (see below) |
Returns
PredictionJob
submit_prediction()
Lower-level method used by the helpers above. It submits acomplex_data dictionary directly.
Prediction flags
All submission methods accept aflags dict. Supported keys include:
use_potentials(bool, default: False)recycling_steps(int, default: 3)diffusion_samples(int, default: 1)sampling_steps(int, default: 200)step_scale(float, default: 1.5)subsample_msa(bool, default: True)num_subsampled_msa(int, default: 1024)
Status and Retrieval
get_prediction_status()
Get the current status of a prediction job.Returns
PredictionStatus
Notes on status values
PredictionStatus.prediction_status is a string returned by the API.
For filtering and common terminal-state logic, the SDK defines a JobStatus enum:
list_predictions()
List predictions with optional filtering.Parameters
| Parameter | Type | Default | Description | |
|---|---|---|---|---|
status | `JobStatus | None` | None | Filter by status |
limit | int | 20 | Maximum number of results to return | |
offset | int | 0 | Number of results to skip for pagination |
Returns
PredictionListResponse
get_prediction_output_url()
Get a presigned URL (or similar) for the archived prediction output, if available.download_results()
Download prediction results to disk.Parameters
| Parameter | Type | Default | Description | |
|---|---|---|---|---|
prediction_id | str | Required | Prediction identifier | |
output_dir | str | "." | Directory to save results | |
output_format | str | "archive" | "archive" (tar.gz) or "json" | |
output_filename | `str | None` | None | Custom filename (without extension) |
Returns
str path to the downloaded file.
wait_for_prediction()
Wait for a prediction to reach a terminal state.PredictionJob
PredictionJob is returned by submission methods and provides convenience wrappers around the client.
Properties
| Property | Type | Description |
|---|---|---|
prediction_id | str | Unique identifier for the job |
Methods
get_status()
wait_for_completion()
download_results()
Data Models
PredictionStatus
Fields returned by the API are mapped intoPredictionStatus. Common fields include:
| Field | Type | Notes | |
|---|---|---|---|
prediction_id | str | ID | |
prediction_name | str | Name (may be empty) | |
prediction_type | str | Type string from the API | |
prediction_status | str | Status string from the API | |
prediction_stage_description | str | Human-readable stage | |
created_at | datetime | Always present | |
started_at | `datetime | None` | Present once started |
completed_at | `datetime | None` | Present once finished |
estimated_completion_time | `datetime | None` | Optional ETA |
prediction_results | `dict | None` | Results (when embedded in the status response) |
PredictionListResponse
| Field | Type | Description |
|---|---|---|
predictions | list[PredictionStatus] | List of predictions |
total | int | Total number of predictions |
Exception Handling
The SDK raises exceptions fromboltz_api.exceptions.
Common exceptions: