> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiveapi.ai/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

# Introduction

> Generate AI videos from text, images, reference assets and clips with one REST API.

Five API turns a text prompt, an image, a set of reference assets or an existing clip into a short video. You send one HTTPS request, Five API generates the video in the background, and you get an MP4 back by webhook or by polling.

> [card] [Quickstart](https://docs.fiveapi.ai/quickstart.md)
>
> Create an API key and generate your first video in a few minutes.

> [card] [API reference](https://docs.fiveapi.ai/api-reference/introduction.md)
>
> Every endpoint, parameter and response, with an interactive playground.

## What you can build

> [card] [Text to video](https://docs.fiveapi.ai/guides/text-to-video.md)
>
> Describe a scene and get a video, with optional synchronized audio.

> [card] [Image to video](https://docs.fiveapi.ai/guides/image-to-video.md)
>
> Animate a photo, a product shot or an illustration.

> [card] [Reference to video](https://docs.fiveapi.ai/guides/reference-to-video.md)
>
> Keep characters, motion and sound from your own reference assets.

> [card] [Video extend](https://docs.fiveapi.ai/guides/video-extend.md)
>
> Continue an existing clip seamlessly, with matched audio.

## Models

| Model | Tasks | Resolutions | Duration | Audio |
| - | - | - | - | - |
| [Video Fast 1.0](https://docs.fiveapi.ai/concepts/models.md#video-fast-1-0) | text, image, reference to video | 480p, 768p | 3–15 s (reference: 3–30 s) | always on |
| [Wan 3.0 Spark](https://docs.fiveapi.ai/concepts/models.md#wan-3-0-spark) | text, image, reference to video | 480p, 720p, 1080p | 2–30 s | optional |
| [Wan 3.0 Prime Spark](https://docs.fiveapi.ai/concepts/models.md#wan-3-0-prime-spark) | text, image, reference to video | 480p, 720p, 1080p | 2–30 s | optional |
| [Video Fast Extend 1.1](https://docs.fiveapi.ai/concepts/models.md#video-fast-extend-1-1) | video extend | 480p, 720p, 1080p | adds 3–30 s | optional |

Video Fast 1.0 generates audio with every video. On the Wan models and Video Fast Extend, audio is optional: send `generate_audio: true` on text to video, image to video and video extend.

See [Models](https://docs.fiveapi.ai/concepts/models.md) for the details of each model and how to choose.

## How it works

**1. Create a task**

`POST /v1/{brand}/{version}/{task}`, for example `POST /v1/wan/v3.0-spark/image-to-video`. The model id is the path. Five API validates the request, holds the estimated price in credits and answers at once with a `queued` task.

**2. Wait for the result**

Receive a signed `task.completed` [webhook](https://docs.fiveapi.ai/concepts/webhooks.md), or poll `GET /v1/tasks/{task_id}` every few seconds.

**3. Download the video**

`output.video.url` is a plain HTTPS download of the MP4. Results are kept for 7 days.

```mermaid theme={null}
sequenceDiagram
    participant App as Your app
    participant API as Five API
    App->>API: POST /v1/wan/v3.0-spark/image-to-video
    API-->>App: 200 task (status: queued, credits held)
    Note over API: queued → processing → completed
    API->>App: webhook task.completed (signed)
    App->>API: GET the task (optional)
    App->>App: download output.video.url
```

## Why Five API

> [accordion] One endpoint per model
>
> Each model has its own endpoint and a published JSON input schema (`GET /v1/models`), so you always know which fields and values a model accepts.

> [accordion] Pay only for videos you get
>
> Credits are held when a task is accepted and charged only when it completes. Failed and cancelled tasks are released in full, and a rejected request (any `4xx`) never costs anything.

> [accordion] Built for production
>
> Signed webhooks with automatic retries, safe retries with `Idempotency-Key`, stable error codes, a request id on every response, per-key scopes and IP allowlists.

> [accordion] Ready for AI coding agents
>
> Install the [Five API agent skill](https://docs.fiveapi.ai/ai-tools/agent-skills.md) or connect the [docs MCP server](https://docs.fiveapi.ai/ai-tools/ai-assistants.md) and let your coding agent write the integration.

## Get help

Email [support@fiveapi.ai](mailto:support@fiveapi.ai) and include the `X-Request-Id` of the request you are asking about. Account, keys, credits and webhooks are managed in the [developer console](https://fiveapi.ai).


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