> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-chore-sync-comfy-api-v2-spec.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Wan 3.0 Video Prime with Comfy Router

> Call wan/wan3.0-video-prime through Comfy Router: endpoint, request shape and the response Router returns.

API Reference for `wan/wan3.0-video-prime`, served by Comfy Router from Wan.

## Quick start

Create a key at [platform.comfy.org/profile/api-keys](https://platform.comfy.org/profile/api-keys) and export it as `COMFY_API_KEY`. The Python and TypeScript snippets use the Comfy SDKs (`pip install comfy-sdk`, `npm install @comfyorg/sdk`); the cURL snippet is the same call over raw HTTP.

**Model ID:** `wan/wan3.0-video-prime`

**Endpoint:** `POST https://api.comfy.org/v2/models/wan/wan3.0-video-prime`

<CodeGroup>
  ```python Python theme={null}
  from comfy_sdk import Comfy

  # Reads COMFY_API_KEY from the environment. Each call sends a fresh
  # Idempotency-Key and waits up to 10 minutes for the finished result.
  with Comfy() as client:
      result = client.models.run(
          "wan/wan3.0-video-prime",
          {
              # Request fields are the provider's own — see Input below.
          },
      )

  print(result)
  ```

  ```typescript TypeScript theme={null}
  import { comfy } from "@comfyorg/sdk";

  // Reads COMFY_API_KEY from the environment. Each call sends a fresh
  // Idempotency-Key and waits up to 10 minutes for the finished result.
  const { data } = await comfy.models.run("wan/wan3.0-video-prime", {
    // Request fields are the provider's own — see Input below.
  });

  console.log(data);
  ```

  ```bash cURL theme={null}
  # Request fields are the provider's own — see Input below.
  curl https://api.comfy.org/v2/models/wan/wan3.0-video-prime \
    -H "X-API-Key: $COMFY_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d "{}"
  ```
</CodeGroup>

## Schema

### Input

<ParamField body="input" type="object" required>
  Enter basic information, such as prompt words, etc.
</ParamField>

<ParamField body="input.audio_url" type="string">
  Audio file download URL. Supported formats: mp3 and wav. Cannot be used with reference\_video\_urls.
</ParamField>

<ParamField body="input.img_url" type="string">
  First frame image URL or Base64 encoded data. Required for I2V models. Image formats: JPEG, JPG, PNG, BMP, WEBP. Resolution: 360-2000 pixels. File size: max 10MB.
</ParamField>

<ParamField body="input.media" type="object[]">
  Media asset list for wan2.7 and wan3.0 models. Specifies reference materials (image, audio, video)
  for video generation. Each element contains a type and url field.
  Supported type values vary by model:

  * wan2.7-i2v: first\_frame, last\_frame, driving\_audio, first\_clip
  * wan2.7-r2v: reference\_image, reference\_video
  * wan2.7-videoedit: video, reference\_image
  * wan3.0-video: first\_frame (max 1), last\_frame (max 1), reference\_image (max 10),
    reference\_video (max 5 clips, total duration \<= 15s), reference\_audio (max 5 clips,
    total duration \<= 15s), file (max 1, cannot be used with link), link (max 1, cannot
    be used with file). The reference\_\*/file/link types and first\_frame/last\_frame types
    are mutually exclusive within the same request. The array order defines the reference
    order of assets in the prompt (Image 1, Video 1, Audio 1, ...).
</ParamField>

<ParamField body="input.media[].type" type="string" required>
  Media asset type

  Possible values: `first_frame`, `last_frame`, `driving_audio`, `first_clip`, `reference_image`, `reference_video`, `reference_audio`, `video`, `file`, `link`
</ParamField>

<ParamField body="input.media[].url" type="string" required>
  URL of the media file (public HTTP/HTTPS URL or OSS temporary URL)
</ParamField>

<ParamField body="input.negative_prompt" type="string">
  Reverse prompt words are used to describe content that you do not want to see in the video screen
</ParamField>

<ParamField body="input.prompt" type="string">
  Text prompt words. Support Chinese and English, length not exceeding 800 characters
  (up to 20,000 characters for wan3.0-video; content exceeding the limit is truncated).
  For wan2.6-r2v with multiple reference videos, use 'character1', 'character2', etc. to refer to subjects
  in the order of reference videos. Example: "Character1 sings on the roadside, Character2 dances beside it"
  For wan3.0-video reference mode, use 'Image 1', 'Video 1', 'Audio 1', etc. to refer to media assets
  in the corresponding order within the media array.
</ParamField>

<ParamField body="input.reference_video_urls" type="string[]">
  Reference video URLs for wan2.6-r2v model only. Array of 1-3 video URLs.
  Input restrictions:

  * Format: mp4, mov
  * Quantity: 1-3 videos
  * Single video length: 2-30 seconds
  * Single file size: max 30MB
  * Cannot be used with audio\_url
    Reference duration: Single video max 5s, two videos max 2.5s each, three videos proportionally less.
    Billing: Based on actual reference duration used.
</ParamField>

<ParamField body="input.template" type="string">
  Video effect template name. Optional. Currently supported: squish, flying, carousel. When used, prompt parameter is ignored.
</ParamField>

<ParamField body="model" type="string">
  The ID of the model to call. NOT constrained on this component: Comfy Router fills it from the `{model}` path segment of `POST /v2/models/wan/{model}`, so a Router caller omits it. A direct v1 call to `POST /proxy/wan/api/v1/services/aigc/video-generation/video-synthesis` MUST supply it, and the enum of accepted spellings lives on that operation's own component, `WanVideoGenerationRequest`.
</ParamField>

<ParamField body="parameters" type="object">
  Video processing parameters
</ParamField>

<ParamField body="parameters.audio" type="boolean" default="true">
  Whether to add audio to the video
</ParamField>

<ParamField body="parameters.audio_setting" type="string" default="&#x22;auto&#x22;">
  Video audio setting for wan2.7-videoedit model.

  * auto (default): Model intelligently judges based on prompt content
  * origin: Forcefully preserve the original audio from the input video

    Possible values: `auto`, `origin`
</ParamField>

<ParamField body="parameters.duration" type="integer" default="5">
  The duration of the video generated, in seconds:

  * wan2.5 models: 5 or 10 seconds
  * wan2.6-t2v, wan2.6-i2v: 5, 10, or 15 seconds
  * wan2.6-r2v: 5 or 10 seconds only (no 15s support)
  * wan2.7-i2v, wan2.7-t2v: integer in \[2, 15]
  * wan2.7-r2v, wan2.7-videoedit: integer in \[2, 10]
  * wan3.0-video: integer in \[2, 30] without video input; with video input the total
    input video duration + output video duration must not exceed 30 seconds; -1 enables
    smart duration mode where the model picks a suitable duration

    Range: `-1` to `30`
</ParamField>

<ParamField body="parameters.prompt_extend" type="boolean" default="true">
  Is it enabled prompt intelligent rewriting. Default is true
</ParamField>

<ParamField body="parameters.ratio" type="string">
  Aspect ratio of the generated video. For wan2.7 and wan3.0 models only.
  For wan2.7 models, defaults based on the resolution tier if not provided.
  For wan3.0-video, adaptive (the default) automatically recommends a suitable
  aspect ratio based on the input media proportions and intent.

  Possible values: `adaptive`, `16:9`, `9:16`, `1:1`, `4:3`, `3:4`
</ParamField>

<ParamField body="parameters.resolution" type="string">
  Resolution level. Supported values vary by model:

  * wan2.5-i2v-preview: 480P, 720P, 1080P
  * wan2.6-i2v: 720P, 1080P only (no 480P support)
  * wan2.7 models (i2v, t2v, r2v, videoedit): 720P, 1080P (default 1080P)
  * wan3.0-video, wan3.0-video-prime: 480P, 720P, 1080P (upstream default 1080P)
    This proxy rejects video generation requests that provide neither resolution
    nor size, because the resolution tier selects the billing rate.

    Possible values: `480P`, `720P`, `1080P`
</ParamField>

<ParamField body="parameters.seed" type="integer">
  Random number seed, used to control the randomness of the model generated content

  Range: `0` to `2147483647`
</ParamField>

<ParamField body="parameters.shot_type" type="string" default="&#x22;single&#x22;">
  Intelligent multi-lens control. Only active when prompt\_extend is enabled.
  For wan2.6 and wan2.7-r2v models.

  * single: Single-shot video (default)
  * multi: Multi-shot video

    Possible values: `multi`, `single`
</ParamField>

<ParamField body="parameters.size" type="string">
  Video resolution in format width*height. Supported resolutions vary by model:
  For wan2.5 T2V: 480P (480*832, 832*480, 624*624), 720P, 1080P sizes
  For wan2.6 T2V/R2V (no 480P):
  720P: 1280*720, 720*1280, 960*960, 1088*832, 832*1088
  1080P: 1920*1080, 1080*1920, 1440*1440, 1632*1248, 1248*1632
</ParamField>

<ParamField body="parameters.watermark" type="boolean" default="false">
  Whether to add a watermark logo, the watermark is located in the lower right corner
</ParamField>

Generated from the schema Router serves at `GET /v2/models/wan/wan3.0-video-prime/openapi.json`, the same document it validates a call against before the request reaches the provider.

### Output

<ResponseField name="output" type="object" required />

<ResponseField name="output.actual_prompt" type="string">
  Actual prompt after intelligent rewriting (for video tasks)
</ResponseField>

<ResponseField name="output.check_audio" type="string">
  Audio URL for I2V tasks with audio generation
</ResponseField>

<ResponseField name="output.code" type="string">
  The error code for the failed request (not returned if request is successful)
</ResponseField>

<ResponseField name="output.end_time" type="string">
  Task completion time
</ResponseField>

<ResponseField name="output.message" type="string">
  Detailed information about the failed request (not returned if request is successful)
</ResponseField>

<ResponseField name="output.orig_prompt" type="string">
  Original input prompt (for video tasks)
</ResponseField>

<ResponseField name="output.results" type="object[]">
  List of task results for image generation tasks
</ResponseField>

<ResponseField name="output.results[].actual_prompt" type="string">
  Actual prompt after intelligent rewriting (if enabled)
</ResponseField>

<ResponseField name="output.results[].code" type="string">
  Image error code (returned when some tasks fail)
</ResponseField>

<ResponseField name="output.results[].message" type="string">
  Image error information (returned when some tasks fail)
</ResponseField>

<ResponseField name="output.results[].orig_prompt" type="string">
  Original input prompt
</ResponseField>

<ResponseField name="output.results[].url" type="string">
  Generated image URL address
</ResponseField>

<ResponseField name="output.scheduled_time" type="string">
  Task execution time
</ResponseField>

<ResponseField name="output.submit_time" type="string">
  Task submission time
</ResponseField>

<ResponseField name="output.task_id" type="string" required>
  Task ID
</ResponseField>

<ResponseField name="output.task_metrics" type="object">
  Task result statistics for image generation tasks
</ResponseField>

<ResponseField name="output.task_metrics.FAILED" type="integer">
  Number of failed tasks
</ResponseField>

<ResponseField name="output.task_metrics.SUCCEEDED" type="integer">
  Number of successful tasks
</ResponseField>

<ResponseField name="output.task_metrics.TOTAL" type="integer">
  Total number of tasks
</ResponseField>

<ResponseField name="output.task_status" type="string" required>
  Task status

  Possible values: `PENDING`, `RUNNING`, `SUCCEEDED`, `FAILED`, `CANCELED`, `UNKNOWN`
</ResponseField>

<ResponseField name="output.video_url" type="string">
  Video URL for completed video generation tasks. Link validity period 24 hours
</ResponseField>

<ResponseField name="request_id" type="string" required>
  Unique request identifier
</ResponseField>

<ResponseField name="usage" type="object">
  Output information statistics. Only successful results are counted
</ResponseField>

<ResponseField name="usage.SR" type="integer">
  Video resolution level (I2V and wan3.0-video tasks)
</ResponseField>

<ResponseField name="usage.duration" type="number">
  Duration of generated video in seconds (I2V and wan3.0-video tasks)
</ResponseField>

<ResponseField name="usage.fps" type="integer">
  Frame rate of the generated video (wan3.0-video tasks)
</ResponseField>

<ResponseField name="usage.image_count" type="integer">
  Number of generated images (T2I tasks)
</ResponseField>

<ResponseField name="usage.input_video_duration" type="number">
  Duration of the input video in seconds, 0.0 when no video input (wan3.0-video tasks)
</ResponseField>

<ResponseField name="usage.output_video_duration" type="number">
  Duration of the output video in seconds (wan3.0-video tasks)
</ResponseField>

<ResponseField name="usage.ratio" type="string">
  Aspect ratio of the generated video, e.g. 16:9 (wan3.0-video tasks)
</ResponseField>

<ResponseField name="usage.size" type="string">
  Image resolution (T2I tasks)
</ResponseField>

<ResponseField name="usage.video_count" type="integer">
  Number of generated videos (T2V tasks)
</ResponseField>

<ResponseField name="usage.video_duration" type="number">
  Duration of generated video in seconds (T2V tasks)
</ResponseField>

<ResponseField name="usage.video_ratio" type="string">
  Video resolution ratio (T2V tasks)
</ResponseField>

<ResponseField name="code" type="string">
  Error code for a failed request, reported at the ROOT of the envelope rather than under `output` (not returned if the request succeeded).
</ResponseField>

<ResponseField name="message" type="string">
  Detailed information about a failed request, reported at the ROOT of the envelope rather than under `output` (not returned if the request succeeded). Read this before falling back to `output.message`.
</ResponseField>

## Examples

### Output

```json theme={null}
{
  "output": {
    "actual_prompt": "a single red maple leaf falling onto still water, slow motion, shallow depth of field",
    "end_time": "2027-01-01T00:01:04.000Z",
    "orig_prompt": "a single red maple leaf falling onto still water",
    "scheduled_time": "2027-01-01T00:00:01.000Z",
    "submit_time": "2027-01-01T00:00:00.000Z",
    "task_id": "0385dc79-5ff8-4d82-bcb6-7c1a9f2e4d60",
    "task_status": "SUCCEEDED",
    "video_url": "https://example.invalid/wan/wan3.0-video/generated.mp4"
  },
  "request_id": "7574ee8f-38a3-4b1e-9280-11c33ab46e51",
  "usage": {
    "SR": 720,
    "duration": 5
  }
}
```

## Before you ship

The snippets above are the shortest working call. Three things are the same for every model and are documented once on the [Comfy Router headers](/development/comfy-router/headers) page: send an `Idempotency-Key` on every paid call and reuse it when you retry, expect the connection to be held up to Router's 10 minute deadline, and keep `X-Comfy-Request-Id` from every response. The SDKs do all three for you; the cURL tab does none of them. On failure, `X-Comfy-Error-Type` names the bucket, and a `422` means the body failed the model's schema and was never billed.

<CardGroup cols={3}>
  <Card title="Headers" icon="list" href="/development/comfy-router/headers">
    Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.
  </Card>

  <Card title="Quick Start" icon="rocket" href="/development/comfy-router/quickstart">
    Typed error handling in Python and TypeScript, reading the 422, walking the catalog.
  </Card>

  <Card title="Limitations" icon="triangle-exclamation" href="/development/comfy-router/limitations">
    What Router does not do today, and what to use instead.
  </Card>
</CardGroup>
