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

# Wan Animate Replace

> Replace the character in a source video with the character from a reference image using Wan Animate Replace.

<Tip>
  1. Submit the request with `VIDGO_API_KEY`. Vidgo validates the request and checks the source video before creating the task. A `task_id` is returned after the task is successfully created.
  2. Use the returned `task_id` with [Query Task Status](/api-manual/task-management/status) until the task reaches `finished` or `failed`. If you provide a `callback_url`, Vidgo also sends the result to your [webhook](/api-manual/task-management/webhooks) when the task finishes or fails.
</Tip>

# Wan Animate Replace

Replace the character in a source video with the character from a reference image using Wan Animate Replace.

## Available Models

* **alibaba/wan/v2.2-14b/animate/replace** - Replace the character in a source video with the character from a reference image using Wan Animate Replace.

## Source Video Requirements

* `video_url` must point to a publicly accessible HTTP(S) video file.
* The entire video file must be no larger than **100 MiB** (104,857,600 bytes), and its duration must be greater than zero.
* Vidgo reads the source video to determine its duration for billing. This endpoint does not accept a `duration` field.

## Key Features

* Replace the character in a source video with the character from a reference image using Wan Animate Replace.
* Accepts an `image_urls` array containing exactly one image URL.
* Supports `480p`, `580p`, and `720p` output resolutions.

## Request Parameters

Set `model` and optional `callback_url` at the request root. The `input` object accepts only `video_url`, `image_urls`, and `resolution`. It does not accept `prompt`, `text`, or `duration`.

Unsupported `input` fields are rejected before credits are deducted. Input URLs must use HTTP(S), include a hostname, and contain no embedded credentials or whitespace.

### Source Video

* `video_url`: Required string. The source video containing the character to replace. The video must meet the source video requirements above.

### Character Image

* `image_urls`: Required array containing exactly one publicly accessible HTTP(S) image URL. The reference image containing the replacement character. A single URL string instead of an array, an empty array, multiple URLs, and Base64 images are rejected.

### Resolution

* `resolution`: Optional string. Accepted values: `480p`, `580p`, `720p`. Defaults to `480p` only when the field is omitted. Null, empty strings, other values, and values with surrounding whitespace are rejected.

## Pricing

Move and Replace use the same per-second rates:

| Resolution | Credits per second | USD per second |
| ---------- | -----------------: | -------------: |
| 480p       |                  7 |        \$0.035 |
| 580p       |                 12 |        \$0.060 |
| 720p       |                 15 |        \$0.075 |

Vidgo measures the source video duration for billing. Whole seconds are billed as measured; any fractional second is rounded up to a whole second. Total credits = `ceil(source video duration in seconds) × credits per second`. For example, a 5.1-second source video at 480p is billed as 6 seconds: 42 credits (\$0.210). Do not send a `duration` field. If Vidgo cannot read the video or determine its duration, the request is rejected before credits are deducted.

Credits are deducted when a valid request is submitted for generation and refunded if the task fails.


## OpenAPI

