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

> Unified 720p/1080p video API for text, first/last frames, multi-reference with voice binding, and video editing.

## Parameters and input modes

Send `model` and `input`. Omitting `input.mode` selects `text_to_video`; the other three workflows require an explicit `mode` (never inferred), and fields are validated against the selected mode. See the Body section below for defaults and 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` (`mode` optional; defaults to `"text_to_video"`) |
| Image to video | `mode: "image_to_video"`, `first_frame_url` (`last_frame_url`, `reference_audio_urls` optional) |
| Reference to video | `mode: "reference_to_video"`, `prompt`, ≥1 image or video (`first_frame_url`/`reference_image_urls` or `image_with_roles`, and/or `reference_video_urls`) |
| Video edit | `mode: "video_edit"`, `source_video_url` (`prompt`, `reference_image_urls` optional) |

## Special modes

Mode compatibility rules; see Body below for exact defaults, duration bounds, and media limits.

* **Mode isolation**: Fields belonging to another mode return HTTP 400. Check the Body resolution default before omitting `resolution`.
* **Reference** (`reference_to_video`): `image_with_roles` and flat images are mutually exclusive; omit `aspect_ratio` with a first frame. Reference videos lower the Body duration cap.
* **Edit** (`video_edit`): Default `duration` matches source length; an explicit duration trims from the start without exceeding source length. Continuation and effects templates are unsupported.

## Use cases

Submit to `POST /api/v1/tasks/create_task`. `files.apistable.ai` URLs are live samples; replace `cdn.example.com` links with public HTTPS URLs meeting Body limits.

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

```json Image to video (first + last frame) theme={null}
{
  "model": "wan-2.7",
  "input": {
    "mode": "image_to_video",
    "first_frame_url": "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-keyframes-input-0.jpg",
    "last_frame_url": "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-keyframes-input-1.jpg",
    "prompt": "Smooth transition as morning mist lifts and warm sunlight brightens the pond.",
    "resolution": "1080p",
    "duration": 5
  }
}
```

```json Reference to video (images + video) theme={null}
{
  "model": "wan-2.7",
  "input": {
    "mode": "reference_to_video",
    "prompt": "Keep the folded paper boat appearance from the reference image and the calm golden-hour pond setting and visual style from the reference video as gentle ripples spread.",
    "reference_image_urls": [
      "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-reference-input-0.jpg"
    ],
    "reference_video_urls": [
      "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-snow-edit-input-0.mp4"
    ],
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9"
  }
}
```

```json Reference with character voice theme={null}
{
  "model": "wan-2.7",
  "input": {
    "mode": "reference_to_video",
    "prompt": "Medium close-up of the studio host from the character reference image speaking calmly into the camera in the bound reference voice, warm studio key light, soft background.",
    "image_with_roles": [
      {
        "url": "https://cdn.example.com/character-host.jpg",
        "role": "reference_image",
        "reference_voice": "https://cdn.example.com/host-voice.mp3"
      }
    ],
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration": 5
  }
}
```

```json Video edit theme={null}
{
  "model": "wan-2.7",
  "input": {
    "mode": "video_edit",
    "source_video_url": "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-snow-edit-input-0.mp4",
    "reference_image_urls": [
      "https://files.apistable.ai/examples/wan/v2/inputs/wan27-boat-reference-input-0.jpg"
    ],
    "prompt": "Replace the distant background with a softly blurred snowy shoreline while keeping the white paper boat, water ripples, and camera motion unchanged.",
    "resolution": "720p",
    "duration": 0,
    "metadata": {
      "audio_setting": "origin"
    }
  }
}
```

> Track `data.task_id` 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 errors and [Quickstart](https://docs.apistable.ai/quickstart.md) for auth. Output URLs last 14 days; tasks unfinished after 24 hours are eligible for timeout cleanup at no charge.

## Playground and pricing

Each task generates 1 video at one per-second rate across modes. Text/image modes bill requested output seconds; reference/edit modes bill every input video’s seconds (including repeated URLs) plus measured output seconds (images/audio add none). Failed tasks cost 0. See [Available Credits](https://docs.apistable.ai/credits.md).

| Resolution | Credits / billable s | USD / billable s |
| - | - | - |
| `720p` | 17.0 | \$0.085 |
| `1080p` (default) | 28.0 | \$0.140 |

> [card] [Try in Playground](https://apistable.ai/models/wan-2.7#try)
>
> Test all four Wan 2.7 modes interactively.

> [card] [View pricing](https://apistable.ai/models/wan-2.7#pricing)
>
> Compare 720p and 1080p rates by mode.


## OpenAPI

````yaml openapi-wan-2.7.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.7
      description: >-
        Unified 720p/1080p video API for text, first/last frames,
        multi-reference with voice binding, and video editing.
      operationId: wan-2.7
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - wan-2.7
                  example: wan-2.7
                  description: The APIstable model ID for this endpoint.
                input:
                  $schema: https://json-schema.org/draft/2020-12/schema
                  oneOf:
                    - 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:
                          type: string
                          minLength: 1
                          maxLength: 5000
                          description: Required scene instruction, 1–5,000 characters.
                        negative_prompt:
                          description: Optional undesired content, up to 500 characters.
                          type: string
                          maxLength: 500
                        resolution:
                          default: 1080p
                          description: >-
                            Output resolution: 720p (17.0 credits/billable s) or
                            1080p (default, 28.0 credits/billable s).
                          type: string
                          enum:
                            - 720p
                            - 1080p
                        duration:
                          default: 5
                          description: Output seconds, integer 2–15 (default 5).
                          type: integer
                          minimum: 2
                          maximum: 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
                        mode:
                          default: text_to_video
                          description: >-
                            Explicit workflow mode: text_to_video (default),
                            image_to_video, reference_to_video, or video_edit;
                            never inferred from media.
                          type: string
                          const: text_to_video
                        aspect_ratio:
                          description: >-
                            Optional output aspect ratio (16:9, 9:16, 1:1, 4:3,
                            3:4); defaults to 16:9.
                          type: string
                          enum:
                            - '16:9'
                            - '9:16'
                            - '1:1'
                            - '4:3'
                            - '3:4'
                      required:
                        - prompt
                      additionalProperties: false
                      description: >-
                        wan-2.7 text_to_video: 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.
                    - 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: Optional scene instruction, 1–5,000 characters.
                          type: string
                          minLength: 1
                          maxLength: 5000
                        negative_prompt:
                          description: Optional undesired content, up to 500 characters.
                          type: string
                          maxLength: 500
                        resolution:
                          default: 1080p
                          description: >-
                            Output resolution: 720p (17.0 credits/billable s) or
                            1080p (default, 28.0 credits/billable s).
                          type: string
                          enum:
                            - 720p
                            - 1080p
                        duration:
                          default: 5
                          description: Output seconds, integer 2–15 (default 5).
                          type: integer
                          minimum: 2
                          maximum: 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
                        mode:
                          type: string
                          const: image_to_video
                          description: >-
                            Explicit workflow mode: text_to_video (default),
                            image_to_video, reference_to_video, or video_edit;
                            never inferred from media.
                        first_frame_url:
                          type: string
                          maxLength: 16384
                          format: uri
                          description: >-
                            Required first frame. 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.
                        last_frame_url:
                          description: >-
                            Optional closing keyframe paired with
                            first_frame_url. Public HTTPS image URL
                            (JPEG/PNG/BMP/WebP, no alpha for any format, ≤10
                            MiB, 240–8000 px, ratio 1:8–8:1).
                          type: string
                          maxLength: 16384
                          format: uri
                        reference_audio_urls:
                          description: >-
                            Optional custom audio URL (max 1; public HTTPS
                            WAV/MP3, 2–30s, ≤15 MiB).
                          maxItems: 1
                          type: array
                          items:
                            type: string
                            maxLength: 16384
                            format: uri
                      required:
                        - mode
                        - first_frame_url
                      additionalProperties: false
                      description: >-
                        wan-2.7 image_to_video: 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.
                    - 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:
                          type: string
                          minLength: 1
                          maxLength: 5000
                          description: Required scene instruction, 1–5,000 characters.
                        negative_prompt:
                          description: Optional undesired content, up to 500 characters.
                          type: string
                          maxLength: 500
                        resolution:
                          default: 1080p
                          description: >-
                            Output resolution: 720p (17.0 credits/billable s) or
                            1080p (default, 28.0 credits/billable s).
                          type: string
                          enum:
                            - 720p
                            - 1080p
                        duration:
                          default: 5
                          description: >-
                            Output seconds, integer 2–15 (default 5); adding any
                            reference video caps output at 2–10.
                          type: integer
                          minimum: 2
                          maximum: 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
                        mode:
                          type: string
                          const: reference_to_video
                          description: >-
                            Explicit workflow mode: text_to_video (default),
                            image_to_video, reference_to_video, or video_edit;
                            never inferred from media.
                        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. 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_image_urls:
                          description: >-
                            Optional reference images. Public HTTPS image URL
                            (JPEG/PNG/BMP/WebP, no alpha for any format, ≤10
                            MiB, 240–8000 px, ratio 1:8–8:1). At least one
                            reference image or video is required; images +
                            videos ≤5.
                          maxItems: 5
                          type: array
                          items:
                            type: string
                            maxLength: 16384
                            format: uri
                        reference_video_urls:
                          description: >-
                            Optional reference videos (up to 5; public HTTPS
                            MP4/MOV, 1–30s each, ≤150s total, ≤100 MiB, 240–4096
                            px, ratio 1:8–8:1). Images + videos ≤5; every
                            supplied video instance (including repeated URLs)
                            contributes its validated seconds to billing.
                          maxItems: 5
                          type: array
                          items:
                            type: string
                            maxLength: 16384
                            format: uri
                        image_with_roles:
                          description: >-
                            Alternative to flat image fields (mutually
                            exclusive) for per-character voice binding (1–30s
                            WAV/MP3, ≤15 MiB). Public HTTPS image URL
                            (JPEG/PNG/BMP/WebP, no alpha for any format, ≤10
                            MiB, 240–8000 px, ratio 1:8–8:1). At most one
                            first_frame; images + videos ≤5.
                          minItems: 1
                          maxItems: 5
                          type: array
                          items:
                            type: object
                            properties:
                              url:
                                type: string
                                maxLength: 16384
                                format: uri
                                description: >-
                                  Public HTTPS image URL (JPEG/PNG/BMP/WebP, no
                                  alpha for any format, ≤10 MiB, 240–8000 px,
                                  ratio 1:8–8:1).
                              role:
                                default: reference_image
                                description: >-
                                  Image role: reference_image (default) or
                                  first_frame (at most one).
                                type: string
                                enum:
                                  - reference_image
                                  - first_frame
                              reference_voice:
                                description: >-
                                  Optional public HTTPS voice sample URL
                                  (WAV/MP3, 1–30s, ≤15 MiB). Passed to the model
                                  provider for its own moderation.
                                type: string
                                maxLength: 16384
                                format: uri
                            required:
                              - url
                            additionalProperties: false
                      required:
                        - prompt
                        - mode
                      additionalProperties: false
                      description: >-
                        wan-2.7 reference_to_video: public HTTPS media without
                        credentials, custom ports, or # fragments; 1 video per
                        request; fallback unavailable. Billable seconds = summed
                        validated input video seconds + measured 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.
                    - 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: Optional edit instruction, 1–5,000 characters.
                          type: string
                          minLength: 1
                          maxLength: 5000
                        negative_prompt:
                          description: Optional undesired content, up to 500 characters.
                          type: string
                          maxLength: 500
                        resolution:
                          default: 1080p
                          description: >-
                            Output resolution: 720p (17.0 credits/billable s) or
                            1080p (default, 28.0 credits/billable s).
                          type: string
                          enum:
                            - 720p
                            - 1080p
                        duration:
                          default: 0
                          description: >-
                            Output seconds: 0 (default) follows source length;
                            2–10 trims from the start and cannot exceed the
                            source video duration. Edits bill source seconds
                            plus measured output seconds.
                          anyOf:
                            - type: number
                              const: 0
                            - type: integer
                              minimum: 2
                              maximum: 10
                        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
                        mode:
                          type: string
                          const: video_edit
                          description: >-
                            Explicit workflow mode: text_to_video (default),
                            image_to_video, reference_to_video, or video_edit;
                            never inferred from media.
                        aspect_ratio:
                          description: >-
                            Optional output aspect ratio (16:9, 9:16, 1:1, 4:3,
                            3:4); omitting follows the source video ratio.
                          type: string
                          enum:
                            - '16:9'
                            - '9:16'
                            - '1:1'
                            - '4:3'
                            - '3:4'
                        reference_image_urls:
                          description: >-
                            Optional reference images (up to 4). Public HTTPS
                            image URL (JPEG/PNG/BMP/WebP, no alpha for any
                            format, ≤10 MiB, 240–8000 px, ratio 1:8–8:1).
                          maxItems: 4
                          type: array
                          items:
                            type: string
                            maxLength: 16384
                            format: uri
                        source_video_url:
                          type: string
                          maxLength: 16384
                          format: uri
                          description: >-
                            Required source video (public HTTPS MP4/MOV, 2–10s,
                            ≤100 MiB, 240–4096 px, ratio 1:8–8:1). Source
                            seconds plus measured output seconds are billed.
                        metadata:
                          default:
                            audio_setting: auto
                          description: >-
                            Video edit audio setting: auto (default) regenerates
                            audio; origin preserves source audio.
                          type: object
                          properties:
                            audio_setting:
                              default: auto
                              description: >-
                                auto (default) regenerates audio; origin
                                preserves source audio.
                              type: string
                              enum:
                                - auto
                                - origin
                          additionalProperties: false
                      required:
                        - mode
                        - source_video_url
                      additionalProperties: false
                      description: >-
                        wan-2.7 video_edit: public HTTPS media without
                        credentials, custom ports, or # fragments; 1 video per
                        request; fallback unavailable. Billable seconds = summed
                        validated input video seconds + measured 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.
                  description: >-
                    Wan 2.7 input validated by the selected workflow (mode:
                    text_to_video, image_to_video, reference_to_video, or
                    video_edit). Omitting mode selects text_to_video; the other
                    three workflows require mode. 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.7
              input:
                mode: text_to_video
                prompt: >-
                  A paper boat drifting on a calm pond at sunrise, gentle
                  ripples
                resolution: 720p
                duration: 2
                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.7",
                      "status": "succeeded",
                      "created_at": "2026-11-24T08:30:00.000Z",
                      "completed_at": "2026-11-24T08:31:45.000Z",
                      "duration": 105000,
                      "charged_credits": 85,
                      "message": "",
                      "input": "{\"mode\":\"text_to_video\",\"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.7
                            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.7
                        status: succeeded
                        created_at: '2026-11-24T08:30:00.000Z'
                        completed_at: '2026-11-24T08:31:45.000Z'
                        duration: 105000
                        charged_credits: 85
                        message: ''
                        input: >-
                          {"mode":"text_to_video","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.