> ## 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

# Input files

> How to pass images, videos and audio to Five API: public HTTPS URLs, the URL policy and the limits of each model.

Five API takes input files as **URLs**. There is no upload endpoint: host the file somewhere public, for example in your own object storage, and pass its HTTPS URL in the request.

| Field | Used by | What it points to |
| - | - | - |
| `image_url` | image to video | The image to animate |
| `reference_images`, `reference_videos`, `reference_audios` | reference to video | Arrays of asset URLs |
| `video_url` | video extend | The clip to continue |

## URL policy

Five API checks every input URL **when you create the task**, before any credit is held. A URL that breaks a rule answers `400 url_not_allowed` with the field in `param`.

* **HTTPS only.** `http://` URLs are rejected.
* **Public host.** The host name must resolve, through public DNS, to a public IP address. Private, loopback, link-local, carrier-grade NAT, cloud metadata and other reserved ranges are rejected.
* **Answers `HEAD`.** Five API sends a `HEAD` request to the URL. It must answer `2xx`, after at most 3 redirects; each redirect target is checked again.
* **Within the size limit.** The `Content-Length` must not exceed the limit of the model (see below).

The same host rules apply to `webhook_url`.

> [!TIP]
>
> Presigned URLs from S3, Google Cloud Storage, Azure Blob Storage, Cloudflare R2 and similar services work well. Keep them valid for at least an hour: a task downloads its input files after it is created, while it is queued.

## Limits per model

| Model | Input | Formats and limits |
| - | - | - |
| Video Fast 1.0, image to video | `image_url` | JPG, PNG or WebP; shorter side at least 300 px; aspect ratio between 0.4 and 2.5; at most 30 MB |
| Wan 3.0 Spark and Prime Spark, image to video | `image_url` | JPG, PNG or WebP; 360–2,000 px per side; at most 20 MB |
| Video Fast 1.0, reference to video | `reference_images` | Up to 9 images: JPG, PNG or WebP; 256–5,760 px; at most 30 MB each |
| | `reference_videos` | Up to 3 clips: 2–15 seconds and at most 50 MB each |
| | `reference_audios` | Up to 3 files: at most 15 MB each; send them together with an image or a video |
| Wan 3.0 Spark, reference to video | `reference_images` | Up to 10 images: JPG, PNG or WebP; at most 20 MB each |
| | `reference_videos` | Up to 5 clips: at most 100 MB each |
| | `reference_audios` | Up to 5 files: at most 15 MB each |
| Video Fast Extend 1.1 | `video_url` | MP4 or MOV; 360–2,000 px per side; 2–30 seconds after the optional window; at most 500 MB |

`GET /v1/models/{brand}/{version}/{task}` returns each model's limits in `input_schema`, including `x-max-input-bytes`, the largest accepted file.

## When an input fails later

The URL check at creation can't see everything inside a file. If a file turns out to be unusable during processing, the task fails and its credits are released:

* `input_fetch_failed` (retryable): the file could not be downloaded or processed, for example because a presigned URL expired.
* `input_invalid` (not retryable): the file was downloaded but its format, dimensions or length do not fit the model.

## Troubleshooting `url_not_allowed`

| Cause | Fix |
| - | - |
| The URL uses `http` | Serve it over `https` |
| The host resolves to a private or reserved address | Use a publicly hosted file; internal hosts and DNS overrides are not reachable |
| The server doesn't answer `HEAD`, or answers without `Content-Length` | Host the file on object storage or a CDN that supports `HEAD` |
| More than 3 redirects | Pass the final URL |
| The file is larger than the model's limit | Compress or resize it, or choose a model with a higher limit |


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