Skip to content
Get started

Request Batch

client.assets.download.requestBatch(DownloadRequestBatchParams { options, query } body, RequestOptionsoptions?): DownloadRequestBatchResponse { jobId }
POST/assets/download

Request a link to batch download assets (batch limited to 1000 assets)

ParametersExpand Collapse
body: DownloadRequestBatchParams { options, query }
options: Options
fileNameTemplate: string

A file naming convention as a string with the following available parameters: (seed used to generate the asset) (index of the asset in the inference) (prompt of the inference) (prompt of the generator) Example: ”---

flat?: boolean

Flag to prevent grouping assets in directories and store them flat

query: Query
assetIds: Array<string>

Every individual assets specified will be included in the archive

inferenceIds: Array<string>

All assets issued from the provided inference ids will be included in the archive

modelIds: Array<string>

All assets issued from the provided model ids will be included in the archive

ReturnsExpand Collapse
DownloadRequestBatchResponse { jobId }
jobId: string

The job id associated with the download request

Request Batch

import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.assets.download.requestBatch({
  options: { fileNameTemplate: 'fileNameTemplate' },
  query: {
    assetIds: ['string'],
    inferenceIds: ['string'],
    modelIds: ['string'],
  },
});

console.log(response.jobId);
{
  "jobId": "jobId"
}
Returns Examples
{
  "jobId": "jobId"
}