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

# Wan 2.2 Video LoRA

> Image-to-video API with optional first-and-last-frame control

## Overview

Wan 2.2 Video LoRA is an asynchronous image-to-video model. It can animate one starting image or create a transition between a first and last frame.

| Capability | Value                                                 |
| ---------- | ----------------------------------------------------- |
| Model ID   | `wan-2-2-video-LoRA`                                  |
| Mode       | `image-to-video` (required)                           |
| Images     | 1 first-frame image, plus 1 optional last-frame image |
| Duration   | `5` or `8` seconds                                    |
| Resolution | `480p` or `720p`                                      |
| Output     | MP4 video URL array in `resultJson.resultUrls`        |

## Endpoint and authentication

Base URL:

```text theme={null}
https://api.apixo.ai/api/v1
```

| Method | Endpoint                                         | Purpose                               |
| ------ | ------------------------------------------------ | ------------------------------------- |
| `POST` | `/generateTask/wan-2-2-video-LoRA`               | Submit an image-to-video task         |
| `GET`  | `/statusTask/wan-2-2-video-LoRA?taskId={taskId}` | Poll task status and retrieve results |

All requests require your APIXO API key:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Copy-paste async quickstart

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-2-video-LoRA" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "image-to-video",
      "prompt": "a cinematic camera move through a rainy neon street",
      "image_urls": ["https://example.com/first-frame.png"],
      "duration": 5,
      "resolution": "480p",
      "prompt_extend": true
    }
  }'
```

The response contains a `taskId`. Save it and poll the status endpoint until `state` becomes `success` or `failed`.

## First-and-last-frame request

Pass exactly two image URLs in order: the first frame followed by the last frame.

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "move smoothly from sunrise to a starry night",
    "image_urls": [
      "https://example.com/first-frame.png",
      "https://example.com/last-frame.png"
    ],
    "duration": 8,
    "resolution": "720p",
    "prompt_extend": true,
    "seed": 12345
  }
}
```

## Parameters

<ParamField body="request_type" type="string" default="async">
  Result delivery mode. Use `async` for polling with `statusTask`, or `callback` for webhook delivery.
</ParamField>

<ParamField body="callback_url" type="string">
  Required when `request_type` is `callback`. Must be a public HTTPS URL that can receive the final task payload. See [Webhooks](/docs/api-reference/webhooks).
</ParamField>

<ParamField body="input" type="object" required>
  Wan 2.2 Video LoRA input parameters.

  <Expandable title="properties">
    <ParamField body="mode" type="string" required>
      Generation mode. The only supported value is `image-to-video`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Non-empty text describing the desired video.
    </ParamField>

    <ParamField body="image_urls" type="string[]" required>
      One or two public image URLs. The first URL is the first frame; the optional second URL is the last frame.
    </ParamField>

    <ParamField body="duration" type="integer" default="5">
      Output duration in seconds. Supported values: `5`, `8`.
    </ParamField>

    <ParamField body="resolution" type="string" default="480p">
      Output resolution. Supported values: `480p`, `720p`.
    </ParamField>

    <ParamField body="prompt_extend" type="boolean" default="true">
      Whether to rewrite and enrich the prompt before generation. This option does not create an additional charge.
    </ParamField>

    <ParamField body="seed" type="integer">
      Optional random seed from `0` through `2147483647`.
    </ParamField>
  </Expandable>
</ParamField>

## Poll for result

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/wan-2-2-video-LoRA?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

After `state` becomes `success`, parse `resultJson` and read its `resultUrls` array.

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/video.mp4\"]}"
  }
}
```

## Billing

Billing is based on output duration: `480p` costs `$0.044/second`; `720p` costs `$0.088/second`. `prompt_extend` does not add a separate charge.

## Tips

* All media URLs must be publicly accessible by the API.
* Start polling about 60 seconds after task creation, then poll every 10 seconds.
* Use callback delivery for long-running production workflows.
