# Wan 3.0 — API Reference Model ID: `model_alibaba-wan-3-0` --- ## Authentication - **API_KEY** and **API_SECRET** are found in your [Scenario Project Settings](https://app.scenario.com/team&tab=api_keys) under API Keys. - Set them as environment variables `SCENARIO_SDK_API_KEY` and `SCENARIO_SDK_API_SECRET` — both SDKs pick them up by default. - For raw HTTP (cURL), use Basic Auth: `Authorization: Basic base64(":")`. ### Install the SDK - JavaScript / TypeScript: `npm install @scenario-labs/sdk` - Python: `pip install scenario-sdk` --- ## Generate **Endpoint:** `POST https://api.cloud.scenario.com/v1/generate/custom/model_alibaba-wan-3-0` ### Parameters | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `prompt` | string | yes | - | Describe the video you want. When you add reference files, refer to them in your text as "Image 1," "Video 1," "Audio 1" — numbered separately per type, in the order you added each list. | | `image` | assetId | - | - | An optional opening frame for the video. Required if you set a last frame. Can't be combined with reference images, videos, or audio. | | `endImage` | assetId | - | - | An optional closing frame. Only works when a first frame is also set. Can't be combined with reference inputs. | | `referenceImages` | assetId[] | - | - | Images to guide the subjects or style (up to 10, 20MB each). Can't be combined with a first or last frame. | | `referenceVideos` | assetId[] | - | - | Videos to guide the motion (up to 5, 100MB each, 15s combined). Can't be combined with a first or last frame. | | `referenceAudios` | assetId[] | - | - | Audio to guide the video (up to 5, 15MB each, 15s combined). Can't be combined with a first or last frame. | | `document` | assetId | - | - | An optional document to generate a video from (up to 100MB or 50 pages). Turns on thinking mode automatically for richer results. | | `link` | string | - | - | A public https:// web page URL to generate from. Must be reachable without authentication. Turns on thinking mode automatically. | | `resolution` | string | - | `720P` | The output quality. 1080P is sharpest but costs more; 480P is cheapest. | | `aspectRatio` | string | - | `adaptive` | The shape of the video. Adaptive follows your input media if you provide any, otherwise defaults to widescreen (16:9). | | `duration` | number | - | `5` | How long the clip lasts, in seconds (2-30), or Smart to let Wan choose. Longer clips cost more. | | `audio` | boolean | - | `true` | Adds a soundtrack to the video. On by default; costs the same either way. | | `enableThinking` | boolean | - | `false` | Let Wan reason about the request before generating. Required for document or link input (turned on automatically when either is provided). | ### Example Requests **cURL** ```bash curl -X POST "https://api.cloud.scenario.com/v1/generate/custom/model_alibaba-wan-3-0" \ -H "Authorization: Basic $(echo -n ':' | base64)" \ -H "Content-Type: application/json" \ --data-binary @- <<'EOF' { "prompt": "A fantasy landscape", "resolution": "720P", "aspectRatio": "adaptive", "duration": 5, "audio": true, "enableThinking": false } EOF ``` **Python** ```python import os from scenario_sdk import Scenario client = Scenario( api_key=os.environ.get("SCENARIO_SDK_API_KEY"), api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"), ) body = { "prompt": "A fantasy landscape", "resolution": "720P", "aspectRatio": "adaptive", "duration": 5, "audio": True, "enableThinking": False } response = client.generate.run_model( model_id="model_alibaba-wan-3-0", body=body, ) print(response) ``` **JavaScript** ```javascript import Scenario from "@scenario-labs/sdk"; const client = new Scenario({ apiKey: process.env["SCENARIO_SDK_API_KEY"], apiSecret: process.env["SCENARIO_SDK_API_SECRET"], }); const body = { "prompt": "A fantasy landscape", "resolution": "720P", "aspectRatio": "adaptive", "duration": 5, "audio": true, "enableThinking": false }; const response = await client.generate.runModel("model_alibaba-wan-3-0", { body }); console.info(response); ``` --- ## Retrieve Results After submitting a generation request, you receive a `jobId`. Poll the job until `job.status` is `"success"`. The generated asset IDs are in `job.metadata.assetIds`. **Endpoint:** `GET https://api.cloud.scenario.com/v1/jobs/{jobId}` ### Example Requests **cURL** ```bash curl -X GET "https://api.cloud.scenario.com/v1/jobs/" \ -H "Authorization: Basic $(echo -n ':' | base64)" ``` **Python** ```python job = client.jobs.retrieve(job_id="") print(job.status) print(job.metadata.asset_ids) ``` **JavaScript** ```javascript // Option 1 — wait on the response from runModel using the SDK helper const completed = await response.job.wait(); console.info(completed.status); console.info(completed.metadata?.assetIds); // Option 2 — retrieve a job by its ID const job = await client.jobs.retrieve(""); console.info(job.status); console.info(job.metadata?.assetIds); ``` **Example response:** ```json { "job": { "jobId": "job_abc123", "status": "success", "metadata": { "assetIds": [ "asset_abc123" ] } } } ``` > **Important:** Generated asset URLs are **temporary** and expire after a short period. Download and store any images you wish to keep before the URL expires. More info: [Content Delivery Network (CDN)](https://docs.scenario.com/get-started/documentation/content-delivery-network-cdn). --- *Generated by [Scenario](https://app.scenario.com)*