Upload images and videos
Upload images or MP4 videos up to 20 MB and use the returned URL with Vydra’s generation and editing APIs. Uploads do not consume credits.
/api/v1/uploadUpload media or request a direct-upload URL
Direct upload · recommended
Authenticate with your API key. Send JSON containing contentType and the exact file size in bytes. The response includes uploadUrl, publicUrl (also returned as url), type, key, and expiresIn. PUT the bytes to uploadUrl with the returned Content-Type within 10 minutes. Only use publicUrl after the PUT succeeds. Do not send your Vydra API key to the storage URL.
Supported types: image/jpeg, image/jpg, image/png, image/webp, image/gif, video/mp4. Direct uploads bypass the serverless request-body limit and preserve the original media bytes.
// Browser or Node.js with a File object named videoFile.
// In a Vydra browser session, omit Authorization; use the session cookie.
const headers = {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
};
const signedResponse = await fetch('https://www.vydra.ai/api/v1/upload', {
method: 'POST', headers,
body: JSON.stringify({
filename: videoFile.name,
contentType: 'video/mp4',
size: videoFile.size
})
});
if (!signedResponse.ok) throw new Error(await signedResponse.text());
const signed = await signedResponse.json();
const uploaded = await fetch(signed.uploadUrl, {
method: 'PUT',
headers: { 'Content-Type': signed.type },
body: videoFile
});
if (!uploaded.ok) throw new Error('Video upload failed');
const response = await fetch('https://www.vydra.ai/api/v1/jobs', {
method: 'POST', headers,
body: JSON.stringify({
workflow: 'generate_video',
input: {
model: 'gemini-omni-flash',
videoUrl: signed.publicUrl,
prompt: 'Change the background to a beach. Keep the subject the same.'
}
})
});
if (!response.ok) throw new Error(await response.text());
const job = await response.json();
// Poll GET /api/v1/jobs/{job.id} until completed or failed.
// A completed response contains result.videoUrl.Multipart upload · small files
Existing clients can send multipart/form-data with a file field. Both images and MP4 videos are accepted. Keep multipart files under 4 MB in production; use direct upload for larger files because the hosting platform limits request bodies. The response includes url, filename, size, type, and key. Videos also include measured duration in seconds. Images may be resized; videos are preserved.
curl https://www.vydra.ai/api/v1/upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@clip.mp4;type=video/mp4"Upload limits and editing limits
The general upload limit is 20 MB. Each model applies its own input requirements before generation: Gemini Omni accepts MP4 clips up to 10 seconds and 20 MB, plus a JPEG, PNG, or WebP image up to 4 MB. Edits preserve the clip’s length and aspect ratio. Uploading a longer video does not make it eligible for Omni; trim or compress it first.
Use the Upload control in Create or your Library to upload a video directly. Studio can use that library video through a video input node. For API uploads, optionally save the uploaded URL to your library with POST /api/v1/library using name, url, and kind: "video" (jobs:write required).
Errors
400: missing file, invalid metadata, unsupported format, or invalid MP4. 401: authentication required. 413 or a hosting body-limit error: retry using direct upload. 429: upload rate limit reached. Storage failures return an error; do not submit a generation until the upload succeeds.
The existing /api/v1/library/upload-url endpoint remains available for Omni references (images up to 4 MB; MP4 up to 20 MB).