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, and video segmentation. See the Pegasus page for token limits.
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.
Your prompts can be instructive or descriptive, or you can phrase them as questions. Pegasus 1.2 limits prompts to 2,000 tokens. For Pegasus 1.5, this text counts toward the context window.
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. Mutually exclusive with the prompt parameter.
The prompt text and reference images count toward the context window.
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 response length, in tokens. 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, as an absolute timestamp in seconds, based on the video’s internal metadata. Use with end_time to analyze only a portion of the video. Requires model_name set to pegasus1.5.
Notes
- If omitted, defaults to the video’s internal start time.
- Most videos start at 0, but some (for example, from cameras or broadcast recordings) may have a non-zero start time. To find the value, run
ffprobe -v error -show_entries format=start_time,duration -of default=noprint_wrappers=1 your_video.mp4. - 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, as an absolute timestamp in seconds, based on the video’s internal metadata. 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’s internal start time plus its duration.
- Most videos start at 0, but some (for example, from cameras or broadcast recordings) may have a non-zero start time. To find the value, run
ffprobe -v error -show_entries format=start_time,duration -of default=noprint_wrappers=1 your_video.mp4. - 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.