> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.twelvelabs.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server.

# Create sync embeddings

> Create embeddings synchronously.

The `Embed.V2` interface provides methods to create embeddings synchronously for multimodal content. It returns embeddings immediately in the response.

# Methods

## Create sync embeddings

**Description**: This method synchronously creates embeddings for multimodal content and returns the results immediately in the response.

Use this method to embed a query for retrieving matching content. With Marengo 3.5, audio and video can be up to 30 seconds. With Marengo 3.0, they can be up to 10 minutes. For longer content, use the [`embed.v2.tasks.create`](/v1.3/sdk-reference/node-js/create-embeddings-v-2/create-async-embeddings#create-an-async-embedding-task) method instead.

The content this method accepts depends on the model. With Marengo 3.5, this method accepts only the `multiInput` input type; provide text, images, audio, or video as media sources. With Marengo 3.0, use the individual input types. For the formats, resolutions, file sizes, and duration limits each model accepts, see the input requirements for [Marengo 3.5](/v1.3/docs/concepts/models/marengo/marengo-3-5#input-requirements) or [Marengo 3.0](/v1.3/docs/concepts/models/marengo/marengo-3-0#input-requirements).

> **Note**
>
> This method is rate-limited. With Marengo 3.5, the platform counts input tokens for each type of content. A request can exceed a limit before you see an error. For details, see [Input token limits for embedding](/v1.3/docs/get-started/rate-limits#input-token-limits-for-embedding).

**Function signature and example**:

**`Function signature`**

```javascript Function signature
create(
    request: TwelvelabsApi.embed.CreateEmbeddingsRequest,
    requestOptions?: V2.RequestOptions
): core.HttpResponsePromise<TwelvelabsApi.EmbeddingSuccessResponse>
```

**`Create text embeddings`**

```javascript Create text embeddings
import { TwelveLabs } from "twelvelabs-js";

const response = await client.embed.v2.create({
    inputType: "multi_input",
    modelName: "marengo3.5",
    multiInput: {
        inputText: "<YOUR_TEXT>",
    },
});

console.log(`Number of embeddings: ${response.data.length}`);
for (const embeddingData of response.data) {
    console.log(`Embedding dimensions: ${embeddingData.embedding.length}`);
    console.log(`First 10 values: ${embeddingData.embedding.slice(0, 10)}`);
}
```

**`Create image embeddings`**

```javascript Create image embeddings
import { TwelveLabs } from "twelvelabs-js";


const response = await client.embed.v2.create({
    inputType: "multi_input",
    modelName: "marengo3.5",
    multiInput: {
        mediaSources: [
            {
                mediaType: "image",
                url: "<YOUR_IMAGE_URL>",
            },
        ],
    },
});

console.log(`Number of embeddings: ${response.data.length}`);
for (const embeddingData of response.data) {
    console.log(`Embedding dimensions: ${embeddingData.embedding.length}`);
    console.log(`First 10 values: ${embeddingData.embedding.slice(0, 10)}`);
}
```

**`Create video embeddings`**

```javascript Create video embeddings
import { TwelveLabs } from 'twelvelabs-js';

const response = await client.embed.v2.create({
    inputType: "multi_input",
    modelName: "marengo3.5",
    multiInput: {
        mediaSources: [
            {
                mediaType: "video",
                url: "<YOUR_VIDEO_URL>",
            },
        ],
    },
});

console.log(`Number of embeddings: ${response.data.length}`);
for (const embeddingData of response.data) {
    console.log(`Embedding dimensions: ${embeddingData.embedding.length}`);
    console.log(`First 10 values: ${embeddingData.embedding.slice(0, 10)}`);
}
```

**`Create embeddings from multiple images`**

```javascript Create embeddings from multiple images
import { TwelveLabs } from "twelvelabs-js";

const response = await client.embed.v2.create({
    inputType: "multi_input",
    modelName: "marengo3.5",
    multiInput: {
        mediaSources: [
            {
                mediaType: "image",
                url: "<YOUR_IMAGE_URL_1>",
            },
            {
                mediaType: "image",
                url: "<YOUR_IMAGE_URL_2>",
            },
        ],
    },
});

console.log(`Number of embeddings: ${response.data.length}`);
for (const embeddingData of response.data) {
    console.log(`Embedding dimensions: ${embeddingData.embedding.length}`);
    console.log(`First 10 values: ${embeddingData.embedding.slice(0, 10)}`);
}
```

**`Create embeddings from images and text`**

```javascript Create embeddings from images and text
import { TwelveLabs } from "twelvelabs-js";

const response = await client.embed.v2.create({
    inputType: "multi_input",
    modelName: "marengo3.5",
    multiInput: {
        inputText: "<@image1> and <@image2> show contrasting scenes",
        mediaSources: [
            {
                name: "image1",
                mediaType: "image",
                url: "<YOUR_IMAGE_URL_1>",
            },
            {
                name: "image2",
                mediaType: "image",
                url: "<YOUR_IMAGE_URL_2>",
            },
        ],
    },
});

console.log(`Number of embeddings: ${response.data.length}`);
for (const embeddingData of response.data) {
    console.log(`Embedding dimensions: ${embeddingData.embedding.length}`);
    console.log(`First 10 values: ${embeddingData.embedding.slice(0, 10)}`);
}
```

### Parameters

| Name             | Type                                          | Required | Description                         |
| :--------------- | :-------------------------------------------- | :------- | :---------------------------------- |
| `request`        | `TwelvelabsApi.embed.CreateEmbeddingsRequest` | Yes      | Parameters for creating embeddings. |
| `requestOptions` | `V2.RequestOptions`                           | No       | Request-specific configuration.     |

The `TwelvelabsApi.embed.CreateEmbeddingsRequest` interface contains the following properties:

| Name                   | Type                                                   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ---------------------- | ------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `inputType`            | `TwelvelabsApi.embed.CreateEmbeddingsRequestInputType` | Yes      | The type of content for the embeddings. Values: - `multi_input`: Text and up to 10 media sources, combined into a single embedding. To reference a specific media source from your text, use a placeholder in the format `&lt;@name&gt;`, where `name` matches the `name` field of a media source. Marengo 3.5 accepts images, video, and audio as media sources. Marengo 3.0 accepts images. - `audio`: An audio file. Requires Marengo 3.0. - `video`: A video file. Requires Marengo 3.0. - `image`: An image file. Requires Marengo 3.0. - `text`: Text input. Requires Marengo 3.0. - `text_image`: Text and an image. Requires Marengo 3.0. |
| `modelName`            | `TwelvelabsApi.embed.CreateEmbeddingsRequestModelName` | Yes      | The embedding model to use. Values: - `marengo3.5`: For details about this version, see the [Marengo 3.5](/v1.3/docs/concepts/models/marengo/marengo-3-5) page. - `marengo3.0`: For details about this version, see the [Marengo 3.0](/v1.3/docs/concepts/models/marengo/marengo-3-0) page.                                                                                                                                                                                                                                                                                                                                                       |
| `text`                 | `TwelvelabsApi.TextInputRequest`                       | No       | Text input configuration. Required when `inputType` is `text`. See [TextInputRequest](#textinputrequest) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `image`                | `TwelvelabsApi.ImageInputRequest`                      | No       | Image input configuration. Required when `inputType` is `image`. See [ImageInputRequest](#imageinputrequest) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `textImage`            | `TwelvelabsApi.TextImageInputRequest`                  | No       | Combined text and image input configuration. Required when `inputType` is `text_image`. See [TextImageInputRequest](#textimageinputrequest) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `audio`                | `TwelvelabsApi.AudioInputRequest`                      | No       | Audio input configuration. Required when `inputType` is `audio`. See [AudioInputRequest](#audioinputrequest) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `video`                | `TwelvelabsApi.VideoInputRequest`                      | No       | Video input configuration. Required when `inputType` is `video`. See [VideoInputRequest](#videoinputrequest) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `multiInput`           | `TwelvelabsApi.MultiInputRequest`                      | No       | Text and media source configuration. Required when `inputType` is `multi_input`. See [MultiInputRequest](#multiinputrequest) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `autoTruncate`         | `boolean`                                              | No       | Controls the behavior of the platform when the text in your request exceeds 2,000 tokens. Requires Marengo 3.5. **Values**: - `false`: Return a `400` error. - `true`: Truncate your text to fit the limit, and set the `usage.truncated` field to `true` in the response.                                                                                                                                                                                                                                                                                                                                                                        |
| `embeddingUncertainty` | `boolean`                                              | No       | Set this parameter to `true` to receive a `data[].embeddingUncertainty` field in the response, representing a per-dimension uncertainty vector with the same length as the `embedding` array. A higher value shows lower confidence in that dimension. Requires Marengo 3.5. Set this parameter to `true` only when your request embeds text only, or media only. Requests that combine text with media sources return a `400` error.                                                                                                                                                                                                             |

#### TextInputRequest

The `TwelvelabsApi.TextInputRequest` interface specifies the configuration for processing text content. Required when `inputType` is `text`.

| Name        | Type     | Required | Description                                                                           |
| ----------- | -------- | -------- | ------------------------------------------------------------------------------------- |
| `inputText` | `string` | Yes      | The text for which you wish to create an embedding. The maximum length is 500 tokens. |

#### ImageInputRequest

The `TwelvelabsApi.ImageInputRequest` interface specifies the configuration for processing image content. Required when `inputType` is `image`.

| Name          | Type                        | Required | Description                                                                          |
| ------------- | --------------------------- | -------- | ------------------------------------------------------------------------------------ |
| `mediaSource` | `TwelvelabsApi.MediaSource` | Yes      | Specifies the source of the image file. See [MediaSource](#mediasource) for details. |

#### TextImageInputRequest

The `TwelvelabsApi.TextImageInputRequest` interface specifies the configuration for processing combined text and image content. Required when `inputType` is `text_image`.

| Name          | Type                        | Required | Description                                                                           |
| ------------- | --------------------------- | -------- | ------------------------------------------------------------------------------------- |
| `mediaSource` | `TwelvelabsApi.MediaSource` | Yes      | Specifies the source of the image file. See [MediaSource](#mediasource) for details.  |
| `inputText`   | `string`                    | Yes      | The text for which you wish to create an embedding. The maximum length is 500 tokens. |

#### AudioInputRequest

The `TwelvelabsApi.AudioInputRequest` interface specifies the configuration for processing audio content. Required when `inputType` is `audio`.

| Name              | Type                                                   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------- | ------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mediaSource`     | `TwelvelabsApi.MediaSource`                            | Yes      | Specifies the source of the audio file. See [MediaSource](#mediasource) for details.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `startSec`        | `number`                                               | No       | The start time in seconds for processing the audio file. Use this parameter to process a portion of the audio file starting from a specific time. **Default**: 0 (start from the beginning).                                                                                                                                                                                                                                                                                                            |
| `endSec`          | `number`                                               | No       | The end time in seconds for processing the audio file. Use this parameter to process a portion of the audio file ending at a specific time. The end time must be greater than the start time. **Default**: End of the audio file                                                                                                                                                                                                                                                                        |
| `segmentation`    | `TwelvelabsApi.AudioSegmentation`                      | No       | Specifies how the platform divides the audio into segments. See [AudioSegmentation](#audiosegmentation) for details.                                                                                                                                                                                                                                                                                                                                                                                    |
| `embeddingOption` | `TwelvelabsApi.AudioInputRequestEmbeddingOptionItem[]` | No       | The types of embeddings you wish to generate. **Values**: - `audio`: Generates embeddings based on audio content (sounds, music, effects) - `transcription`: Generates embeddings based on transcribed speech You can specify multiple values to generate different types of embeddings for the same audio. **Default**: `["audio", "transcription"]`                                                                                                                                                   |
| `embeddingScope`  | `TwelvelabsApi.AudioInputRequestEmbeddingScopeItem[]`  | No       | The scope for which you wish to generate embeddings. **Values**: - `clip`: Generates one embedding for each segment - `asset`: Generates one embedding for the entire audio file You can specify multiple scopes to generate embeddings at different levels. **Default**: `["clip", "asset"]`                                                                                                                                                                                                           |
| `embeddingType`   | `TwelvelabsApi.AudioInputRequestEmbeddingTypeItem[]`   | No       | Specifies how to structure the embedding. Include this parameter only when the `embeddingOption` parameter contains at least two values. **Values**: - `separate_embedding`: Returns separate embeddings for each modality specified in the `embeddingOption` parameter. - `fused_embedding`: Returns a single combined embedding that integrates all modalities into one vector. Specify both values to receive separate and fused embeddings in the same response. **Default**: `separate_embedding`. |

#### VideoInputRequest

The `TwelvelabsApi.VideoInputRequest` interface specifies the configuration for processing video content. Required when `inputType` is `video`.

| Name              | Type                                                   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------------- | ------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mediaSource`     | `TwelvelabsApi.MediaSource`                            | Yes      | Specifies the source of the video file. See [MediaSource](#mediasource) for details.                                                                                                                                                                                                                                                                                                                                                                                |
| `startSec`        | `number`                                               | No       | The start time in seconds for processing the video file. Use this parameter to process a portion of the video file starting from a specific time. **Default**: 0 (start from the beginning)                                                                                                                                                                                                                                                                         |
| `endSec`          | `number`                                               | No       | The end time in seconds for processing the video file. Use this parameter to process a portion of the video file ending at a specific time. The end time must be greater than the start time. **Default**: End of the video file                                                                                                                                                                                                                                    |
| `segmentation`    | `TwelvelabsApi.VideoSegmentation`                      | No       | Specifies how the platform divides the video into segments. See [VideoSegmentation](#videosegmentation) for details.                                                                                                                                                                                                                                                                                                                                                |
| `embeddingOption` | `TwelvelabsApi.VideoInputRequestEmbeddingOptionItem[]` | No       | The types of embeddings to generate for the video. **Values**: - `visual`: Generates embeddings based on visual content (scenes, objects, actions) - `audio`: Generates embeddings based on audio content (sounds, music, effects) - `transcription`: Generates embeddings based on transcribed speech You can specify multiple values to generate different types of embeddings for the same video. **Default**: `["visual", "audio", "transcription"]`            |
| `embeddingScope`  | `TwelvelabsApi.VideoInputRequestEmbeddingScopeItem[]`  | No       | The scope for which you wish to generate embeddings. **Values**: - `clip`: Generates one embedding for each segment - `asset`: Generates one embedding for the entire video file. Use this scope for videos up to 10-30 seconds to maintain optimal performance. You can specify multiple scopes to generate embeddings at different levels. **Default**: `["clip", "asset"]`                                                                                       |
| `embeddingType`   | `TwelvelabsApi.VideoInputRequestEmbeddingTypeItem[]`   | No       | Specifies how to structure the embedding. Include this parameter only when `embeddingOption` contains at least two values. **Values**: - `separate_embedding`: Returns separate embeddings per modality specified in the `embeddingOption` field - `fused_embedding`: Returns a single embedding that combines all modalities into one vector Specify both values to receive separate and fused embeddings in the same response. **Default**: `separate_embedding`. |

#### MultiInputRequest

The `MultiInputRequest` class specifies the configuration for processing text and media sources. Required when `inputType` is `multi_input`.

Marengo 3.5 accepts images, video, and audio as media sources. Marengo 3.0 accepts images.

Include text in the `input_text` field when you combine media sources of different types. For example, a request that combines an image and a video returns a `400` error without text. Media sources of the same type do not require text.

Marengo 3.5 accepts images, video, and audio as media sources. Marengo 3.0 accepts images.

| Name           | Type                                    | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| -------------- | --------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `inputText`    | `string`                                | No       | Text to include in the embedding. With Marengo 3.5, the text cannot exceed 2,000 tokens. Use the `autoTruncate` parameter to control the behavior of the platform when your text exceeds it. **Usage options**: - Provide text without media sources to create a text-only embedding. - Combine text with media sources to add context. Example: "A person cooking." - Use media source references to describe relationships between specific media sources. The format is `&lt;@name&gt;`, where `name` matches the `name` field of a media source. Example: "A person wearing \<@outfit> and holding \<@accessory>." - Omit this field to create an embedding from media sources only. |
| `mediaSources` | `TwelvelabsApi.MultiInputMediaSource[]` | No       | An array of up to 10 media sources to include in the embedding. Omit it to create a text-only embedding from the `inputText` field. The platform processes media sources in the order they appear in the array. If you use media source references in the `inputText` parameter, each must have a corresponding media source with a matching `name` field. If a reference has no match, the request fails.                                                                                                                                                                                                                                                                               |

#### MediaSource

The `TwelvelabsApi.MediaSource` interface specifies the source of the media file. Provide exactly one of the following:

| Name           | Type     | Required | Description                                                                                                                                                                                                                                                                                                                                   |
| -------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `base64String` | `string` | No       | The base64-encoded media data.                                                                                                                                                                                                                                                                                                                |
| `url`          | `string` | No       | The publicly accessible URL of the media file. Use direct links to raw media files. Video hosting platforms and cloud storage sharing links are not supported.                                                                                                                                                                                |
| `assetId`      | `string` | No       | The unique identifier of an asset from a [direct](/v1.3/sdk-reference/node-js/upload-content/direct-uploads) or [multipart](/v1.3/sdk-reference/node-js/upload-content/multipart-uploads) upload. The asset status must be `ready`. Use [`assets.retrieve`](/v1.3/sdk-reference/node-js/manage-assets#retrieve-an-asset) to check the status. |

#### MultiInputMediaSource

A class specifying a media source for multi-input embeddings. You must provide exactly one of the `url`, `base64String`, or `assetId` fields. With Marengo 3.5, each media source can be up to 32 MB, whichever of the three fields you use. Audio and video can be up to 30 seconds. Content above either limit returns a `400` error.

| Name           | Type                                           | Required | Description                                                                                                                                                                                          |
| -------------- | ---------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`         | `string`                                       | No       | The unique identifier for this media source. This field is required when `inputText` references this media source.                                                                                   |
| `mediaType`    | `TwelvelabsApi.MultiInputMediaSourceMediaType` | No       | The type of media. **Values**: - `image`: An image file. Works with both Marengo 3.0 and Marengo 3.5. - `video`: A video file. Requires Marengo 3.5. - `audio`: An audio file. Requires Marengo 3.5. |
| `url`          | `string`                                       | No       | The publicly accessible URL of the media file. Use direct links to raw files. Media hosting platforms and cloud storage sharing links are not supported.                                             |
| `base64String` | `string`                                       | No       | The base64-encoded media data.                                                                                                                                                                       |
| `assetId`      | `string`                                       | No       | The unique identifier of an asset from a [direct](/v1.3/sdk-reference/node-js/upload-content/direct-uploads) or [multipart](/v1.3/sdk-reference/node-js/upload-content/multipart-uploads) upload.    |

#### AudioSegmentation

The `TwelvelabsApi.AudioSegmentation` interface specifies how the platform divides the audio into segments using fixed-length intervals.

| Name       | Type                                   | Required | Description                                                                                                                                                            |
| ---------- | -------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `strategy` | `"fixed"`                              | Yes      | The segmentation strategy. Value: `fixed`.                                                                                                                             |
| `fixed`    | `TwelvelabsApi.AudioSegmentationFixed` | Yes      | Configuration for fixed segmentation. This object is required when the `strategy` field is `fixed`. See [AudioSegmentationFixed](#audiosegmentationfixed) for details. |

#### AudioSegmentationFixed

The `TwelvelabsApi.AudioSegmentationFixed` interface configures fixed-length segmentation for audio.

| Name          | Type     | Required | Description                                                                                                                                                                                                                                                                                                                            |
| ------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `durationSec` | `number` | Yes      | The duration in seconds for each segment. The platform divides the audio into segments of this exact length. The final segment may be shorter if the audio duration is not evenly divisible. **Min**: `2`. **Max**: `10`. **Example**: With `duration_sec: 5`, a 12-second audio file produces segments: \[0-5s], \[5-10s], \[10-12s]. |

#### VideoSegmentation

The `TwelvelabsApi.VideoSegmentation` type specifies how the platform divides the video into segments. Use one of the following:

**Fixed segmentation**: Divides the video into equal-length segments:

| Name       | Type                                        | Required | Description                                                                                                        |
| ---------- | ------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `strategy` | `"fixed"`                                   | Yes      | The segmentation strategy. Value: `fixed`.                                                                         |
| `fixed`    | `TwelvelabsApi.VideoSegmentationFixedFixed` | Yes      | Configuration for fixed segmentation. See [VideoSegmentationFixedFixed](#videosegmentationfixedfixed) for details. |

**Dynamic segmentation**: Divides the video into adaptive segments based on scene changes:

| Name       | Type                                            | Required | Description                                                                                                                  |
| ---------- | ----------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `strategy` | `"dynamic"`                                     | Yes      | The segmentation strategy. Value: `dynamic`.                                                                                 |
| `dynamic`  | `TwelvelabsApi.VideoSegmentationDynamicDynamic` | Yes      | Configuration for dynamic segmentation. See [VideoSegmentationDynamicDynamic](#videosegmentationdynamicdynamic) for details. |

#### VideoSegmentationFixedFixed

The `TwelvelabsApi.VideoSegmentationFixedFixed` interface configures fixed-length segmentation for video.

| Name          | Type     | Required | Description                                                                                                                                                                                                                                                                                                                       |
| ------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `durationSec` | `number` | Yes      | The duration in seconds for each segment. The platform divides the video into segments of this exact length. The final segment may be shorter if the video duration is not evenly divisible. **Min**: `2`. **Max**: `10`. **Example**: With `duration_sec: 5`, a 12-second video produces segments: \[0-5s], \[5-10s], \[10-12s]. |

#### VideoSegmentationDynamicDynamic

The `TwelvelabsApi.VideoSegmentationDynamicDynamic` interface configures dynamic segmentation for video based on scene changes.

| Name             | Type     | Required | Description                                                                                                                                                                                                                                                                                                                                         |
| ---------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `minDurationSec` | `number` | Yes      | The minimum duration in seconds for each segment. The platform divides the video into segments that are at least this long. Segments adapt to scene changes and content boundaries and may be longer than the minimum. **Min**: `2`. **Max**: `5`. **Example**: With `min_duration_sec: 3`, segments might be: \[0-3.2s], \[3.2-7.8s], \[7.8-12.1s] |

### Return value

Returns an `HttpResponsePromise` that resolves to a `TwelvelabsApi.EmbeddingSuccessResponse` object containing the embedding results.

The `TwelvelabsApi.EmbeddingSuccessResponse` interface contains the following properties:

| Name       | Type                                   | Description                                                                                                                                                                                |
| ---------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `data`     | `TwelvelabsApi.EmbeddingData[]`        | Array of embedding results.                                                                                                                                                                |
| `usage`    | `TwelvelabsApi.EmbeddingUsage`         | Token counts for the request. Only Marengo 3.5 returns this field. See [EmbeddingUsage](#embeddingusage) for details.                                                                      |
| `metadata` | `TwelvelabsApi.EmbeddingMediaMetadata` | Metadata for the media input. Available for the `image`, `text_image`, `audio`, `video`, and `multi_input` input types. See [EmbeddingMediaMetadata](#embeddingmediametadata) for details. |

The `TwelvelabsApi.EmbeddingData` interface contains the following properties:

| Name                   | Type                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `embedding`            | `number[]`                                             | The embedding vector for the content.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `embeddingUncertainty` | `Optional<number[]>`                                   | A per-dimension uncertainty vector with the same length as the `embedding` array. A higher value shows lower confidence in that dimension. Present when the request sets `embeddingUncertainty: true`. Only Marengo 3.5 returns this field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `embeddingOption`      | `Optional<TwelvelabsApi.EmbeddingDataEmbeddingOption>` | The modality used to generate this embedding. **Values**: - `visual`: Embedding based on visual content (a video, a page of a PDF file, or an image embedded asynchronously). - `audio`: Embedding based on audio content. - `transcription`: Embedding based on transcribed speech. Returned only for content embedded with Marengo 3.0. - `text`: The platform does not return this value. - `fused`: Embedding based on a combination of the modalities specified in the request. The platform returns this embedding only for video and audio input, and only when the `embeddingType` parameter includes the `fused_embedding` value. - `null`: For text embeddings and images embedded synchronously. |
| `embeddingScope`       | `Optional<TwelvelabsApi.EmbeddingDataEmbeddingScope>`  | The scope for which the embedding was generated. **Values**: - `clip`: Embedding for a segment. For video and audio input, one embedding per detected segment. - `page`: Embedding for one page of a document. The platform returns this value only for PDF files embedded asynchronously. - `asset`: Embedding for the entire file. For video and audio input, use this scope for content up to 10-30 seconds to maintain optimal performance. - `null`: For text embeddings and images embedded synchronously.                                                                                                                                                                                            |
| `startSec`             | `Optional<number>`                                     | The start time in seconds for this segment. This field is `null` for text and image embeddings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `endSec`               | `Optional<number>`                                     | The end time in seconds for this segment. This field is `null` for text and image embeddings.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `startPageNumber`      | `Optional<number>`                                     | The first page this embedding covers, counting from 1. The platform returns this field only for page-level embeddings of a PDF file, and `null` in every other case.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `endPageNumber`        | `Optional<number>`                                     | The last page this embedding covers, counting from 1 and including that page. This field matches the `startPageNumber` field when the embedding covers a single page. The platform returns this field only for page-level embeddings of a PDF file, and `null` in every other case.                                                                                                                                                                                                                                                                                                                                                                                                                         |

#### EmbeddingUsage

The `TwelvelabsApi.EmbeddingUsage` interface contains token counts for the request. Only Marengo 3.5 returns this object.

| Name          | Type                     | Description                                                                                                                                        |
| ------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `inputTokens` | `Record<string, number>` | The number of tokens the request used. Each key names a type of content the request processed, and each value is the token count for that content. |
| `truncated`   | `boolean`                | Whether the input was truncated to fit within the token limit.                                                                                     |

#### EmbeddingMediaMetadata

The `TwelvelabsApi.EmbeddingMediaMetadata` type provides metadata for the media input. Available for the `image`, `text_image`, `audio`, `video`, and `multi_input` input types. The `inputType` field selects one variant:

**Image**: Metadata for image embeddings.

| Name            | Type               | Description                                     |
| --------------- | ------------------ | ----------------------------------------------- |
| `inputType`     | `"image"`          | The type of the input content. Value: `image`.  |
| `inputUrl`      | `Optional<string>` | The publicly accessible URL for the image file. |
| `inputFilename` | `Optional<string>` | The name of the image file.                     |

**Text and image**: Metadata for text-image embeddings.

| Name            | Type               | Description                                         |
| --------------- | ------------------ | --------------------------------------------------- |
| `inputType`     | `"text_image"`     | The type of the input content. Value: `text_image`. |
| `inputUrl`      | `Optional<string>` | The publicly accessible URL for the image file.     |
| `inputFilename` | `Optional<string>` | The name of the image file.                         |

**Audio**: Metadata for audio embeddings.

| Name               | Type                                                        | Description                                                  |
| ------------------ | ----------------------------------------------------------- | ------------------------------------------------------------ |
| `inputType`        | `"audio"`                                                   | The type of the input content. Value: `audio`.               |
| `inputUrl`         | `Optional<string>`                                          | The publicly accessible URL for the audio file.              |
| `inputFilename`    | `Optional<string>`                                          | The name of the audio file.                                  |
| `embeddingOptions` | `string[]`                                                  | The `embeddingOption` values used to generate the embedding. |
| `embeddingScopes`  | `TwelvelabsApi.EmbeddingAudioMetadataEmbeddingScopesItem[]` | The `embeddingScope` values used to generate the embedding.  |
| `duration`         | `number`                                                    | The duration of the audio in seconds.                        |
| `startOffsetSec`   | `Optional<number>`                                          | The start offset in seconds.                                 |
| `endOffsetSec`     | `Optional<number>`                                          | The end offset in seconds.                                   |

**Video**: Metadata for video embeddings.

| Name               | Type                                                        | Description                                                                  |
| ------------------ | ----------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `inputType`        | `"video"`                                                   | The type of the input content. Value: `video`.                               |
| `inputUrl`         | `Optional<string>`                                          | The publicly accessible URL for the video file.                              |
| `inputFilename`    | `Optional<string>`                                          | The name of the video file.                                                  |
| `clipLength`       | `Optional<number>`                                          | Length of each video clip in seconds. Only available for fixed segmentation. |
| `embeddingScopes`  | `TwelvelabsApi.EmbeddingVideoMetadataEmbeddingScopesItem[]` | The `embeddingScope` values used to generate the embedding.                  |
| `embeddingOptions` | `string[]`                                                  | The `embeddingOption` values used to generate the embedding.                 |
| `duration`         | `number`                                                    | The duration of the video in seconds.                                        |
| `startOffsetSec`   | `Optional<number>`                                          | The start offset in seconds.                                                 |
| `endOffsetSec`     | `Optional<number>`                                          | The end offset in seconds.                                                   |

**Multi-input**: Metadata for multi-input embeddings.

| Name        | Type            | Description                                          |
| ----------- | --------------- | ---------------------------------------------------- |
| `inputType` | `"multi_input"` | The type of the input content. Value: `multi_input`. |

### API Reference

[Create sync embeddings](/v1.3/api-reference/create-embeddings-v2/create-embeddings)

### Related guide

* [Embed a query](/v1.3/docs/guides/create-embeddings/query)