Short answer
[InvalidParameter] Failed to download https://… means the model service could not fetch the media you passed in. It is not an APIYI gateway failure, and it is not caused by your key, your parameters, or a corrupt file. The usual cause is that your origin is too far from mainland China or the path is unstable, so the fetch does not finish within the download deadline. Wan3.0 and HappyHorse return the same error; their fetch deadlines differ.
First, the media is not downloaded by us
The API forwardsinput.media to the model service as-is. When the media is a public URL, the model service fetches it directly from your origin. So:
- Our gateway logs will not contain a download record for that file; finding nothing on our side is expected;
- The fetch requests you see in your origin’s nginx come from the model service’s fetcher, not from APIYI servers;
- After you switch to base64 (below), the provider no longer fetches your origin, and those requests disappear from your nginx log.
Which of the three causes applies
If the same file (identical SHA-256) has both succeeded and failed, you can assume the first cause. Wan3.0’s fetch deadline is about 180 seconds; HappyHorse’s is shorter, so it may fail within 20–100 seconds.
Measured reference
We compared the same 1.5 MB reference video at the same time:
The model-side download deadline is on the order of 3 minutes (180 s), so 1.5 MB sits right on the line: slightly better throughput passes, slightly worse fails. That is exactly why the same file is intermittent. Larger files fail far more reliably. The same math applies to images: at this throughput, a 1 MB image needs about 90–170 seconds; a few tens of KB completes, while a ~1 MB image often cuts off near the end.
How to fix it
1. If you cannot move the media: send images as base64 data URIs
Image media (first_frame / last_frame / reference_image) can carry the image bytes directly in url instead of a public URL:
wan3.0-video with first_frame, and the task completed; HappyHorse’s first_frame / reference_image accept the same form.
Notes:
- The MIME type after
data:must match the file (image/jpegorimage/png), and the base64 string must not contain line breaks; - Base64 adds about one third to the payload. Submission time grows with image size (about 3 s for 20 KB, 26 s for 180 KB, and 110 s for 0.7–1.1 MB in our tests), so set the client-side submission timeout to at least 300 seconds;
- Do not blindly retry after a submission timeout: the task may already have been created on the provider side, and a retry would create a second task and a second charge. Contact us with the failure time to check, or compress the image and try again;
- Compressing images to a few hundred KB shortens submission significantly; a 720P first frame does not need 1 MB;
- Video, audio, and document media are too large for this; keep using a public URL for them.
2. Host source media close to mainland China
In order of preference:- CDN or object storage in Hong Kong, Singapore, or Japan (best cross-border fetch quality, and no ICP filing needed)
- An international CDN with Asian POPs (Cloudflare, Bunny, CloudFront all work — pick Hong Kong, Singapore, or Tokyo)
- Direct origin delivery from Europe or the Americas — worst option, and exactly the scenario that fails today
.ru or .com usually have none, so mainland nodes are not available; Hong Kong, Singapore, and Japan are the practical choice.
3. Reduce the media size
A 10-second 720P reference video is usually only 1–2 MB. If yours is tens of megabytes, lower the bitrate or resolution. Based on the measurements above, anything above 3 MB rarely finishes in time. The same applies to images: a few hundred KB speeds up both the provider’s fetch and a base64 submission.4. Check the link itself
- Publicly reachable without a session, cookies, or a Referer allowlist;
- Returns 200 with a complete
Content-Lengthand supportsRange; - Avoid short-lived signed URLs, or make sure they outlive the task.
5. Retrying does not help
Retrying only buys another download deadline. Throughput has not changed, so the success rate matches the first attempt.When to contact support
If your media already sits on a Hong Kong, Singapore, or Japan node and is under 3 MB, or if an image still fails after switching to base64, send us:- The task ID (
task_id) - The full media URL, or the media type / size you used
- When the failure happened (with time zone)
- The HTTP status code and exact error text from submission (for base64)