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

# Wan 2.6

> Generate 720p or 1080p videos (5s, 10s, or 15s) from text or a first-frame image with audio included.

## Parameters and input modes

Send `model` and `input` for text-to-video or first-frame image-to-video, with an optional custom soundtrack add-on for either workflow. See the Body section below for defaults, enum values, and media limits.

nsfw\_check: true screens text/images; false or omitted skips it. Provider moderation still applies.

| Request type | Required input fields |
| - | - |
| Text to video | `prompt` |
| First-frame image to video | `first_frame_url` (`prompt` optional; omit `aspect_ratio`) |
| Custom audio (add-on) | Add `reference_audio_urls` to either workflow (overrides `generate_audio`) |

## Use cases

Submit an example to `POST /api/v1/tasks/create_task`. The first-frame example uses a hosted sample image; replace `cdn.example.com` placeholder audio URLs with your own public HTTPS link meeting the Body limits.

```json Text to video theme={null}
{
  "model": "wan-2.6",
  "input": {
    "prompt": "A paper boat drifting on a calm pond at sunrise, gentle ripples",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9"
  }
}
```

```json First-frame image to video theme={null}
{
  "model": "wan-2.6",
  "input": {
    "first_frame_url": "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-keyframes-input-0.jpg",
    "prompt": "Slow camera push-in as golden sunrise light ripples across the water.",
    "resolution": "1080p",
    "duration": 5
  }
}
```

```json Custom audio and multi-shot theme={null}
{
  "model": "wan-2.6",
  "input": {
    "prompt": "Opening shot glides along rain-slicked cobblestones before cutting to a warm cafe window.",
    "reference_audio_urls": [
      "https://cdn.example.com/narration-10s.mp3"
    ],
    "resolution": "720p",
    "duration": 10,
    "aspect_ratio": "16:9",
    "shot_type": "multi",
    "prompt_extend": true
  }
}
```

