# FLUX 3 Max

> Create 5–20 second videos with FLUX 3 Max from text, one or two images, or up to ten positioned keyframes. Choose 720p or 1080p and generate native synchronized audio.

## Overview

- Submit: `https://api.poyo.ai/api/generate/submit`
- Status: `https://api.poyo.ai/api/generate/status/{task_id}`
- Page: https://poyo.ai/models/flux-3-max
- Model page ID: `flux-3-max`
- API model IDs: `flux-3-max/text-to-video`, `flux-3-max/image-to-video`, `flux-3-max/keyframes-to-video`
- Category: Video
- Auth: `Authorization: Bearer $POYO_API_KEY`
- Create a key at https://poyo.ai/dashboard/api-key

This model uses PoYo's unified async API. POST the JSON body below, then poll status with the returned `task_id` or receive a webhook on `callback_url`. Failed tasks are not charged.

## Pricing

- 720p: 34 credits ($0.170) per second
- 1080p: 58 credits ($0.290) per second

For more details, see https://poyo.ai/models/flux-3-max.

## API Information

The request envelope is always `{ model, input, callback_url? }`. Input fields below are nested under `input`.

### Request envelope

- `model` (`ModelEnum`, required):
  Public model identifier.
  - Options: `"flux-3-max/text-to-video"`, `"flux-3-max/image-to-video"`, `"flux-3-max/keyframes-to-video"`
- `callback_url` (`string`, optional):
  Webhook URL for finished or failed task notifications.

### Input Schema

Parameters for the selected model. Media fields are required only for their corresponding mode.

The API accepts the following `input` parameters:

- `prompt` (`string`, required):
  Describe the scene, motion, camera behavior, and desired audio.
  - Length: 1 to unbounded characters
- `image_urls` (`list`, optional):
  Required for flux-3-max/image-to-video only. Supply one starting image and an optional ending image, in this order. Do not combine with keyframes.
  - Array of string
  - Length: 1 to 2
- `keyframes` (`list`, optional):
  Required for flux-3-max/keyframes-to-video only. Supply 1-10 images with unique frame_index values from 0 through duration * 24. Do not combine with image_urls.
  - Array of Keyframe
  - Length: 1 to 10
- `duration` (`integer`, optional):
  Output duration in seconds.
  - Default: `5`
  - Range: `5` to `20`
- `resolution` (`ResolutionEnum`, optional):
  Output video resolution.
  - Default: `"720p"`
  - Options: `"720p"`, `"1080p"`
- `aspect_ratio` (`AspectRatioEnum`, optional):
  Output aspect ratio. auto uses 16:9 for text input and follows the first image for image or keyframe input.
  - Default: `"auto"`
  - Options: `"auto"`, `"21:9"`, `"2:1"`, `"16:9"`, `"4:3"`, `"1:1"`, `"3:4"`, `"9:16"`
- `sound` (`boolean`, optional):
  Generate audio with the video.
  - Default: `true`

Required Parameters Example:

```json
{
  "model": "flux-3-max/text-to-video",
  "input": {
    "prompt": "A red panda walks through a sunlit forest",
    "duration": 5,
    "resolution": "720p"
  }
}
```

Full Example:

```json
{
  "model": "flux-3-max/text-to-video",
  "input": {
    "prompt": "A red panda walks through a sunlit forest",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "auto",
    "sound": true
  }
}
```

Animate a starting image:

```json
{
  "model": "flux-3-max/image-to-video",
  "input": {
    "prompt": "The camera slowly moves closer",
    "image_urls": [
      "https://example.com/start.png"
    ]
  }
}
```

Animate between starting and ending images:

```json
{
  "model": "flux-3-max/image-to-video",
  "input": {
    "prompt": "Transition smoothly from sunrise to sunset",
    "image_urls": [
      "https://example.com/start.png",
      "https://example.com/end.png"
    ],
    "duration": 8,
    "sound": false
  }
}
```

### Output Schema

Submit returns a `task_id`. Poll `GET /api/generate/status/{task_id}` until `status` is `finished` or `failed`. Completed media is in `data.files`.

Response fields:

- `code` (`CodeEnum`, required):
  - Options: `200`
  - Examples: `200`
- `data` (`object`, required):

Example Response:

```json
{
  "code": 200,
  "data": {
    "task_id": "task_example",
    "status": "finished",
    "files": [
      {
        "file_url": "https://storage.poyo.ai/models/flux-3-max/examples/max-t2v-bakery-output-56789cf24b79.mp4",
        "file_type": "video"
      }
    ]
  }
}
```

## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://api.poyo.ai/api/generate/submit \
  --header "Authorization: Bearer $POYO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"model":"flux-3-max/text-to-video","input":{"prompt":"A red panda walks through a sunlit forest","duration":5,"resolution":"720p"}}'
```

### Python

```python
import json
import os
import time
import requests

API = "https://api.poyo.ai"
headers = {
    "Authorization": f"Bearer {os.environ['POYO_API_KEY']}",
    "Content-Type": "application/json",
}
payload = json.loads("{\n  \"model\": \"flux-3-max/text-to-video\",\n  \"input\": {\n    \"prompt\": \"A red panda walks through a sunlit forest\",\n    \"duration\": 5,\n    \"resolution\": \"720p\"\n  }\n}")

submit = requests.post(f"{API}/api/generate/submit", headers=headers, json=payload)
submit.raise_for_status()
task_id = submit.json()["data"]["task_id"]

while True:
    status = requests.get(f"{API}/api/generate/status/{task_id}", headers=headers)
    status.raise_for_status()
    data = status.json()["data"]
    if data["status"] in ("finished", "failed"):
        print(data)
        break
    time.sleep(2)
```

### JavaScript

```javascript
const headers = {
  Authorization: `Bearer ${process.env.POYO_API_KEY}`,
  "Content-Type": "application/json",
};

const submit = await fetch("https://api.poyo.ai/api/generate/submit", {
  method: "POST",
  headers,
  body: JSON.stringify({
  "model": "flux-3-max/text-to-video",
  "input": {
    "prompt": "A red panda walks through a sunlit forest",
    "duration": 5,
    "resolution": "720p"
  }
}),
});

const submitted = await submit.json();
const taskId = submitted.data.task_id;

while (true) {
  const statusResponse = await fetch(`https://api.poyo.ai/api/generate/status/${taskId}`, { headers });
  const status = await statusResponse.json();
  if (["finished", "failed"].includes(status.data.status)) {
    console.log(status.data);
    break;
  }
  await new Promise((resolve) => setTimeout(resolve, 2000));
}
```

## Additional Resources

### Documentation

- [Model Playground](https://poyo.ai/models/flux-3-max)
- [API Documentation](https://docs.poyo.ai/api-manual/video-series/flux-3-max)
- [API Documentation (Markdown)](https://docs.poyo.ai/api-manual/video-series/flux-3-max.md)
- [Task status](https://docs.poyo.ai/api-manual/task-management/query-task-status)
- [Webhooks](https://docs.poyo.ai/api-manual/task-management/webhooks)

### Other agent-readable surfaces

- [Platform overview](https://poyo.ai/llms.txt)
- [Documentation index](https://docs.poyo.ai/llms.txt)
- [Full documentation text](https://docs.poyo.ai/llms-full.txt)
- Any other model: `https://poyo.ai/models/<model-id>/llms.txt`
