# H3 Max Extend Video

> H3 Max Extend Video adds a text-guided continuation to an existing video. It supports prompt expansion, adjustable duration and aspect ratio, and output resolutions from 480p to 2K, returning either the full extended video or only the new footage.


## Overview

- **Endpoint**: `https://fal.run/minimax/h3-max/extend-video`
- **Model ID**: `minimax/h3-max/extend-video`
- **Category**: video-to-video
- **Kind**: inference
**Tags**: extend, video, continuation



## Pricing

Billing is calculated per second of generated video, plus reference input charges beyond the included allowance. Video costs **$0.05** per second at **480p**, **$0.08** per second at **768p**, **$0.16** per second at **1080p**, and **$0.32** per second at **2K**. Each request includes **4,096 reference tokens** at no additional charge. Reference usage above this allowance costs **$0.02 per 1,000 tokens**, prorated to the actual token count.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`video_url`** (`string`, _required_):
  URL of the video to extend. Must be 1.625 s to 60 s long, up to 50 MB, aspect ratio between 0.4 and 2.5.
  - Examples: "https://storage.googleapis.com/falserverless/example_inputs/flux-3-red-panda.mp4"

- **`prompt`** (`string`, _required_):
  What happens next. Describe the continuation, not the source.
  - Examples: "The red panda keeps walking along the log, then looks up at a bird."

- **`enable_prompt_expansion`** (`boolean`, _optional_):
  Automatically enhance the prompt using the source video to help keep the continuation consistent. May increase processing time. Default value: `true`
  - Default: `true`

- **`duration`** (`integer`, _optional_):
  Seconds of new footage to add after the source. The actual duration may be slightly longer. Default value: `5`
  - Default: `5`
  - Range: `5` to `15`

- **`resolution`** (`ResolutionEnum`, _optional_):
  Output video resolution. Default value: `"768P"`
  - Default: `"768P"`
  - Options: `"480P"`, `"768P"`, `"1080P"`, `"2K"`

- **`aspect_ratio`** (`AspectRatioEnum`, _optional_):
  Output aspect ratio. 'auto' follows the source video. Other values crop the video to fit the selected ratio. Default value: `"auto"`
  - Default: `"auto"`
  - Options: `"auto"`, `"21:9"`, `"16:9"`, `"4:3"`, `"1:1"`, `"3:4"`, `"9:16"`

- **`seed`** (`integer`, _optional_):
  Seed for the continuation. Random when omitted.

- **`output`** (`OutputEnum`, _optional_):
  'extended' returns the whole source video followed by the new footage. 'continuation' returns only the generated continuation. Default value: `"extended"`
  - Default: `"extended"`
  - Options: `"extended"`, `"continuation"`

- **`enable_safety_checker`** (`boolean`, _optional_):
  Moderate the source video and the prompt. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "video_url": "https://storage.googleapis.com/falserverless/example_inputs/flux-3-red-panda.mp4",
  "prompt": "The red panda keeps walking along the log, then looks up at a bird."
}
```

**Full Example**:

```json
{
  "video_url": "https://storage.googleapis.com/falserverless/example_inputs/flux-3-red-panda.mp4",
  "prompt": "The red panda keeps walking along the log, then looks up at a bird.",
  "enable_prompt_expansion": true,
  "duration": 5,
  "resolution": "768P",
  "aspect_ratio": "auto",
  "output": "extended",
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`video`** (`File`, _required_):
  The extended video, or only the continuation per 'output'.

- **`seed`** (`integer`, _required_):
  Seed used for the continuation.

- **`duration`** (`float`, _required_):
  Seconds of returned video.

- **`source`** (`Source`, _required_):
  Source video information: width, height, frame rate, duration, and audio.

- **`expanded_prompt`** (`string`, _optional_):
  The prompt used after expansion, or null when unchanged.

- **`timings`** (`Timings`, _optional_)



**Example Response**:

```json
{
  "video": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/minimax/h3-max/extend-video \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "video_url": "https://storage.googleapis.com/falserverless/example_inputs/flux-3-red-panda.mp4",
     "prompt": "The red panda keeps walking along the log, then looks up at a bird."
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "minimax/h3-max/extend-video",
    arguments={
        "video_url": "https://storage.googleapis.com/falserverless/example_inputs/flux-3-red-panda.mp4",
        "prompt": "The red panda keeps walking along the log, then looks up at a bird."
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("minimax/h3-max/extend-video", {
  input: {
    video_url: "https://storage.googleapis.com/falserverless/example_inputs/flux-3-red-panda.mp4",
    prompt: "The red panda keeps walking along the log, then looks up at a bird."
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/minimax/h3-max/extend-video)
- [API Documentation](https://fal.ai/models/minimax/h3-max/extend-video/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=minimax/h3-max/extend-video)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
