Skip to main content
POST
  • Upload local files or raw binary data via multipart/form-data
  • MP4/MOV video: up to 200 MiB (209,715,200 bytes); other files: 100 MiB (104,857,600 bytes)
  • Files automatically expire and are purged after 72 hours
  • Limit of 2,000 active files per user; returns 429 when quota is exhausted
  • Auth: Authorization: Bearer sk-...

Browser direct upload

Browser direct uploads are live as of October 12, 2026. The multipart endpoint remains available.
Use the existing POST /api/v1/files/upload/presign and POST /api/v1/files/upload/confirm endpoints (also available under /v1/files/upload/*), not the publishing media-presign endpoint. Ticket and confirmation calls use the existing file-upload authentication. Both accept JSON: presign requires non-empty string file_name and mime_type, a positive integer file_size, and optional string upload_path; confirm requires string file_id and the same integer file_size. The standard response uses success (boolean), code (integer), msg (string), and data on success. Ticket data contains file_id, upload_url, upload_method, upload_headers (a string-to-string map), resource_url, download_url, and expires_at. Upload tickets default to 15 minutes and cannot exceed 1 hour. Ticket data.expires_at is the upload deadline, not the confirmed file’s retention deadline.
  1. Request a ticket with file_name, mime_type, positive file_size in bytes, and optional upload_path. The ceiling is 200 MiB (209,715,200 bytes) for MP4/MOV video and 100 MiB (104,857,600 bytes) for other files; a website flow may impose a lower limit. For ordinary uploads, a video MIME type or .mp4/.mov filename selects the video reading budget, but files larger than 100 MiB must also pass actual MP4/MOV container checks. Renaming a non-video file does not raise its valid limit. The reference-video browser-check purpose below has a separate policy. Base64 uploads retain the 100 MiB decoded-file limit.
  2. PUT the original browser File as the request body to data.upload_url, using data.upload_method and every returned data.upload_headers value unchanged. These are the required signed headers, including If-None-Match: *, which prevents replay from overwriting an existing object. Do not wrap the file in FormData, use the site’s authenticated client, or add an OmniMux Bearer header. Set credentials: "omit".
  3. After PUT succeeds, confirm with file_id and the same file_size. Use the confirmed URL and retention in the existing upload library only after confirmation succeeds. A ticket’s resource_url is not proof of a confirmed file.
Fall back to multipart only if the ticket endpoint returns the documented 501 unsupported-storage response. Authentication, quota, network, PUT, and confirmation failures must not silently relay or retry the file; preserve the service’s safe msg. Confirmation checks object existence, positive size, and stored Content-Type metadata through R2 HEAD, without reading the complete object body. Actual size must equal the original ticket declaration, even if confirmation supplies a different size; type metadata must equal the ticket’s normalized MIME type. Confirmation atomically activates only an owned, pending, unexpired record. Repeated or conflicting confirmation cannot replace an active object. For ordinary video uploads above 100 MiB, confirmation also reads the object to verify the complete stored size and an MP4/MOV container; a temporary read failure can be retried. This container check does not establish codec or decodability. These metadata checks do not validate the actual media format, duration, or safety. Separate reference-media preparation still applies to ordinary uploads; the reference-video purpose below uses browser checks instead.

Reference-video browser checks

The reference-video browser-check purpose is available as of October 18, 2026. The influencer page reads and checks the original file in the browser before requesting an upload. Failed checks or unsupported source-following duration/framing produce the existing top-of-page message and prevent adding or uploading that file. The browser retains the complete metadata and submits it again for generation; duration and framing follow the reference rather than manual controls. Presign accepts the following additional JSON fields. Multipart fallback accepts the same fields as form values; video_metadata must be a JSON-encoded string in multipart, rather than another file part. The current browser-check upload purpose also requires the following declared specifications. Passing the general video-input bounds alone does not establish that the current generation service can follow the source.

Duration following and audio/video tail differences

Let s = round(video_duration) and T = 1 / frame_rate + 0.001 seconds. The actual generation duration s must be 4–30 seconds, and both conditions must hold:
  1. The video-track duration is within T of s: abs(video_duration - s) ≤ T.
  2. The container satisfies abs(duration - s) ≤ T. Otherwise, accept it only with a supported audio track from the table above, duration ≥ video_duration, and duration - video_duration ≤ T.
The additional branch accommodates only a positive container-to-video tail difference of at most one frame plus 1 millisecond. It does not broaden the tolerance for genuine fractional video duration or establish that extra audio is encoding padding. Files without audio cannot use the additional tail-difference condition. For example, a 24 fps video with AAC audio, a 7.072-second container, and a 7.041667-second video track meets these duration conditions: its video is close to 7 seconds, and its container is only 0.030333 seconds longer than the video. The page retains and displays the original 7.072-second reference duration and explicitly shows the actual generation duration of 7 seconds. Upload and generation declarations retain the raw fractional values; the file and metadata are not rewritten. All other format, resolution, framing, and input checks must still pass. A genuine 7.2-second video track, a 7.2-second container with a 7-second video track, or the 7.072/7.041667-second example without audio is still rejected with a top-of-page message before upload. Either duration below 4 seconds or above 30 seconds is also rejected. Supply all fields with finite numeric values. The declared MIME must match container: video/mp4 for MP4; video/quicktime or video/x-quicktime for MOV. In presign, file_size must equal video_metadata.size_bytes; in multipart, the file part’s size and Content-Type must match those declarations. The 200 MiB (209,715,200-byte) hard ceiling still applies. The service checks declaration bounds and consistency but does not read the file to establish media facts for this purpose. The server binds this policy to the upload record when presign succeeds; it retains the reserved influencer-reference/browser-upload path and ignores a caller-supplied custom folder for this purpose. Confirmation cannot change an ordinary ticket to this purpose. Direct-upload confirmation keeps ownership, pending-state, expiry, R2 HEAD existence, exact size, and matching Content-Type checks, including for files over 100 MiB. It does not download the object to inspect its container, codec, duration, resolution, or decodability. Multipart still transfers the bytes through the server, but skips media-content inspection for this purpose. This policy does not label metadata as server-verified and does not change ordinary uploads or public generation API behavior.

Upload response metadata

Both this multipart response and the POST /api/v1/files/upload/confirm response include an optional video_metadata object in data when the upload used the influencer_reference_video purpose. It repeats the nine fields from the declaration table above with the same browser-declared values. It is omitted for ordinary uploads and for files recorded before this field existed. The echoed object is still the client-provided declaration, not server-verified media evidence. Confirmation still uses R2 HEAD without reading the media, and multipart skips media-content inspection for this purpose. Do not treat the echoed values as measured output properties or as a substitute for your own validation.

Form Fields (multipart/form-data)

Response Example

For purpose=influencer_reference_video, the stream and confirmation responses add the optional echo described above; it is absent for ordinary uploads:
Reference-video upload