Video jobs are asynchronous
Waiting inside a web request loses tasks when a page reloads or a server restarts. Save the task_id and check back.
HappyWan API
The HappyWan API will be available here on Alibaba’s launch day, expected mid-December 2026. It uses the same endpoint and API key as Wan 3, so you can build and test your client today and switch to HappyWan by changing one value.
Key points
Why now
On launch day the slow part isn’t the prompt. It’s the client code around it.
Waiting inside a web request loses tasks when a page reloads or a server restarts. Save the task_id and check back.
Checking every few milliseconds doesn’t make the video any faster. It only uses up your rate limit.
Unchecked prompts, durations and double clicks create tasks you didn’t mean to pay for.
Quickstart
Sign up and add credit. There’s no subscription: you pay per second of video you generate.
Sign upCreate a key in the console and keep it as API_KEY. One key works for HappyWan and every other model.
Use the examples below. Video generation is asynchronous: you get a task ID back, then fetch the finished video.
Code examples
These examples run today with Wan 3. The model name lives in VIDEO_MODEL: when HappyWan launches, change that one value.
# Set API_KEY first. Keep the model in VIDEO_MODEL: at launch, change it to HappyWan. export VIDEO_MODEL="${VIDEO_MODEL:-alibaba/wan-3.0-t2v}" # 1. Create a task and save the task_id it returns curl https://api.siray.ai/v1/video/generations \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "'"$VIDEO_MODEL"'", "prompt": "A red paper boat drifts down a rainy street at dusk", "duration": 5, "size": "720p", "aspect_ratio": "16:9" }' # 2. Every 5 seconds, check the task until status is SUCCESS or FAILURE curl https://api.siray.ai/v1/video/generations/$TASK_ID \ -H "Authorization: Bearer $API_KEY"
import os, random, time, requests API = "https://api.siray.ai/v1/video/generations" HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"} MODEL = os.getenv("VIDEO_MODEL", "alibaba/wan-3.0-t2v") # change to HappyWan at launch def call(method, url, retry_server_errors=True, **kw): # Back off on 429, and on 5xx for safe requests; raise on everything else for attempt in range(4): r = requests.request(method, url, headers=HEADERS, timeout=30, **kw) if r.status_code == 429 or (retry_server_errors and r.status_code >= 500): time.sleep(min(30, 2 ** attempt) + random.random()) continue r.raise_for_status() return r.json() raise RuntimeError("Gave up after 4 attempts") task_id = call("POST", API, retry_server_errors=False, json={ "model": MODEL, "prompt": "A red paper boat drifts down a rainy street at dusk", "duration": 5, "size": "720p", "aspect_ratio": "16:9", })["data"]["task_id"] # save task_id before polling deadline = time.time() + 300 while time.time() < deadline: job = call("GET", f"{API}/{task_id}")["data"] if job["status"] == "SUCCESS": print(job["outputs"][0]) # download and store it right away break if job["status"] == "FAILURE": raise RuntimeError(f"{job.get('fail_code')}: {job.get('fail_reason')}") time.sleep(5)
const API = "https://api.siray.ai/v1/video/generations"; const MODEL = process.env.VIDEO_MODEL ?? "alibaba/wan-3.0-t2v"; // change to HappyWan at launch const headers = { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json", }; const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); const res = await fetch(API, { method: "POST", headers, body: JSON.stringify({ model: MODEL, prompt: "A red paper boat drifts down a rainy street at dusk", duration: 5, size: "720p", aspect_ratio: "16:9", }), }); if (!res.ok) throw new Error(`Submit failed: ${res.status}`); const taskId = (await res.json()).data.task_id; // save it before polling const deadline = Date.now() + 5 * 60 * 1000; while (Date.now() < deadline) { await sleep(5000); const r = await fetch(`${API}/${taskId}`, { headers }); if (r.status === 429 || r.status >= 500) continue; // safe to retry const job = (await r.json()).data; if (job.status === "SUCCESS") { console.log(job.outputs[0]); break; } if (job.status === "FAILURE") throw new Error(`${job.fail_code}: ${job.fail_reason}`); }
Request types
Request bodies you can send today with Wan 3. HappyWan accepts the same kinds of input, with the final field names confirmed at launch.
{
"model": "alibaba/wan-3.0-t2v",
"prompt": "A red paper boat drifts down a rainy street at dusk, soft rain sounds",
"duration": 5,
"size": "720p",
"aspect_ratio": "16:9",
"audio_enable": true
}{
"model": "alibaba/wan-3.0-i2v",
"prompt": "The camera rises over the dunes toward the lighthouse",
"image": "https://example.com/first-frame.jpg",
"end_image": "https://example.com/last-frame.jpg",
"duration": 5,
"size": "720p",
"aspect_ratio": "adaptive"
}{
"model": "alibaba/wan-3.0-ref2v",
"prompt": "The character from image 1 walks through the market from image 2",
"images": [
"https://example.com/character.jpg",
"https://example.com/market.jpg"
],
"duration": 8,
"size": "720p",
"aspect_ratio": "16:9"
}Parameters
HappyWan values are from early API drafts and are confirmed at launch. Parameter names and Wan 3 values are from our API reference.
| Parameter | Description | HappyWan (expected) | Wan 3 today |
|---|---|---|---|
model | Model name | happywan in early drafts | alibaba/wan-3.0-t2v |
prompt | What should happen, including camera and sound | Text | Text |
duration | Length in seconds | 2–30, or automatic | 2–30 |
size | Resolution | 480p, 720p, 1080p | 480p, 720p, 1080p |
aspect_ratio | Frame shape | adaptive, 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 | adaptive, 16:9, 9:16, 1:1, 4:3, 3:4 |
audio_enable | Generate sound with the video | On by default | true / false |
| image, end_image | First and last frame | Up to 2 images | wan-3.0-i2v |
images | Reference images | More than earlier models | Up to 10 (wan-3.0-ref2v) |
videos | Reference videos | Don’t count toward the length limit | Up to 5 (wan-3.0-ref2v) |
audios | Reference audio clips | Supported | Up to 5 (wan-3.0-ref2v) |
| Document or web page | A link to turn into a video | Supported | — |
seed | Random seed, -1 for random | -1 to 2147483647 | -1 to 2147483647 |
Production
Errors
When a request is rejected or a task ends in FAILURE, the response includes a fail_code. The common ones:
| HTTP | fail_code | What to do |
|---|---|---|
| 400 | InvalidParameter | Fix the request. Don’t retry automatically. |
| 400 | MissingParameter | Add the missing field, such as prompt or model. |
| 400 | InputTextSensitiveContentDetected | Change the prompt or the input media. |
| 401 | AuthenticationError | Check your API key. Stop retrying. |
| 403 | InsufficientBalance | Add credit, then resubmit. |
| 404 | InvalidEndpointOrModel.NotFound | Check the model name. HappyWan’s ID only works after launch. |
| 429 | ServerOverloaded | Wait and retry with backoff. |
| 500 | InternalServiceError | Retry status checks. Resubmit only if no task_id came back. |
Cost
The number that matters isn’t the price per second. It’s what each clip you actually keep costs:
Cost per usable clip = price per second × seconds ÷ share of clips you keep
For example, Wan 3 at 720p is $0.0801/s. A 5-second clip costs $0.40. If you keep 4 out of 5 clips, each usable clip costs $0.50.
Build a test set of 10 real prompts on Wan 3 today. On launch day, run the same set on HappyWan and compare how many clips you keep and what each one costs. HappyWan pricing is published at launch.
SDKs and integrations
Every SDK and integration below will work with HappyWan on launch day.
Official client for Python.
Official client for Node.js and TypeScript.
Custom nodes for ComfyUI workflows.
Automate video generation in n8n.
Add the models to Dify apps.
Every model, parameter and error code.
FAQ
Yes. The HappyWan API will be available here on Alibaba’s launch day, expected mid-December 2026.
Alibaba hasn’t published it yet. This page will be updated with it at launch.
Yes. Keep the model name in a variable such as VIDEO_MODEL. At launch, change that one value. The endpoint, API key and polling stay the same.
Yes. Build with Wan 3 today using the same endpoint and API key. When HappyWan goes live, you only change the model value.
Per second of generated video, at the published price. Failed tasks aren’t charged. See HappyWan pricing.
The Python and Node.js SDKs, plus the ComfyUI, n8n and Dify integrations.
Every 3–5 seconds. HappyWan takes about 45 seconds per video, so most tasks finish within a dozen checks.
No. Tasks that end in FAILURE aren’t charged.
One API key for HappyWan on launch day and every other model today.