> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Video Embedding

> Generate vector embeddings for videos using multimodal models

<Info>
  **Product**: Visual Intelligence — Embeddings
  **Use case**: Generate vector embeddings for image, video, or text inputs for semantic search and similarity tasks
  **Host**: `https://mavi-backend.memories.ai/serve/api/v2`
  **Auth**: `Authorization: sk-mavi-...` (no `Bearer` prefix)
</Info>

This endpoint generates a single vector embedding representing the entire video content. The video must be previously uploaded and referenced by its asset ID.

<Note>
  **Pricing:**

  * \$0.002/second of video
</Note>

### Code Examples

<CodeGroup>
  ```javascript fetch theme={null}
  const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2";
  const API_KEY = "sk-mavi-...";

  const response = await fetch(`${BASE_URL}/embeddings/video`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': API_KEY
    },
    body: JSON.stringify({
      asset_id: 're_657745568997527552',
      model: 'multimodalembedding@001'
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```javascript axios theme={null}
  import axios from 'axios';

  const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2";
  const API_KEY = "sk-mavi-...";

  const response = await axios.post(`${BASE_URL}/embeddings/video`, {
    asset_id: 're_657745568997527552',
    model: 'multimodalembedding@001'
  }, {
    headers: {
      'Authorization': API_KEY
    }
  });

  console.log(response.data);
  ```

  ```python Python theme={null}
  import requests

  BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
  API_KEY = "sk-mavi-..."
  HEADERS = {
      "Authorization": f"{API_KEY}"
  }

  def video_embedding(asset_id, model="multimodalembedding@001"):
      url = f"{BASE_URL}/embeddings/video"
      data = {"asset_id": asset_id, "model": model}
      response = requests.post(url, headers=HEADERS, json=data)
      return response.json()

  # Usage example
  result = video_embedding("re_657745568997527552", model="multimodalembedding@001")
  print(result)
  ```
</CodeGroup>

### Request Body

| Field     | Type   | Required | Description                           |
| --------- | ------ | -------- | ------------------------------------- |
| asset\_id | string | Yes      | Video asset ID from a previous upload |
| model     | string | Yes      | Embedding model name                  |

**Supported Models:**

* `multimodalembedding@001` - Google's multimodal embedding model supporting video

### Response

Returns a single embedding vector representing the entire video.

<ResponseExample>
  ```json theme={null}
  {
    "code": 200,
    "msg": "success",
    "data": {
      "embedding": [
        0.0156250,
        -0.0234375,
        0.0312500,
        0.0078125,
        -0.0156250,
        "... (continues for vector length)"
      ]
    },
    "success": true,
    "failed": false
  }
  ```
</ResponseExample>

### Response Parameters

| Parameter      | Type           | Description                                                        |
| -------------- | -------------- | ------------------------------------------------------------------ |
| code           | string         | Response code indicating the result status (200 indicates success) |
| msg            | string         | Response message describing the operation result                   |
| data           | object         | Response data object containing the embedding                      |
| data.embedding | array\[number] | Vector embedding array representing the entire video               |
| success        | boolean        | Indicates whether the operation was successful                     |
| failed         | boolean        | Indicates whether the operation failed                             |

### Notes

* Video embeddings are returned synchronously in the response
* The embedding represents the entire video content as a single vector
* Videos must be uploaded first using the `/upload` endpoint to obtain an asset\_id
* `multimodalembedding@001` produces 1408-dimensional vectors
* Supports various video formats: MP4, MOV, AVI, WebM, MKV, etc.
* Processing time depends on video length and complexity
* Use video embeddings for:
  * Video similarity search
  * Content-based video retrieval
  * Video classification and categorization
  * Duplicate video detection


## OpenAPI

````yaml POST /embeddings/video
openapi: 3.1.0
info:
  title: Embeddings API Reference
  description: REST APIs for generating vector embeddings from images, videos, and text
  version: v1.0.0
servers:
  - url: https://mavi-backend.memories.ai/serve/api/v2
security:
  - ApiKeyAuth: []
paths:
  /embeddings/video:
    post:
      summary: Generate Video Embedding
      operationId: video_embedding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                asset_id:
                  type: string
                  description: Video asset ID
                  example: re_657745568997527552
                model:
                  type: string
                  description: Embedding model name
                  example: multimodalembedding@001
                  enum:
                    - multimodalembedding@001
              required:
                - asset_id
                - model
      responses:
        '200':
          description: Embedding generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: 200
                    description: Response code indicating the result status
                  msg:
                    type: string
                    example: success
                    description: Response message describing the operation result
                  data:
                    type: object
                    properties:
                      embedding:
                        type: array
                        items:
                          type: number
                        description: Vector embedding array representing the entire video
                        example:
                          - 0.015625
                          - -0.0234375
                          - 0.03125
                          - 0.0078125
                    description: Response data object containing the embedding
                  success:
                    type: boolean
                    example: true
                    description: Indicates whether the operation was successful
                  failed:
                    type: boolean
                    example: false
                    description: Indicates whether the operation failed
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````