> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Wan 3.0 Video with Comfy Router

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

API Reference for `wan/wan3.0-video`, 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`

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

<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",
          {
              # 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", {
    // 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 \
    -H "X-API-Key: $COMFY_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{}'
  ```
</CodeGroup>

## Schema

### Input

<Note>
  Router has not published an authored input schema for this model yet: `GET /v2/models/wan/wan3.0-video/openapi.json` returns an open object with `x-comfy-input-schema-authored: false`. Router forwards the body to Wan unchanged, so Wan's own API documentation is authoritative for the request fields, and nothing is validated server side.
</Note>

### 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>
