Async Generate Video Transcription
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-video \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_id": "re_657929111888723968",
"model": "gemini-2.5-flash-lite"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-video"
payload = {
"asset_id": "re_657929111888723968",
"model": "gemini-2.5-flash-lite"
}
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_657929111888723968', model: 'gemini-2.5-flash-lite'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-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/transcriptions/async-generate-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_657929111888723968',
'model' => 'gemini-2.5-flash-lite'
]),
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/transcriptions/async-generate-video"
payload := strings.NewReader("{\n \"asset_id\": \"re_657929111888723968\",\n \"model\": \"gemini-2.5-flash-lite\"\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/transcriptions/async-generate-video")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"re_657929111888723968\",\n \"model\": \"gemini-2.5-flash-lite\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-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_657929111888723968\",\n \"model\": \"gemini-2.5-flash-lite\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"task_id": "ec2449885ba84c4f943a80ff0633158e"
},
"failed": false,
"success": true
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"data": {
"data": [
{
"end_time": 2.0,
"start_time": 0.0,
"transcript": "A drone shot flies over a dense forest with lush green trees and some bare branches, suggesting early spring."
},
{
"end_time": 4.0,
"start_time": 2.0,
"transcript": "A woman in a flowing light green dress runs across a grassy area towards a wooden structure, her back to the camera."
},
{
"end_time": 6.0,
"start_time": 4.0,
"transcript": "A close-up shows a person wearing a costume with antlers and dreadlocks, with a distressed expression."
}
],
"error_rate": 0.0,
"usage_metadata": {
"duration": 0.0,
"model": "gemini-2.5-flash-lite",
"output_tokens": 24641,
"prompt_tokens": 283901
}
},
"msg": "Video description completed successfully",
"success": true
},
"task_id": "580e35a50faa437480b2d425bdcf1c87"
}
Video Task APIs
Video Frame Description
Generate timestamped visual descriptions of what appears on screen in a video.
POST
/
transcriptions
/
async-generate-video
Async Generate Video Transcription
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-video \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_id": "re_657929111888723968",
"model": "gemini-2.5-flash-lite"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-video"
payload = {
"asset_id": "re_657929111888723968",
"model": "gemini-2.5-flash-lite"
}
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_657929111888723968', model: 'gemini-2.5-flash-lite'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-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/transcriptions/async-generate-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_657929111888723968',
'model' => 'gemini-2.5-flash-lite'
]),
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/transcriptions/async-generate-video"
payload := strings.NewReader("{\n \"asset_id\": \"re_657929111888723968\",\n \"model\": \"gemini-2.5-flash-lite\"\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/transcriptions/async-generate-video")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"re_657929111888723968\",\n \"model\": \"gemini-2.5-flash-lite\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-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_657929111888723968\",\n \"model\": \"gemini-2.5-flash-lite\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"task_id": "ec2449885ba84c4f943a80ff0633158e"
},
"failed": false,
"success": true
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"data": {
"data": [
{
"end_time": 2.0,
"start_time": 0.0,
"transcript": "A drone shot flies over a dense forest with lush green trees and some bare branches, suggesting early spring."
},
{
"end_time": 4.0,
"start_time": 2.0,
"transcript": "A woman in a flowing light green dress runs across a grassy area towards a wooden structure, her back to the camera."
},
{
"end_time": 6.0,
"start_time": 4.0,
"transcript": "A close-up shows a person wearing a costume with antlers and dreadlocks, with a distressed expression."
}
],
"error_rate": 0.0,
"usage_metadata": {
"duration": 0.0,
"model": "gemini-2.5-flash-lite",
"output_tokens": 24641,
"prompt_tokens": 283901
}
},
"msg": "Video description completed successfully",
"success": true
},
"task_id": "580e35a50faa437480b2d425bdcf1c87"
}
Product: Visual Intelligence — Video Task APIs (application layer)
Use case: Pre-packaged video analysis tasks built on top of the Video Model APIs — fixed prompt + workflow, you just POST a video and get a structured result. For full control over prompt and model selection, see Video Model APIs.
Host:
https://mavi-backend.memories.ai/serve/api/v2
Auth: Authorization: sk-mavi-... (no Bearer prefix)security.memories.ai service, supports Human ReID (named person identification), and requires a separate API key. Use Video Frame Description for standard frame-by-frame analysis on assets you’ve uploaded via the main API.
This is an async endpoint. You must configure a webhook URL in Webhooks Settings before calling this endpoint, otherwise you will not receive the processing results. See Webhooks Configuration Guide for details.
Pricing:
- Input tokens: $0.45/1M tokens
- Output tokens: $3.75/1M tokens
Supported Models
gemini-2.5-flash-litegemini-2.5-flashgemini-2.5-flash-preview-09-2025gemini-2.5-flash-lite-preview-09-2025
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| asset_id | string | Yes | The unique identifier of the video asset to generate visual descriptions for |
| model | string | Yes | The model to use for video description (e.g., gemini-2.5-flash-lite) |
Code Example
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-generate-video \
--header 'Authorization: sk-mavi-...' \
--header 'Content-Type: application/json' \
--data '{
"asset_id": "re_657929111888723968",
"model": "gemini-2.5-flash-lite"
}'
const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2/transcriptions";
const API_KEY = "sk-mavi-...";
const response = await fetch(`${BASE_URL}/async-generate-video`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': API_KEY
},
body: JSON.stringify({
asset_id: 're_657929111888723968',
model: 'gemini-2.5-flash-lite'
})
});
const data = await response.json();
console.log(data);
import requests
BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2/transcriptions"
API_KEY = "sk-mavi-..."
HEADERS = {
"Authorization": f"{API_KEY}"
}
def async_generate_video(asset_id: str, model: str):
url = f"{BASE_URL}/async-generate-video"
data = {"asset_id": asset_id, "model": model}
resp = requests.post(url, json=data, headers=HEADERS)
return resp.json()
# Usage example
result = async_generate_video("re_657929111888723968", "gemini-2.5-flash-lite")
print(result)
Response
Returns the video description task information.{
"code": 200,
"msg": "success",
"data": {
"task_id": "ec2449885ba84c4f943a80ff0633158e"
},
"failed": false,
"success": true
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"data": {
"data": [
{
"end_time": 2.0,
"start_time": 0.0,
"transcript": "A drone shot flies over a dense forest with lush green trees and some bare branches, suggesting early spring."
},
{
"end_time": 4.0,
"start_time": 2.0,
"transcript": "A woman in a flowing light green dress runs across a grassy area towards a wooden structure, her back to the camera."
},
{
"end_time": 6.0,
"start_time": 4.0,
"transcript": "A close-up shows a person wearing a costume with antlers and dreadlocks, with a distressed expression."
}
],
"error_rate": 0.0,
"usage_metadata": {
"duration": 0.0,
"model": "gemini-2.5-flash-lite",
"output_tokens": 24641,
"prompt_tokens": 283901
}
},
"msg": "Video description completed successfully",
"success": true
},
"task_id": "580e35a50faa437480b2d425bdcf1c87"
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code indicating the result status |
| msg | string | Response message describing the operation result |
| data | object | Response data object containing task information |
| data.task_id | string | Unique identifier of the video description task |
| success | boolean | Indicates whether the operation was successful |
| failed | boolean | Indicates whether the operation failed |
Callback Response Parameters
When the video description is complete, a callback will be sent to your configured webhook URL.| Parameter | Type | Description |
|---|---|---|
| code | string | Response code (200 indicates success) |
| message | string | Status message (e.g., “SUCCESS”) |
| data | object | Response data object containing the description result and metadata |
| data.data | object | Inner data object containing description segments and usage information |
| data.data.data | array | Array of description segments with timestamps |
| data.data.data[].start_time | number | Start time of the segment in seconds |
| data.data.data[].end_time | number | End time of the segment in seconds |
| data.data.data[].transcript | string | Visual description text for this time segment |
| data.data.error_rate | number | Error rate of the description (0.0 means no errors) |
| data.data.usage_metadata | object | Usage statistics for the API call |
| data.data.usage_metadata.duration | number | Processing duration in seconds |
| data.data.usage_metadata.model | string | The AI model used for description (e.g., “gemini-2.5-flash-lite”) |
| data.data.usage_metadata.output_tokens | integer | Number of tokens in the generated description |
| data.data.usage_metadata.prompt_tokens | integer | Number of tokens in the input prompt |
| data.msg | string | Detailed message about the operation result |
| data.success | boolean | Indicates whether the description was successful |
| task_id | string | The task ID associated with this description request |
Authorizations
Body
application/json
Response
200 - application/json
Transcription task information
Response code indicating the result status
Example:
200
Response message describing the operation result
Example:
"success"
Response data object containing task information
Show child attributes
Show child attributes
Indicates whether the operation was successful
Example:
true
Indicates whether the operation failed
Example:
false
⌘I
