Create a batch
Use this method to submit many video analysis requests in a single call. Each request creates an analysis task. The response contains one batch identifier and one task identifier per request. Use the batch identifier to check progress and retrieve results.
When to use this method:
- Run the same analysis settings across many videos.
- Track a single batch instead of many individual analysis tasks.
Do not use this method for:
- Single videos that require immediate results. Use the
POSTmethod of the/analyzeendpoint instead. - Background processing of a single video. Use the
POSTmethod of the/analyze/tasksendpoint instead.
Retention and retry:
- Batches expire 24 hours after creation. You can retrieve results for 30 days after creation.
- If processing does not finish for some items in time, resubmit them in a new batch.
- An item whose analysis window exceeds 2 hours fails on its own. The error code is
video_duration_too_long. The rest of the batch is still submitted.
Limits:
- Up to 1,000 requests per batch.
- Up to 2,000 total content hours per batch.
- Up to 5 active batches per account.
- The duration limits of the
POSTmethod of the/analyze/tasksendpoint apply to each item.
Authentication
Your API key.
You can find your API key on the API Keys page.
Request
The analysis mode for every item in this batch.
general: Generate text from each video based on the prompt (thepromptfield of the item if set, otherwisedefaults.prompt). Supports structured JSON output by usingjson_schemain theresponse_format.typefield.time_based_metadata: Extract timestamped metadata by usingsegment_definitionsin theresponse_format.typefield.
Batches with mixed modes are not supported.
Default values applied to every item that does not override them. Every field is optional. Items in the requests array override these values. To override the prompt or response_format field, provide the full object on the item. You cannot change only some of its nested fields.
Response headers
Response
The status of a batch. For the meaning of each value, see the Batch statuses section on the The batch object page.
The date and time, in the RFC 3339 format, when the batch expires (the created_at field value plus 24 hours). Unfinished items at expiration are canceled. Items that finished before then remain retrievable for 30 days after creation, when the batch and its results are deleted.