Upload a media file
Changed onGets a media file into your AITuber library and returns an assetId you can pass to other endpoints. Every upload has a purpose that says what the file is for; the purpose decides the validation rules and where the asset can be used.
Two ways to upload:
1. From a URL (easiest, works from AI agents): pass sourceUrl and we download the file for you. Only available for small image purposes (not video).
2. Direct upload (for local files): pass contentType and fileSizeBytes and you get back an uploadUrl. PUT your file bytes to that URL within 1 hour (set the same Content-Type header), then use the assetId.
Supported purposes:
- background-video-upload: H.264 MP4, up to 500MB and 10 minutes. Direct upload only. Call POST /uploads/confirm-background-video after PUT.
- clip-reference-image, clip-reference-video, clip-reference-audio: input files for standalone clip generation. Images allow JPEG, PNG, or WebP up to 25MB. Videos allow MP4, MOV, or WebM up to 200MB. Audio allows MP3, WAV, M4A, AAC, OGG, or WebM up to 50MB. Direct upload only.
- rebuild-still: a Before or After picture for an AI Construction Timelapse (templateId: "rebuild"). Pass the returned URL as beforeImageUrl or afterImageUrl. A photo, a drawing, or a render all work. JPEG, PNG, or WebP, max 25MB. URL upload allowed.
- element-image: a reference photo for an element (a person, product, or place). JPEG, PNG, or WebP, max 25MB. URL upload allowed. Use the assetId in POST /elements.
- visual-style-reference: a picture of a look you want to reuse. JPEG, PNG, or WebP, max 10MB. URL upload allowed. AITuber reads the picture and writes a reusable visual style from it.
- ugc-demo: a product demo video for a UGC hook video. MP4, MOV, or WebM, max 200MB, up to 3 minutes. Direct upload only. Use the assetId as demoVideoAssetId in POST /ugc/videos.
- music: an audio track to score a music video. MP3, WAV, M4A, or AAC, max 50MB. Direct upload only, and durationSeconds is REQUIRED. Use the assetId as musicAssetId in POST /music-videos.
- voice-sample: an audio sample for voice cloning. MP3, WAV, M4A, AAC, OGG, or WebM, max 11MB. Direct upload only. Pass the assetId to the voice clone endpoint.
- document-source: a PDF to turn into a video. PDF only, max 25MB, up to 100 pages. Direct upload only.
Optional fileName: the name of the file you are uploading. We keep it for display, so a PDF shows its own name instead of an id.
Uploads that are never attached to anything are deleted after 7 days.
Request
- Base URLhttps://app.aituber.app/api/v1
- AuthHTTP bearer
Request body
Response
OK
Changes
- info
added the new
application/vnd.openxmlformats-officedocument.presentationml.presentationenum value to the request property - info
added the new
application/vnd.openxmlformats-officedocument.spreadsheetml.sheetenum value to the request property - info
added the new
application/vnd.openxmlformats-officedocument.wordprocessingml.documentenum value to the request property - info
added the new
text/csvenum value to the request property - info
added the new
text/markdownenum value to the request property - info
added the new
text/plainenum value to the request property
- info
- info
api operation id
uploads.createremoved and replaced withcreateUpload
- info