# Wan (Tongyi Wanxiang) & HappyHorse video API: duration, resolution, aspect ratio, and errors Source: https://ofox.io/docs/develop/models/wan Alibaba's video generation models, six in total, called through the OfoxAI video endpoint `POST /v1/videos`. Tasks run asynchronously: creating a task returns a task ID, which you then use to query the result. ## Choosing a model **Key point**:Choose Wan 3.0 when you need 30-second duration, 480p, or a 4:3 aspect ratio; for short videos of 2 to 3 seconds, only the Alibaba models support them. | Model | Resolutions (default) | Duration | Aspect ratios | Video reference | |---|---|---|---|---| | Wan 3.0 Prime | `480p` `720p` `1080p` (`1080p`) | 2–30 s | `16:9` `4:3` `1:1` `3:4` `9:16` `adaptive` | Supported | | Wan 3.0 | `480p` `720p` `1080p` (`1080p`) | 2–30 s | Same as above | Supported | | Wan 2.7 | `720p` `1080p` (`1080p`) | 2–15 s | `16:9` `9:16` `1:1` | Supported | | Wan 2.6 | `720p` `1080p` (`1080p`) | 2–15 s | `16:9` `9:16` `1:1` | Not supported | | HappyHorse 1.0 | `720p` `1080p` (`1080p`) | 3–15 s | `16:9` `9:16` `1:1` | Supported | | HappyHorse 1.1 | `720p` `1080p` (`1080p`) | 3–15 s | `16:9` `9:16` `1:1` | Not supported | All six support text-to-video and image-to-video, and can generate a synchronized audio track (`generate_audio` defaults to `true`). `adaptive` keeps the input image's aspect ratio. **Model IDs (copy them exactly)** - Wan 3.0 Prime: `alibaba/wan-3.0-prime` — 30 s, 480p to 1080p - Wan 3.0: `alibaba/wan-3.0` — 30 s, 480p to 1080p - Wan 2.7: `alibaba/wan-2.7` — 2 to 15 s - Wan 2.6: `alibaba/wan-2.6` — No video reference - HappyHorse 1.0: `alibaba/happyhorse-1.0` — 3 to 15 s - HappyHorse 1.1: `alibaba/happyhorse-1.1` — No video reference The table above matches the `video_attributes` returned by the [Models API](https://ofox.io/docs/api/openai/models); if model capabilities change, the API response takes precedence. Billing is per second, and the actual charge is `usage.video_cost` in the task result. For prices, see the [model page](https://ofox.io/models/alibaba/wan-3.0). **Pass `resolution` explicitly.** If omitted, all six default to `1080p`, and cost is calculated by resolution tier. For previews or vertical social media videos, `720p` or `480p` is recommended. ## Examples The examples below show only the request that creates the task. For the full flow of querying status and downloading the result after creation, see [Video API · Quickstart](https://ofox.io/docs/api/videos#quickstart). **Text to video** Send only `prompt`. ```bash filename="Terminal" curl -X POST https://api.ofox.io/v1/videos \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "alibaba/wan-3.0", "prompt": "A water town in southern China at dawn, a small boat gliding slowly under a stone bridge", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9" }' ``` **Image to video** Pass one `first_frame` in `frame_images`; the video uses that image as its first frame. ```bash filename="Terminal" curl -X POST https://api.ofox.io/v1/videos \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "alibaba/wan-3.0", "prompt": "The person in the frame turns and walks into the distance", "duration": 5, "resolution": "720p", "frame_images": [ { "type": "image_url", "image_url": { "url": "https://example.com/first.jpg" }, "frame_type": "first_frame" } ] }' ``` **Video reference** Pass one video in `input_references` as a reference. Wan 2.6 and HappyHorse 1.1 do not support video reference. When video is used as input, billed seconds may include the input video's duration. ```bash filename="Terminal" curl -X POST https://api.ofox.io/v1/videos \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "alibaba/wan-2.7", "prompt": "Keep the camera movement and restyle the footage as ink-wash animation", "duration": 5, "resolution": "720p", "input_references": [ { "type": "video_url", "video_url": { "url": "https://example.com/source.mp4" } } ] }' ``` - `frame_images` and `input_references` cannot be sent together; sending both returns `400 references_conflict`. - Pass `"generate_audio": false` when you do not need an audio track. - For the full field structure, see [Create video task](https://ofox.io/docs/api/videos/create). ## Differences from other families **Key point**:Tasks cannot be cancelled after submission; video URLs are temporary, so download them promptly. - **Cannot be cancelled**: once a task has been submitted upstream, `DELETE /v1/videos/{id}` returns `400 cancel_not_supported`, and the task continues generating and is billed. Confirm your parameters before submitting. - **Video URLs**: in our tests, completed tasks return only `unsigned_urls` (temporary Alibaba Cloud OSS addresses), with no `mirror_urls`. Temporary addresses may expire after 24 hours, so download and save them promptly. - **Shorter durations**: Wan goes down to 2 seconds and HappyHorse to 3 seconds; the minimum for other families is 4 seconds. ## Remove watermark Parameters specific to Alibaba models are passed through `provider.options.dashscope`: ```json { "model": "alibaba/wan-3.0", "prompt": "...", "duration": 5, "resolution": "720p", "provider": { "options": { "dashscope": { "watermark": false } } } } ``` `provider.options` is passed only to the matching provider; other providers do not receive it. For full details, see [Video provider routing](https://ofox.io/docs/api/videos/provider-routing). ## Common errors **Key point**:Parameter validation errors are returned at creation time; no task is created and nothing is charged. The error message lists the allowed values. | HTTP · code | Error message | Cause | Fix | |---|---|---|---| | 400 `unsupported_parameter` | `duration 31 out of range [2, 30]` | Duration outside the model's range | 2–30 s for Wan 3.0, 2–15 s for Wan 2.x, 3–15 s for HappyHorse | | 400 `unsupported_parameter` | `aspect_ratio "4:3" not supported; allowed: [16:9 9:16 1:1]` | Wan 2.x and HappyHorse do not support 4:3 or 3:4 | Switch to Wan 3.0, or use a supported ratio | | 400 `unsupported_parameter` | `mixref2video requests are not supported by this model` | Wan 2.6 and HappyHorse 1.1 do not support video reference | Remove the `video_url` reference, or switch to Wan 2.7, Wan 3.0, or HappyHorse 1.0 | | 400 `cancel_not_supported` | `provider does not support task cancellation` | Alibaba tasks cannot be cancelled after submission | The task will run to completion | | 400 `references_conflict` | `frame_images and input_references are mutually exclusive` | Both input fields were sent | Use only one of them | | 404 `model_not_found` | `model not found` | Model ID misspelled | Copy the model ID from this page | For the full list of error codes, see [Video API error codes](https://ofox.io/docs/api/videos/errors). ## Official docs - [Alibaba Cloud Model Studio · Model service documentation](https://help.aliyun.com/zh/model-studio/) - [OfoxAI · Create video task](https://ofox.io/docs/api/videos/create) ## FAQ **What is the maximum length Wan can generate?** Wan 3.0 and Wan 3.0 Prime generate 2 to 30 seconds per task; Wan 2.6 and Wan 2.7 generate 2 to 15 seconds; HappyHorse 1.0 and 1.1 generate 3 to 15 seconds. Values outside the range return 400 duration out of range. **How do I remove the watermark from Wan videos?** Add provider.options.dashscope.watermark: false to the request. provider.options is passed only to the Alibaba Cloud Model Studio (dashscope) provider. **Can Wan video tasks be cancelled?** No. Tasks for Alibaba models cannot be interrupted once submitted upstream; DELETE returns 400 cancel_not_supported, and the task continues generating and is billed. Confirm your parameters before submitting. **Wan 2.6 returns mixref2video requests are not supported by this model?** Wan 2.6 and HappyHorse 1.1 do not support using a video as reference. Remove the video_url from input_references, or switch to Wan 2.7, Wan 3.0, or HappyHorse 1.0. **Does Wan support 4:3 or 3:4?** Only Wan 3.0 and Wan 3.0 Prime support 4:3, 3:4, and adaptive. Wan 2.x and HappyHorse support only 16:9, 9:16, and 1:1. **How long is the Wan video URL valid?** Completed tasks return unsigned_urls, which are temporary Alibaba Cloud OSS addresses that may expire after 24 hours, so download and save them promptly.