For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sample appsIntegrationsDiscordPlaygroundDevEx repo
GuidesSDK ReferenceAPI Reference
GuidesSDK ReferenceAPI Reference
  • TwelveLabs API
    • Introduction
    • Authentication
  • API Reference
    • Manage indexes
    • Upload content
    • Index content
    • Manage videos
    • Manage entities
    • Any-to-video search
    • Create embeddings v2
    • Create embeddings v1
      • Create video embeddings
        • The video embedding object
        • POSTCreate a video embedding task
        • GETList video embedding tasks
        • GETRetrieve the status of a video embedding task
        • GETRetrieve video embeddings
      • Create text, image, and audio embeddings
    • Analyze and segment videos
    • Error codes
LogoLogo
Sample appsIntegrationsDiscordPlaygroundDevEx repo
API ReferenceCreate embeddings v1Create video embeddings

Create a video embedding task

POST
https://api.twelvelabs.io/v1.3/embed/tasks
POST
/v1.3/embed/tasks
$curl -X POST https://api.twelvelabs.io/v1.3/embed/tasks \
> -H "x-api-key: <apiKey>" \
> -H "Content-Type: multipart/form-data" \
> -F model_name="marengo3.0" \
> -F video_file=@/Users/john/Documents/video.mp4 \
> -F video_embedding_scope='[
> "clip"
>]'
1{
2 "_id": "66419a20c70bb578439bd8f4"
3}
<Note title="Note"> This endpoint will be deprecated in a future version. Migrate to the [Embed API v2](/v1.3/api-reference/create-embeddings-v2) for continued support and access to new features. </Note> This method creates a new video embedding task that uploads a video to the platform and creates one or multiple video embeddings. <Note title="Note"> This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page. </Note> Upload options: - **Local file**: Use the `video_file` parameter - **Publicly accessible URL**: Use the `video_url` parameter. Specify at least one option. If both are provided, `video_url` takes precedence. Your video files must meet the [requirements](/v1.3/docs/concepts/models/marengo#video-file-requirements). This endpoint allows you to upload files up to 2 GB in size. To upload larger files, use the [Multipart Upload API](/v1.3/api-reference/upload-content/multipart-uploads) <Note title="Notes"> - The Marengo video understanding model generates embeddings for all modalities in the same latent space. This shared space enables any-to-any searches across different types of content. - Video embeddings are stored for seven days. </Note>
Was this page helpful?
Previous

List video embedding tasks

Next
Built with
Note

This endpoint will be deprecated in a future version. Migrate to the Embed API v2 for continued support and access to new features.

This method creates a new video embedding task that uploads a video to the platform and creates one or multiple video embeddings.

Note

This endpoint is rate-limited. For details, see the Rate limits page.

Upload options:

  • Local file: Use the video_file parameter
  • Publicly accessible URL: Use the video_url parameter.

Specify at least one option. If both are provided, video_url takes precedence.

Your video files must meet the requirements. This endpoint allows you to upload files up to 2 GB in size. To upload larger files, use the Multipart Upload API

Notes
  • The Marengo video understanding model generates embeddings for all modalities in the same latent space. This shared space enables any-to-any searches across different types of content.
  • Video embeddings are stored for seven days.

Authentication

x-api-keystring
Your API key. <Note title="Note"> You can find your API key on the <a href="https://playground.twelvelabs.io/dashboard/api-keys" target="_blank">API Keys</a> page. </Note>

Request

Request to create a video embedding task.
model_namestringRequired

The name of the model you want to use. The following models are available:

  • marengo3.0: Enhanced model with sports intelligence and extended content support.
video_filefileOptional
Specify this parameter to upload a video from your local file system.
video_urlstringOptional
Specify this parameter to upload a video from a publicly accessible URL.
video_start_offset_secdoubleOptional

The start offset in seconds from the beginning of the video where processing should begin. Specifying 0 means starting from the beginning of the video.

Default: 0 Min: 0 Max: Duration of the video minus video_clip_length

video_end_offset_secdoubleOptional
The end offset in seconds from the beginning of the video where processing should stop. Ensure the following when you specify this parameter: - The end offset does not exceed the total duration of the video file. - The end offset is greater than the start offset. - You must set both the start and end offsets. Setting only one of these offsets is not permitted, resulting in an error. **Min**: video_start_offset + video_clip_length **Max**: Duration of the video file
video_clip_lengthdoubleOptional

The desired duration in seconds for each clip for which the platform generates an embedding. Ensure that the clip length does not exceed the interval between the start and end offsets.

Default: 6 Min: 2 Max: 10

video_embedding_scopelist of enumsOptional
Defines the scope of video embedding generation. Valid values are the following: - `clip`: Creates embeddings for each video segment of `video_clip_length` seconds, from `video_start_offset_sec` to `video_end_offset_sec`. - `clip` and `video`: Creates embeddings for video segments and the entire video. Use the `video` scope for videos up to 10-30 seconds to maintain optimal performance. To create embeddings for segments and the entire video in the same request, include this parameter twice as shown below: ```json --form video_embedding_scope=clip \ --form video_embedding_scope=video ``` **Default**: `clip`
Allowed values:

Response

A video embedding task has successfully been created.
_idstring

The unique identifier of the video embedding task. You can use the identifier to:

  • Retrieve the status of your task by invoking the GET method of the /embed/tasks/{task_id}/status endpoint.
  • Retrieve the embedding by invoking the GET method of the /embed/tasks/{task_id} endpoint.

Errors

400
Bad Request Error

Your API key.

Note

You can find your API key on the API Keys page.

The end offset in seconds from the beginning of the video where processing should stop.

Ensure the following when you specify this parameter:

  • The end offset does not exceed the total duration of the video file.
  • The end offset is greater than the start offset.
  • You must set both the start and end offsets. Setting only one of these offsets is not permitted, resulting in an error.

Min: video_start_offset + video_clip_length Max: Duration of the video file

Defines the scope of video embedding generation. Valid values are the following:

  • clip: Creates embeddings for each video segment of video_clip_length seconds, from video_start_offset_sec to video_end_offset_sec.
  • clip and video: Creates embeddings for video segments and the entire video. Use the video scope for videos up to 10-30 seconds to maintain optimal performance.

To create embeddings for segments and the entire video in the same request, include this parameter twice as shown below:

1--form video_embedding_scope=clip \
2--form video_embedding_scope=video

Default: clip