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

# Image to video

> Animate a photo, a product shot or an illustration, keeping its look and composition.

Image to video uses your image as the first frame and animates it. The prompt describes the motion.

| Model | Endpoint | Resolutions | Duration | Audio | Image |
| - | - | - | - | - | - |
| Video Fast 1.0 | `POST /v1/video-fast/v1.0/image-to-video` | 480p, 768p | 3–15 s | — | at most 30 MB |
| Wan 3.0 Spark | `POST /v1/wan/v3.0-spark/image-to-video` | 480p, 720p, 1080p | 2–30 s | yes | at most 20 MB |
| Wan 3.0 Prime Spark | `POST /v1/wan/v3.0-prime-spark/image-to-video` | 480p, 720p, 1080p | 2–30 s | yes | at most 20 MB |

## Create a task

```bash cURL theme={null}
curl https://api.fiveapi.ai/v1/video-fast/v1.0/image-to-video \
  -H "Authorization: Bearer $FIVEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://assets.example.com/inputs/portrait.jpg",
    "prompt": "slow push-in, soft morning light, hair moving in the breeze",
    "duration": 5,
    "resolution": "768p",
    "aspect_ratio": "adaptive",
    "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.0/image-to-video",
    headers={"Authorization": f"Bearer {os.environ['FIVEAPI_API_KEY']}"},
    json={
        "image_url": "https://assets.example.com/inputs/portrait.jpg",
        "prompt": "slow push-in, soft morning light, hair moving in the breeze",
        "duration": 5,
        "resolution": "768p",
        "aspect_ratio": "adaptive",
        "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.0/image-to-video", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FIVEAPI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    image_url: "https://assets.example.com/inputs/portrait.jpg",
    prompt: "slow push-in, soft morning light, hair moving in the breeze",
    duration: 5,
    resolution: "768p",
    aspect_ratio: "adaptive",
    webhook_url: "https://hooks.example.com/fiveapi",
  }),
});
const task = await res.json();
console.log(task.id, task.status);
```

Replace `image_url` with a public HTTPS URL of your own image. The URL is checked before anything is charged; see [Input files](https://testweb2-docs-openapi.test765.com/concepts/input-files.md).

## Parameters

| Field | Required | Description |
| - | - | - |
| `image_url` | yes | Public HTTPS URL of a JPG, PNG or WebP image within the model's limits. |
| `duration` | yes | Length in seconds, within the model's range. |
| `resolution` | yes | One of the model's resolutions. |
| `prompt` | no | How to animate the image: motion, camera movement, mood. Up to 2,000 characters. |
| `aspect_ratio` | no | `adaptive` (default) keeps the shape of the image. `9:16`, `16:9`, `1:1`, `3:4` or `4:3` crops to that ratio. |
| `negative_prompt` | no | What to keep out of the video. |
| `generate_audio` | no | Wan 3.0 only. `true` adds synchronized audio. |
| `prompt_expansion` | no | `none`, `basic` or `advanced` (default). |
| `seed` | no | Fixed seed for more reproducible results. |
| `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). |

## Image requirements

| Model | Formats | Dimensions | Size |
| - | - | - | - |
| Video Fast 1.0 | JPG, PNG, WebP | Shorter side at least 300 px; aspect ratio between 0.4 and 2.5 | at most 30 MB |
| Wan 3.0 Spark, Wan 3.0 Prime Spark | JPG, PNG, WebP | 360–2,000 px per side | at most 20 MB |

## Tips for good results

* **Start from a sharp, well-lit image.** The video can't add detail the image doesn't have.
* **Describe motion, not the picture.** The model already sees the image. Say what moves and how the camera moves: "the waves roll in, the camera slowly pulls back".
* **Keep the aspect ratio `adaptive`** unless you need a specific format. Forcing a different ratio crops the image.
* **Match the motion to the duration.** Small, continuous motion fits short clips; a sequence of actions needs more seconds.
* **For products,** a slow orbit or push-in with studio lighting keeps the product recognizable.


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