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

# Video extension

> Continue a reference video with new footage.

Again add the reference video, describe what happens next and how the camera moves, and send `omni_reference_task_type: extend`. `duration` is the length of the newly generated part; the ratio follows the input video, so `ratio` must be `adaptive` (applied when omitted) and other values return 400 without charge.

> [!TIP]
>
> Want to try it? Open [Create video task](https://docs.dreamto.ai/en/api-reference/seedance-2-5-flash/create-task.md), pick "Video extension" in the request example dropdown, enter your API Key and click **Try it**.

## Request

`$DREAMTO_API_KEY` is your API Key.

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/api/v3/contents/generations/tasks" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.5-flash",
    "content": [
      {
        "type": "text",
        "text": "Keep the original camera move; the person keeps walking out of frame to the right as the light turns to dusk"
      },
      {
        "type": "video_url",
        "video_url": {
          "url": "https://example.com/clip.mp4"
        },
        "role": "reference_video"
      }
    ],
    "ratio": "adaptive",
    "duration": 5,
    "resolution": "720p",
    "omni_reference_task_type": "extend"
  }'
```

```python Python theme={null}
import os
import requests

payload = {
    "model": "seedance-2.5-flash",
    "content": [
        {
            "type": "text",
            "text": "Keep the original camera move; the person keeps walking out of frame to the right as the light turns to dusk"
        },
        {
            "type": "video_url",
            "video_url": {
                "url": "https://example.com/clip.mp4"
            },
            "role": "reference_video"
        }
    ],
    "ratio": "adaptive",
    "duration": 5,
    "resolution": "720p",
    "omni_reference_task_type": "extend"
}

resp = requests.post(
    "https://api.dreamto.ai/api/v3/contents/generations/tasks",
    headers={"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"},
    json=payload,
    timeout=60,
)
print(resp.status_code, resp.json())  # {'id': 'task_...', 'request_id': 'req_...'}
```

```javascript Node.js theme={null}
const payload = {
  "model": "seedance-2.5-flash",
  "content": [
    {
      "type": "text",
      "text": "Keep the original camera move; the person keeps walking out of frame to the right as the light turns to dusk"
    },
    {
      "type": "video_url",
      "video_url": {
        "url": "https://example.com/clip.mp4"
      },
      "role": "reference_video"
    }
  ],
  "ratio": "adaptive",
  "duration": 5,
  "resolution": "720p",
  "omni_reference_task_type": "extend"
};

const resp = await fetch("https://api.dreamto.ai/api/v3/contents/generations/tasks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.DREAMTO_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});
console.log(resp.status, await resp.json()); // { id: 'task_...', request_id: 'req_...' }
```

## Response

On success the API returns HTTP 200. `request_id` equals the `X-Request-Id` header; include it when contacting support:

```json theme={null}
{
  "id": "task_8c1d2e3f4a5b6c7d8e9f0a1b",
  "request_id": "req_3f9a1c2b7d4e5f60718293a4"
}
```

With the task `id`, poll [Get task](https://docs.dreamto.ai/en/api-reference/seedance-2-5-flash/get-task.md); when `status` is `succeeded`, read `content.video_url`. See [Create video task](https://docs.dreamto.ai/en/api-reference/seedance-2-5-flash/create-task.md) for every parameter and value.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.