POST
/
embeddings
/
video
Generate Video Embedding
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/embeddings/video \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "asset_id": "re_657745568997527552",
  "model": "multimodalembedding@001"
}
'
{
  "code": "0000",
  "msg": "success",
  "data": {
    "embedding": [
      0.0156250,
      -0.0234375,
      0.0312500,
      0.0078125,
      -0.0156250,
      "... (continues for vector length)"
    ]
  },
  "success": true,
  "failed": false
}
This endpoint generates a single vector embedding representing the entire video content. The video must be previously uploaded and referenced by its asset ID.

Code Examples

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

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

Request Body

FieldTypeRequiredDescription
asset_idstringYesVideo asset ID from a previous upload
modelstringYesEmbedding model name
Supported Models:
  • multimodalembedding@001 - Google’s multimodal embedding model supporting video

Response

Returns a single embedding vector representing the entire video.
{
  "code": "0000",
  "msg": "success",
  "data": {
    "embedding": [
      0.0156250,
      -0.0234375,
      0.0312500,
      0.0078125,
      -0.0156250,
      "... (continues for vector length)"
    ]
  },
  "success": true,
  "failed": false
}

Response Parameters

ParameterTypeDescription
codestringResponse code indicating the result status (“0000” indicates success)
msgstringResponse message describing the operation result
dataobjectResponse data object containing the embedding
data.embeddingarray[number]Vector embedding array representing the entire video
successbooleanIndicates whether the operation was successful
failedbooleanIndicates 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
  • Embedding dimensions depend on the model (typically 512-1024 dimensions)
  • 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

Authorizations

Authorization
string
header
required

Body

application/json
asset_id
string
required

Video asset ID

Example:

"re_657745568997527552"

model
enum<string>
required

Embedding model name

Available options:
multimodalembedding@001
Example:

"multimodalembedding@001"

Response

200 - application/json

Embedding generated successfully

code
string

Response code indicating the result status

Example:

"0000"

msg
string

Response message describing the operation result

Example:

"success"

data
object

Response data object containing the embedding

success
boolean

Indicates whether the operation was successful

Example:

true

failed
boolean

Indicates whether the operation failed

Example:

false