VidMage

VidMage is an AI video and image creation platform for creators. Turn your ideas and images into videos and fresh visuals.

Open the creator tools
Explore APIs
AI Video APIsAI Image APIsAI Audio APIsAI 3D APIsAI Face Swap APIsAI Effects APIs
Build with VidMage
QuickstartAPI keysVidMage MCPError reference
Your account
Developer consoleAbout VidMagePlans and creditsAPI billingContact support
© 2026 VidMage. All rights reserved.
Privacy PolicyTerms of ServiceReport Abuse
Skip to content
VidMage/Developers
Overview
APIs
All APIsAI Video APIsAI Image APIsAI Audio APIsAI 3D APIsAI Face Swap APIsAI Effects APIs
DocumentationVidMage MCPOpen console
Developers/Documentation/Upload local media
Start here
DocumentationQuickstartAuthentication
Core workflows
File uploadsTask lifecycleCredits and billingErrors and recoveryVidMage MCP
Browse documentation
All API documentation
Video documentation 36AI Video Head SwapAI Video Face SwapAI Multiple Face Swap VideoAI Text to VideoAI Image to VideoAI Video to VideoAI Video ExtenderAI Video to Anime ConverterAI Video Background RemoverAI Video Watermark RemoverSora Link Watermark RemoverSora 2 Video GeneratorAI Photo DanceAI Motion ControlAI Talking PhotoAI Lip SyncAI Subtitle GeneratorAI Video UpscalerKling AI Video GeneratorPixVerse AI Video GeneratorHailuo AI Video GeneratorMiniMax H3 AI Video GeneratorGrok Video GeneratorSora 2 AI Video GeneratorWan AI Video GeneratorWan 3.0 AI Video GeneratorSeedance 2.0 AI Video GeneratorSeedance 2.5 AI Video GeneratorSeedance AI Video GeneratorMidjourney Video GeneratorVidu AI Video GeneratorVeo 3.1 AI Video GeneratorKling 3.0 AI Video GeneratorSkyReels AI Video GeneratorHappyHorse AI ModelRunway AI Video Generator
Image documentation 24AI Photo Face SwapAI Head SwapAI Multiple Face SwapAI Text to ImageAI Image to ImageAI Girl GeneratorAI Hairstyle ChangerAI Clothes ChangerAI Object RemoverAI Image Watermark RemoverAI Image UpscalerGPT Image 2 Image to ImageAI GIF Face SwapMidjourney AI Image GeneratorGrok AI Image GeneratorNano Banana AI Image GeneratorGPT Image GeneratorSeedream AI Image GeneratorZ-Image AI ModelWan Image GeneratorQwen Image GeneratorQwen 3.0 Image GeneratorGPT Image 2 GeneratorGPT Image 2.5 Generator
Audio documentation 3AI Voice CloneAI Voice DesignAI Text to Music
3d documentation 3AI Image to 3DAI Four-View to 3DAI Text to 3D

Upload local media

Create an upload for a specific capability input, transfer the file directly to storage, and pass the returned file URL to the task.

On this page01 / 04
01Upload flow02File metadata03Transfer file04Upload errors

The upload has three parts

  1. Send file metadata to POST /api/v1/files/upload. Name the capability and the parameter that will receive the file.
  2. Upload the exact file bytes to the returned uploadUrl with every returned header, or run the provided uploadCommand.
  3. After the upload completes, use fileUrl in the capability submission.

The upload URL is temporary and bound to a file size. Bytes travel directly to storage. VidMage checks the upload before charging generation credits.

Build metadata from the actual file

This Python example prepares an image for face-swap.targetImageUrl. It requests an upload but does not submit a generation task. Install requests in your chosen environment first.

import os
from pathlib import Path
import requests

media = Path("./input.jpg")
response = requests.post(
    "https://vidmage.ai/api/v1/files/upload",
    headers={"Authorization": f"Bearer {os.environ['VIDMAGE_API_KEY']}"},
    json={
        "capability": "face-swap",
        "parameter": "targetImageUrl",
        "fileName": media.name,
        "localPath": str(media.resolve()),
        "contentType": "image/jpeg",
        "fileSize": media.stat().st_size,
    },
    timeout=60,
)
response.raise_for_status()
print(response.json())

Match contentType to the file bytes, not just a renamed extension. Use the exact byte count, including for large videos. Do not supply duration in upload metadata. The server measures the uploaded media before billing; the upload contract accepts file metadata only.

Transfer first, then submit

Use the upload details returned by the service. Use HTTP PUT for the exact bytes and every returned upload header. Do not add your VidMage Bearer key to this storage request or replace the file with another file of a different size. The storage upload URL and the task input URL have different jobs: upload bytes with uploadUrl, then submit fileUrl.

Task inputUpload parameter
Photo to edittargetImageUrl for AI Photo Face Swap
Video to edittargetVideoUrl for AI Video Face Swap
Replacement face photoreferenceFaceImageUrl for either face swap capability
Seedance media referenceUse the matching field from the Seedance reference.

Each returned fileUrl belongs to the capability parameter named when creating that upload. Do not reuse it for an unrelated input. In MCP, prepare one to five local files in a single upload_files call, then complete all returned storage transfers.

Resolve upload state before generation

ErrorNext step
UPLOAD_NOT_READYCheck that the storage transfer has finished before using its fileUrl.
UPLOAD_EXPIREDCreate a new temporary upload and transfer the media again.
VALIDATION_ERRORCorrect the reported size, type, input field, or other metadata.

Temporary files are cleared automatically. No fixed retention interval is specified here. For bulk local media in an AI client, use the batch upload flow in the MCP guide.

Reference reviewed September 21, 2026Documentation home ↗