The envelope and the media each have limits
The API limits the multipart request to under 22 MB including form data, while individual supported photos are limited to 8 MB and reference MP4 files to 20 MB. Passing the overall envelope check does not make an unsupported file valid. H3 scope and private-storage readiness are additional requirements.
What to do next
- 01
Check request construction
Use the client's form-data API and attach the actual file bytes. Do not manually set application/json or omit the boundary while sending a multipart body.
- 02
Check field meaning
Use kind=photo for the replacement image and kind=reference for the short MP4. Verify format, size and the reference's measured 4–10-second runtime before uploading.
- 03
Use only confirmed responses
Accept the owned ID only from a successful upload response. Retain safe error details and correct the underlying issue rather than passing a placeholder identifier to /videos.
A concrete example
Illustrative cURL setup: use form fields for file=@portrait.jpg and kind=photo while sending the bearer header. Do not add a bare Content-Type: multipart/form-data header that prevents the client from constructing its normal boundary.
Before you call it ready
- The form includes both required fields.
- The file is valid within its own limit.
- Only a confirmed upload ID reaches generation.
When to stop or choose another method
If the upload remains rejected, diagnose the exact envelope or file error. Creating paid jobs with a guessed reference ID cannot repair an unsuccessful transfer.
