embed

Create embeddings for text, image, and audio

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 embeddings for text, image, and audio content.

Ensure your media files meet the following requirements:

  • Audio files.
  • Images.

Parameters for embeddings:

  • Common parameters:
    • model_name: The video understanding model you want to use. Example: "marengo3.0".
  • Text embeddings:
    • text: Text for which to create an embedding.
  • Image embeddings: Provide one of the following:
    • image_url: Publicly accessible URL of your image file.
    • image_file: Local image file.
  • Audio embeddings: Provide one of the following:
    • audio_url: Publicly accessible URL of your audio file.
    • audio_file: Local audio file.
<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. - You can create multiple types of embeddings in a single API call. - Audio embeddings combine generic sound and human speech in a single embedding. For videos with transcriptions, you can retrieve transcriptions and then [create text embeddings](/v1.3/api-reference/create-embeddings-v1/text-image-audio-embeddings/create-text-image-audio-embeddings) from these - This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page. </Note>
post/embed

Request

  • Base URL: https://api.twelvelabs.io/v1.3
  • URL: https://api.twelvelabs.io/v1.3/embed
  • 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.
textstring

The text for which you wish to create an embedding.

Example: "Man with a dog crossing the street"

image_urlstring uri

The publicly accessible URL of the image for which you wish to create an embedding. This parameter is required for image embeddings if image_file is not provided.

image_filestring binary

The image file for which you wish to create an embedding as a local file. This parameter is required for image embeddings if image_url is not provided.

audio_urlstring uri

The publicly accessible URL of the audio file for which you wish to creae an embedding. This parameter is required for audio embeddings if audio_file is not provided.

audio_filestring binary

The audio file for which you wish to create an embedding as a local file. This parameter is required for audio embeddings if audio_url is not provided.

audio_start_offset_secnumber double

Specifies the start time, in seconds, from which the platform generates the audio embeddings. This parameter allows you to skip the initial portion of the audio during processing. Default: 0.

Response

A text embedding has successfully been created.

model_namestring required

The name of the video understanding model the platform has used to create this embedding.

Changes