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

> ## Agent Instructions
> Five API is a video generation REST API. Base URL: https://api.fiveapi.ai. Authenticate with the header Authorization: Bearer <API key>; read the key from the FIVEAPI_API_KEY environment variable and never hard-code it.
> Every generation is an asynchronous task: POST /v1/{brand}/{version}/{task} returns a queued task, then poll GET /v1/tasks/{task_id} or receive a signed webhook, and download output.video.url before expires_at (7 days).
> The OpenAPI spec is at https://docs.fiveapi.ai/api-reference/openapi.yaml. An installable agent skill: npx skills add https://docs.fiveapi.ai

# Video extend

> Continue an existing clip with new footage that picks up where it ends, with matched audio.

Video extend takes a clip you already have and continues it. The result is your clip followed by the new seconds, as one MP4.

| Model | Endpoint | Resolutions | Added duration | Audio |
| - | - | - | - | - |
| Video Fast Extend 1.1 | `POST /v1/video-fast/v1.1/video-extend` | 480p, 720p, 1080p | 3–30 s | `generate_audio` |

## Create a task

```bash cURL theme={null}
curl https://api.fiveapi.ai/v1/video-fast/v1.1/video-extend \
  -H "Authorization: Bearer $FIVEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://assets.example.com/inputs/clip.mp4",
    "prompt": "the camera keeps panning right across the skyline as the city lights come on",
    "duration": 5,
    "resolution": "720p",
    "generate_audio": true,
    "webhook_url": "https://hooks.example.com/fiveapi"
  }'
```

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

task = requests.post(
    "https://api.fiveapi.ai/v1/video-fast/v1.1/video-extend",
    headers={"Authorization": f"Bearer {os.environ['FIVEAPI_API_KEY']}"},
    json={
        "video_url": "https://assets.example.com/inputs/clip.mp4",
        "prompt": "the camera keeps panning right across the skyline as the city lights come on",
        "duration": 5,
        "resolution": "720p",
        "generate_audio": True,
        "webhook_url": "https://hooks.example.com/fiveapi",
    },
    timeout=30,
).json()
print(task["id"], task["status"])
```

```javascript Node.js theme={null}
const res = await fetch("https://api.fiveapi.ai/v1/video-fast/v1.1/video-extend", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FIVEAPI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    video_url: "https://assets.example.com/inputs/clip.mp4",
    prompt: "the camera keeps panning right across the skyline as the city lights come on",
    duration: 5,
    resolution: "720p",
    generate_audio: true,
    webhook_url: "https://hooks.example.com/fiveapi",
  }),
});
const task = await res.json();
console.log(task.id, task.status);
```

## Parameters

| Field | Required | Description |
| - | - | - |
| `video_url` | yes | Public HTTPS URL of an MP4 or MOV clip: 360–2,000 px per side, at most 500 MB. |
| `prompt` | yes | How the video continues, up to 2,000 characters. |
| `duration` | yes | Seconds to **add** after the clip, 3–30. |
| `resolution` | yes | `480p`, `720p` or `1080p`. |
| `start_time`, `end_time` | no | A window of the clip to continue from, in seconds. Send both or neither; `end_time` must be greater than `start_time`. Default: the whole clip. |
| `generate_audio` | no | `true` generates audio for the new part that matches the clip. Default `false`. |
| `prompt_expansion` | no | `none`, `basic` or `advanced` (default). |
| `webhook_url`, `metadata` | no | See [Webhooks](https://testweb2-docs-openapi.test765.com/concepts/webhooks.md) and [Tasks](https://testweb2-docs-openapi.test765.com/concepts/tasks.md). |

## Duration rules

* The clip, or the window you select with `start_time` and `end_time`, must be 2–30 seconds long.
* The clip plus the added seconds may not exceed **30 seconds**. For example, a 10-second clip can be extended by at most 20 seconds.
* The result contains the clip followed by the continuation, so `output.video.duration` is at least `duration`.

Use a window to continue from a specific part of a longer video:

```json theme={null}
{
  "video_url": "https://assets.example.com/inputs/long-take.mp4",
  "start_time": 12,
  "end_time": 20,
  "prompt": "the runner crosses the finish line and raises both arms",
  "duration": 6,
  "resolution": "720p"
}
```

## Tips for good results

* **Continue the action that is already happening.** The best extensions follow the motion and camera movement at the end of the clip.
* **End the window on a clean frame.** A frame without motion blur or a scene cut gives the model a stable start.


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