Wan 3.0 API in Node: vertical image-to-video from a first frame

Call Wan 3.0 on Sume from Node with fetch: pin a first frame, ask for 9:16 at 720p, poll the job and save the MP4. Includes limits and the 8-second price.

5 min readSume
All posts

To use Wan 3.0 by API on Sume, POST to https://api.sume.com/v1/videos with model: "wan-3.0", put your still in frame_images as a first_frame, then poll the returned polling_url until the status is completed and download unsigned_urls[0]. The script below does exactly that with Node's built-in fetch.

An 8-second 9:16 clip at 720p costs $1.00 on Sume (provider list $0.10 per second times 1.25).

The script

Save it as wan.mjs and run SUME_API_KEY=... node wan.mjs on Node 18 or later. It uses the OpenRouter-shaped wire that /v1/videos follows, so submit and poll answer with bare objects, not a data envelope.

const H = { Authorization: `Bearer ${process.env.SUME_API_KEY}`, "Content-Type": "application/json" };
const body = {
  model: "wan-3.0",
  prompt: "Slow dolly in, steam rises from the cup, soft morning light",
  duration: 8,
  resolution: "720p",
  aspect_ratio: "9:16",
  frame_images: [{ type: "image_url", image_url: { url: "https://example.com/cup.png" }, frame_type: "first_frame" }],
};
async function main() {
  const sub = await fetch("https://api.sume.com/v1/videos", { method: "POST", headers: H, body: JSON.stringify(body) });
  if (sub.status !== 202) throw new Error(`${sub.status} ${await sub.text()}`);
  const job = await sub.json();
  for (;;) {
    const s = await (await fetch(job.polling_url, { headers: H })).json();
    if (s.status === "completed") {
      const res = await fetch(s.unsigned_urls[0], { headers: H });
      await (await import("node:fs/promises")).writeFile("wan.mp4", Buffer.from(await res.arrayBuffer()));
      return console.log("saved wan.mp4, cost", s.usage?.cost);
    }
    if (s.status === "failed" || s.status === "cancelled") throw new Error(s.error ?? s.status);
    await new Promise((r) => setTimeout(r, 10000));
  }
}
main();

What Wan 3.0 accepts on Sume

The catalog row gives Wan 3.0 a 2 to 30 second range, 480p, 720p and 1080p, and text, image, first and last frame, and reference inputs. Alibaba Cloud's Model Studio page lists the same three resolutions and a 30-second maximum for the hosted model, and describes text, image, video and audio inputs (read 2026-10-07).

Wan 3.0 request limits on Sume (read 2026-10-07)
FieldLimit
duration2 to 30 whole seconds
resolution480p, 720p, 1080p (default 1080p when omitted)
aspect_ratioRead supported_aspect_ratios from GET /v1/videos/models
input_referencesUp to 10 images, 5 videos (15 seconds in total, 16 fps or more), 5 audio clips (15 seconds in total)
seed, size, provider.optionsRejected with 400 unsupported_parameter

Things that trip first runs

The default resolution is 1080p, which is the most expensive tier, so set resolution on purpose. Document and web-page inputs (file_url, web_url) and enable_thinking are not exposed in v1, even though the vendor model supports documents.

If both frame_images and input_references are present, frame_images wins and the job runs as image-to-video. A URL that Sume cannot download fails the job with a message that names the media type, not the URL. Add an Idempotency-Key header if your code retries a submit, so a replay returns the original job instead of a second charge.

  • Submit answers 202 with id, polling_url, status and model.
  • Statuses are pending, in_progress, completed, failed, cancelled.
  • Prefer callback_url over polling for long jobs; it must be HTTPS.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume