embed > tasks

Create a video embedding task

Changed on
<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 videos 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

<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>
post/embed/tasks

Request

  • Base URL: https://api.twelvelabs.io/v1.3
  • URL: https://api.twelvelabs.io/v1.3/embed/tasks
  • Auth: API key in header x-api-key

Request body multipart/form-data

model_namestring required

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_filestring binary

Specify this parameter to upload a video from your local file system.

video_urlstring

Specify this parameter to upload a video from a publicly accessible URL.

video_start_offset_secnumber double

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_secnumber double

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_lengthnumber double

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_scopeEmbedTasksPostRequestBodyContentMultipartFormDataSchemaVideoEmbeddingScopeItems[]

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:

--form video_embedding_scope=clip \
--form video_embedding_scope=video

Default: clip

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.

Changes