Migrate from Pegasus 1.2 to Pegasus 1.5
This guide shows how to migrate your application to Pegasus 1.5. It focuses on SDK migrations, but it also includes cURL examples for steps where the request shape changes.
TwelveLabs removed Pegasus 1.2 on August 18, 2026. The platform now rejects any request that specifies Pegasus 1.2, and uses Pegasus 1.5 by default when you omit the model_name parameter.
To use Pegasus 1.5, update your SDK to the latest version, or update your REST API calls as shown in the cURL examples. If you use structured responses, you may also need to update your code. See the Update your structured responses section for details.
Migration steps
Update how you provide the video
Skip this step if you already provide your video as an asset, URL, or base64 string.
If you use sync analysis, upload your video as an asset and provide the unique identifier of that asset instead. If you use async analysis, no changes are needed.
Pegasus 1.5 doesn’t accept the unique identifier of a video you uploaded with a video indexing task. For a step-by-step guide, see Analyze videos.
Python
Node.js
cURL
Replace the video_id parameter with a VideoContext_AssetId object passed to the video parameter.
Before:
After:
If you uploaded your video with the Create a video indexing task method, call the Retrieve video information method. The response includes the unique identifier of your asset.
Update your structured responses
Skip this step if you do not use structured responses.
Structured responses now use separate types for synchronous and asynchronous analysis.
The examples below show the change for synchronous analysis. For asynchronous analysis, make the same change with the asynchronous type.
Python
Node.js
Replace the ResponseFormat type with the SyncResponseFormat type.
Before:
After:
Update your analysis calls
These changes apply to both sync and async methods. The examples below show how to update your code for sync analysis. For async analysis, make similar changes.
Python
Node.js
cURL
- Set the
model_nameparameter to"pegasus1.5". - Replace the
promptparameter withprompt_v_2. This parameter is now an object. Set theinput_textfield to your prompt text.
Note
You can still use theprompt parameter, but it will be deprecated in a future version. TwelveLabs recommends that you replace it with prompt_v_2.Before:
After:
Note
Pegasus 1.5 supports responses up to 98,304 tokens, compared to 4,096 for Pegasus 1.2. The input and response must fit within the context window. If your application validates or caps the maximum response length, update the limit.Use new Pegasus 1.5 features
The following examples show each new capability.
Video segmentation
Pegasus 1.5 transforms raw videos into structured, timestamped data. Define the types of segments you want to detect and the custom fields you want to extract. Video segmentation requires the asynchronous analysis endpoint.
Python
Node.js
cURL
The following example detects scene changes and extracts a sentiment field for each segment:
You can also restrict segment extraction to specific time windows by adding time ranges to individual segment definitions. The following example limits scene detection to two windows (0-30s and 60-90s):
Structured prompts with reference images
Reference up to 4 images in your prompt. Use <@name> placeholders in the prompt text and provide the referenced images. The following example asks whether a reference photo matches a person in the video:
Python
Node.js
cURL
Video clipping
Analyze a specific portion of a video by setting a start and end time. The clip must be at least 4 seconds long. The following example analyzes a 60-second clip starting at timestamp 30: