This method analyzes your videos and returns the results directly in the response. It generates text based on your prompts and supports both Pegasus 1.2 and Pegasus 1.5 for general analysis (prompt-based text generation).
When to use this method:
Do not use this method for:
POST method of the /analyze/tasks endpoint instead.POST method of the /analyze/tasks endpoint with the model_name parameter set to pegasus1.5 instead.This endpoint is rate-limited. For details, see the Rate limits page.
A text prompt that guides the model on the desired format or content. Works with both Pegasus 1.2 and Pegasus 1.5. To include reference images in your prompt, use the prompt_v2 parameter instead (Pegasus 1.5 only). Mutually exclusive with the prompt_v2 parameter.
A structured prompt with <@name> placeholders for referencing images. Requires the model_name parameter set to pegasus1.5. Mutually exclusive with the prompt parameter.
Controls the randomness of the text output.
Default: 0.2 Min: 0 Max: 1
Specifies the format of the response. When you omit this parameter, the platform returns unstructured text. Only the json_schema type is supported for synchronous analysis.
Your API key.
You can find your API key on the API Keys 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, extended token limits, and video segmentation (async only). Does not support analysis_mode=time_based_metadata or response_format.type=segment_definitions — use the POST method of the /analyze/tasks endpoint instead.Default: pegasus1.2
The unique identifier of the video to analyze. Use this parameter when the model_name parameter is pegasus1.2. Not supported with pegasus1.5.
video parameter instead.Set this parameter to true to enable streaming responses in the NDJSON format.
Default: true
The maximum number of tokens to generate. The allowed range depends on the model:
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.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.The specified video has successfully been analyzed.
The maximum response length is 4,096 tokens for Pegasus 1.2 and up to 65,536 tokens for Pegasus 1.5. Set the max_tokens parameter to change this limit.