> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poyo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Flux 3 Max

> 根据文本、起始和结束图片或定位关键帧创建视频，可选生成音频。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.poyo.ai/zh/api-manual/task-management/status.md)接口获取结果。

Flux 3 Max 可根据文本描述创建视频，让起始和结束图片动起来，或将放置在时间轴上的图片连接起来。请在提示词中描述所需的场景、运动、镜头行为和音频。

## 模型

* **flux-3-max/text-to-video** — 根据文本生成视频
* **flux-3-max/image-to-video** — 根据起始图片和可选的结束图片生成视频
* **flux-3-max/keyframes-to-video** — 根据定位关键帧生成视频

## 功能

* 生成 5–20 秒、720p 或 1080p 的视频。
* 随视频一同生成音频，或通过 `sound: false` 关闭音频。
* 通过起始和结束图片，或最多 10 个定位关键帧引导过渡。

## 输入模式

| 模型 | 必需的媒体输入 |
| - | - |
| `flux-3-max/text-to-video` | 无 |
| `flux-3-max/image-to-video` | `image_urls` 中 1–2 个按顺序排列的 URL |
| `flux-3-max/keyframes-to-video` | `keyframes` 中 1–10 个对象 |

文本模式不接受任何媒体字段。图片模式只接受 `image_urls`，起始图片在前，可选的结束图片在后。关键帧模式只接受 `keyframes`。

## 必填参数

* `prompt` (string)：非空的视频描述，包括运动、镜头行为和所需音频。
* `image_urls` (array of strings)：仅图片模式必填。提供一个起始图片 URL，可选再跟一个结束图片 URL。
* `keyframes` (array of objects)：仅关键帧模式必填。提供 1–10 个包含 `image_url` 和 `frame_index` 的对象。

## 可选参数

* `duration` (integer)：输出时长，5 到 20 秒。默认为 5。
* `resolution` (string)：`720p`（默认）或 `1080p`。
* `aspect_ratio` (string)：`auto`（默认）、`21:9`、`2:1`、`16:9`、`4:3`、`1:1`、`3:4` 或 `9:16`。
* `sound` (boolean)：是否生成音频。默认为 `true`。

## 示例

OpenAPI 示例涵盖文本生成、单张起始图片、起始和结束图片以及定位关键帧。

如需在两张图片之间过渡，选择 `flux-3-max/image-to-video`，并在 `image_urls` 中按起始帧、结束帧的顺序提供两个 URL。

如需定位图片，选择 `flux-3-max/keyframes-to-video`。每个 `frame_index` 基于 24 fps 时间轴设置。对于 5 秒视频，位置范围为 0 到 120（含）。

## 注意事项

图片 URL 必须是可公开访问的 HTTP(S) URL，格式为 PNG、JPEG 或 WebP。每个关键帧位置必须唯一，且不能超过 `duration × 24`。

当 `aspect_ratio: "auto"` 时，文本模式使用 `16:9`；图片模式和关键帧模式跟随第一张图片。媒体字段放在 `input` 内，`callback_url` 放在请求顶层。


## OpenAPI

````yaml zh/api-manual/video-series/flux-3-max.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo AI - Flux 3 Max API
  description: 根据文本、首尾帧图像或指定位置的关键帧生成视频，可选生成音频。
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: 生产环境
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Flux 3 Max
      summary: 提交 Flux 3 Max 任务
      operationId: submitFlux3MaxTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              text-to-video:
                summary: 文本生成
                value:
                  model: flux-3-max/text-to-video
                  input:
                    prompt: A red panda walks through a sunlit forest
                    duration: 5
                    resolution: 720p
              image-to-video:
                summary: 让首帧图像动起来
                value:
                  model: flux-3-max/image-to-video
                  input:
                    prompt: The camera slowly moves closer
                    image_urls:
                      - https://example.com/start.png
              first-last-frame:
                summary: 在首帧和尾帧图像之间生成动画
                value:
                  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
              keyframes-to-video:
                summary: 根据指定位置的关键帧生成动画
                value:
                  model: flux-3-max/keyframes-to-video
                  input:
                    prompt: Move smoothly through both scenes
                    duration: 5
                    keyframes:
                      - image_url: https://example.com/frame-1.png
                        frame_index: 0
                      - image_url: https://example.com/frame-2.png
                        frame_index: 120
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
            - flux-3-max/text-to-video
            - flux-3-max/image-to-video
            - flux-3-max/keyframes-to-video
          description: 公开的模型标识。
        callback_url:
          type: string
          format: uri
          description: 任务完成或失败时接收通知的 Webhook URL。
        input:
          type: object
          required:
            - prompt
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              description: 描述场景、运动、镜头行为和所需音频。必须包含非空白文本。
            image_urls:
              type: array
              minItems: 1
              maxItems: 2
              items:
                type: string
                format: uri
              description: >-
                仅 flux-3-max/image-to-video 必填。按顺序提供一张首帧图像和一张可选的尾帧图像。不要与
                keyframes 同时使用。必须是公开可访问的 HTTP 或 HTTPS URL。
            keyframes:
              type: array
              minItems: 1
              maxItems: 10
              items:
                $ref: '#/components/schemas/Keyframe'
              description: >-
                仅 flux-3-max/keyframes-to-video 必填。提供 1-10 张图像，frame_index
                值互不重复，取值范围为 0 到 duration * 24。不要与 image_urls 同时使用。
            duration:
              type: integer
              minimum: 5
              maximum: 20
              default: 5
              description: 输出时长，单位为秒。
            resolution:
              type: string
              enum:
                - 720p
                - 1080p
              default: 720p
              description: 输出视频分辨率。
            aspect_ratio:
              type: string
              enum:
                - auto
                - '21:9'
                - '2:1'
                - '16:9'
                - '4:3'
                - '1:1'
                - '3:4'
                - '9:16'
              default: auto
              description: 输出宽高比。auto 在文本输入时使用 16:9，在图像或关键帧输入时跟随第一张图像。
            sound:
              type: boolean
              default: true
              description: 随视频一起生成音频。
          description: 所选模型的参数。媒体字段仅在对应模式下必填。
      description: 根据文本、首尾帧图像或指定位置的关键帧生成视频，可选生成音频。
      x-poyo-model-requests:
        $ref: '#/components/schemas/ModelRequests'
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          example: 200
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1792468800-example
            status:
              type: string
              enum:
                - not_started
                - running
                - finished
                - failed
              example: not_started
              description: >-
                任务状态。提交后立即返回时始终为
                `not_started`。后续状态请通过[查询任务状态](/zh/api-manual/task-management/status)接口或
                `callback_url` 获取。


                - `not_started`：排队中，等待处理

                - `running`：生成中

                - `finished`：已完成，结果在 `files` 或 `output` 中

                - `failed`：失败，详情见 `error_message`
            created_time:
              type: string
              format: date-time
              example: '2026-10-20T12:00:00'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
    Keyframe:
      type: object
      required:
        - image_url
        - frame_index
      additionalProperties: false
      properties:
        image_url:
          type: string
          format: uri
          description: 公开的 PNG、JPEG 或 WebP 图像 URL。必须是公开可访问的 HTTP 或 HTTPS URL。
        frame_index:
          type: integer
          minimum: 0
          description: 互不重复的帧位置，取值范围为 0 到 duration * 24（含两端）。
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 接口都需要 Bearer Token 认证。


        创建 API Key：登录 PoYo，进入 **仪表盘 → API
        密钥**（[poyo.ai/zh/dashboard/api-key](https://poyo.ai/zh/dashboard/api-key)），点击创建
        Key。


        在请求头中添加：


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

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