# alibaba/wan-2-7-i2v

Source: https://docs.sociaro.com/models/alibaba-wan-2-7-i2v/

Wan 2.7 image-to-video, three jobs in one model: first frame, first + last frame, and continuation of a video clip. prompt (req); media, each at most once: first_frame_url, last_frame_url, driving_audio_url (public https WAV/MP3, 2-30 s — the audio drives the clip, e.g. lip-sync), first_clip_url (an MP4/MOV of 2-10 s to continue); first_frame_url OR first_clip_url is required, and last_frame_url may accompany either. resolution 720p|1080p (def 1080p; no 480p); duration whole seconds 2-15 (def 5; a continuation is billed for the final length); negative_prompt (<=500 chars); seed; prompt_extend (def true); watermark (def false).

No aspect_ratio: the output follows the input.

Served via the relay: POST /v1/alibaba/generations, poll GET /v1/alibaba/generations/{task_id}. Per-second pricing (by resolution) billed by the relay from the vendor's reported usage.

Unknown parameters are rejected.

|  |  |
| --- | --- |
| Slug | `alibaba/wan-2-7-i2v` |
| Kind | video |
| Vendor | alibaba |
| Endpoint | `POST /v1/alibaba/generations` |

[View pricing and billing conditions](https://docs.sociaro.com/models/alibaba-wan-2-7-i2v/#pricing)

## Example request

cURL

```bash
curl https://api.sociaro.com/v1/alibaba/generations \
  -H "Authorization: Bearer $SOCIARO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "model": "alibaba/wan-2-7-i2v",
        "prompt": "a paper boat on a rain-soaked street",
        "first_frame_url": "https://your-cdn.example.com/first.png",
        "resolution": "720p",
        "duration": 5
      }'

# then poll the job id it returns:
curl https://api.sociaro.com/v1/alibaba/generations/JOB_ID \
  -H "Authorization: Bearer $SOCIARO_API_KEY"
```

Python

```python
# Requires Python 3 and requests (pip install requests).
import os
import time
import requests

payload = {'model': 'alibaba/wan-2-7-i2v',
 'prompt': 'a paper boat on a rain-soaked street',
 'first_frame_url': 'https://your-cdn.example.com/first.png',
 'resolution': '720p',
 'duration': 5}

response = requests.post(
    'https://api.sociaro.com/v1/alibaba/generations',
    headers={
        'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
        'Content-Type': 'application/json',
    },
    json=payload,
    timeout=120,
)
response.raise_for_status()
submitted = response.json()
job_id = submitted['job_id']
print(submitted)

# then poll the job id it returns:
while True:
    response = requests.get(
        'https://api.sociaro.com/v1/alibaba/generations/' + job_id,
        headers={
            'Authorization': 'Bearer ' + os.environ['SOCIARO_API_KEY'],
        },
        timeout=120,
    )
    response.raise_for_status()
    result = response.json()
    status = result['status']
    if status == 'completed':
        break
    if status not in ('submitted', 'processing'):
        raise RuntimeError(result)
    time.sleep(5)
print(result)
```

JavaScript

```javascript
// Run as an .mjs file with Node.js 22 or later.
let jobId;
let result;

{
  const payload = {
    "model": "alibaba/wan-2-7-i2v",
    "prompt": "a paper boat on a rain-soaked street",
    "first_frame_url": "https://your-cdn.example.com/first.png",
    "resolution": "720p",
    "duration": 5
  };
  
  const response = await fetch("https://api.sociaro.com/v1/alibaba/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });
  if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
  const submitted = await response.json();
  jobId = submitted.job_id;
  console.log(submitted);
}

// then poll the job id it returns:
{
  while (true) {
    const response = await fetch("https://api.sociaro.com/v1/alibaba/generations/" + jobId, {
      headers: {
        "Authorization": "Bearer " + process.env.SOCIARO_API_KEY,
      },
    });
    if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
    result = await response.json();
    const status = result.status;
    if (status === "completed") break;
    if (!["submitted", "processing"].includes(status)) throw new Error(JSON.stringify(result));
    await new Promise(resolve => setTimeout(resolve, 5000));
  }
  console.log(result);
}
```

## Parameters

- `prompt`
- `first_frame_url`
- `last_frame_url`
- `driving_audio_url`
- `first_clip_url`
- `resolution`
- `duration`
- `negative_prompt`
- `seed`
- `prompt_extend`
- `watermark`

The endpoint rejects unknown request fields.

## Pricing

| Billable unit and options | Rate (USD) |
| --- | --- |
| per second of output video 720p | $0.1 |
| per second of output video 1080p | $0.15 |

- Billed on the seconds and resolution the generator reports for the finished clip.
- Leaving out resolution gives 1080p.
- Continuing a clip (first_clip_url) bills the whole finished clip, the source clip included.

[View this model in the pricing catalogue](https://sociaro.com/pricing?model=alibaba%2Fwan-2-7-i2v). Your [billing logs](https://docs.sociaro.com/billing/index.md) show the actual charge for each request.