> Track results with `data.task_id` from the create-task response via [Query task](https://docs.apistable.ai/query-task.md) or `callback_url` ([Webhook security](https://docs.apistable.ai/webhook-secret.md)); see [Create task](https://docs.apistable.ai/create-task.md) for submission errors and [Quickstart](https://docs.apistable.ai/quickstart.md) for authentication. Archived video URLs remain valid for 14 days; tasks still unfinished after 24 hours are eligible for timeout cleanup at no charge.

## Playground and pricing

Each request generates 1 video and bills requested output seconds at the chosen resolution rate; native or custom audio adds no extra charge. Failed tasks charge 0 credits. Check balances via [Available Credits](https://docs.apistable.ai/credits.md).

| Resolution | Credits / s | USD / s |
| - | - | - |
| `720p` (default) | 13.0 | \$0.065 |
| `1080p` | 21.0 | \$0.105 |

> [card] [Try in Playground](https://apistable.ai/models/wan-2.6#try)
>
> Test text-to-video, first-frame animation, and audio options interactively.

> [card] [View pricing](https://apistable.ai/models/wan-2.6#pricing)
>
> Compare 720p and 1080p per-second rates and bonus pricing.


## OpenAPI

````yaml openapi-wan-2.6.json POST /api/v1/tasks/create_task
openapi: 3.1.0
info:
  title: APIstable API
  version: 1.0.0-preview
  description: >-
    Public /api/v1 protocol. Valid API keys have the same account-scoped access.
    Read the selected model documentation for its ID, supported inputs, result
    format and availability before submitting. No client submission idempotency
    or max_credits. Availability, pricing, file retention and callback formats
    follow the selected model contract. Unconfigured operations return 503.
servers:
  - url: https://apistable.ai
    description: API Stable API
security: []
paths:
  /api/v1/tasks/create_task:
    post:
      summary: Wan 2.6
      description: >-
        Generate 720p or 1080p videos (5s, 10s, or 15s) from text or a
        first-frame image with audio included.
      operationId: wan-2.6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - wan-2.6
                  example: wan-2.6
                  description: The APIstable model ID for this endpoint.
                input:
                  $schema: https://json-schema.org/draft/2020-12/schema
                  type: object
                  properties:
                    nsfw_check:
                      description: >-
                        Run APIstable input screening when true; omitted or
                        false skips it. Never forwarded to the generation
                        provider.
                      type: boolean
                    prompt:
                      description: >-
                        Scene instruction, 1–5,000 characters; required when no
                        first frame is provided.
                      type: string
                      minLength: 1
                      maxLength: 5000
                    negative_prompt:
                      description: Optional undesired content, up to 500 characters.
                      type: string
                      maxLength: 500
                    resolution:
                      default: 720p
                      description: >-
                        Output resolution: 720p (default, 13.0 credits/s) or
                        1080p (21.0 credits/s).
                      type: string
                      enum:
                        - 720p
                        - 1080p
                    duration:
                      default: 5
                      description: 'Output seconds: 5 (default), 10, or 15.'
                      anyOf:
                        - type: number
                          const: 5
                        - type: number
                          const: 10
                        - type: number
                          const: 15
                    prompt_extend:
                      default: true
                      description: Enable automatic prompt expansion (default true).
                      type: boolean
                    watermark:
                      default: false
                      description: Add an AI-generated watermark (default false).
                      type: boolean
                    seed:
                      description: >-
                        Optional non-negative integer seed (0–2147483647); omit
                        for random generation.
                      type: integer
                      minimum: 0
                      maximum: 2147483647
                    output_count:
                      default: 1
                      description: Fixed at 1 video per request.
                      type: number
                      const: 1
                    official_fallback:
                      default: false
                      description: Fallback is unavailable; fixed at false.
                      type: boolean
                      const: false
                    aspect_ratio:
                      description: >-
                        Optional output aspect ratio (16:9, 9:16, 1:1, 4:3,
                        3:4); defaults to 16:9. Omit when providing a first
                        frame, which sets output proportions.
                      type: string
                      enum:
                        - '16:9'
                        - '9:16'
                        - '1:1'
                        - '4:3'
                        - '3:4'
                    first_frame_url:
                      description: >-
                        Optional first frame (required when prompt is omitted).
                        Public HTTPS image URL (JPEG/PNG/BMP/WebP, no alpha for
                        any format, ≤10 MiB, 240–8000 px, ratio 1:8–8:1). Sets
                        output aspect ratio; omit aspect_ratio.
                      type: string
                      maxLength: 16384
                      format: uri
                    reference_audio_urls:
                      description: >-
                        Optional custom audio URL (max 1; public HTTPS WAV/MP3,
                        ≥1s and ≤ output duration, ≤15 MiB); overrides
                        generate_audio.
                      maxItems: 1
                      type: array
                      items:
                        type: string
                        maxLength: 16384
                        format: uri
                    generate_audio:
                      default: true
                      description: >-
                        Generate synchronized audio (default true) at no extra
                        cost; a supplied reference_audio_urls entry overrides
                        this.
                      type: boolean
                    shot_type:
                      description: >-
                        Single take (single, default) or multi-shot cuts
                        (multi); supplying this field requires
                        prompt_extend=true.
                      type: string
                      enum:
                        - single
                        - multi
                  additionalProperties: false
                  description: >-
                    wan-2.6: public HTTPS media without credentials, custom
                    ports, or # fragments; 1 video per request; fallback
                    unavailable. Billable seconds = requested output seconds.
                    Video continuation and effects templates are not supported.
                    When nsfw_check is true, APIstable screens text and images
                    before submission; omitted or false skips APIstable
                    screening. Video and audio are passed to the model provider,
                    which applies its own moderation.
                callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional public HTTPS endpoint for signed completion
                    callbacks; no redirects or private IPs.
            example:
              model: wan-2.6
              input:
                prompt: >-
                  A paper boat drifting on a calm pond at sunrise, gentle
                  ripples
                resolution: 720p
                duration: 5
                aspect_ratio: '16:9'
      responses:
        '200':
          description: >-
            Accepted task. Use `task_id` to [query the task](/query-task), or
            receive the result at `callback_url`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - data
                additionalProperties: false
                properties:
                  code:
                    const: 200
                  msg:
                    const: success
                  data:
                    type: object
                    required:
                      - task_id
                    additionalProperties: false
                    properties:
                      task_id:
                        type: string
        '400':
          description: >-
            40001 invalid JSON, 40002 invalid input/callback or input rejected
            by screening, 40003 unsupported parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: '40201: Insufficient credits (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: '40301: Website session requests require the APIstable site origin.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '40401: Unknown model or resource not found in this account.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '40901: Resource incompatible with this operation.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: '41001: Source audio or temporary resource has expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: '41301: Request too large.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: '42201: Requested capability combination is not enabled.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '42901: Rate/concurrency limit (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '50301: Service unavailable. No live submission or charge.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      callbacks:
        Webhook:
          '{$request.body#/callback_url}':
            post:
              requestBody:
                required: true
                description: >-
                  When the task succeeds or fails, APIstable sends a JSON POST
                  to the `callback_url` supplied at creation. Verify the
                  signature and return HTTP 2xx to acknowledge delivery.


                  Read `data.status` to determine the generation outcome.
                  Successful tasks report `succeeded` with generated video URLs
                  in `data.result.urls`. For a failed task, `data.result` is
                  `null` and `data.message` contains the failure reason.


                  Use `X-APIstable-Signature`, `X-APIstable-Timestamp`, and
                  `X-APIstable-Event-Id` to verify and deduplicate deliveries.
                  See [Webhook security](/webhook-secret).


                  **Webhook payload example**


                  ```json

                  {
                    "code": 200,
                    "msg": "success",
                    "data": {
                      "task_id": "c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb",
                      "model": "wan-2.6",
                      "status": "succeeded",
                      "created_at": "2026-11-24T08:30:00.000Z",
                      "completed_at": "2026-11-24T08:31:45.000Z",
                      "duration": 105000,
                      "charged_credits": 65,
                      "message": "",
                      "input": "{\"prompt\":\"A paper boat drifting on a calm pond at sunrise, gentle ripples\",\"resolution\":\"720p\",\"aspect_ratio\":\"16:9\",\"duration\":5}",
                      "result": {
                        "urls": [
                          "https://cdn.example.com/generated/wan-video.mp4"
                        ],
                        "items": [
                          {
                            "id": "e7aacd19-819a-4747-bbbf-46fb6f2995a5",
                            "urls": [
                              "https://cdn.example.com/generated/wan-video.mp4"
                            ],
                            "last_frame_url": null,
                            "draft": false,
                            "draft_expires_at": null
                          }
                        ]
                      }
                    }
                  }

                  ```
                content:
                  application/json:
                    schema:
                      type: object
                      required:
                        - code
                        - msg
                        - data
                      properties:
                        code:
                          type: integer
                          const: 200
                        msg:
                          type: string
                          const: success
                        data:
                          type: object
                          additionalProperties: false
                          required:
                            - task_id
                            - model
                            - status
                            - created_at
                            - completed_at
                            - duration
                            - charged_credits
                            - message
                            - input
                            - result
                          properties:
                            task_id:
                              type: string
                            model:
                              type: string
                              const: wan-2.6
                            status:
                              type: string
                              enum:
                                - succeeded
                                - failed
                            created_at:
                              type: string
                              format: date-time
                            completed_at:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            duration:
                              type:
                                - integer
                                - 'null'
                              minimum: 0
                              description: >-
                                Total elapsed milliseconds; null while
                                processing.
                            charged_credits:
                              type:
                                - number
                                - 'null'
                              minimum: 0
                              description: Final charged Credits; null until completion.
                            message:
                              type: string
                              description: >-
                                Failure reason for failed tasks, or an
                                actionable pending-settlement message while
                                processing; empty on success.
                            input:
                              type: string
                              contentMediaType: application/json
                              description: JSON-serialized accepted model input.
                            result:
                              type:
                                - object
                                - 'null'
                              required:
                                - urls
                                - items
                              properties:
                                urls:
                                  type: array
                                  items:
                                    type: string
                                    format: uri
                                items:
                                  type: array
                                  maxItems: 1
                                  items:
                                    type: object
                                    required:
                                      - id
                                      - urls
                                      - last_frame_url
                                      - draft
                                      - draft_expires_at
                                    properties:
                                      id:
                                        type: string
                                        format: uuid
                                      urls:
                                        type: array
                                        items:
                                          type: string
                                          format: uri
                                      last_frame_url:
                                        type:
                                          - string
                                          - 'null'
                                        format: uri
                                      draft:
                                        type: boolean
                                      draft_expires_at:
                                        type:
                                          - string
                                          - 'null'
                                        format: date-time
                    example:
                      code: 200
                      msg: success
                      data:
                        task_id: c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb
                        model: wan-2.6
                        status: succeeded
                        created_at: '2026-11-24T08:30:00.000Z'
                        completed_at: '2026-11-24T08:31:45.000Z'
                        duration: 105000
                        charged_credits: 65
                        message: ''
                        input: >-
                          {"prompt":"A paper boat drifting on a calm pond at
                          sunrise, gentle
                          ripples","resolution":"720p","aspect_ratio":"16:9","duration":5}
                        result:
                          urls:
                            - https://cdn.example.com/generated/wan-video.mp4
                          items:
                            - id: e7aacd19-819a-4747-bbbf-46fb6f2995a5
                              urls:
                                - >-
                                  https://cdn.example.com/generated/wan-video.mp4
                              last_frame_url: null
                              draft: false
                              draft_expires_at: null
              responses:
                2XX:
                  description: Webhook acknowledged.
              method: post
              type: path
            path: '{$request.body#/callback_url}'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - code
        - msg
        - data
      properties:
        code:
          type: integer
        msg:
          type: string
        data:
          type: 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Sign in to APIstable, then create and copy a key from [API Key
        management](https://apistable.ai/console/keys).


        Send this HTTP header with every request:


        ```http

        Authorization: Bearer YOUR_API_KEY

        ```


        Replace YOUR_API_KEY with the key you created.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.