This method asynchronously analyzes your videos. It supports two analysis modes: general analysis (prompt-based text generation) and video segmentation with custom segment definitions. Video segmentation requires Pegasus 1.5.
When to use this method:
Do not use this method for:
POST method of the /analyze endpoint instead.Analyzing videos asynchronously requires three steps:
GET method of the /analyze/tasks/{task_id} endpoint. Wait until the status is ready.ready using the GET method of the /analyze/tasks/{task_id} endpoint.This endpoint is rate-limited. For details, see the Rate limits page.
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:
GET method of the /analyze/tasks/{task_id} endpointGET method of the /analyze/tasks endpointanalyze.task.ready and analyze.task.failed webhook payloadsFormat: 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:
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 via response_format.time_based_metadata: Segment the video into time-based intervals and extract custom metadata for each segment. Requires model_name set to pegasus1.5 and response_format.type set to segment_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. Requires model_name set to pegasus1.5 and analysis_mode set to time_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.
0.end_time and less than the video duration. The clip (end_time - start_time) must be at least 4 seconds.response_format.segment_definitions[].time_ranges.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.
start_time and less than or equal to the video duration. The clip (end_time - start_time) must be at least 4 seconds.response_format.segment_definitions[].time_ranges.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.Your API key.
You can find your API key on the API Keys page.