````yaml api-manual/video-series/alibaba-wan-v2-2-14b-animate-replace.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Wan Animate Replace
  description: >-
    Replace the character in a source video with the character from a reference
    image using Wan Animate Replace.
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Video Series
      summary: Wan Animate Replace
      description: >-
        Replace the character in a source video with the character from a
        reference image using Wan Animate Replace.


        Set model and optional callback_url at the request root. The input
        object accepts only video_url, image_urls, and resolution. It does not
        accept prompt, text, or duration. Unsupported input fields are rejected
        before credits are deducted.


        Input URLs must use HTTP(S), include a hostname, and contain no embedded
        credentials or whitespace. The source video must be publicly accessible,
        its entire file must be no larger than 100 MiB (104,857,600 bytes), and
        its duration must be greater than zero. Vidgo validates the request and
        checks the source video before creating the task. A task_id is returned
        after the task is successfully created. Query task status or provide a
        callback_url to receive the result.


        Billing uses the source video duration rounded up to a whole second,
        multiplied by the selected resolution rate: 480p costs 7 credits
        ($0.035) per second; 580p costs 12 credits ($0.060); 720p costs 15
        credits ($0.075). A 5.1-second source video at 480p is billed as 6
        seconds: 42 credits ($0.210). Video inspection failures are rejected
        before credits are deducted. Credits are deducted when a valid request
        is submitted for generation and refunded if the task fails.
      operationId: submit_alibaba_wan_v2_2_14b_animate_replace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: true
              properties:
                model:
                  type: string
                  enum:
                    - alibaba/wan/v2.2-14b/animate/replace
                  example: alibaba/wan/v2.2-14b/animate/replace
                  description: >-
                    Vidgo public model ID. Must be
                    `alibaba/wan/v2.2-14b/animate/replace`.
                input:
                  type: object
                  required:
                    - image_urls
                    - video_url
                  properties:
                    video_url:
                      type: string
                      format: uri
                      description: >-
                        Required string. The source video containing the
                        character to replace. Use a publicly accessible HTTP(S)
                        URL with a hostname and no embedded credentials or
                        whitespace. The entire video file must be no larger than
                        100 MiB (104,857,600 bytes), and its duration must be
                        greater than zero. Vidgo determines the source duration
                        for billing; do not send a duration field.
                    image_urls:
                      type: array
                      items:
                        type: string
                        format: uri
                        description: >-
                          A publicly accessible HTTP(S) image URL with a
                          hostname and no embedded credentials or whitespace.
                      minItems: 1
                      maxItems: 1
                      description: >-
                        Required array containing exactly one publicly
                        accessible HTTP(S) image URL. The reference image
                        containing the replacement character. A single URL
                        string instead of an array, an empty array, multiple
                        URLs, and Base64 images are rejected. URLs must include
                        a hostname and contain no embedded credentials or
                        whitespace.
                    resolution:
                      type: string
                      enum:
                        - 480p
                        - 580p
                        - 720p
                      default: 480p
                      description: >-
                        Optional string: 480p, 580p, or 720p. Defaults to 480p
                        only when omitted. Null, empty strings, other values,
                        and values with surrounding whitespace are rejected.
                        Rates per billable second: 480p costs 7 credits
                        ($0.035); 580p costs 12 credits ($0.060); 720p costs 15
                        credits ($0.075). The source video duration is rounded
                        up to a whole second before calculating the total.
                  additionalProperties: false
                callback_url:
                  type: string
                  nullable: true
                  description: >-
                    Optional public HTTP(S) endpoint for task completion
                    notifications. HTTPS is recommended. Omit, use null, or use
                    an empty string to disable callbacks.
              description: >-
                Keep model and callback_url at the root. Unknown root fields are
                ignored; unsupported input fields are rejected.
            examples:
              basic:
                summary: Basic workflow
                value:
                  model: alibaba/wan/v2.2-14b/animate/replace
                  input:
                    image_urls:
                      - https://example.com/image.png
                    video_url: https://example.com/video.mp4
                    resolution: 480p
              callback:
                summary: Receive a completion callback
                value:
                  model: alibaba/wan/v2.2-14b/animate/replace
                  input:
                    image_urls:
                      - https://example.com/image.png
                    video_url: https://example.com/video.mp4
                    resolution: 480p
                  callback_url: https://your-domain.com/callback
      responses:
        '200':
          description: >-
            Task created successfully. Use the returned task_id to query its
            status and retrieve the result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - data
                properties:
                  code:
                    type: integer
                    enum:
                      - 200
                  data:
                    type: object
                    required:
                      - task_id
                      - status
                      - created_time
                    properties:
                      task_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - not_started
                          - running
                          - finished
                          - failed
                      created_time:
                        type: string
                        format: date-time
              example:
                code: 200
                data:
                  task_id: task-unified-example
                  status: running
                  created_time: '2026-09-10T08:00:00'
        '400':
          description: >-
            Invalid or unsupported input parameters, an inaccessible source
            video, a video that exceeds 100 MiB or has a non-positive or
            unreadable duration, or insufficient credits.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '401':
          description: Invalid credentials
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '404':
          description: Unknown or disabled model
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '408':
          description: Request timed out
          content:
            text/plain:
              schema:
                type: string
              example: Request timeout
        '422':
          description: Invalid JSON or non-object request body
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '429':
          description: Rate or API key credit limit exceeded
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '502':
          description: Unable to create the video generation task.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '503':
          description: The selected model is currently unavailable.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Use VIDGO_API_KEY.

````