# 1. Get upload URL
curl -X GET "https://dubsmart.ai/api/v1/upload" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"region": "EU",
"fileExtension": "mp4"
}'
# 2. Upload file using returned URL
curl -X PUT "PRESIGNED_URL_FROM_STEP_1" \
-H "Content-Type: video/mp4" \
--data-binary @video.mp4
curl -X POST "https://dubsmart.ai/api/v1/project" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {"path": "uploaded_file_key"},
"targetLanguages": ["es", "fr", "de"],
"voice": "voiceCloning"
}'
curl --request PUT \
--url https://dubsmart.ai/api/v1/project \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"title": "Updated Project Title",
"speakers": [
"Speaker 1",
"Speaker 2"
],
"backgroundVolume": 0.5,
"id": "64f8a2b1c3d4e5f6a7b8c9d0"
}'
curl -X GET "https://dubsmart.ai/api/v1/project/PROJECT_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
/upload
{
"region": "EU",
"fileExtension": "mp4"
}
{
"url": "https://storage.dubsmart.ai/...",
"key": "uploads/user_id/filename.mp4"
}
// JavaScript/Node.js Example
const axios = require('axios');
const fs = require('fs');
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://dubsmart.ai/api/v1';
async function createDubbingProject() {
try {
// 1. Get upload URL
const uploadResponse = await axios.get(`${BASE_URL}/upload`, {
params: {
region: 'EU',
fileExtension: 'mp4'
},
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
// 2. Upload file using presigned URL
const fileBuffer = fs.readFileSync('video.mp4');
await axios.put(uploadResponse.data.url, fileBuffer, {
headers: {
'Content-Type': 'video/mp4'
}
});
// 3. Create dubbing project
const projectResponse = await axios.post(`${BASE_URL}/project`, {
input: {
path: uploadResponse.data.key,
type: 'LOCAL_FILE',
voice: 'voiceCloning',
textCheck: false
},
targetLanguages: ['es', 'fr', 'de'],
title: 'My Multilingual Video'
}, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
console.log('Project created:', projectResponse.data);
return projectResponse.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
// Monitor project status
async function checkProjectStatus(projectId) {
const response = await axios.get(`${BASE_URL}/project/${projectId}`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
return response.data;
}