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"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/embeddings/video"
payload = {
"asset_id": "re_657745568997527552",
"model": "multimodalembedding@001"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({asset_id: 're_657745568997527552', model: 'multimodalembedding@001'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/embeddings/video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mavi-backend.memories.ai/serve/api/v2/embeddings/video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'asset_id' => 're_657745568997527552',
'model' => 'multimodalembedding@001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/embeddings/video"
payload := strings.NewReader("{\n \"asset_id\": \"re_657745568997527552\",\n \"model\": \"multimodalembedding@001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/embeddings/video")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"re_657745568997527552\",\n \"model\": \"multimodalembedding@001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/embeddings/video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_id\": \"re_657745568997527552\",\n \"model\": \"multimodalembedding@001\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"embedding": [
0.0156250,
-0.0234375,
0.0312500,
0.0078125,
-0.0156250,
"... (continues for vector length)"
]
},
"success": true,
"failed": false
}
Embeddings
Generate Video Embedding
Generate vector embeddings for videos using multimodal models
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"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/embeddings/video"
payload = {
"asset_id": "re_657745568997527552",
"model": "multimodalembedding@001"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({asset_id: 're_657745568997527552', model: 'multimodalembedding@001'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/embeddings/video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mavi-backend.memories.ai/serve/api/v2/embeddings/video",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'asset_id' => 're_657745568997527552',
'model' => 'multimodalembedding@001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/embeddings/video"
payload := strings.NewReader("{\n \"asset_id\": \"re_657745568997527552\",\n \"model\": \"multimodalembedding@001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/embeddings/video")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"re_657745568997527552\",\n \"model\": \"multimodalembedding@001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/embeddings/video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_id\": \"re_657745568997527552\",\n \"model\": \"multimodalembedding@001\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"embedding": [
0.0156250,
-0.0234375,
0.0312500,
0.0078125,
-0.0156250,
"... (continues for vector length)"
]
},
"success": true,
"failed": false
}
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)Pricing:
- $0.002/second of video
Code Examples
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);
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);
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)
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| asset_id | string | Yes | Video asset ID from a previous upload |
| model | string | Yes | Embedding model name |
multimodalembedding@001- Google’s multimodal embedding model supporting video
Response
Returns a single embedding vector representing the entire video.{
"code": 200,
"msg": "success",
"data": {
"embedding": [
0.0156250,
-0.0234375,
0.0312500,
0.0078125,
-0.0156250,
"... (continues for vector length)"
]
},
"success": true,
"failed": false
}
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
/uploadendpoint to obtain an asset_id multimodalembedding@001produces 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
Authorizations
Body
application/json
Response
200 - application/json
Embedding generated successfully
Response code indicating the result status
Example:
200
Response message describing the operation result
Example:
"success"
Response data object containing the embedding
Show child attributes
Show child attributes
Indicates whether the operation was successful
Example:
true
Indicates whether the operation failed
Example:
false
