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

# Wan 2.7 — Reference to Video

> Generate video conditioned on up to 5 reference images and/or 3 reference videos with Wan 2.7.

|              |                       |
| ------------ | --------------------- |
| **Model ID** | `alibaba/wan-2-7-r2v` |
| **Family**   | `wan-2-7-novita`      |
| **Task**     | `reference-to-video`  |
| **Modality** | Video                 |
| **Upstream** | Alibaba Wan 2.7       |

<Note>
  Like T2V, the output dimension is the explicit `size` field (full
  pixel dimensions) — it sets both the aspect ratio and the price tier.
  At least one of `image_urls` or `video_urls` should be supplied — the
  whole point of this task is to bias generation on references.
</Note>

## Endpoint

```http theme={null}
POST https://routerbase.com/v1/videos/generations
```

Async — returns `{id, status: "pending"}`; poll
`GET /v1/videos/generations/{id}` until `success` or `failed`.

## Parameters

<ParamField body="prompt" type="string" required>
  Text prompt describing the desired video. Max 1500 characters.
</ParamField>

<ParamField body="image_urls" type="string[]">
  Up to 5 reference image URLs (HTTPS, PNG / JPEG).
</ParamField>

<ParamField body="video_urls" type="string[]">
  Up to 3 reference video URLs (HTTPS, MP4).
</ParamField>

<ParamField body="size" type="enum" default="&#x22;1920*1080&#x22;">
  Full pixel dimensions — sets the aspect ratio and the price tier. One
  of `1920*1080`, `1080*1920`, `1440*1440`, `1632*1248`, `1248*1632`
  (\~2M px, **$0.15/s**), or `1280*720`, `720*1280`, `960*960`,   `1088*832`, `832*1088` (~0.9M px, **$0.10/s**).
</ParamField>

<ParamField body="duration" type="integer" default="5">
  Length of the generated clip in seconds. Range `[2, 10]`.
</ParamField>

<ParamField body="shot_type" type="&#x22;single&#x22; | &#x22;multi&#x22;" default="&#x22;single&#x22;">
  `multi` lets the model cut between shots; `single` keeps a continuous
  take.
</ParamField>

<ParamField body="audio" type="boolean" default="true">
  Whether to generate a synchronized audio track.
</ParamField>

<ParamField body="negative_prompt" type="string">
  Content to steer the model away from. Max 500 characters.
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  Whether to overlay an upstream watermark on the output.
</ParamField>

<ParamField body="seed" type="integer">
  Random-generator initialiser. Range `[0, 2147483647]`.
</ParamField>

## Example

```bash theme={null}
curl https://routerbase.com/v1/videos/generations \
  -H "Authorization: Bearer $ROUTERBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "alibaba/wan-2-7-r2v",
    "prompt": "a stylised remix of the references, moody lighting",
    "image_urls": ["https://example.com/ref-a.jpg", "https://example.com/ref-b.jpg"],
    "size": "1920*1080",
    "duration": 5,
    "shot_type": "multi"
  }'
```

```json theme={null}
{ "id": "wan_r2v_001…", "status": "pending", "model": "alibaba/wan-2-7-r2v" }
```

Poll until terminal:

```bash theme={null}
curl https://routerbase.com/v1/videos/generations/wan_r2v_001… \
  -H "Authorization: Bearer $ROUTERBASE_API_KEY"
```

```json theme={null}
{
  "id": "wan_r2v_001…",
  "status": "success",
  "data": [{ "url": "https://…mp4" }]
}
```

## Reference
