Get Upload Signed URL
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"original_filename": "video.mp4"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url"
payload = { "original_filename": "video.mp4" }
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({original_filename: 'video.mp4'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url', 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/upload/signed-url",
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([
'original_filename' => 'video.mp4'
]),
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/upload/signed-url"
payload := strings.NewReader("{\n \"original_filename\": \"video.mp4\"\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/upload/signed-url")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"original_filename\": \"video.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url")
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 \"original_filename\": \"video.mp4\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"asset_id": "re_660736410386149376",
"signed_url": "https://storage.googleapis.com/...",
"expires_in": 93600
},
"success": true,
"failed": false
}
Asset Management
Get Upload Signed URL
Generate a pre-signed URL for direct file upload
POST
/
upload
/
signed-url
Get Upload Signed URL
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"original_filename": "video.mp4"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url"
payload = { "original_filename": "video.mp4" }
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({original_filename: 'video.mp4'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url', 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/upload/signed-url",
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([
'original_filename' => 'video.mp4'
]),
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/upload/signed-url"
payload := strings.NewReader("{\n \"original_filename\": \"video.mp4\"\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/upload/signed-url")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"original_filename\": \"video.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/upload/signed-url")
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 \"original_filename\": \"video.mp4\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"asset_id": "re_660736410386149376",
"signed_url": "https://storage.googleapis.com/...",
"expires_in": 93600
},
"success": true,
"failed": false
}
Product: Visual Intelligence — Asset Management
Use case: Upload, manage, and download video/image assets used by other Visual Intelligence APIs
Host:
https://mavi-backend.memories.ai/serve/api/v2
Auth: Authorization: sk-mavi-... (no Bearer prefix)Pricing:
- API calls are free
- Storage fee: $0.001/1GB per day
Code Examples
const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2";
const API_KEY = "sk-mavi-...";
const response = await fetch(`${BASE_URL}/upload/signed-url`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': API_KEY
},
body: JSON.stringify({
original_filename: 'video.mp4'
})
});
const data = await response.json();
console.log(data);
// Then upload the file using the signed URL
const formData = new FormData();
formData.append('file', file);
await fetch(data.data.signed_url, {
method: 'POST',
body: formData
});
import axios from 'axios';
const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2";
const API_KEY = "sk-mavi-...";
// Step 1: Get signed URL
const { data } = await axios.post(`${BASE_URL}/upload/signed-url`, {
original_filename: 'video.mp4'
}, {
headers: {
'Authorization': API_KEY
}
});
// Step 2: Upload file using signed URL
const formData = new FormData();
formData.append('file', file);
await axios.post(data.data.signed_url, formData);
import requests
BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-mavi-..."
HEADERS = {
"Authorization": f"{API_KEY}"
}
def upload_signed_url(original_filename):
url = f"{BASE_URL}/upload/signed-url"
data = {"original_filename": original_filename}
response = requests.post(url, json=data, headers=HEADERS)
return response.json()
def upload_by_signed_url(signed_url_info, file_path):
upload_url = signed_url_info['data']["signed_url"]
fields = signed_url_info.get("fields", {})
with open(file_path, "rb") as f:
files = {"file": (file_path, f)}
data = fields
resp = requests.post(upload_url, data=data, files=files)
return resp.status_code, resp.text
# Usage example
signed_url_info = upload_signed_url("video.mp4")
status, response = upload_by_signed_url(signed_url_info, "path/to/video.mp4")
print(f"Upload status: {status}")
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| original_filename | string | Yes | The original filename with extension (e.g., “video.mp4”) |
Response
Returns a signed URL and associated metadata for file upload.{
"code": 200,
"msg": "success",
"data": {
"asset_id": "re_660736410386149376",
"signed_url": "https://storage.googleapis.com/...",
"expires_in": 93600
},
"success": true,
"failed": false
}
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 the signed URL and asset information |
| data.asset_id | string | Unique identifier of the asset that will be created after upload |
| data.signed_url | string | Pre-signed URL for direct file upload to cloud storage |
| data.expires_in | integer | Validity period of the signed URL in seconds |
| success | boolean | Indicates whether the operation was successful |
| failed | boolean | Indicates whether the operation failed |
Notes
- The signed URL expires after the time specified in
expires_in(in seconds) - Upload the file before the URL expires to avoid upload failures
- The
expires_invalue indicates how long the signed URL remains valid from the time it was generated
Authorizations
Body
application/json
The original filename with extension
Example:
"video.mp4"
Response
200 - application/json
Signed URL generated successfully
Response code indicating the result status
Example:
200
Response message describing the operation result
Example:
"success"
Response data object containing the signed URL and asset information
Show child attributes
Show child attributes
Indicates whether the operation was successful
Example:
true
Indicates whether the operation failed
Example:
false
