Create an async analysis task
Authentication
Request
The video understanding model to use for analysis.
pegasus1.2: General analysis (prompt-based text generation).pegasus1.5: General analysis (prompt-based text generation) with video clipping, structured prompts with reference images, extended token limits, and video segmentation.
Default: pegasus1.2
An optional identifier that you set when you create the task. Use this field to correlate tasks across responses, for example, to distinguish tasks by type or environment.
The platform stores this value unchanged and returns it in the following responses:
- The
GETmethod of the/analyze/tasks/{task_id}endpoint - The
GETmethod of the/analyze/tasksendpoint - The
analyze.task.readyandanalyze.task.failedwebhook payloads
Format: 1–64 characters. Alphanumeric, hyphens (-), and underscores (_) only. An empty string is rejected with a 400 Bad Request.
This field does not enforce uniqueness. You can submit multiple tasks with the same custom_id. To prevent duplicate task creation, use an Idempotency-Key header instead.
Natural-language instructions for analyzing the video. Required for general analysis (prompt-based text generation). Not supported when analysis_mode is time_based_metadata. To include reference images in your prompt, use the prompt_v2 parameter instead (Pegasus 1.5 only). Mutually exclusive with the prompt_v2 parameter.
Notes
- Even though the model behind this endpoint is trained to a high degree of accuracy, the preciseness of the generated text may vary based on the nature and quality of the video and the clarity of the prompt.
- Your prompts can be instructive or descriptive, or you can also phrase them as questions.
- The maximum length of a prompt is 2,000 tokens.
Examples:
- Based on this video, I want to generate five keywords for SEO (Search Engine Optimization).
- I want to generate a description for my video with the following format: Title of the video, followed by a summary in 2-3 sentences, highlighting the main topic, key events, and concluding remarks.
A structured prompt with <@name> placeholders for referencing images. Requires the model_name parameter set to pegasus1.5. Not supported when the analysis_mode parameter is time_based_metadata. Mutually exclusive with the prompt parameter.
The analysis approach for this task.
general: Analyze the video and generate a response based on your prompt. Supports both free-form text and structured output viaresponse_format.time_based_metadata: Segment the video into time-based intervals and extract custom metadata for each segment. Requiresmodel_nameset topegasus1.5andresponse_format.typeset tosegment_definitions.
Default: general
Controls the randomness of the text output.
Default: 0.2 Min: 0 Max: 1
The maximum number of tokens to generate. The allowed range depends on the model and analysis mode:
Controls the response format. When you omit this parameter, you receive unstructured text.
json_schema: Return structured JSON that conforms to your schema.segment_definitions: Extract timestamped metadata with custom fields from your video. Requiresmodel_nameset topegasus1.5andanalysis_modeset totime_based_metadata.
Minimum duration for each extracted segment, in seconds. Set this value to enforce a minimum segment length. Requires model_name set to pegasus1.5 and analysis_mode set to time_based_metadata. Mutually exclusive with response_format.segment_definitions[].time_ranges.
Min: 2
Maximum duration for each extracted segment, in seconds. Set this value to split long continuous sections into shorter segments. Must be greater than or equal to min_segment_duration. Requires model_name set to pegasus1.5 and analysis_mode set to time_based_metadata. Mutually exclusive with response_format.segment_definitions[].time_ranges.
Min: 2
Start of the analysis window, in seconds. Use with end_time to analyze only a portion of the video. Requires model_name set to pegasus1.5.
Notes
- If omitted, defaults to
0. - Must be less than
end_timeand less than the video duration. The clip (end_time - start_time) must be at least4seconds. - Mutually exclusive with
response_format.segment_definitions[].time_ranges. - Together with
end_time, this parameter determines the billable video duration. If you omit both, billing uses the full video duration. For details, see the Frequently asked questions page.
End of the analysis window, in seconds. Use with start_time to analyze only a portion of the video. Requires model_name set to pegasus1.5.
Notes
- If omitted, defaults to the video duration.
- Must be greater than
start_timeand less than or equal to the video duration. The clip (end_time - start_time) must be at least4seconds. - Mutually exclusive with
response_format.segment_definitions[].time_ranges. - Together with
start_time, this parameter determines the billable video duration. If you omit both, billing uses the full video duration. For details, see the Frequently asked questions page.